]> git.proxmox.com Git - pve-container.git/log
pve-container.git
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>
2 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>
3 years agosetup: Devuan: add support for Beowulf
Thomas Lamprecht [Tue, 17 Nov 2020 07:47:15 +0000 (08:47 +0100)]
setup: Devuan: add support for Beowulf

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.2-3
Thomas Lamprecht [Mon, 16 Nov 2020 15:41:31 +0000 (16:41 +0100)]
bump version to 3.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosupport new known Ubuntu releases
Thomas Lamprecht [Mon, 16 Nov 2020 15:17:59 +0000 (16:17 +0100)]
support new known Ubuntu releases

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadapt to new storage_migrate activation behavior
Fabian Ebner [Fri, 6 Nov 2020 14:30:56 +0000 (15:30 +0100)]
adapt to new storage_migrate activation behavior

Every local volume is migrated via storage_migrate and activated there,
so there is no need to do it in prepare() anymore.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agod/control: bump versioned dependency of pve-storage
Thomas Lamprecht [Tue, 10 Nov 2020 18:14:26 +0000 (19:14 +0100)]
d/control: bump versioned dependency of pve-storage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosnapshot creation: fsfreeze mountpoints, if needed
Stoiko Ivanov [Fri, 6 Nov 2020 14:19:42 +0000 (15:19 +0100)]
snapshot creation: fsfreeze mountpoints, if needed

fixes #2991, #2528.

creating a snapshot with rbd, after the syncfs finished successfully does not
guarantee that the snapshot has the state of the filesystem after syncfs.

suggestion taken from #2528 (running fsfreeze -f/-u before snapshotting on
the mountpoints)

added helper PVE::Storage::volume_snapshot_needs_fsfreeze, to indicate
which volumes need to be frozen/thawed. (and mocked it in the tests here).

Added the freeze to sync_container_namespace, since it needs to run inside the
container's mount namespace.

unfreezing happens in a sub of its own.

tests in #2991 seem to indicate that this helps to successfully create backups.

needs a versioned dependency bump on pve-storage

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
3 years agoadd fsfreeze helper:
Stoiko Ivanov [Fri, 6 Nov 2020 14:19:41 +0000 (15:19 +0100)]
add fsfreeze helper:

fsfreeze_mountpoint issues the same ioctls as fsfreeze(8) on the provided
directory (the $thaw parameter deciding between '--freeze' and '--unfreeze')

This is used for container backups on RBD, where snapshots on containers,
which are heavy on IO, are not mountable readonly, because the ext4 is not
consistent.

Needed to fix #2991 and #2528.

The ioctl numbers were found via strace -X verbose (and verified with the
kernel documentation).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
3 years agoallow fedora 33 container
Oguz Bektas [Mon, 9 Nov 2020 12:23:33 +0000 (13:23 +0100)]
allow fedora 33 container

used template for testing:
https://uk.images.linuxcontainers.org/images/fedora/33/amd64/default/20201108_20:33/rootfs.tar.xz

unprivileged container - everything works as expected
privileged container - needs 'nesting=1' for network connection to work

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
3 years agovzdump: clearer log message when removing temp. snapshot again
Thomas Lamprecht [Sun, 1 Nov 2020 19:19:49 +0000 (20:19 +0100)]
vzdump: clearer log message when removing temp. snapshot again

the original sounded a tad dangerous..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofollowup: description wording
Thomas Lamprecht [Thu, 29 Oct 2020 12:14:37 +0000 (13:14 +0100)]
followup: description wording

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopct fstrim: add 'ignore-mountpoints' parameter
Oguz Bektas [Thu, 29 Oct 2020 10:09:21 +0000 (11:09 +0100)]
pct fstrim: add 'ignore-mountpoints' parameter

parameter to ignore mountpoints when doing fstrim on a container

root@pve:~# pct fstrim 123
/var/lib/lxc/123/rootfs/: 338.7 MiB (355094528 bytes) trimmed
/var/lib/lxc/123/rootfs/test: 8.9 GiB (9576009728 bytes) trimmed
root@pve:~# pct fstrim 123 --ignore-mountpoints
/var/lib/lxc/123/rootfs/: 338.7 MiB (355094528 bytes) trimmed

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
3 years agoSPAM: [PATCH v2 container 1/1] Fix numbering scheme detection for CentOS Stream releases.
Achim Dreyer [Sat, 17 Oct 2020 13:45:56 +0000 (14:45 +0100)]
SPAM: [PATCH v2 container 1/1] Fix numbering scheme detection for CentOS Stream releases.

Signed-off-by: Achim Dreyer <ml11045@adreyer.com>
3 years agobump version to 3.2-2
Thomas Lamprecht [Tue, 22 Sep 2020 08:55:29 +0000 (10:55 +0200)]
bump version to 3.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosync_container_namespace: skip virtual filesystems
Stoiko Ivanov [Fri, 18 Sep 2020 12:16:21 +0000 (14:16 +0200)]
sync_container_namespace: skip virtual filesystems

skip additional virtual filesystems.

the list is taken from a running debian container's /proc/mounts

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
3 years agofix #3016: clone: do not copy snapshot config
Fabian Grünbichler [Tue, 22 Sep 2020 06:32:39 +0000 (08:32 +0200)]
fix #3016: clone: do not copy snapshot config

those entries belong to the source CT, not the target.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agofix #2938: increase limit of max cores from 128 to 8192
Oguz Bektas [Tue, 15 Sep 2020 09:14:06 +0000 (11:14 +0200)]
fix #2938: increase limit of max cores from 128 to 8192

To match the currently used limit from our kernel config

https://git.proxmox.com/?p=mirror_ubuntu-focal-kernel.git;a=blob;f=arch/x86/Kconfig;h=8ef85139553f5a4ad5187375af898266355c4177;hb=b311b46c7d1ab21bf0a11a6fa5bad76f98fb77af#l1014

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.2-1
Thomas Lamprecht [Wed, 9 Sep 2020 19:21:36 +0000 (21:21 +0200)]
bump version to 3.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosetup: heuristically warn if the FS hosting /etc is not mounted
Thomas Lamprecht [Wed, 9 Sep 2020 18:02:25 +0000 (20:02 +0200)]
setup: heuristically warn if the FS hosting /etc is not mounted

Check for the existence of /etc, use -e as it could also be a symlink
(and it's just a heuristic). But only do so if the expected ostype
from the config does not match the detected one, this normally
indicates that we had a "reals" distro running but detected the
fallback "unmanaged". Only warn though, as a hint for the user.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoalpine: setup net: pass whole config to parent method
Thomas Lamprecht [Wed, 9 Sep 2020 17:55:41 +0000 (19:55 +0200)]
alpine: setup net: pass whole config to parent method

We expected the whole $conf to be passed in a call to setup_network,
a bit ago it worked if their where only the netX keys present, for
some plugin that still is the case.
But, in the Debian version, reused by Alpine, we now check if the CT
distro version is recent enough to support (or need) the address in
CIDR format.
So, at least "ostype" needs to be passed to, else we get ugly
warnings in the syslog (or the recently added --debug log CLI switch)

Just pass the whole config, the setup_network method need to cope
with that anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoprotected_call: remove left-over rootdir/dev mkdir
Thomas Lamprecht [Wed, 9 Sep 2020 17:31:51 +0000 (19:31 +0200)]
protected_call: remove left-over rootdir/dev mkdir

commit 797e12e8a5df246d8afc53b045e632977cdf0088 got rid of our "just
bind-mount the root /dev to the CT temporarily for some stuff" for
good a while ago (2015), but creating the /dev directory in the CT
root was kept, from what I can tell, by mistake.

This can be a problem if, whyever, the CT rootfs is not mounted, as
we then break a future mount as we create this /dev directory inside
what would be the CTs rootfs mount point. It is then not empty
anymore and a normal mount cannot happen, failing with "directory is
not empty"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoimplement debug start
Thomas Lamprecht [Wed, 9 Sep 2020 16:10:43 +0000 (18:10 +0200)]
implement debug start

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoct start: track lxc-start stderr and print in error case
Thomas Lamprecht [Wed, 9 Sep 2020 16:24:28 +0000 (18:24 +0200)]
ct start: track lxc-start stderr and print in error case

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