]> git.proxmox.com Git - pve-container.git/log
pve-container.git
5 years agoMark CT as a template after rename volumes.
Wolfgang Link [Wed, 30 May 2018 10:12:52 +0000 (12:12 +0200)]
Mark CT as a template after rename volumes.

If a rename fails, the CT should not mark as a template.

5 years agotemplate create: handle mountpoints besides rootfs
Wolfgang Link [Wed, 30 May 2018 10:12:51 +0000 (12:12 +0200)]
template create: handle mountpoints besides rootfs

we only handled the special rootfs mount so creating a template
from a container with additional mountpoint did not work correctly.
Use foreach_mountpoint to create a base vdisk for all mount points
after checking if the storage supports it

5 years agobump version to 2.0-23
Fabian Grünbichler [Mon, 14 May 2018 09:10:41 +0000 (11:10 +0200)]
bump version to 2.0-23

5 years agoAdd cifs as allowed storage type.
Wolfgang Link [Tue, 8 May 2018 07:27:00 +0000 (09:27 +0200)]
Add cifs as allowed storage type.

5 years agocopy_volume: get the real volume size
Wolfgang Bumiller [Mon, 7 May 2018 12:52:47 +0000 (14:52 +0200)]
copy_volume: get the real volume size

Since we're not supposed to rely on this property being
there or even correct.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofixup: add missing eval around umount
Wolfgang Bumiller [Fri, 4 May 2018 09:12:14 +0000 (11:12 +0200)]
fixup: add missing eval around umount

(as it throws no error)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofix #1721: unmount containers before trying to mount them
René Jochum [Fri, 4 May 2018 08:04:16 +0000 (10:04 +0200)]
fix #1721: unmount containers before trying to mount them

Signed-off-by: René Jochum <r.jochum@proxmox.com>
6 years agosupport Fedora 28
Thomas Lamprecht [Fri, 27 Apr 2018 09:08:24 +0000 (11:08 +0200)]
support Fedora 28

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoupdate_config: rescan volume size
Fabian Grünbichler [Mon, 23 Apr 2018 10:36:16 +0000 (12:36 +0200)]
update_config: rescan volume size

otherwise the size information gets lost when detaching and reattaching
a mountpoint volume, which is less than ideal since mountpoints without
size information require manual information when restoring.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agobump version to 2.0-22
Dietmar Maurer [Mon, 23 Apr 2018 09:05:20 +0000 (11:05 +0200)]
bump version to 2.0-22

6 years agoadd Ubuntu 18.04 to known versions.
Dietmar Maurer [Mon, 23 Apr 2018 08:59:17 +0000 (10:59 +0200)]
add Ubuntu 18.04 to known versions.

6 years agobump version to 2.0-21
Thomas Lamprecht [Thu, 22 Mar 2018 08:21:40 +0000 (09:21 +0100)]
bump version to 2.0-21

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agocreate: add missing lzo to compression_map
Thomas Lamprecht [Wed, 21 Mar 2018 11:43:21 +0000 (12:43 +0100)]
create: add missing lzo to compression_map

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agorestore: support i/o rate limiting
Wolfgang Bumiller [Wed, 21 Mar 2018 08:57:48 +0000 (09:57 +0100)]
restore: support i/o rate limiting

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agocreate: fix passing of template file descriptor
Wolfgang Bumiller [Wed, 21 Mar 2018 08:57:47 +0000 (09:57 +0100)]
create: fix passing of template file descriptor

This finishes the work started with 07084526aa4a ("create:
open templates as real root"), which opened templates as
real root, but passed it to tar via /proc/*/fd, which does
not actually bypass the check. (Curiously tar did manage to
figure out the file extension from it).

In order to actually extract templates the unprivileged user
cannot access by themselves, we need to pass it to tar via
stdin, however, this means tar cannot auto-detect the
compression (or more accurately, it can and does, but tells
you which option to pass it rather than just extracting
it...)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoclone: randomize network MAC HW address of clone
Thomas Lamprecht [Tue, 20 Mar 2018 14:28:46 +0000 (15:28 +0100)]
clone: randomize network MAC HW address of clone

adapt code from qemu-servers clone API path and generate a new
randomized network hardware address (MAC) for the new clone to avoid
address collisions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agodisable keyctl in user namespaces
Wolfgang Bumiller [Fri, 16 Mar 2018 08:12:41 +0000 (09:12 +0100)]
disable keyctl in user namespaces

systemd-networkd keeps trying to use keyctl() and if it
refuses to work it is apparently a fatal error, so let's
make it think keyctl() support doesn't actually exist by
letting it always fail with ENOSYS.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agofix #1704: get container uptime with /proc/<pid>/stat
Dominik Csapak [Mon, 19 Mar 2018 15:30:15 +0000 (16:30 +0100)]
fix #1704: get container uptime with /proc/<pid>/stat

stat on /proc/<pid> is reset when caches are dropped (e.g. from pveperf)
so get the uptime like lxcfs it does, via /proc/<pid>/stat

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agoclone: check storage permissions
Dietmar Maurer [Tue, 20 Mar 2018 11:19:13 +0000 (12:19 +0100)]
clone: check storage permissions

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 years agoclone: implement target parameter
Dietmar Maurer [Tue, 20 Mar 2018 11:19:12 +0000 (12:19 +0100)]
clone: implement target parameter

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 years agoadd features 'clone', 'copy' to api
Dominik Csapak [Mon, 19 Mar 2018 12:32:31 +0000 (13:32 +0100)]
add features 'clone', 'copy' to api

the gui needs this to detect full/linked clone and snapshots

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agofix spelling
Dietmar Maurer [Fri, 16 Mar 2018 09:54:29 +0000 (10:54 +0100)]
fix spelling

6 years agoclone: use better default for parameter 'full'
Dietmar Maurer [Thu, 15 Mar 2018 13:08:00 +0000 (14:08 +0100)]
clone: use better default for parameter 'full'

template => linked clone
normal container => full clone

6 years agoclone: allow clone to same storage without specifying storage parameter
Dietmar Maurer [Thu, 15 Mar 2018 12:01:07 +0000 (13:01 +0100)]
clone: allow clone to same storage without specifying storage parameter

6 years agoPVE/API2/LXC.pm: remove experimental parameter for clone/template
Dietmar Maurer [Thu, 15 Mar 2018 11:21:20 +0000 (12:21 +0100)]
PVE/API2/LXC.pm: remove experimental parameter for clone/template

6 years agovm_start: cleanup - remove dead code
Dietmar Maurer [Wed, 14 Mar 2018 13:04:04 +0000 (14:04 +0100)]
vm_start: cleanup - remove dead code

6 years agoFix pct skiplock
Alwin Antreich [Wed, 14 Mar 2018 12:51:55 +0000 (13:51 +0100)]
Fix pct skiplock

The method vm_start sets an environment variable that is not picked up
anymore by systemd. This patch removes the environment variable and
introduces a skiplock file that is picked up by the
lxc-pve-prestart-hook.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
6 years agoadd move_volume api call
Wolfgang Bumiller [Tue, 17 Oct 2017 10:58:57 +0000 (12:58 +0200)]
add move_volume api call

6 years agoconfig: is_volume_in_use: ability to search only snapshots
Wolfgang Bumiller [Tue, 17 Oct 2017 10:58:56 +0000 (12:58 +0200)]
config: is_volume_in_use: ability to search only snapshots

6 years agouse copy_volume for full clones
Wolfgang Bumiller [Tue, 17 Oct 2017 10:58:55 +0000 (12:58 +0200)]
use copy_volume for full clones

Also refactor the locking as suggested by Fabian.

6 years agoimplement copy_volume
Wolfgang Bumiller [Tue, 17 Oct 2017 10:58:54 +0000 (12:58 +0200)]
implement copy_volume

6 years agofactor out disk allocation+formatting for reuse
Wolfgang Bumiller [Tue, 17 Oct 2017 10:58:53 +0000 (12:58 +0200)]
factor out disk allocation+formatting for reuse

6 years agobump version to 2.0-20
Dietmar Maurer [Mon, 12 Mar 2018 12:24:34 +0000 (13:24 +0100)]
bump version to 2.0-20

6 years agoRemove obsolete read from storage.cfg in vm_start api call
Alwin Antreich [Fri, 9 Mar 2018 15:15:00 +0000 (16:15 +0100)]
Remove obsolete read from storage.cfg in vm_start api call

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
6 years agoFix #1547: on migration abort, the CT starts again
Alwin Antreich [Fri, 9 Mar 2018 15:14:59 +0000 (16:14 +0100)]
Fix #1547: on migration abort, the CT starts again

When a migration fails, the final_cleanup phase now starts the container
on the source node again, if it was a migration in restart_mode and the
CT was running.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
6 years agoseperate serachdomain and nameserver config
Dominik Csapak [Tue, 6 Mar 2018 10:08:04 +0000 (11:08 +0100)]
seperate serachdomain and nameserver config

until now, if either searchdomain or nameservers was not set,
we used the values from the host.

it would make sense, to set this individually (e.g. only use a
different searchdomain)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agobump version to 2.0-19
Dietmar Maurer [Fri, 16 Feb 2018 05:12:31 +0000 (06:12 +0100)]
bump version to 2.0-19

6 years agoclose #1668: add Devuan support
Thomas Lamprecht [Fri, 16 Feb 2018 07:40:48 +0000 (08:40 +0100)]
close #1668: add Devuan support

Add separate Plugin as the Debian Plugin will get more systemd
specific stuff in the future, while this here is as anti-systemd as
it gets, so make the split from the start.

But only overwrite the plugin constructor for now, the rest is still
backward compatible.

6 years agobuildsys: actually save git revision
Thomas Lamprecht [Wed, 7 Feb 2018 09:38:00 +0000 (10:38 +0100)]
buildsys: actually save git revision

${GITVERSION} is empty else.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agorevert removal of pct from installation
Wolfgang Bumiller [Tue, 6 Feb 2018 12:54:10 +0000 (13:54 +0100)]
revert removal of pct from installation

Fixes: c47b855338e2 "remove transitional pve-update-lxc-config script (PVE 4 beta era)"
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agopackaging: remove now unused postinst
Thomas Lamprecht [Thu, 25 Jan 2018 12:56:56 +0000 (13:56 +0100)]
packaging: remove now unused postinst

Was soley introduced for the, now removed, transitional
pve-update-lxc-config script (a PVE 4 older beta -> PVE 4 newer beta
helper).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoremove transitional pve-update-lxc-config script (PVE 4 beta era)
Thomas Lamprecht [Thu, 25 Jan 2018 12:56:55 +0000 (13:56 +0100)]
remove transitional pve-update-lxc-config script (PVE 4 beta era)

Short nack history:
In PVE 4 Beta we introduced LXC as our new container technology.
Initially we did not used the our section config format for its
configuration file in /etc/pve . It  was then decided to reuse our
config format (section config), so that we do not need to maintain a
separate parser, and that VM and CT config where not completely
different, which could confuse users.

This script was added to allow an easy transition from the old LXC
config format to the new Proxmox SectionConfig one.

All new installations since, and including, PVE 4.0 never needed this.
And all beta users must go through PVE 4.4 if they want to
dist-upgrade to PVE 5.0, so just remove it - it's forever tracked in
git anyway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agofix #1618: do not double encode the description
Dominik Csapak [Tue, 16 Jan 2018 14:43:18 +0000 (15:43 +0100)]
fix #1618: do not double encode the description

we already encode the description in 'write_config',
we do not need to do it here again

this lead to newlines also to be encoded instead of
splitting the description into lines and decode that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agobump version to 2.0-18
Wolfgang Bumiller [Wed, 13 Dec 2017 13:59:43 +0000 (14:59 +0100)]
bump version to 2.0-18

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoadd termproxy api call for lxc
Dominik Csapak [Mon, 11 Dec 2017 13:55:31 +0000 (14:55 +0100)]
add termproxy api call for lxc

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agosetup/fedora: we support fedora release 27
Thomas Lamprecht [Thu, 30 Nov 2017 07:47:22 +0000 (08:47 +0100)]
setup/fedora: we support fedora release 27

Standard tests (create, network, TTY) seem to work OK.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoadd 'noescapechar' parameter to get_console_command
Dominik Csapak [Fri, 24 Nov 2017 14:43:32 +0000 (15:43 +0100)]
add 'noescapechar' parameter to get_console_command

this adds a '-e -1' to lxc-console, and disables the
escape character (which we do not want with the web console)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agocreate: refactor arch detection to run_fork_with_timeout
Thomas Lamprecht [Thu, 16 Nov 2017 14:07:40 +0000 (15:07 +0100)]
create: refactor arch detection to run_fork_with_timeout

Swap out our own fork/waitpid code with run_fork_with_timeout, which
not only allows to return arbitrary results from the called method
but also has a timeout configured, which prevents that a creation
hangs forever (= next reboot).

As we can now return more than with an exit code number we do not
return the ELF class but the detected architecture directly and pull
the fallback code into this method.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agopct mount: tell user where he can find the mounted CT
Thomas Lamprecht [Thu, 16 Nov 2017 14:07:39 +0000 (15:07 +0100)]
pct mount: tell user where he can find the mounted CT

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agomake ssh connection transparent
Dominik Csapak [Fri, 17 Nov 2017 09:22:54 +0000 (10:22 +0100)]
make ssh connection transparent

do not use an escape character for ssh connections for vncterm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agovzdump: log the warning about NFS properly
Wolfgang Bumiller [Mon, 13 Nov 2017 10:49:22 +0000 (11:49 +0100)]
vzdump: log the warning about NFS properly

Otherwise it's only visible on the command line.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agofix trailing whitespace
Dominik Csapak [Tue, 31 Oct 2017 10:25:11 +0000 (11:25 +0100)]
fix trailing whitespace

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agosimply version check
Dominik Csapak [Tue, 31 Oct 2017 10:25:10 +0000 (11:25 +0100)]
simply version check

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agouse systemd-networkd for ubuntu >= 17.10
Dominik Csapak [Tue, 31 Oct 2017 10:25:09 +0000 (11:25 +0100)]
use systemd-networkd for ubuntu >= 17.10

Ubuntu Artful uses systemd-networkd now,
but we have to delete the default netplan config from the
upstream lxc container, and enable systemd-networkd

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agobump version to 2.0-17
Fabian Grünbichler [Tue, 17 Oct 2017 13:11:25 +0000 (15:11 +0200)]
bump version to 2.0-17

and add versioned dependency on libpve-common-perl for new helper
run_fork

6 years agomigrate: skip replication handling if not replicated
Fabian Grünbichler [Tue, 17 Oct 2017 11:25:24 +0000 (13:25 +0200)]
migrate: skip replication handling if not replicated

in case the container has no replicated disks, this reduces downtime for
restart migration and makes the log shorter

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agomigrate: cleanup final_cleanup
Fabian Grünbichler [Tue, 17 Oct 2017 11:25:23 +0000 (13:25 +0200)]
migrate: cleanup final_cleanup

use remove_lock instead of manually removing

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agomigrate: only restart if conf was moved
Fabian Grünbichler [Tue, 17 Oct 2017 11:25:22 +0000 (13:25 +0200)]
migrate: only restart if conf was moved

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoadd vm_stop helper
Wolfgang Bumiller [Fri, 13 Oct 2017 11:25:50 +0000 (13:25 +0200)]
add vm_stop helper

Since we use a post-stop hook to unmount all file systems at
container shutdown rather than a stop hook (because at this
point there are still multiple mount namespaces around), we
need to wait for the lxc-start/monitor process to exit to be
sure all the unmounting has succeeded, because it will put
the container into a STOPPED state before executing the
post-stop hook, making lxc-wait and lxc-stop signal success
too early when waiting for the container to stop.

Introduce a vm_stop() helper which calls lxc-stop and then
waits for the command socket to close. Note that lxc-stop
already has the "hard-stop-after-timeout" mechanic built in,
so the 'forceStop' code path of the vm_stop api call removed
here was not actually necessary.
Technically we could pass --nokill for the behavior assumed
there, but for now this patch should not be causing any
actual behavior changes.

6 years agofix read_cgroup_value for unprivileged containers
Wolfgang Bumiller [Tue, 17 Oct 2017 07:57:10 +0000 (09:57 +0200)]
fix read_cgroup_value for unprivileged containers

We changed this to read values from the container's inner
cgroup, but didn't take into account that unprivileged
containers don't have one.
Add a parameter to specify whether it is an unprivileged
container.

Fixes: 41ef9833bf00 ("include ns/ dir in read_cgroup_value")
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agobuild: mark lxc@.service.d for future removal
Fabian Grünbichler [Wed, 11 Oct 2017 12:13:13 +0000 (14:13 +0200)]
build: mark lxc@.service.d for future removal

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoswitch to pve-container@ unit
Fabian Grünbichler [Wed, 11 Oct 2017 12:13:12 +0000 (14:13 +0200)]
switch to pve-container@ unit

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoadd new pve-container units
Fabian Grünbichler [Wed, 11 Oct 2017 12:13:11 +0000 (14:13 +0200)]
add new pve-container units

to replace lxc@.service.

we want our unit to only start when manually invoked (by our code), and
stop on shutdown via pve-guests or pve-ha-lrm. lxc@ units are stopped by
systemd on shutdown, because of transitive dependencies.

since all instances of template service units are by default assigned to
a new slice with DefaultDependencies=yes, we also need to introduce our
own custom slice with DefaultDependencies=no.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoinstall lxc@ snippets to correct location
Fabian Grünbichler [Wed, 11 Oct 2017 12:13:10 +0000 (14:13 +0200)]
install lxc@ snippets to correct location

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agofixes #1227: include ns/ dir in read_cgroup_value
Philip Abernethy [Fri, 6 Oct 2017 13:52:15 +0000 (15:52 +0200)]
fixes #1227: include ns/ dir in read_cgroup_value

this fixes the disk I/O graph and now also correctly sums the values.

6 years agobuild: reformat debian/control
Fabian Grünbichler [Wed, 4 Oct 2017 09:05:33 +0000 (11:05 +0200)]
build: reformat debian/control

using wrap-and-sort -abt

6 years agodoc: add auto/dhcp/manual to netX ip6 description
Fabian Grünbichler [Mon, 15 May 2017 07:44:19 +0000 (09:44 +0200)]
doc: add auto/dhcp/manual to netX ip6 description

and shorten IPv6Format to IPv6

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agodoc: add dhcp/manual to netX ip description
Fabian Grünbichler [Mon, 15 May 2017 07:44:18 +0000 (09:44 +0200)]
doc: add dhcp/manual to netX ip description

and shorten IPv4Format to IPv4

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
6 years agoVM.Snapshot.Rollback privilege added
Matthias Urban [Wed, 13 Sep 2017 10:30:35 +0000 (12:30 +0200)]
VM.Snapshot.Rollback privilege added

VM.Snapshot.Rollback privilege added

Signed-off-by: Matthias Urban <matthias.urban@pure-systems.com>
6 years agobump version to 2.0-16
Wolfgang Bumiller [Tue, 12 Sep 2017 11:51:01 +0000 (13:51 +0200)]
bump version to 2.0-16

6 years agoconfig: update for lxc-2.1
Wolfgang Bumiller [Wed, 6 Sep 2017 13:46:37 +0000 (15:46 +0200)]
config: update for lxc-2.1

With 2.1 a bunch of keys were renamed for consistency, and
network interface configuration is now done with explicit
indices.

Since we allow various custom "lxc.*" keys in our container
configuration we need to deal with this change and we now
inform the user about this with a warning.

6 years agoAPI/clone: do not overwrite global signal handlers
Thomas Lamprecht [Wed, 6 Sep 2017 11:29:05 +0000 (13:29 +0200)]
API/clone: do not overwrite global signal handlers

perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agobuild: drop -rfakeroot
Fabian Grünbichler [Fri, 1 Sep 2017 06:58:00 +0000 (08:58 +0200)]
build: drop -rfakeroot

it's the default anyway.

6 years agobuild: use 'git rev-parse' for GITVERSION
Fabian Grünbichler [Fri, 1 Sep 2017 06:57:48 +0000 (08:57 +0200)]
build: use 'git rev-parse' for GITVERSION

6 years agoclose #1478: add check for unsupported config
Philip Abernethy [Wed, 23 Aug 2017 15:04:37 +0000 (17:04 +0200)]
close #1478: add check for unsupported config

Adds a check if an unprivileged container is configured to use
quota on any of its mountpoints. If so an understandable error
message is given. Ideally I'd like to catch those
configurations on the GUI, too, to avoid users just running
into it.

6 years agosetup/fedora: use os_release and support 26
Thomas Lamprecht [Tue, 22 Aug 2017 13:43:25 +0000 (15:43 +0200)]
setup/fedora: use os_release and support 26

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoupdate_lxc_config: remove ostype check
Thomas Lamprecht [Tue, 22 Aug 2017 13:43:24 +0000 (15:43 +0200)]
update_lxc_config: remove ostype check

We have altogether three calls to this method, all in API context with already
sanitizied ostype.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agofix os-release mapping for similar flavoured distros
Thomas Lamprecht [Tue, 22 Aug 2017 13:43:23 +0000 (15:43 +0200)]
fix os-release mapping for similar flavoured distros

This avoid failing the check where the auto detected type differs
from the configs ostype.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoremove unused Data::Dumper
Thomas Lamprecht [Tue, 22 Aug 2017 13:43:22 +0000 (15:43 +0200)]
remove unused Data::Dumper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agosetup: recognize 'sles' os_release ID
Wolfgang Bumiller [Wed, 2 Aug 2017 08:40:39 +0000 (10:40 +0200)]
setup: recognize 'sles' os_release ID

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agosetup/suse: fix #1464: support SLES 12 container
Thomas Lamprecht [Tue, 1 Aug 2017 09:28:59 +0000 (11:28 +0200)]
setup/suse: fix #1464: support SLES 12 container

SLES 12 shares its base with opensuse leap, so we shouldn't get into
much trouble here.
I copied the os-release file from a SLES installation.
I didn't found official SLES CT/rootfs images, people with access to
the repos should be able to create them.

Fixes: #1464
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agosetup/suse: support tumbleweed container
Thomas Lamprecht [Tue, 1 Aug 2017 09:28:58 +0000 (11:28 +0200)]
setup/suse: support tumbleweed container

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agosetup/suse: check early if setting up the ct getty service is needed
Thomas Lamprecht [Tue, 1 Aug 2017 09:28:57 +0000 (11:28 +0200)]
setup/suse: check early if setting up the ct getty service is needed

Explixitly set if we need to call setup_container_getty_service(), as
its more expressive, especially with suse version jumping in mind.
Also next patches will add support for other opensuse based releases
(tumbleweed, sles).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agosetup/suse: use new os_release_var to simplify version detection
Thomas Lamprecht [Tue, 1 Aug 2017 09:28:56 +0000 (11:28 +0200)]
setup/suse: use new os_release_var to simplify version detection

Not only simplify but also correct version detection.

Until now we checked the files 'SuSE-release' and 'SuSE-brand' for
version parsing. 'SuSE-release' is marked as obsolete and replaced by
the newer standarised 'os-release', and the fallback is plain wrong
and not guaranteed to exist or match the actual version.

'SuSE-brand' does not get supplied by the 'openSUSE-release' package
but by another package, i.e. 'branding-openSUSE' this isn't
guaranteed to be installed, at least on CT creation, and may have
another version as the actual template provides. E.g. on tumbleweed I
get version 13.3 there, while the release package tells me "20170729".

As "os-release" is available at least sine openSUSE 12.2, and we
support 13.X and newer currently, just use it instead.

Adapt the regex as the non-rolling releases have always a X.Y format.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agouse /etc/os-release
Wolfgang Bumiller [Tue, 1 Aug 2017 09:28:55 +0000 (11:28 +0200)]
use /etc/os-release

This should exist everywhere, its content look like shell
assignments but are limited enough to not require a shell to
parse (see os-release(5) or its parts pasted as a comment to
the parse function).
Further motivation for this is the fact that in suse the
/etc/SuSE-release file is declared deprecated in favor of
/etc/os-release.
Note that we have to read the file in a protected_call to
avoid symlink issues.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agosetup: add a additional mapping for archlinux
Thomas Lamprecht [Tue, 1 Aug 2017 09:28:54 +0000 (11:28 +0200)]
setup: add a additional mapping for archlinux

Allows simpler distro detection in next patch. Note the "ostype" in
the config file will be still set to "archlinux" by Setup/ArchLinux

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agosetup: protected_call: the plugin is not required
Wolfgang Bumiller [Tue, 1 Aug 2017 09:28:53 +0000 (11:28 +0200)]
setup: protected_call: the plugin is not required

we don't use this anywhere where this would be the case

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agosetup: support returning a scalar in protected_call
Wolfgang Bumiller [Tue, 1 Aug 2017 09:28:52 +0000 (11:28 +0200)]
setup: support returning a scalar in protected_call

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agofix #1253: show ssh key fingerprints again
Wolfgang Bumiller [Mon, 24 Jul 2017 08:49:59 +0000 (10:49 +0200)]
fix #1253: show ssh key fingerprints again

ssh-keygen's fingerprint output has changed

6 years agobump version to 2.0-15
Wolfgang Bumiller [Mon, 24 Jul 2017 07:18:27 +0000 (09:18 +0200)]
bump version to 2.0-15

6 years agoubuntu: recognize 17.10
Wolfgang Bumiller [Mon, 24 Jul 2017 07:13:49 +0000 (09:13 +0200)]
ubuntu: recognize 17.10

6 years agodebian: recognize all stretch versions, translate buster/sid to 10
Wolfgang Bumiller [Mon, 24 Jul 2017 06:49:44 +0000 (08:49 +0200)]
debian: recognize all stretch versions, translate buster/sid to 10

6 years agobump version to 2.0-14
Dietmar Maurer [Wed, 28 Jun 2017 10:50:58 +0000 (12:50 +0200)]
bump version to 2.0-14

6 years agosnapshot-test.pm: ignore existing replication config
Dietmar Maurer [Wed, 28 Jun 2017 11:23:28 +0000 (13:23 +0200)]
snapshot-test.pm: ignore existing replication config

6 years agoallow disks on shared storages on replicated VMs
Wolfgang Bumiller [Tue, 27 Jun 2017 13:00:10 +0000 (15:00 +0200)]
allow disks on shared storages on replicated VMs

6 years agorefuse to add non-replicatable disks to replicating VMs
Wolfgang Bumiller [Tue, 27 Jun 2017 09:51:10 +0000 (11:51 +0200)]
refuse to add non-replicatable disks to replicating VMs

Unless replication is explicitly disabled for them.

6 years agoAPI HA tasks: we request states not execute them
Thomas Lamprecht [Wed, 21 Jun 2017 05:20:12 +0000 (07:20 +0200)]
API HA tasks: we request states not execute them

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agouse COMMON_TAR_FLAGS from pve-storage
Wolfgang Bumiller [Mon, 26 Jun 2017 11:55:02 +0000 (13:55 +0200)]
use COMMON_TAR_FLAGS from pve-storage

6 years agocreate: open templates as real root
Wolfgang Bumiller [Mon, 26 Jun 2017 11:55:01 +0000 (13:55 +0200)]
create: open templates as real root

When creating an unprivileged container previously couldn't
open template files the unprivileged namespace did not have
access to. This fixes that.

Note that we cannot pass the file via stdin since tar will
then refuse to extract compressed archives automatically.

6 years agoremove unused next_free_nbd_dev function
Wolfgang Bumiller [Mon, 26 Jun 2017 07:32:58 +0000 (09:32 +0200)]
remove unused next_free_nbd_dev function