]> git.proxmox.com Git - pve-container.git/log
pve-container.git
4 years agoLXC: separate freeze_thaw to explicit freeze and thaw methods
Thomas Lamprecht [Fri, 15 May 2020 13:41:20 +0000 (15:41 +0200)]
LXC: separate freeze_thaw to explicit freeze and thaw methods

as else one needs to always lookup parameter value means freeze and
which one thaw when reading call sites what

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agostop using lxc-freeze/unfreeze binaries
Wolfgang Bumiller [Fri, 15 May 2020 09:08:42 +0000 (11:08 +0200)]
stop using lxc-freeze/unfreeze binaries

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd PVE::LXC::freeze_thaw
Wolfgang Bumiller [Fri, 15 May 2020 09:08:41 +0000 (11:08 +0200)]
add PVE::LXC::freeze_thaw

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: add freeze_thaw implementation
Wolfgang Bumiller [Fri, 15 May 2020 09:08:40 +0000 (11:08 +0200)]
cgroup: add freeze_thaw implementation

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: some fixups & use limiting cgroup path
Wolfgang Bumiller [Fri, 15 May 2020 09:08:39 +0000 (11:08 +0200)]
cgroup: some fixups & use limiting cgroup path

Fix cpu quota/shares using the wrong controller path, and
use the outer path to apply hotplugged changes.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: factor out cgroupv2_base_path
Wolfgang Bumiller [Fri, 15 May 2020 09:08:38 +0000 (11:08 +0200)]
cgroup: factor out cgroupv2_base_path

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoget_cgroup_path: add fallback for lxc 3
Wolfgang Bumiller [Fri, 15 May 2020 09:08:37 +0000 (11:08 +0200)]
get_cgroup_path: add fallback for lxc 3

Fixes some hotplug issues with containers still running
lxc 3.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocommands: add freeze and unfreeze
Wolfgang Bumiller [Fri, 15 May 2020 09:08:36 +0000 (11:08 +0200)]
commands: add freeze and unfreeze

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump version to 3.1-5
Thomas Lamprecht [Thu, 7 May 2020 19:54:55 +0000 (21:54 +0200)]
bump version to 3.1-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agovzdump: use new 'pbs' option
Fabian Grünbichler [Wed, 6 May 2020 08:57:51 +0000 (10:57 +0200)]
vzdump: use new 'pbs' option

instead of storage config to determine whether we are in 'PBS mode'

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump version to 3.1-4
Fabian Grünbichler [Tue, 5 May 2020 09:24:02 +0000 (11:24 +0200)]
bump version to 3.1-4

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agod/control: depend on newer libpve-guest-common-perl
Fabian Grünbichler [Tue, 5 May 2020 09:22:52 +0000 (11:22 +0200)]
d/control: depend on newer libpve-guest-common-perl

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoapi/destroy: repeat early checks after locking
Fabian Grünbichler [Tue, 5 May 2020 08:27:20 +0000 (10:27 +0200)]
api/destroy: repeat early checks after locking

and check_lock before forking as well

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agocreate_vm: avoid premature write_config caused by update_pct_config
Fabian Ebner [Tue, 5 May 2020 08:27:15 +0000 (10:27 +0200)]
create_vm: avoid premature write_config caused by update_pct_config

by moving the write_config calls from vmconfig_*_pending to their
call sites. The single other call site for update_pct_config in
update_vm is also adapted.

The update_pct_config call lead to a write_config call and so the
configuration file was created before it was intended to be created.

When the CFS is updated in between the write_config call and the
PVE::Cluster::check_vmid_unused call in create_and_lock_config,
the container file would already exist and so creation would
fail after writing out a basically empty config.

Even worse, a race was possible for two containers created with the
same ID at the same time:
Assuming the initial PVE::Cluster::check_vmid_unused check in the
parameter verification passes for both create_vm calls, the later one
would potentially overwrite the earlier configuration file with its
update_pct_config call.

Additionally, the file read for $old_config was always the one written
by update_pct_config. Meaning that for a create_vm call with force=1,
already existing old volumes were not removed.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoLXC: drop unused imported locking functions
Fabian Grünbichler [Tue, 5 May 2020 08:27:14 +0000 (10:27 +0200)]
LXC: drop unused imported locking functions

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoFix: #2124 add zstd
Alwin Antreich [Tue, 28 Apr 2020 13:58:10 +0000 (15:58 +0200)]
Fix: #2124 add zstd

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
4 years agobump version to 3.1-3
Wolfgang Bumiller [Wed, 29 Apr 2020 09:33:25 +0000 (11:33 +0200)]
bump version to 3.1-3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: use version returned from get_path()
Wolfgang Bumiller [Thu, 9 Apr 2020 11:28:39 +0000 (13:28 +0200)]
cgroup: use version returned from get_path()

Instead of deciding via `cgroup_mode()` use the version we
get from get_path().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agosupport cpuset cgroupv2 controller
Wolfgang Bumiller [Thu, 9 Apr 2020 11:28:38 +0000 (13:28 +0200)]
support cpuset cgroupv2 controller

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: more generic get_cgroup_controllers function
Wolfgang Bumiller [Thu, 9 Apr 2020 11:28:37 +0000 (13:28 +0200)]
cgroup: more generic get_cgroup_controllers function

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoconsider lxc.cgroup2.cpuset.cpus as explicit cpuset
Wolfgang Bumiller [Thu, 9 Apr 2020 11:28:36 +0000 (13:28 +0200)]
consider lxc.cgroup2.cpuset.cpus as explicit cpuset

We should not override it in either case.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoconfig: whitelist lxc.cgroup2 raw keys
Wolfgang Bumiller [Thu, 9 Apr 2020 11:28:35 +0000 (13:28 +0200)]
config: whitelist lxc.cgroup2 raw keys

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoapi/destroy: add force to allow destroying running CT
Thomas Lamprecht [Sat, 25 Apr 2020 15:44:19 +0000 (17:44 +0200)]
api/destroy: add force to allow destroying running CT

Convenient and naturally opt-in

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi/destroy: improve description for purge param
Thomas Lamprecht [Sat, 25 Apr 2020 15:35:08 +0000 (17:35 +0200)]
api/destroy: improve description for purge param

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopct: reorder CLI definitions
Thomas Lamprecht [Sat, 25 Apr 2020 15:34:35 +0000 (17:34 +0200)]
pct: reorder CLI definitions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoCentOS 6: add '--nohangup' as mingetty arg
Stoiko Ivanov [Wed, 22 Apr 2020 09:24:27 +0000 (11:24 +0200)]
CentOS 6: add '--nohangup' as mingetty arg

When creating an unprivileged container with CentOS 6 (which will be EOL in
Nov 2020 [0]) the console does not work.

The problem is mitigated by adding the --nohangup argument to the mingetty
invocations during bootup (in /etc/init/tty.conf).

The idea for the fix is based on the legacy template builder-scripts from
lxc:
https://github.com/lxc/lxc-templates/blob/master/templates/lxc-centos.in#L308

Since '/etc/init/tty.conf' is only written during container creation/restore
and since it is guarded to CentOS versions < 7, the potential for regression
should be rather small.

Tested by creating an unprivileged and a privileged CentOS6 container and
with nesting enabled and disabled for both - the console showed up in
all cases with this fix.

[0] https://wiki.centos.org/About/Product
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 years agoFix move_volume by using result from parse_volume
Fabian Ebner [Mon, 20 Apr 2020 11:12:28 +0000 (13:12 +0200)]
Fix move_volume by using result from parse_volume

This was changed by accident by my refactoring in
commit e4034859fd0e3491fd1aefb4f9ef44ee585aa404

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoAlso free unused volumes owned by a container on removal
Fabian Ebner [Tue, 14 Apr 2020 12:02:18 +0000 (14:02 +0200)]
Also free unused volumes owned by a container on removal

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoFix parse_volume for unused volumes
Fabian Ebner [Tue, 14 Apr 2020 12:02:17 +0000 (14:02 +0200)]
Fix parse_volume for unused volumes

by extending the description. Also fixes the relevant for loop to
iterate over MAX_UNUSED_DISKS instead of MAX_MOUNT_POINTS.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agobump version to 3.1-2
Fabian Grünbichler [Thu, 9 Apr 2020 06:50:58 +0000 (08:50 +0200)]
bump version to 3.1-2

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agod/control: depend on pve-storage with new storage_migrate
Fabian Grünbichler [Thu, 9 Apr 2020 06:49:44 +0000 (08:49 +0200)]
d/control: depend on pve-storage with new storage_migrate

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoconfig: make full parser private sub
Fabian Grünbichler [Wed, 8 Apr 2020 20:58:04 +0000 (22:58 +0200)]
config: make full parser private sub

it's now only used within the public parse_volume interface

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoUse new storage_migrate interface
Fabian Ebner [Wed, 8 Apr 2020 09:25:02 +0000 (11:25 +0200)]
Use new storage_migrate interface

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoUse parse_volume instead of parse_ct-variants
Fabian Ebner [Wed, 8 Apr 2020 09:24:58 +0000 (11:24 +0200)]
Use parse_volume instead of parse_ct-variants

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoUse foreach_volume instead of foreach_mountpoint-variants
Fabian Ebner [Wed, 8 Apr 2020 09:24:57 +0000 (11:24 +0200)]
Use foreach_volume instead of foreach_mountpoint-variants

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agobump version to 3.1-1
Wolfgang Bumiller [Mon, 6 Apr 2020 12:24:19 +0000 (14:24 +0200)]
bump version to 3.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocommand: get_cgroup_path: handle undef subsystem
Wolfgang Bumiller [Mon, 6 Apr 2020 07:50:46 +0000 (09:50 +0200)]
command: get_cgroup_path: handle undef subsystem

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocommand: actually use the provided command id
Wolfgang Bumiller [Mon, 6 Apr 2020 07:50:45 +0000 (09:50 +0200)]
command: actually use the provided command id

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup cleanup: add missing lxc.monitor cleanup
Wolfgang Bumiller [Mon, 6 Apr 2020 07:50:44 +0000 (09:50 +0200)]
cgroup cleanup: add missing lxc.monitor cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocommand: cleanup unused function
Wolfgang Bumiller [Mon, 6 Apr 2020 07:50:43 +0000 (09:50 +0200)]
command: cleanup unused function

We used a $limiting parameter instead.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse final names for cgroup isolation
Wolfgang Bumiller [Mon, 6 Apr 2020 07:50:42 +0000 (09:50 +0200)]
use final names for cgroup isolation

See: https://github.com/lxc/lxc/pull/3353
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agofollowup: fix some comment typos
Thomas Lamprecht [Sat, 4 Apr 2020 18:04:00 +0000 (20:04 +0200)]
followup: fix some comment typos

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: bump versioned dependency for libpve-common-perl
Thomas Lamprecht [Sat, 4 Apr 2020 17:57:07 +0000 (19:57 +0200)]
d/control: bump versioned dependency for libpve-common-perl

for the newer cpuset/cgroupv2 adaptions and refactoring.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocleanup cgroups in pre-start hook
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:40 +0000 (16:37 +0200)]
cleanup cgroups in pre-start hook

Though I wish perl had an fdopendir equivalent...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agohandle cgroup related changes of lxc-4.0
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:39 +0000 (16:37 +0200)]
handle cgroup related changes of lxc-4.0

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopve-container@.service: switch to foreground mode
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:38 +0000 (16:37 +0200)]
pve-container@.service: switch to foreground mode

And use StandardOutput/Error=null, so we can use
`Type=simple`. Because using `Type=forking` has become more
difficult with systemd & upstream lxc's cgroup layout
changes. This seems to be the path of least resistance.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd upscript (lxcnetaddbr) to container lxc config
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:37 +0000 (16:37 +0200)]
add upscript (lxcnetaddbr) to container lxc config

This used to be a patch on top of lxc, now we just configure
it explicitly here to reduce the patch load.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd helper to get the lxc version
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:36 +0000 (16:37 +0200)]
add helper to get the lxc version

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocleanup unused functions
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:35 +0000 (16:37 +0200)]
cleanup unused functions

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse CGroup::change_cpu_{shares, quota}
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:34 +0000 (16:37 +0200)]
use CGroup::change_cpu_{shares, quota}

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: add change_cpu_quota, change_cpu_shares
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:33 +0000 (16:37 +0200)]
cgroup: add change_cpu_quota, change_cpu_shares

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse CGroup::change_memory_limit
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:32 +0000 (16:37 +0200)]
use CGroup::change_memory_limit

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: add change_memory_limit
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:31 +0000 (16:37 +0200)]
cgroup: add change_memory_limit

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse CGroup::get_memory_stat
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:30 +0000 (16:37 +0200)]
use CGroup::get_memory_stat

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: add get_memory_stat
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:29 +0000 (16:37 +0200)]
cgroup: add get_memory_stat

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse CGroup::get_cpu_stat
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:28 +0000 (16:37 +0200)]
use CGroup::get_cpu_stat

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: add get_cpu_stat
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:27 +0000 (16:37 +0200)]
cgroup: add get_cpu_stat

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse CGroup::get_io_stats
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:26 +0000 (16:37 +0200)]
use CGroup::get_io_stats

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agocgroup: add get_io_stats and parse_nested_keyed_file
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:25 +0000 (16:37 +0200)]
cgroup: add get_io_stats and parse_nested_keyed_file

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoupdate_lxc_config: cgroupv2 support
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:24 +0000 (16:37 +0200)]
update_lxc_config: cgroupv2 support

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopct: use CGroup submodule and new CpuSet methods
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:23 +0000 (16:37 +0200)]
pct: use CGroup submodule and new CpuSet methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd PVE::LXC::{CGroup, Command} submodules
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:22 +0000 (16:37 +0200)]
add PVE::LXC::{CGroup, Command} submodules

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd Delegate flag to pve-container@.service
Wolfgang Bumiller [Fri, 3 Apr 2020 14:37:21 +0000 (16:37 +0200)]
add Delegate flag to pve-container@.service

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump version to 3.0-12
Fabian Grünbichler [Mon, 30 Mar 2020 07:36:07 +0000 (09:36 +0200)]
bump version to 3.0-12

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoImplement volume-related helpers and use new foreach_volume
Fabian Ebner [Thu, 26 Mar 2020 08:09:39 +0000 (09:09 +0100)]
Implement volume-related helpers and use new foreach_volume

Renames mountpoint_names to avoid the need to create a wrapper.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoVZDump: mark template disks as ro
Fabian Grünbichler [Fri, 27 Mar 2020 08:59:17 +0000 (09:59 +0100)]
VZDump: mark template disks as ro

since immutable .raw base volumes cannot be mounted RW.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove_volume: if deleting old volume fails, add it as unused
Fabian Ebner [Mon, 23 Mar 2020 11:18:54 +0000 (12:18 +0100)]
move_volume: if deleting old volume fails, add it as unused

Especially useful when there are linked clones using the volume
that is being moved, but shouldn't hurt otherwise either.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agofix #1904: convert to base image when moving a volume of a template
Fabian Ebner [Mon, 23 Mar 2020 11:18:53 +0000 (12:18 +0100)]
fix #1904: convert to base image when moving a volume of a template

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoRely on template_create to check whether creating a template is possible
Fabian Ebner [Mon, 23 Mar 2020 11:18:52 +0000 (12:18 +0100)]
Rely on template_create to check whether creating a template is possible

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoFor clone+copy features, make sure a valid format for the target is supported
Fabian Ebner [Mon, 23 Mar 2020 11:18:51 +0000 (12:18 +0100)]
For clone+copy features, make sure a valid format for the target is supported

using the new option valid_target_formats. This is
necessary, because clone_image can result in a qcow2 image
being created (on directory based storages) which is not
valid for LXC.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agobump version to 3.0-23
Thomas Lamprecht [Thu, 19 Mar 2020 18:02:54 +0000 (19:02 +0100)]
bump version to 3.0-23

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agolxc_config: mount /sys as mixed for unprivileged by default
Thomas Lamprecht [Wed, 18 Mar 2020 09:46:17 +0000 (10:46 +0100)]
lxc_config: mount /sys as mixed for unprivileged by default

CONTAINER_INTERFACE[0] is something systemd people call their API and
we need to adapt to it a bit, even if it means doing stupid
unnecessary things, as else systemd decides to regress and suddenly
break network stack in CT after an upgrade[1].

This mounts the parent /sys as mixed, which is:
> mount /sys as read-only but with /sys/devices/virtual/net writable.
-- man 5 lxc.container.conf

Allow users to overwrite that with a features knob, as surely some
run into other issues else and manually adding a "lxc.mount.auto"
entry in the container .conf is not an nice user experience for most.

Fixes the system regression in up to date Arch installations
introduced by[2].

[0]: https://systemd.io/CONTAINER_INTERFACE/
[1]: https://github.com/systemd/systemd/issues/15101#issuecomment-598607582
[2]: https://github.com/systemd/systemd/commit/bf331d87171b7750d1c72ab0b140a240c0cf32c3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump version to 3.0-22
Thomas Lamprecht [Mon, 16 Mar 2020 08:09:49 +0000 (09:09 +0100)]
bump version to 3.0-22

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoallow restoring non-volume backups again
Fabian Grünbichler [Mon, 16 Mar 2020 07:52:46 +0000 (08:52 +0100)]
allow restoring non-volume backups again

this got broken with PBS integration patches

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agosetup: warn on unknown os-release ID
Thomas Lamprecht [Thu, 12 Mar 2020 12:40:57 +0000 (13:40 +0100)]
setup: warn on unknown os-release ID

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2580: api/delete: drop CT from HA resources if purge is set
Thomas Lamprecht [Thu, 12 Mar 2020 12:15:53 +0000 (13:15 +0100)]
fix #2580: api/delete: drop CT from HA resources if purge is set

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup whitespace and style fixes
Thomas Lamprecht [Tue, 10 Mar 2020 18:40:16 +0000 (19:40 +0100)]
followup whitespace and style fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agolxc: add sdn veth_create|plug
Alexandre Derumier [Mon, 9 Mar 2020 09:24:30 +0000 (10:24 +0100)]
lxc: add sdn veth_create|plug

4 years agod/control: bump versioned dependency for libpve-guest-common-perl (>= 3.0-4)
Thomas Lamprecht [Tue, 10 Mar 2020 13:31:18 +0000 (14:31 +0100)]
d/control: bump versioned dependency for libpve-guest-common-perl (>= 3.0-4)

For the moved definedness-safe comparison methods

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: do not import unused methods~
Thomas Lamprecht [Tue, 10 Mar 2020 13:30:13 +0000 (14:30 +0100)]
followup: do not import unused methods~

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agouse helper functions from GuestHelpers
Oguz Bektas [Wed, 19 Feb 2020 16:07:57 +0000 (17:07 +0100)]
use helper functions from GuestHelpers

remove safe_string_ne and safe_num_ne code which is now shared in
GuestHelpers. also change all the calls.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agoFix mounting ZFS snapshots whose dataset is not mounted below '/'
Fabian Ebner [Tue, 18 Feb 2020 11:31:22 +0000 (12:31 +0100)]
Fix mounting ZFS snapshots whose dataset is not mounted below '/'

Trying to back up a container with a ZFS dataset with non-standard mount
would fail, see [0].

This also removes the near-dead code
$name .= "\@$snapname";
when snapname is false-y, but defined and turns
the check for $snapname into one for definedness.

[0]: https://forum.proxmox.com/threads/lxc-backup-fails-unable-to-open-the-dataset-vzdump.64944/

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agobump version to 3.0-21
Thomas Lamprecht [Tue, 3 Mar 2020 11:00:57 +0000 (12:00 +0100)]
bump version to 3.0-21

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2611: use correct operation in get_bandwidth_limit
Stefan Reiter [Tue, 25 Feb 2020 15:32:02 +0000 (16:32 +0100)]
fix #2611: use correct operation in get_bandwidth_limit

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agovzdump: add support for proxmox backup server
Dietmar Maurer [Tue, 25 Feb 2020 09:43:44 +0000 (10:43 +0100)]
vzdump: add support for proxmox backup server

4 years agosetup/ubuntu: add upcoming 20.04 focal release
Thomas Lamprecht [Fri, 21 Feb 2020 12:07:56 +0000 (13:07 +0100)]
setup/ubuntu: add upcoming 20.04 focal release

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosetup/ubuntu: note LTS versions
Thomas Lamprecht [Fri, 21 Feb 2020 12:07:32 +0000 (13:07 +0100)]
setup/ubuntu: note LTS versions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 3.0-20
Thomas Lamprecht [Thu, 20 Feb 2020 12:59:07 +0000 (13:59 +0100)]
bump version to 3.0-20

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobackup: improve module usage sorting and code readability
Thomas Lamprecht [Wed, 19 Feb 2020 16:42:45 +0000 (17:42 +0100)]
backup: improve module usage sorting and code readability

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobackup prepare: remove useless "activate volumes"
Thomas Lamprecht [Wed, 19 Feb 2020 16:41:49 +0000 (17:41 +0100)]
backup prepare: remove useless "activate volumes"

As the actual stop of the CT happened after VZDump called the prepare
step, the volume activation was undone again.
commit 00cc04160351f0034c5349d208e59a5f46d8ee33 improved that by
doing the activate now in the archive step when colleting the
moutpoints to backup, so drop it here for good.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2598: activate volumes before mounting in stop mode backup
Oguz Bektas [Tue, 18 Feb 2020 13:38:52 +0000 (14:38 +0100)]
fix #2598: activate volumes before mounting in stop mode backup

'stop' mode deactivates the volumes (relevant for LVM backend), and
they're not reactivated before trying to mount them for backup.

reactivating the volumes before the mount in 'stop' mode backup solves
the issue.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapply_pending: do cleanup pending between, not during, change/delete loop
Oguz Bektas [Wed, 5 Feb 2020 14:03:29 +0000 (15:03 +0100)]
apply_pending: do cleanup pending between, not during, change/delete loop

instead of calling it while iterating, inbetween the loops is a
better place in terms of similarity with qemu-server side, while also
fixing the bug that Dominik found[0]:

> when setting a netX option that is semantically the same as the one
> already set but in a different order, e.g.:
>
> in config:
> net0: name=eth0,bridge=vmbr0,hwaddr=AA:AA:AA:AA:AA:AA,type=veth
> setting via api:
> net0: bridge=vmbr0,name=eth0,hwaddr=AA:AA:AA:AA:AA:AA,type=veth
>
> the code tries to 'hot-apply' the change (which is no change
> really) where the api line then gets parsed and printed which
> results in the same string already in the config
>
> then we do a 'cleanup_pending' which removes it from pending, since
> the config already contains the exact same options, but then we
> overwrite the config from pending (which is empty) resulting in an
> invalid config line:
> --8<--
> net0:
> -->8--

Avoid this by only calling the cleanup pending change outside the
loop, it makes no sense to loop over the whole config on each pending
property change and pending delete.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2020-February/041573.html

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
[ Thomas: adapted commit message with some extra info ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoallow reading snapshot config for VM.Audit
Dominik Csapak [Fri, 31 Jan 2020 10:40:52 +0000 (11:40 +0100)]
allow reading snapshot config for VM.Audit

VM.Audit can see the current config and the list of snapshots
already, so there is no real reason to disallow
the config of snapshots

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agod/control: depend on pve-lxc-syscalld
Thomas Lamprecht [Fri, 31 Jan 2020 15:24:30 +0000 (16:24 +0100)]
d/control: depend on pve-lxc-syscalld

It's a really small daemon doing nothing if not in use, and only
requiring < 1M of disk space and ~2M of memory (and one can always
stop the service if not wanted)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoset lxc.seccomp.notify.cookie to the vmid
Wolfgang Bumiller [Thu, 30 Jan 2020 08:27:33 +0000 (09:27 +0100)]
set lxc.seccomp.notify.cookie to the vmid

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agomask 'mknod' feature by kernel version
Wolfgang Bumiller [Thu, 30 Jan 2020 08:27:32 +0000 (09:27 +0100)]
mask 'mknod' feature by kernel version

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
[ Thomas: use new helper from common ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd mknod feature flag
Wolfgang Bumiller [Thu, 30 Jan 2020 08:27:30 +0000 (09:27 +0100)]
add mknod feature flag

This causes char and blockdev mknod() and mknodat() calls to
be forwarded to the seccomp proxy, so unprivileged
containers can finally create /dev/null by themselves.

For now this is experimental and therefore added to
`features`. Ideally, if this works as intended, we can make
it the default in pve 7.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump version to 3.0-19
Thomas Lamprecht [Mon, 27 Jan 2020 17:54:11 +0000 (18:54 +0100)]
bump version to 3.0-19

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2568: hotplug: fix typo 'cpu.shares'
Oguz Bektas [Mon, 27 Jan 2020 17:44:00 +0000 (18:44 +0100)]
fix #2568: hotplug: fix typo 'cpu.shares'

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agofix #2560: adapt some sysctl values for high CT counts
Thomas Lamprecht [Thu, 23 Jan 2020 09:09:27 +0000 (10:09 +0100)]
fix #2560: adapt some sysctl values for high CT counts

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>