]> git.proxmox.com Git - pve-container.git/log
pve-container.git
3 years agobump version to 2.0-42 stable-5
Thomas Lamprecht [Sat, 25 Apr 2020 14:29:53 +0000 (16:29 +0200)]
bump version to 2.0-42

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 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>
(cherry picked from commit eb03cc119c03f4b5108a0a02ddfd7f7cba53b051)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 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>
(cherry picked from commit a89aed4bbd15af96648b9fd285c0287668bba868)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosetup: allow centos up to version 9
Oguz Bektas [Fri, 17 Jan 2020 12:43:45 +0000 (13:43 +0100)]
setup: allow centos up to version 9

[0]: https://forum.proxmox.com/threads/centos-8-1-lxc-unsupported-centos-release.63530/

so that we handle all the point releases between 8-9

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
(cherry picked from commit c823eb0a1b2b04bc7745bbac4819be9a9c96df51)
(cherry picked from commit 6566b196964dd8723eebf7c43181854b669f6e87)
[ Thomas: Squashed above two cherry-picks into one commit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 2.0-41
Thomas Lamprecht [Thu, 14 Nov 2019 17:24:51 +0000 (18:24 +0100)]
bump version to 2.0-41

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agomountpoints: create parent dirs with correct owner
Fabian Grünbichler [Wed, 24 Jul 2019 11:37:13 +0000 (13:37 +0200)]
mountpoints: create parent dirs with correct owner

otherwise unprivileged containers might end up with directories that
they cannot modify since they are owned by the user root in the host
namespace, instead of root inside the container.

note: the problematic behaviour is only exhibited when an intermediate
directory needs to be created, e.g. a mountpoint /test/mp gets mounted,
and /test does not yet exist.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 4c98d66ce75d83185f1ec99e170e6f950f0c68f5)
[ Thomas: backport followup fix: locally define AT_EMPTY_PATH ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agodon't leave fstrim lock if mount_all fails
Oguz Bektas [Mon, 26 Aug 2019 14:06:32 +0000 (16:06 +0200)]
don't leave fstrim lock if mount_all fails

when a container has a mountpoint which can't be mounted for some
reason, mount_all dies and the fstrim lock stays. prevent this by
moving the call into eval, warn if any error occurs.

Still try to unmount all already mounted MPs so that nothing blocking
remains left.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit a179d3a7390beef3bfa6e61572034a0a7d237d6e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agorestore lxc.* entries once
Fabian Grünbichler [Wed, 25 Sep 2019 12:35:04 +0000 (14:35 +0200)]
restore lxc.* entries once

either via recover_config, OR via restore_configuration. non-root behaviour stays the same.

Tested-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit a67908f1efc9b77cbde166f4be23975481dbbfb6)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix issue where ttys aren't correctly set after restore
Oguz Bektas [Fri, 13 Sep 2019 10:35:57 +0000 (12:35 +0200)]
fix issue where ttys aren't correctly set after restore

restore from unpriv to priv causes a problem with the log-in from web
console, since the /etc/securetty file isn't modified after a restore to
reflect that change (/dev/lxc/tty1 and so on).

template_fixup is normally called in post_create_hook, but we have no
$password or $ssh_keys to call the hook with during the restore. instead
we call template_fixup by itself to fix the ttys on some distributions.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
(cherry picked from commit 4b4bbe553bebac2fbc179616c90594eed275b07e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosetup: fedora: allow 31 (and 32)
Thomas Lamprecht [Thu, 31 Oct 2019 15:45:05 +0000 (16:45 +0100)]
setup: fedora: allow 31 (and 32)

tested by installing fedora 30 and using dnf-system-upgrade to get
version 31.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 5a973aa68f1d0d5a19b1337094ab3f7cb74453a0)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agoadd upcoming Ubuntu 19.10 Eoan as supported
Thomas Lamprecht [Thu, 31 Oct 2019 15:45:04 +0000 (16:45 +0100)]
add upcoming Ubuntu 19.10 Eoan as supported

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 5c5d57f05b0bb8daedb24625ec69dd30133b8dc7)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agosetup: allow CentOS 5 and CentOS 8
Thomas Lamprecht [Tue, 27 Aug 2019 16:49:01 +0000 (18:49 +0200)]
setup: allow CentOS 5 and CentOS 8

One is in the extended support phase, it should not be used but
people report that the CentOS 6 code path works just fine, so why
not...

The other is for the upcoming CentOS 8, while not fully testable for
compatibility yet, CentOS 7 code path should do the trick, else
we'll need to adapt it anyway, so see this as experimental

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 9b940fef409e443713cf8ae3ca4f42f75f756f9e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 2.0-40
Thomas Lamprecht [Fri, 26 Jul 2019 07:09:40 +0000 (09:09 +0200)]
bump version to 2.0-40

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosetup getty: ensure the getty.target is not masked
Thomas Lamprecht [Wed, 17 Jul 2019 10:07:40 +0000 (12:07 +0200)]
setup getty: ensure the getty.target is not masked

some distro templates have this masked by default, it makes sense to
always ensure that it can work, a CT admin can still prevent this by
using the .pve-ignore.$file mechanism.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 570798fadd62752e5f370fec908c1308394000a2)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosetup getty: drop now obsolete setup_systemd_console
Thomas Lamprecht [Thu, 18 Jul 2019 15:17:17 +0000 (17:17 +0200)]
setup getty: drop now obsolete setup_systemd_console

The setup_container_getty_service can now handle also old
getty@.service if the newer container-getty@.service is not
available. So drop, and convert the two remaining users to calling
the now compatible setup_container_getty_service

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit a4f1fab1416f8c6cf0993539587ca3028e8bded8)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosetup getty: generalize setup_container_getty_service
Thomas Lamprecht [Thu, 18 Jul 2019 15:10:30 +0000 (17:10 +0200)]
setup getty: generalize setup_container_getty_service

to allow switching the two remaining users and then finally dropping
the setup_systemd_console method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Co-developed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit bfe63c1a05a692cd8cc54c2bb7f9460ff8df93fd)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosetup getty: ensure the correct services are enabled
Thomas Lamprecht [Wed, 17 Jul 2019 10:02:34 +0000 (12:02 +0200)]
setup getty: ensure the correct services are enabled

I.e., some distro templates do not have anything enabled, thus also
ensure that the respective container-getty@ services are enabled.

But, as to getty on the same TTY makes for a strange experience also
ensure that the getty@ are all removed (and vice versa in the other
case)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 73aa033d569a953428962cdace7b31c11ef20ec8)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agogetty setup: move hack for old systemd getty services out
Thomas Lamprecht [Thu, 18 Jul 2019 13:25:33 +0000 (15:25 +0200)]
getty setup: move hack for old systemd getty services out

This makes it easier to remove the setup_systemd_console method in
the future.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit dd7a436bcbea44cbcbfabcec50a674a1fe35f667)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd support for debian bullseye/sid
Mira Limbeck [Thu, 18 Jul 2019 13:56:12 +0000 (15:56 +0200)]
add support for debian bullseye/sid

Add support for the newest DebianTesting aka bullseye.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
(cherry picked from commit 93da83ffa3d7b546f7c9e2627c2652f1b3d4d171)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2270: allow custom lxc options to be restored as root
Stefan Reiter [Tue, 9 Jul 2019 15:20:57 +0000 (17:20 +0200)]
fix #2270: allow custom lxc options to be restored as root

Seems to be a regression introduced with
f360d7f16b094fa258cf82d2557d06f3284435e4 (related to #2028).
$conf->{'lxc'} would always be defined, hence we never replaced it with
the restored options.

Co-developed-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
(cherry picked from commit 82bfeccbe6cbc12f39a04a4a8d1ac5ef12ae73ad)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotests: avoid ipcc usage by mocking PVE::Cluster::get_config
Wolfgang Bumiller [Fri, 28 Jun 2019 09:58:32 +0000 (11:58 +0200)]
tests: avoid ipcc usage by mocking PVE::Cluster::get_config

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
(cherry picked from commit b0c4f0658fc3a157de071d0b2e604b0657b57a79)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agorestore: correctly handle fw config from archive
Fabian Grünbichler [Thu, 25 Jul 2019 12:40:42 +0000 (14:40 +0200)]
restore: correctly handle fw config from archive

and skip restoring it if the user only has VM.Backup permissions, the
contained config file is a symlink, or if it is empty.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 391706445abd30f8f33d80baf58977016632bd19)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agovzdump: always add (empty) firewall config
Fabian Grünbichler [Thu, 25 Jul 2019 12:40:41 +0000 (14:40 +0200)]
vzdump: always add (empty) firewall config

just like we always add the container config

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit d1671a80d5846fde9905e175a62903d346d2a1d1)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoFix #576: Fix dangling files for Move Disk
Dominic Jäger [Wed, 12 Jun 2019 10:04:57 +0000 (12:04 +0200)]
Fix #576: Fix dangling files for Move Disk

When Move Disk is called for a container rsync starts copying it to a
new destination. This initial rsync process gets killed when the Stop
button gets pressed. At this moment the destination file is not fully
copied and useless as a consequence. Our code already tries to remove
it. However, rsync has forked and those forks are still accessing the
destination file for some time. Thus, the attempt to remove it fails.

With the patch we wait for other processes to release the destination
files. As we are in a mount namespace and protected by a config lock,
those other processes should be children of rsync only. The waiting
time was less than a second when I tried it. Afterwards, the existing
remove procedure is carried out.

Co-developed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
(cherry picked from commit 75c2677fb5f26fce508a81528cc730f56fc9118c)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofixup: nitpick: no parenthesis on simple post if
Thomas Lamprecht [Thu, 23 May 2019 07:28:45 +0000 (09:28 +0200)]
fixup: nitpick: no parenthesis on simple post if

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 68300601d205649d702afec522d8bc575d772e62)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoFix: check if compression_map format is undefined
Alwin Antreich [Thu, 23 May 2019 07:13:40 +0000 (09:13 +0200)]
Fix: check if compression_map format is undefined

We want to check for an supported compression type, but the check was
not correct as this only works if both sides are scalars, but an
assignment to an array is always "truthy", so actually check explicitly
if the compression type is supported before.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 539660e2bd3e9a557a8c0ce7e17865377bf269b9)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotests: fix lxc-usernsexec invocation for uid != gid
Wolfgang Bumiller [Wed, 22 May 2019 12:25:11 +0000 (14:25 +0200)]
tests: fix lxc-usernsexec invocation for uid != gid

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
(cherry picked from commit 8f4bd6245b25218d05dbf1267a85728f447a13d4)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump debian compat level to 10
Thomas Lamprecht [Wed, 22 May 2019 10:40:50 +0000 (12:40 +0200)]
bump debian compat level to 10

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: write source file to correct build dir
Thomas Lamprecht [Wed, 22 May 2019 10:40:13 +0000 (12:40 +0200)]
buildsys: write source file to correct build dir

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: use dpkg-dev makefile helpers for pkg info
Thomas Lamprecht [Wed, 22 May 2019 10:37:58 +0000 (12:37 +0200)]
buildsys: use dpkg-dev makefile helpers for pkg info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoset debian source format to 1.0
Thomas Lamprecht [Wed, 22 May 2019 10:37:44 +0000 (12:37 +0200)]
set debian source format to 1.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 2.0-39
Thomas Lamprecht [Wed, 15 May 2019 14:38:53 +0000 (16:38 +0200)]
bump version to 2.0-39

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoremove Data::Dumper usages
Thomas Lamprecht [Mon, 13 May 2019 11:45:42 +0000 (11:45 +0000)]
remove Data::Dumper usages

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi config: cleanup indentation and whitespace issues
Thomas Lamprecht [Mon, 13 May 2019 11:45:29 +0000 (11:45 +0000)]
api config: cleanup indentation and whitespace issues

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: remove undefined ${shlib:depends} from arch-independent package
Thomas Lamprecht [Mon, 13 May 2019 11:41:36 +0000 (11:41 +0000)]
d/control: remove undefined ${shlib:depends} from arch-independent package

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi status: indentation, whitespace and empty newline fixes
Thomas Lamprecht [Mon, 13 May 2019 11:40:49 +0000 (11:40 +0000)]
api status: indentation, whitespace and empty newline fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi status: code cleanup for HA calls
Thomas Lamprecht [Mon, 13 May 2019 11:39:52 +0000 (11:39 +0000)]
api status: code cleanup for HA  calls

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi status: use own variable for frequent hash use
Thomas Lamprecht [Fri, 10 May 2019 10:04:37 +0000 (10:04 +0000)]
api status: use own variable for frequent hash use

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi status: cleanup nested closures
Thomas Lamprecht [Fri, 10 May 2019 10:03:37 +0000 (10:03 +0000)]
api status: cleanup nested closures

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi status: indentation cleanup
Thomas Lamprecht [Fri, 10 May 2019 10:01:44 +0000 (10:01 +0000)]
api status: indentation cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2200: vm_stop: add nokill-after-timeout parameter
Thomas Lamprecht [Wed, 8 May 2019 07:07:22 +0000 (07:07 +0000)]
fix #2200: vm_stop: add nokill-after-timeout parameter

This allows to have the same semantics as qemu-server:
* immediate hard-kill
* shutdown with kill after timeout
* shutdown without kill after timeout

And thus we finally can move the vm_shutdown API call to a correct
semantic, i.e., do not immediate hard kill if forceStop is not passed
but rather see it as stop after timeout knob.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agovm_stop: remove unused exit_timeout parameter
Thomas Lamprecht [Wed, 8 May 2019 06:59:40 +0000 (06:59 +0000)]
vm_stop: remove unused exit_timeout parameter

No call-site used this parameter, and thus it was dead code,
remove it not only for cleanup sake but also to make space for a new
"nokill-after-timeout" parameter, comming in a future patch.

This code was always dead since it was introduced with the addition
of vm_stop in commit b1bad293c4f7a6024bbd363b6784b3875ca5d098
so pretty safe to remove anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2027: do not disable IPV6_AUTOCONF on centos
Oguz Bektas [Thu, 9 May 2019 11:57:29 +0000 (13:57 +0200)]
fix #2027: do not disable IPV6_AUTOCONF on centos

we used to disable IPV6_AUTOCONF when the DHCP option was chosen for the
container network (was only activated with SLAAC option).

however, this option is actually dependent on IPV6FORWARDING (which is
set to no by default), according to this rule:

IPV6_AUTOCONF=!IPV6FORWARDING

which enables it automatically when forwarding is disabled. this way, we
respect the defaults set by centos.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agobump version to 2.0-38
Thomas Lamprecht [Tue, 7 May 2019 11:12:14 +0000 (11:12 +0000)]
bump version to 2.0-38

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoraise supported fedora version to 30
Stoiko Ivanov [Mon, 6 May 2019 14:27:44 +0000 (16:27 +0200)]
raise supported fedora version to 30

Tested by installing a fedora 29 container and upgrading it via dnf [0].
The upgraded container boots, but in order to get networking running (and many
warnings and errors less in the journal) 'nesting' needs to be activated both
for privileged and unprivileged containers.

[0] https://fedoraproject.org/wiki/DNF_system_upgrade

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 years agofix: #1075: Correctly restore CT templates form backup
Christian Ebner [Wed, 17 Apr 2019 14:38:28 +0000 (16:38 +0200)]
fix: #1075: Correctly restore CT templates form backup

Restoring a backup from a CT template wrongly resulted in a CT with the template
flag set in the config.
This makes sure the CT template backup gets restored to a CT and only if the
storage supports templates, the resulting CT is converted to a template.
Otherwise the backup restores simply to a CT.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 years agoadd fstrim lock to enum
Oguz Bektas [Thu, 11 Apr 2019 13:07:49 +0000 (15:07 +0200)]
add fstrim lock to enum

forgot to add this while adding 'pct fstrim' parameter

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agoadd create lock to enum
Dominik Csapak [Thu, 11 Apr 2019 07:16:52 +0000 (09:16 +0200)]
add create lock to enum

we use that lock on create/restoration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 2.0-37
Thomas Lamprecht [Thu, 4 Apr 2019 14:25:00 +0000 (16:25 +0200)]
bump version to 2.0-37

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: reword bwlimit default wording
Thomas Lamprecht [Tue, 2 Apr 2019 09:29:00 +0000 (11:29 +0200)]
followup: reword bwlimit default wording

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobwlimit: add parameter to API2 calls
Stoiko Ivanov [Mon, 1 Apr 2019 09:31:08 +0000 (11:31 +0200)]
bwlimit: add parameter to API2 calls

for migrate_vm, clone_vm and move_volume. The 'migrate_vm' call passes it to
PVE::LXC::Migrate->migrate for handling.

Additionally the bwlimit option's description of the 'create_vm' call gets
consistent capitalization of I/O.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobwlimit: add parameter to rsync in copy_volume
Stoiko Ivanov [Mon, 1 Apr 2019 09:31:07 +0000 (11:31 +0200)]
bwlimit: add parameter to rsync in copy_volume

Unconditionally add a '--bwlimit' parameter to the rsync invocation, defaulting
to an argument of '0' (= unlimited - see `man rsync).
Normally this is a rate per second, with a passed unit. With no unit
passed rsync assumes "K", which is exactly what our units are in, so
make our life easy and omit it.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agostorage migrate: add bwlimit parameter
Stoiko Ivanov [Mon, 1 Apr 2019 09:31:06 +0000 (11:31 +0200)]
storage migrate: add bwlimit parameter

pass bwlimit parameter to storage_migrate

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix some reasonable lintian warnings on dsc
Thomas Lamprecht [Tue, 2 Apr 2019 08:06:49 +0000 (10:06 +0200)]
fix some reasonable lintian warnings on dsc

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: remove double parenthesis and hook regex
Thomas Lamprecht [Tue, 2 Apr 2019 08:06:02 +0000 (10:06 +0200)]
followup: remove double parenthesis and hook regex

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix: #1218 Add flag 'unique' to pct restore in order to set new MAC addresses to...
Christian Ebner [Mon, 1 Apr 2019 15:45:24 +0000 (17:45 +0200)]
fix: #1218 Add flag 'unique' to pct restore in order to set new MAC addresses to NICs

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 years agofix #2147: re-add support for current opensuse tumbleweed
Oguz Bektas [Fri, 29 Mar 2019 16:16:33 +0000 (17:16 +0100)]
fix #2147: re-add support for current opensuse tumbleweed

this enables opensuse-tumbleweed templates to be used in Proxmox VE
_again_. It was already supported but it seems that the os-release
backed ID changed and thus our distro detection code didn't detect it
anymore.

a few things didn't work properly in my tests, so some things to consider:
* (probably) because of network configuration issues, it takes a while
for the container to start fully (~30s on my setup)
* unprivileged containers (w/ and w/o nesting enabled) had no network
after starting, and needed to be enabled manually with ip addr and
route.
* privileged containers seemed to function normally, except the
startup delay

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agofix #1607: implement pct fstrim
Oguz Bektas [Thu, 28 Mar 2019 13:01:44 +0000 (14:01 +0100)]
fix #1607: implement pct fstrim

runs fstrim on the rootfs and all mountpoints of a given container. this
works for both running and stopped containers.

lock the CT during this operation using a config lock as it is
potentially long running. While fstrim itself wouldn't really need
the lock, as multiple parallel fstrim calls can be made without
problems, we want to forbid migrations during it and want to avoid
that we unmount a with the CT mounted with 'mount' lock (race) -
while we could handle and allow this its just not needed and easier
this way

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobuildsys: add dsc target
Thomas Lamprecht [Wed, 27 Mar 2019 16:21:19 +0000 (17:21 +0100)]
buildsys: add dsc target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agodepreacate pve-lxc-snapshot-name in favor of identical pve-snapshot-name
Thomas Lamprecht [Wed, 27 Mar 2019 14:14:05 +0000 (15:14 +0100)]
depreacate pve-lxc-snapshot-name in favor of identical pve-snapshot-name

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: which lock
Thomas Lamprecht [Thu, 21 Mar 2019 17:38:01 +0000 (18:38 +0100)]
followup: which lock

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd lock to vm status
Dominik Csapak [Thu, 21 Mar 2019 09:55:19 +0000 (10:55 +0100)]
add lock to vm status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agosetup: fix alpine ipv6-slaac configuration
Stoiko Ivanov [Tue, 19 Mar 2019 15:34:27 +0000 (16:34 +0100)]
setup: fix alpine ipv6-slaac configuration

busybox ifupdown implementation differs from debian's - configuration type
auto is not supported. If SLAAC is selected for the ipv6 configuration of an
interface, the complete networking is not started, because of that error.

This workaround sets the interface type to 'manual' in case SLAAC is selected
(as is already done for dhcpv6 (for different reasons)). That way all other
configuration stanzas are setup correctly, and if a ipv4 configuration is
present for the same interface the SLAAC-part usually works out of the box
anyways (unless 'accept_ra' is set to 0 for the interface in the kernel).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobump version to 2.0-36
Thomas Lamprecht [Tue, 19 Mar 2019 11:38:17 +0000 (12:38 +0100)]
bump version to 2.0-36

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agosetup: add support for Ubuntu 19.04 Disco Dingo
Thomas Lamprecht [Tue, 19 Mar 2019 10:16:50 +0000 (11:16 +0100)]
setup: add support for Ubuntu 19.04 Disco Dingo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump version dependency of libpve-common-perl
Thomas Lamprecht [Thu, 14 Mar 2019 09:05:20 +0000 (10:05 +0100)]
d/control: bump version dependency of libpve-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoconfig: hwaddr: enforce unicast MAC addresses
Stoiko Ivanov [Tue, 12 Mar 2019 15:07:42 +0000 (16:07 +0100)]
config: hwaddr: enforce unicast MAC addresses

having a container with a multicast mac (see [1]), prevents it from starting
(see [0,3]).

This patch uses the 'mac-addr' standard_option defined in PVE::JSONSchema to
ensure only unicast macaddresses are used for netconfig.

[0] https://lists.linuxcontainers.org/pipermail/lxc-users/2010-August/000783.html
[1] https://en.wikipedia.org/wiki/MAC_address
[2] https://pve.proxmox.com/pipermail/pve-devel/2019-March/035996.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agotests: move multicast MACs addresses to unicast ones
Stoiko Ivanov [Tue, 12 Mar 2019 15:07:43 +0000 (16:07 +0100)]
tests: move multicast MACs addresses to unicast ones

we'll change the format to forbid MAC addresses with the I/G (group)
bit set in a future patch so lets ensure we do not run into problems
there.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofixup: only un-map if not running and comment so
Thomas Lamprecht [Mon, 11 Mar 2019 09:37:54 +0000 (10:37 +0100)]
fixup: only un-map if not running and comment so

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofixup: always un-map and comment more
Thomas Lamprecht [Mon, 11 Mar 2019 08:39:46 +0000 (09:39 +0100)]
fixup: always un-map and comment more

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix #2109: resize rbd volume for container failed
Alwin Antreich [Fri, 8 Mar 2019 14:41:55 +0000 (15:41 +0100)]
Fix #2109: resize rbd volume for container failed

On resizing a container's disk image the filesystem is extended and in
the case of RBD the returned path of the volume was not a path to a
mapped device.

This patch uses map_volume (respectively unmap_volume) to get a device
mapped and its path returned by the storage plugin. If a path is not
returned then the path method is tried. Currently only the RBD storage
plugin returns a path on map_volume.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
5 years agobump version to 2.0-35
Thomas Lamprecht [Wed, 6 Mar 2019 07:23:27 +0000 (08:23 +0100)]
bump version to 2.0-35

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofollowup: code cleanup
Thomas Lamprecht [Mon, 4 Mar 2019 11:29:03 +0000 (12:29 +0100)]
followup: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #2117: don't keep custom idmap in pct pipe restore
Oguz Bektas [Mon, 4 Mar 2019 10:02:53 +0000 (11:02 +0100)]
fix #2117: don't keep custom idmap in pct pipe restore

while doing a pct restore operation, custom id mappings were being
obtained from the archive file to be used in the newly created container.
this fails when using pipe restore, since there is no file for the
mappings to be recovered from.

Co-Authored by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agod/control: bump version dependency to pve-doc-generator
Thomas Lamprecht [Fri, 22 Feb 2019 12:31:32 +0000 (13:31 +0100)]
d/control: bump version dependency to pve-doc-generator

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years ago1891 Add zsh command completion generation for pct
Christian Ebner [Thu, 21 Feb 2019 13:25:05 +0000 (14:25 +0100)]
1891 Add zsh command completion generation for pct

Generates the zsh command completion scripts for pct.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 years agofix #2104: config "features: mount" regex pattern
Oguz Bektas [Tue, 19 Feb 2019 12:52:01 +0000 (13:52 +0100)]
fix #2104: config "features: mount" regex pattern

this adds an underscore '_' character to the regex match for "features:
mount", which allows rpc_pipefs to be parsed correctly.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agofix #2086: change process checking mechanism in vmstatus
Oguz Bektas [Mon, 11 Feb 2019 14:51:06 +0000 (15:51 +0100)]
fix #2086: change process checking mechanism in vmstatus

vmstatus checked if the container was running by looking at the pid,
which was not an indicator of the process being completely stopped, as
the command socket in /proc/net/unix stays a little while after the
process is dead according to lxc-info.

this resulted in destroy_vm and similar functions which use
/proc/net/unix command socket based checking mechanism to fail when
executed too fast after the vm_status reported the process as stopped.

this changes vm_status to use the same kind of command socket based
mechanism in order to avoid reporting the container as being stopped too
early.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agod/control: bump version dependency of libpve-common-perl
Thomas Lamprecht [Mon, 4 Feb 2019 11:02:51 +0000 (12:02 +0100)]
d/control: bump version dependency of libpve-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #2080: fix device encoding in the prestart hook
Wolfgang Bumiller [Mon, 4 Feb 2019 09:42:02 +0000 (10:42 +0100)]
fix #2080: fix device encoding in the prestart hook

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agobump version to 2.0-34
Thomas Lamprecht [Fri, 1 Feb 2019 12:14:18 +0000 (13:14 +0100)]
bump version to 2.0-34

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump version dependency of libpve-guest-common-perl
Thomas Lamprecht [Fri, 1 Feb 2019 12:08:32 +0000 (13:08 +0100)]
d/control: bump version dependency of libpve-guest-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd pre- start/stop hookscript to containers
Dominik Csapak [Thu, 31 Jan 2019 13:33:40 +0000 (14:33 +0100)]
add pre- start/stop hookscript to containers

this adds the config (hookscript) and executes it on four points in
time for the container:

'pre-start'
'post-start'
'pre-stop'
'post-stop'

on pre-start we abort if the script fails and pre-stop will not be
called if the vm crashes or if the vm gets powered off from inside
the guest

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofixup: slight code cleanup
Thomas Lamprecht [Wed, 30 Jan 2019 13:53:37 +0000 (14:53 +0100)]
fixup: slight code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofixup indentation
Thomas Lamprecht [Wed, 30 Jan 2019 13:53:20 +0000 (14:53 +0100)]
fixup indentation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoAdd debian/SOURCE to docs
Rhonda D'Vine [Wed, 30 Jan 2019 13:41:34 +0000 (14:41 +0100)]
Add debian/SOURCE to docs

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agoFix #1924: add snapshot parameter
Rhonda D'Vine [Wed, 30 Jan 2019 13:41:33 +0000 (14:41 +0100)]
Fix #1924: add snapshot parameter

The pct CLI command offer the config function. The output of that may
vary with respect to a given snapshot. This adds a switch that shows the
corresponding snapshot's config.

The code needs a newer libpve-guest-common-perl, thus bumping the
dependency.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agofix #889: api create: reserver config with create lock early
Thomas Lamprecht [Mon, 28 Jan 2019 07:06:48 +0000 (08:06 +0100)]
fix #889: api create: reserver config with create lock early

allows to remove some checks as we can be sure the config belongs to
us once we have it resered, either for restore or new creation.

This is similar to the qemu-server approach[0][1], adapted to the
LXC code. We need to cleanup a bit less if something fails, as the
LXC code path always removed the config and all created volumes in
this case, which means the 'create' reserve lock is gone too.

The early reserve on API entry, instead of doing it after forked
worker entry, allows to workaround the issues reported in #889 as
successful return from the API call means that the VMID is locked.

[0]: https://git.proxmox.com/?p=qemu-server.git;a=commit;h=8ba8418ca1d1a76a7e24c34045ca7702b0cd969d
[1]: https://git.proxmox.com/?p=qemu-server.git;a=commit;h=4fedc13b453d2011b35352df246cf9ea396e942b

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agodestroy_config: die if unlink fails
Thomas Lamprecht [Mon, 28 Jan 2019 07:06:47 +0000 (08:06 +0100)]
destroy_config: die if unlink fails

We use this in two places, in the cleanup path of the create/restore
API path and indirectly through PVE::LXC::destroy_lxc_container, once
again in the restore code path of the create API call, to cleanup a
CT before overwriting it with a backup if the force flag ist set. The
second time in the destroy CT API call, both times a hard error in a
erroneous cleanup is wanted.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoapi/create: trivial: move worker name out
Thomas Lamprecht [Sat, 26 Jan 2019 13:28:00 +0000 (14:28 +0100)]
api/create: trivial: move worker name out

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoapi/create: empty newline cleanup
Thomas Lamprecht [Sat, 26 Jan 2019 12:27:40 +0000 (13:27 +0100)]
api/create: empty newline cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 2.0-33
Wolfgang Bumiller [Mon, 7 Jan 2019 14:37:19 +0000 (15:37 +0100)]
bump version to 2.0-33

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agobuildsys: use dpkg-parsechangelog
Wolfgang Bumiller [Mon, 7 Jan 2019 14:36:11 +0000 (15:36 +0100)]
buildsys: use dpkg-parsechangelog

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoonly recover id mapping on restore
Wolfgang Bumiller [Mon, 7 Jan 2019 14:32:42 +0000 (15:32 +0100)]
only recover id mapping on restore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoclose #1785: whitelist namespaced lxc.sysfs.* entries
Wolfgang Bumiller [Fri, 4 Jan 2019 11:35:27 +0000 (12:35 +0100)]
close #1785: whitelist namespaced lxc.sysfs.* entries

According do namespaces(7) these should be namespaced (iow.
changing these values on the host they are not propagated to
running containers), so it makes sense to whitelist them.

Note that these only work when also using
'lxc.mount.auto: proc:rw'

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Link: https://github.com/lxc/lxc/issues/989
5 years agobump version to 2.0-32
Thomas Lamprecht [Mon, 7 Jan 2019 12:48:35 +0000 (13:48 +0100)]
bump version to 2.0-32

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd informative comment...
Wolfgang Bumiller [Fri, 4 Jan 2019 10:17:10 +0000 (11:17 +0100)]
add informative comment...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofixup comment about early lxc.idmap recovery
Wolfgang Bumiller [Thu, 27 Dec 2018 12:55:46 +0000 (13:55 +0100)]
fixup comment about early lxc.idmap recovery

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agocleanup: factor out root@pam check
Wolfgang Bumiller [Thu, 27 Dec 2018 12:53:53 +0000 (13:53 +0100)]
cleanup: factor out root@pam check

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoarray usage fixup
Wolfgang Bumiller [Thu, 27 Dec 2018 13:18:49 +0000 (14:18 +0100)]
array usage fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>