]> git.proxmox.com Git - pve-container.git/log
pve-container.git
2 years agoallow nesting to be changed for VM.Allocate on unprivileged containers
Dominik Csapak [Wed, 4 Aug 2021 10:51:08 +0000 (12:51 +0200)]
allow nesting to be changed for VM.Allocate on unprivileged containers

instead of it being root only

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoadd old config and unprivileged to check_ct_modify_config_perm
Dominik Csapak [Wed, 4 Aug 2021 10:51:07 +0000 (12:51 +0200)]
add old config and unprivileged to check_ct_modify_config_perm

we'll need that for checking the features more granularly
for it to work correctly, we have to move the permission checks
into the 'lock_config' sub, since we now also need to check the current
config and it could change between the permission check and the lock

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofix #3478: abort container creation on arch detection timeout
Lorenz Stechauner [Thu, 22 Jul 2021 07:54:56 +0000 (09:54 +0200)]
fix #3478: abort container creation on arch detection timeout

increased the timeout for detect_arch from 5 to 10 seconds.

until now, on any error detect_architecture would fall back to amd64.
to avoid falling back due to an timeout error this function now dies
on timeout errors.

additionally minor changes to the error messages have been made.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2 years agopct cpuset: show effective values
Wolfgang Bumiller [Tue, 20 Jul 2021 11:19:28 +0000 (13:19 +0200)]
pct cpuset: show effective values

rather than the "desired" ones, this is more useful
(we could also show differences if there are any?)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agopct cpuset: use limiting cgroup
Wolfgang Bumiller [Tue, 20 Jul 2021 11:19:27 +0000 (13:19 +0200)]
pct cpuset: use limiting cgroup

this is what's actually applied to the container (although
the container may be imposing an even stricter limit, but
that's not what we want to see...)

also, the v2 cpuset list may be empty (and often is for
unprivileged+nesting containers), which currently fails to
parse

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 4.0-8
Fabian Grünbichler [Thu, 8 Jul 2021 10:30:01 +0000 (12:30 +0200)]
bump version to 4.0-8

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoconfig: sync ACL checks with qemu-server
Fabian Grünbichler [Thu, 8 Jul 2021 09:23:55 +0000 (11:23 +0200)]
config: sync ACL checks with qemu-server

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agobump version to 4.0-7
Thomas Lamprecht [Tue, 6 Jul 2021 13:48:18 +0000 (15:48 +0200)]
bump version to 4.0-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3506: config: fix removing the cpulimit of a running CT
Thomas Lamprecht [Tue, 6 Jul 2021 13:45:53 +0000 (15:45 +0200)]
fix #3506: config: fix removing the cpulimit of a running CT

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 4.0-6
Wolfgang Bumiller [Tue, 6 Jul 2021 06:27:42 +0000 (08:27 +0200)]
bump version to 4.0-6

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoensure the config dir exists in update_lxc_config
Wolfgang Bumiller [Tue, 6 Jul 2021 06:22:28 +0000 (08:22 +0200)]
ensure the config dir exists in update_lxc_config

Otherwise make_seccomp_config cannot add files to it.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 4.0-5
Thomas Lamprecht [Mon, 5 Jul 2021 16:56:16 +0000 (18:56 +0200)]
bump version to 4.0-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agostart: cgroup compat: warn also to task log
Thomas Lamprecht [Mon, 5 Jul 2021 16:54:31 +0000 (18:54 +0200)]
start: cgroup compat: warn also to task log

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agostart: add pre-start-hook log-warn infra
Thomas Lamprecht [Mon, 5 Jul 2021 16:54:10 +0000 (18:54 +0200)]
start: add pre-start-hook log-warn infra

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosetup: shortcut cgroupv2 support for non-systemd distros
Stoiko Ivanov [Mon, 5 Jul 2021 10:57:15 +0000 (12:57 +0200)]
setup: shortcut cgroupv2 support for non-systemd distros

Alpine and Devuan do not use systemd as init, thus run without
problems in a pure cgroupv2 environment

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agoprestart-hook: detect cgroupv2 incompatible systemd version
Stoiko Ivanov [Mon, 5 Jul 2021 10:57:14 +0000 (12:57 +0200)]
prestart-hook: detect cgroupv2 incompatible systemd version

Some container OS (e.g. CentOS 7, Ubuntu 16.04) are booted with
systemd, in a version which is not able to run with a pure cgroupv2
(a.k.a unified hierarchy) environment.

Detect those in the lxc-pve-prestart-hook, because there we already
have all mount-points set up.

This approach only leaves syslog/journal as place for notifying the
user since starting a container eventually runs `systemctl start
pve-container@VMID.service`, where we lose the prints to stdout and
stderr.

The alternative of shortly mounting all container mounts just to
obtain the systemd-version, before starting the container seems
prohibitively expensive.

The heuristic of /sbin/init needing to be a link to something ending
in systemd is taken from the systemd documentation[0] and was verified
on a few of our container-templates.

[0] https://www.freedesktop.org/software/systemd/man/systemd.html
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agobump version to 4.0-4
Wolfgang Bumiller [Mon, 5 Jul 2021 08:12:31 +0000 (10:12 +0200)]
bump version to 4.0-4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd default userns config file
Wolfgang Bumiller [Mon, 5 Jul 2021 07:13:51 +0000 (09:13 +0200)]
add default userns config file

With cgroupv2 we lose the default devices entries, which in
cgroupv1 results in the default inherited 'a *:* rwm', so
let's have lxc's cgroupv2 default do the same (iow. turn it
into a "deny-list").

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodisable btrfs ioctl in user namespaces
Wolfgang Bumiller [Thu, 24 Jun 2021 14:09:17 +0000 (16:09 +0200)]
disable btrfs ioctl in user namespaces

Changes the seccomp profile to return EPERM on every btrfs
ioctl.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobtrfs: pass size when creating subvolumes
Wolfgang Bumiller [Thu, 24 Jun 2021 08:14:41 +0000 (10:14 +0200)]
btrfs: pass size when creating subvolumes

otherwise the exception doesn't make much sense

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 4.0-3
Thomas Lamprecht [Thu, 24 Jun 2021 06:08:41 +0000 (08:08 +0200)]
bump version to 4.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agospecial case btrfs+quotas to use subvolumes
Wolfgang Bumiller [Tue, 22 Jun 2021 12:18:27 +0000 (14:18 +0200)]
special case btrfs+quotas to use subvolumes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoenable btrfs support via subvolumes
Wolfgang Bumiller [Tue, 22 Jun 2021 12:18:26 +0000 (14:18 +0200)]
enable btrfs support via subvolumes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomigration: fix snapshots boolean accounting
Wolfgang Bumiller [Tue, 22 Jun 2021 12:18:25 +0000 (14:18 +0200)]
migration: fix snapshots boolean accounting

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoalloc_disk: adapt error for content-type
Thomas Lamprecht [Mon, 21 Jun 2021 08:49:59 +0000 (10:49 +0200)]
alloc_disk: adapt error for content-type

as containers may be supported by the underlying storage tech, but
just not configured at the moment.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoalloc_disk: indentation/text-width cleanup
Thomas Lamprecht [Mon, 21 Jun 2021 08:49:44 +0000 (10:49 +0200)]
alloc_disk: indentation/text-width cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3421: allow custom storage plugins to support rootfs
Lorenz Stechauner [Thu, 27 May 2021 12:23:30 +0000 (14:23 +0200)]
fix #3421: allow custom storage plugins to support rootfs

it is now necessary for storages to support the 'rootdir' content in
order to start containers on them. all native storage plugins
already report the rootdir content correctly.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agopct: correctly handle warnings task status
Fabian Ebner [Wed, 12 May 2021 12:32:56 +0000 (14:32 +0200)]
pct: correctly handle warnings task status

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agobump version to 4.0-2
Thomas Lamprecht [Mon, 21 Jun 2021 08:41:50 +0000 (10:41 +0200)]
bump version to 4.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomigrate: enforce that rootdir content type is available
Fabian Ebner [Fri, 18 Jun 2021 10:59:32 +0000 (12:59 +0200)]
migrate: enforce that rootdir content type is available

and use it for the vdisk_list call too. This avoids scanning (and picking up
volumes from!) storages that are not even configured to hold container images.

Also serves a bit as a preparation to enforce content type on guest startup,
because now migration failure happens early and not only when trying to start
the guest on the remote node.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agomigrate: also test unused volumes
Fabian Ebner [Fri, 18 Jun 2021 10:59:31 +0000 (12:59 +0200)]
migrate: also test unused volumes

otherwise an unused volume on a disabled storage is silently left on the old
node, even if referenced.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoprefer storage_check_enabled over storage_check_node
Fabian Ebner [Fri, 18 Jun 2021 10:59:30 +0000 (12:59 +0200)]
prefer storage_check_enabled over storage_check_node

storage_check_enabled simply checks for the 'disable' option and then calls
storage_check_node.

While not strictly necessary for a second call where only the storage differs,
it is more future-proof: if support for a target storage is added at some point,
it might be easy to miss adapting the call.

For the migration checks, disabled storages are now always caught.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoclear machine-id: only truncate machine-id file if either it exists or systemd managed
Thomas Lamprecht [Fri, 18 Jun 2021 16:15:45 +0000 (18:15 +0200)]
clear machine-id: only truncate machine-id file if either it exists or systemd managed

Not nice to create empty /etc/machine-id files in, e.g., Alpine Linux
CTs.

The adaption of the else branch is not only an optimization to avoid
unlink call of non-existent file, but required as it not guaranteed
to be in the "no clone" case else anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosetup: fix calling clone hook with weird params
Thomas Lamprecht [Fri, 18 Jun 2021 16:02:21 +0000 (18:02 +0200)]
setup: fix calling clone hook with weird params

$clone has no use and what the interface constraints on $conf vs.
$self->{conf} really are is nowhere documented, so just use $conf for
now, to at least use only one thing (and avoid the highly confusing
case where the signature suggests that $conf is used, so when one
would pass a to $self->{conf} unrelated $conf it would not work)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoclone_vm: rework firewall config cloning
Fabian Grünbichler [Fri, 18 Jun 2021 12:51:23 +0000 (14:51 +0200)]
clone_vm: rework firewall config cloning

we need to clone the firewall config before doing any actual work, else
we risk partially aborting and leaving a non-firewalled container
around. accordingly, we need to (attempt to) remove the cloned FW config
after successfully removing the guest config in error handling.

partially reverts/fixes 4925b86a920a862f25f0d93d243ce099c922979d clone_vm: improve config locking

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclone_vm: refactor locking further
Fabian Grünbichler [Fri, 18 Jun 2021 12:51:22 +0000 (14:51 +0200)]
clone_vm: refactor locking further

introduce a new helper handling
- obtaining the flock
- (re)loading the config
- checking that the 'create' lock is still there

before calling a passed-in sub with the current config, since this
pattern was used quite a lot here.

intentionally changed behaviour:
- flock is now held for the post_clone hook call
- failure to remove the 'create' lock or to move the config to the
  target node if applicable will not undo the clone, since either is
  trivially fixable ('pct unlock' or a no-op migration), and copying all
  those volumes might have been quite expensive..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclone_vm: move linked clone check in eval
Fabian Grünbichler [Fri, 18 Jun 2021 12:51:21 +0000 (14:51 +0200)]
clone_vm: move linked clone check in eval

so that the source config is properly cleaned up/unlocked

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclone_vm: reduce source flock scope
Fabian Grünbichler [Fri, 18 Jun 2021 12:51:20 +0000 (14:51 +0200)]
clone_vm: reduce source flock scope

set_lock already obtains the flock (since it does a read-modify-write
cycle), and the rest of this code does not touch the config file in any
fashion so no need to hold the flock either..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclone_vm: use destroy_config instead of manual unlink
Fabian Grünbichler [Fri, 18 Jun 2021 12:51:19 +0000 (14:51 +0200)]
clone_vm: use destroy_config instead of manual unlink

and wrap the calls in an eval to preserve original errors causing us to
remove the config in the first place..

also, remove disks before removing the locked config (reverse order of
creation).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclone_vm: use move_config_to_node
Fabian Grünbichler [Fri, 18 Jun 2021 12:51:18 +0000 (14:51 +0200)]
clone_vm: use move_config_to_node

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclone_vm: fix minor typo in error message
Oguz Bektas [Thu, 17 Jun 2021 10:52:01 +0000 (12:52 +0200)]
clone_vm: fix minor typo in error message

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2 years agorun post_clone_hook in clone_vm API
Oguz Bektas [Thu, 17 Jun 2021 10:52:00 +0000 (12:52 +0200)]
run post_clone_hook in clone_vm API

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2 years agoclone_vm: improve config locking
Oguz Bektas [Thu, 17 Jun 2021 10:51:59 +0000 (12:51 +0200)]
clone_vm: improve config locking

cleaned up the locking situation with config files as Fabian G.
suggested in the review.

use the 'create_and_lock_config' helper in the beginning to ensure that
the target CTID is available, and that the target config is locked from
the beginning. in case any error happens during the initial checks, we
unlink this config in error handling.

firewall config is also now cloned inside the worker instead of before
the worker, in case the clone fails.

also lock the config file when renaming the conf (for moving to a target
node when the option is passed).

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2 years agosetup: add post_clone_hook for containers
Oguz Bektas [Thu, 17 Jun 2021 10:51:58 +0000 (12:51 +0200)]
setup: add post_clone_hook for containers

for now it calls the new clear_machine_id function.

this way when new containers are created they will have a unique
/etc/machine-id.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2 years agoconfig: limit description/comment length to 8 KiB
Thomas Lamprecht [Fri, 18 Jun 2021 11:10:56 +0000 (13:10 +0200)]
config: limit description/comment length to 8 KiB

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agovm status: force int where appropriate
Fabian Ebner [Tue, 1 Jun 2021 06:43:05 +0000 (08:43 +0200)]
vm status: force int where appropriate

In the case of a running container with cgroupv2, swap would be a string,
causing a
    size.toFixed is not a function
error for the format_size call in the containers's "Summary" page in the UI.

The vmids from config_list() are already integers as the return schema expects,
while the opt_vmid passed from the status/current API call needs to be
converted.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agopct: sort and group module-use
Thomas Lamprecht [Wed, 16 Jun 2021 16:34:21 +0000 (18:34 +0200)]
pct: sort and group module-use

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopct config: fix indentation and rework to shorter code
Thomas Lamprecht [Wed, 16 Jun 2021 14:14:10 +0000 (16:14 +0200)]
pct config: fix indentation and rework to shorter code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopct: exec, attach: drop "Error: " prefix from error message
Thomas Lamprecht [Wed, 16 Jun 2021 14:12:39 +0000 (16:12 +0200)]
pct: exec, attach: drop "Error: " prefix from error message

we normally do not have that here, the load_config call (which
ensures that the CT exists) also errors without any "Error" like
prefix, so for consistency drop it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopct exec: do running check earlier
Thomas Lamprecht [Wed, 16 Jun 2021 14:05:51 +0000 (16:05 +0200)]
pct exec: do running check earlier

So that both VMID and state related checks are grouped together.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopct exec: factor out often used VMID into variable
Thomas Lamprecht [Wed, 16 Jun 2021 14:04:52 +0000 (16:04 +0200)]
pct exec: factor out often used VMID into variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopct: whitespace cleanup
Thomas Lamprecht [Wed, 16 Jun 2021 14:01:51 +0000 (16:01 +0200)]
pct: whitespace cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopct exec: add friendly warning in case container not running
Oguz Bektas [Mon, 14 Jun 2021 13:07:03 +0000 (15:07 +0200)]
pct exec: add friendly warning in case container not running

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2 years agoconfigure cpu/cpuset/memory cgroupv2 values
Wolfgang Bumiller [Thu, 10 Jun 2021 11:15:16 +0000 (13:15 +0200)]
configure cpu/cpuset/memory cgroupv2 values

While the hotplug code utilized PVE::CGroup and already
supported cgroupv2 with this, we did not write out the
configuration before.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomigrate: remove deprecated force parameter
Fabian Ebner [Fri, 4 Jun 2021 13:49:27 +0000 (15:49 +0200)]
migrate: remove deprecated force parameter

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agobuildsys: change upload dist to bullseye
Thomas Lamprecht [Tue, 8 Jun 2021 08:28:34 +0000 (10:28 +0200)]
buildsys: change upload dist to bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agovmstatus: make template property optional
Fabian Ebner [Thu, 11 Mar 2021 10:26:48 +0000 (11:26 +0100)]
vmstatus: make template property optional

to avoid printing 'template: ' with 'pct status <id> --verbose' if it's false.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: clone: whitespace/code cleanup
Thomas Lamprecht [Wed, 26 May 2021 15:41:06 +0000 (17:41 +0200)]
api: clone: whitespace/code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 4.0-1
Thomas Lamprecht [Thu, 13 May 2021 12:02:14 +0000 (14:02 +0200)]
bump version to 4.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/control: clean-up and fixes
Thomas Lamprecht [Wed, 12 May 2021 19:08:54 +0000 (21:08 +0200)]
d/control: clean-up and fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.3-5
Thomas Lamprecht [Tue, 20 Apr 2021 12:13:40 +0000 (14:13 +0200)]
bump version to 3.3-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosetup: fedora: allow upcomming Fedora 34
Thomas Lamprecht [Mon, 19 Apr 2021 16:24:10 +0000 (18:24 +0200)]
setup: fedora: allow upcomming Fedora 34

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosetup: fedora: code cleanup, reuse variable
Thomas Lamprecht [Mon, 19 Apr 2021 16:23:45 +0000 (18:23 +0200)]
setup: fedora: code cleanup, reuse variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoschema: mention special syntax for allocating a new volume
Fabian Ebner [Tue, 2 Mar 2021 12:02:05 +0000 (13:02 +0100)]
schema: mention special syntax for allocating a new volume

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agod/control: bump pve-storage dependency for new vdisk param
Thomas Lamprecht [Sun, 18 Apr 2021 16:05:07 +0000 (18:05 +0200)]
d/control: bump pve-storage dependency for new vdisk param

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofilter by content type when using vdisk_list
Fabian Ebner [Mon, 22 Mar 2021 14:32:42 +0000 (15:32 +0100)]
filter by content type when using vdisk_list

except for migration, where it would be subtly backwards-incompatible.

Also allows to get rid of the existing filtering hack in rescan().

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agopct: fix edge case for 'pct push' with root uid/gid
Oguz Bektas [Tue, 6 Apr 2021 11:56:16 +0000 (13:56 +0200)]
pct: fix edge case for 'pct push' with root uid/gid

we should check if the variable is defined in the end (because root
uid:gid is 0:0, this causes perl to get confused and die, eventhough the
uid:gid was obtained correctly)

reported here:
https://forum.proxmox.com/threads/pct-push-fails-to-get-uid-gid.87065/

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agovmstatus: make lock property optional again
Fabian Ebner [Thu, 11 Mar 2021 10:26:50 +0000 (11:26 +0100)]
vmstatus: make lock property optional again

Commit d02262048cbbe91ca8b12f98e3dc7bbab28e4c64 made the property de-facto
non-optional. Partially revert this and instead adapt the printing, making the
behavior match the API description again. The conditional assignment is
already there further down the vmstatus function.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoconfig: parse: also allow empty values
Fabian Ebner [Thu, 11 Mar 2021 10:26:49 +0000 (11:26 +0100)]
config: parse: also allow empty values

because they are valid for '-list' formats and it makes the behavior match with
what we do for VM configs. The new pattern is the same that is used for VM
configs. Because it is a non-greedy pattern, trailing whitespaces will not be
included in the value anymore. This /should/ cause no problems and the '\s*$'
at the end suggests that that is how it was intended in the first place.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoimprove code readability
Thomas Lamprecht [Thu, 25 Feb 2021 14:26:32 +0000 (15:26 +0100)]
improve code readability

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofix #3313: restore: keep unprivileged status from archive config
Oguz Bektas [Thu, 25 Feb 2021 14:11:16 +0000 (15:11 +0100)]
fix #3313: restore: keep unprivileged status from archive config

Since pct defaults to privileged containers, it restores the
container as privileged when `--unprivileged 1` is not passed.
Instead we should check the old configuration and retrieve it from
there.

This way, when one creates an unprivileged container, it will be
still be unprivileged after restore, if not overwritten by API
arguments.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobackup: keep CT template status for non-root restores
Oguz Bektas [Thu, 25 Feb 2021 14:11:17 +0000 (15:11 +0100)]
backup: keep CT template status for non-root restores

but still keep the lxc.* parameters limited to root, as originally
intended.

note: $orig_mp_param isn't protected by $is_root, but when it's used we
make another recover_config() call on the archive file

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.3-4
Thomas Lamprecht [Wed, 17 Feb 2021 07:59:36 +0000 (08:59 +0100)]
bump version to 3.3-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: ostype: add devuan
Thomas Lamprecht [Wed, 17 Feb 2021 07:57:21 +0000 (08:57 +0100)]
api: ostype: add devuan

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosetup: debian: add preliminary support for Debian 12 Bookworm
Thomas Lamprecht [Tue, 9 Feb 2021 09:19:52 +0000 (10:19 +0100)]
setup: debian: add preliminary support for Debian 12 Bookworm

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosetup: debian: use hash map for translating dev versions
Thomas Lamprecht [Tue, 9 Feb 2021 09:18:49 +0000 (10:18 +0100)]
setup: debian: use hash map for translating dev versions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofix #3176: allow development Devuan versions, improve version detection
Thomas Lamprecht [Tue, 9 Feb 2021 09:12:43 +0000 (10:12 +0100)]
fix #3176: allow development Devuan versions, improve version detection

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.3-3
Thomas Lamprecht [Thu, 28 Jan 2021 16:12:52 +0000 (17:12 +0100)]
bump version to 3.3-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofix #3275: remove old FW config when restoring
Fabian Grünbichler [Thu, 28 Jan 2021 08:25:59 +0000 (09:25 +0100)]
fix #3275: remove old FW config when restoring

otherwise proxmox-backup-client will error and the whole restore will
fail.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agorestore: add more informational messages
Fabian Grünbichler [Wed, 25 Nov 2020 14:07:50 +0000 (15:07 +0100)]
restore: add more informational messages

to provide context for warnings/output created by various sub-operations.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agorestore: pass target vmid to config recovery
Fabian Grünbichler [Wed, 25 Nov 2020 14:07:49 +0000 (15:07 +0100)]
restore: pass target vmid to config recovery

so that we get the correct warning prefix when the config contains bogus lines.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agouse monitor commands to freeze on pure-v2 setups
Wolfgang Bumiller [Mon, 25 Jan 2021 11:05:32 +0000 (12:05 +0100)]
use monitor commands to freeze on pure-v2 setups

even an explicit query for the 'unified' cgroup hierarchy
does not work on lxc when run in a pure v2 environment via
the kernel options

    systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all

so let's use the freeze commands provided by lxc we already
have code for...

See-also: https://forum.proxmox.com/threads/short-read-on-command-socket-error-when-running-backup-of-lxc-containers.82978/

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoapi: destroy: add 'destroy-unreferenced-disks' parameter
Thomas Lamprecht [Mon, 25 Jan 2021 19:20:13 +0000 (20:20 +0100)]
api: destroy: add 'destroy-unreferenced-disks' parameter

Making the CT and VM API more stream lined. But, we do not use the
same dangerous default than the VM API does, as we only have it there
for backward compatibility.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomkfs: make less noisy
Thomas Lamprecht [Mon, 25 Jan 2021 19:15:24 +0000 (20:15 +0100)]
mkfs: make less noisy

Easiest and cleanest would be to pass the -q quiet parameter, but
that drops also possible relevant information when rescuing such a
filesystem (super block backup positions, UUID, ...)

Will let thorugh something like:

> Creating filesystem with 262144 4k blocks and 65536 inodes
> Filesystem UUID: 3a6f3548-baf6-45fa-93d2-b61212668d23
> Superblock backups stored on blocks:
>  32768, 98304, 163840, 229376

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agolxc: import run_command and cleanup formatting
Thomas Lamprecht [Mon, 25 Jan 2021 15:51:50 +0000 (16:51 +0100)]
lxc: import run_command and cleanup formatting

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agouse new move_config_to_node method
Fabian Ebner [Tue, 1 Dec 2020 12:06:58 +0000 (13:06 +0100)]
use new move_config_to_node method

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agobump version to 3.3-2
Thomas Lamprecht [Wed, 9 Dec 2020 11:49:36 +0000 (12:49 +0100)]
bump version to 3.3-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agorestore: fix fw.conf restore for PBS
Fabian Grünbichler [Mon, 7 Dec 2020 08:18:49 +0000 (09:18 +0100)]
restore: fix fw.conf restore for PBS

the 'files' command returns a list of hashes, and the filename is
'fw.conf.blob' not 'fw.conf'.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agobump version to 3.3-1
Thomas Lamprecht [Wed, 25 Nov 2020 12:58:46 +0000 (13:58 +0100)]
bump version to 3.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agovzdump: pass along exclude patterns to proxmox-backup-client
Fabian Ebner [Fri, 20 Nov 2020 14:50:45 +0000 (15:50 +0100)]
vzdump: pass along exclude patterns to proxmox-backup-client

to make the behavior consistent across modes.

Previously vzdump's exclude-path option only had an effect for suspend mode
backups, as then the exclusion already happens when rsync copies the data
during an earlier stage in the backup.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agovzdump: allow relative exclude patterns for snapshot and stop mode
Fabian Ebner [Fri, 20 Nov 2020 14:50:44 +0000 (15:50 +0100)]
vzdump: allow relative exclude patterns for snapshot and stop mode

to make the behavior consistent across modes.

For suspend mode, relative patterns worked for a long time, because the
exclusion already happens when rsync copies the data during an earlier stage of
the backup.

For the other two methods, the way the patterns are passed to tar (after the
'--anchored' option and prefixed with a dot) meant that relative patterns
had no effect previously.

Users which have a relative exclude path by accident (if it's not by accident
then this fixes the behavior) and did not use suspend mode (if they did use
suspend mode, they hopefully would have noticed the unintended exclusion then)
will be affected by this change.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agovzdump: turn findexcl into its own variable
Fabian Ebner [Fri, 20 Nov 2020 14:50:43 +0000 (15:50 +0100)]
vzdump: turn findexcl into its own variable

for easier readability.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agodeactivate volumes after storage_migrate
Fabian Ebner [Fri, 6 Nov 2020 14:30:57 +0000 (15:30 +0100)]
deactivate volumes after storage_migrate

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agofix #3140: allow iface suffix on link local dns address
Wolfgang Bumiller [Tue, 24 Nov 2020 12:19:45 +0000 (13:19 +0100)]
fix #3140: allow iface suffix on link local dns address

Allows nameserver entries of the form `fe80::1%eth2`

Note that previously the schema allowed domain names here as
well, while only allowing IPs in the hotplug's verification
code.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agouse PVE::CGroup
Alexandre Derumier [Fri, 30 Oct 2020 09:42:27 +0000 (10:42 +0100)]
use PVE::CGroup

3 years agoCgroups: use base PVE::CGroup and keep specific lxc code
Alexandre Derumier [Fri, 30 Oct 2020 09:42:26 +0000 (10:42 +0100)]
Cgroups: use base PVE::CGroup and keep specific lxc code

3 years agod/rules: do not try to start or enable system-pve\x2dcontainer.slice
Thomas Lamprecht [Tue, 24 Nov 2020 09:11:50 +0000 (10:11 +0100)]
d/rules: do not try to start or enable system-pve\x2dcontainer.slice

Yes, we need *all* those flags for the installsystemd debhelper to do
nothing.

That is not required and logs errors during package upgrade, like:
> system-pve\x2dcontainer.slice is a disabled or a static unit,
> not starting it.

Completes the fix of commit 41d3078b34c08dc0d66a2c0215f2a598a05fcb6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.2-4
Thomas Lamprecht [Mon, 23 Nov 2020 18:48:21 +0000 (19:48 +0100)]
bump version to 3.2-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofix #3161: snapshot creation: only check volumes for fsfreeze
Stoiko Ivanov [Mon, 23 Nov 2020 10:12:29 +0000 (11:12 +0100)]
fix #3161: snapshot creation: only check volumes for fsfreeze

When considering mountpoints for running 'fsfreeze' before snapshot
creation, commit 8463099d99273561c46398bf02206b4d9d431bc5 did not
only consider volumes created by our storage-stack, but also
bindmounts and devmounts (directly mounting a blockdevice).

This led to PVE::Storage::parse_volume_id failing on those
mountpoints.

Since the fsfreeze call is best-effort and only run for specific
storageplugins, we can simply skip non-volume mountpoints, when
gathering the list of volumes to call fsfreeze on.

Tested with a container with a bind mount.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosetup: Devuan: add support for Chimaera
Thomas Lamprecht [Tue, 17 Nov 2020 07:51:25 +0000 (08:51 +0100)]
setup: Devuan: add support for Chimaera

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