Re: [pve-devel] [PATCH 4/9] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Dietmar Maurer
comments inline On 08/16/2015 07:43 PM, Alexandre Derumier wrote: Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/API2/LXC.pm | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 7eb0afb..870da69

Re: [pve-devel] [PATCH 9/9] mount hook : mount blockdevs

2015-08-17 Thread Alexandre DERUMIER
yes, I see that, could be used to mount an encryptet rootfs. I'll do tests. I have done a lot of tests, I'm unable to do it in pre-mount hook. If I mount the root manually, I have error after when lxc try to mount rootfs. and I need the root, to mount others mountpoints. So, the mount hook

Re: [pve-devel] [PATCH 4/9] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre DERUMIER
I currently use $scfg-{path} to test for filesystem based storages (that also works with glusterfs). But you need to exclude volumes with format 'subvol'. See code inside PVE::LXC::update_lxc_config( Oh, ok. I'll fix this. (Sorry I don't have zfs on my dev server currently) - Mail

[pve-devel] [PATCH] Fix Typo

2015-08-17 Thread Wolfgang Link
--- src/PVE/HA/CRM.pm |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/HA/CRM.pm b/src/PVE/HA/CRM.pm index 9feda05..4196bba 100644 --- a/src/PVE/HA/CRM.pm +++ b/src/PVE/HA/CRM.pm @@ -16,7 +16,7 @@ use PVE::HA::Manager; my $valid_states = { wait_for_quorum =

[pve-devel] [PATCH] Bugfix 684: Fix Typo

2015-08-17 Thread Wolfgang Link
--- www/manager/ha/Fencing.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/manager/ha/Fencing.js b/www/manager/ha/Fencing.js index f6bd365..1238fbc 100644 --- a/www/manager/ha/Fencing.js +++ b/www/manager/ha/Fencing.js @@ -16,7 +16,7 @@

Re: [pve-devel] [PATCH 4/9] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Dietmar Maurer
I currently use $scfg-{path} to test for filesystem based storages (that also works with glusterfs). But you need to exclude volumes with format 'subvol'. See code inside PVE::LXC::update_lxc_config( Oh, ok. I'll fix this. (Sorry I don't have zfs on my dev server currently) You can now

[pve-devel] [PATCH qemu-server] adapt /config and /pending API calls to force-delete

2015-08-17 Thread Wolfgang Bumiller
--- PVE/API2/Qemu.pm | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 5d3b352..60687e1 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -674,7 +674,8 @@ __PACKAGE__-register_method({ next if

Re: [pve-devel] [PATCH 9/9] mount hook : mount blockdevs

2015-08-17 Thread Dietmar Maurer
I can try, but I'm not sure if lxc will not thrown error after, as it'll try to mount the rootfs again. Maybe there is a way to avoid that. man lxc.container.conf mentions that it can be used for for manipulation of the rootfs ___ pve-devel

Re: [pve-devel] [PATCH 9/9] mount hook : mount blockdevs

2015-08-17 Thread Alexandre DERUMIER
Maybe there is a way to avoid that. man lxc.container.conf mentions that it can be used for for manipulation of the rootfs yes, I see that, could be used to mount an encryptet rootfs. I'll do tests. - Mail original - De: dietmar diet...@proxmox.com À: aderumier aderum...@odiso.com

[pve-devel] [PATCH 5/6] add lxc.mount.entry for subvol

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXC.pm | 56 ++-- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index c68207b..1a0a514 100644 --- a/src/PVE/LXC.pm +++

[pve-devel] [PATCH 6/6] mount hook : setup_mountpoints

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXC.pm | 51 ++ src/lxc-pve-mount-hook | 2 ++ 2 files changed, 53 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 1a0a514..086dc60 100644 ---

[pve-devel] [PATCH 3/6] add lxc-pve-poststop-hook and move vm_stop_cleanup

2015-08-17 Thread Alexandre Derumier
It's better to vm_stop_cleanup inside poststop hook, in case of CT failure (wrong start for example) Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/Makefile | 6 ++- src/PVE/API2/LXC.pm | 4 -- src/lxc-pve-poststop-hook | 128

[pve-devel] pve-container : add mountpoint support v4

2015-08-17 Thread Alexandre Derumier
changelog: - add pre-start hook and move activate volumes code inside - don't write lxc.cgroup.devices.allow in conf, but directly write to cgroup in mount hook - move setup_mountpoints for LXC::Setup::Base to LXC:: This is tested with loop raw file, subvol and rbd volume. lxc-start correctly

[pve-devel] [PATCH 4/6] add pve-prestart-hook and move activate volumes inside it

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/Makefile | 6 +- src/PVE/API2/LXC.pm | 17 -- src/lxc-pve-prestart-hook | 153 ++ src/lxc-pve.conf | 1 + 4 files changed, 159 insertions(+), 18

[pve-devel] [PATCH 1/6] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/API2/LXC.pm | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 7eb0afb..b395af3 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -1007,7

[pve-devel] [PATCH 2/6] vm_stop_cleanup : detach loopdevices for non rootfs mountpoint

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXC.pm | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 10a89f2..c68207b 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1266,9 +1266,28 @@ sub

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre DERUMIER
I Think I can solve lxc.cgroup.devices.allow, by simply writing /sys/fs/cgroup/devices/lxc/VMID/devices.list in hook. So, I can move the activate part to pre_start hook. I'll do tests today. - Mail original - De: aderumier aderum...@odiso.com À: dietmar diet...@proxmox.com Cc:

[pve-devel] [PATCH 2/5] vm_stop_cleanup : detach loopdevices for non rootfs mountpoint

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXC.pm | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 10a89f2..c68207b 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1266,9 +1266,28 @@ sub

[pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/API2/LXC.pm | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 7eb0afb..b395af3 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -1007,7

[pve-devel] [PATCH 3/5] add lxc-pve-poststop-hook and move vm_stop_cleanup

2015-08-17 Thread Alexandre Derumier
It's better to vm_stop_cleanup inside poststop hook, in case of CT failure (wrong start for example) Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/Makefile | 6 ++- src/PVE/API2/LXC.pm | 4 -- src/lxc-pve-poststop-hook | 135

[pve-devel] [PATCH 4/5] add lxc.cgroup.devices.allow lxc.mount.entry

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXC.pm | 55 +-- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index c68207b..de9dff3 100644 --- a/src/PVE/LXC.pm +++

[pve-devel] [PATCH 5/5] mount hook : setup_mountpoints

2015-08-17 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXCSetup/Base.pm | 47 +++ 1 file changed, 47 insertions(+) diff --git a/src/PVE/LXCSetup/Base.pm b/src/PVE/LXCSetup/Base.pm index b4d8286..b4215f1 100644 --- a/src/PVE/LXCSetup/Base.pm

[pve-devel] [PATCH] Bugfix 517: improve error message

2015-08-17 Thread Wolfgang Link
Get a understandble message, if someone try to increase a qcow2 image where one or more snapshots reside --- PVE/API2/Qemu.pm | 6 ++ 1 file changed, 6 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 24a066f..5caaf1a 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm

[pve-devel] pve-container : add mountpoint support part 3

2015-08-17 Thread Alexandre Derumier
changelog : - add support for subvols - remove lxc.aa_profile = lxc-container-default-with-mounting ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Dietmar Maurer
So it is no longer possible to start such containers using lxc-start? On August 17, 2015 at 3:18 PM Alexandre Derumier aderum...@odiso.com wrote: Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/API2/LXC.pm | 14 +- 1 file changed, 13 insertions(+), 1

Re: [pve-devel] [PATCH 4/9] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre DERUMIER
You can now create 'subvol' with normal directory storage, by passing zero size with pct create, or simply: Ok, I'll improve my patches, because it don't work currently with subvol. (I have only tested with loop raw and block device). It's a little bit different with subvol. - Mail

Re: [pve-devel] [PATCH v2 qemu-server] adapt /config and /pending API calls to force-delete

2015-08-17 Thread Dietmar Maurer
@@ -721,7 +722,7 @@ __PACKAGE__-register_method({ }, delete = { description = Indicated a pending delete request., - type = 'boolean', + type = 'integer', optional = 1, },

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Dietmar Maurer
I Think I can solve lxc.cgroup.devices.allow, by simply writing /sys/fs/cgroup/devices/lxc/VMID/devices.list in hook. So, I can move the activate part to pre_start hook. AFAIK we write the LXC conf file at create time, and when we do 'pct start'. So there is no real need to rewrite it

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Dietmar Maurer
OK, I applied the patches - I am testing now, an try to apply cleanups when I think I can improve code. Please can you test if those patches works for you: https://git.proxmox.com/?p=pve-container.git;a=commitdiff;h=9459f07d921d224dd6ba059e3d08b29908f01eb6

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre DERUMIER
AFAIK we write the LXC conf file at create time, and when we do 'pct start'. So there is no real need to rewrite it again in pre-start hook? I don't write it again in pre-start hook. (I only move activate volumes code to pre-start hook , and keep write lxc config in vm_start) : (patch 4/5)

Re: [pve-devel] [PATCH 5/5] mount hook : setup_mountpoints

2015-08-17 Thread Dietmar Maurer
Just found a feature request here: https://github.com/lxc/lxc/issues/195 I guess that would also simplify your code? ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre DERUMIER
So it is no longer possible to start such containers using lxc-start? mmm, activate could be done could be done in a pre-start hook. But I need to access real device devices path to configure lxc.cgroup.devices.allow, and lxc.mount.entry for subvol, so before lxc-start. - Mail original

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Dietmar Maurer
On August 17, 2015 at 8:26 PM Alexandre DERUMIER aderum...@odiso.com wrote: So it is no longer possible to start such containers using lxc-start? mmm, activate could be done could be done in a pre-start hook. But I need to access real device devices path to configure

Re: [pve-devel] [PATCH 5/5] mount hook : setup_mountpoints

2015-08-17 Thread Alexandre DERUMIER
I guess that would also simplify your code? Yes, I have already see this tracker (from 2014). Definiltiity, it could simplify a lot the code. I think it should be too diffcult to implement, as rootfs already implement almost all the features. But I don't have skill to patch lxc ;) - Mail

Re: [pve-devel] [PATCH 1/5] vm_start : attach loop devices for non rootfs mountpoint

2015-08-17 Thread Alexandre DERUMIER
But I need to access real device devices path to configure lxc.cgroup.devices.allow, and lxc.mount.entry for subvol, so before lxc-start. That does not work in the pre-start hook? We can configure before, so that it is still possible to use lxc-start directly? Do you want to rewrite

Re: [pve-devel] [PATCH] Bugfix 860: fix the upload from a VM when it is restricted.

2015-08-17 Thread Wolfgang Link
Yes sure we need this clean up. On 08/17/2015 09:13 AM, Dietmar Maurer wrote: - system(/sbin/tc filter del dev $iface parent : protocol ip prio 50 estimator 1sec 8sec /dev/null 21); +system(/sbin/tc filter del dev $iface parent : protocol all pref 50 u32 /dev/null 21);

Re: [pve-devel] [PATCH] Bugfix 860: fix the upload from a VM when it is restricted.

2015-08-17 Thread Dietmar Maurer
I think we need this cleanup? diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index e1e22b0..ff4a89c 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -67,7 +67,7 @@ sub setup_tc_rate_limit { my ($iface, $rate, $burst, $debug) = @_; system(/sbin/tc class del dev $iface

[pve-devel] [PATCH=Stable-3] Bugfix 682: change at the Gui the used disk size.

2015-08-17 Thread Wolfgang Link
in the pvesm and pvesh we are giving the correct size of the used space from a disk. this change make the output of Gui and CLI consistent. --- bin/pvestatd |5 + www/manager/storage/StatusView.js |7 +-- 2 files changed, 2 insertions(+), 10 deletions(-)

[pve-devel] [PATCH] Bugfix 682: change at the Gui the used disk size.

2015-08-17 Thread Wolfgang Link
in the pvesm and pvesh we are giving the correct size of the used space from a disk. this change make the output of Gui and CLI consistent. --- bin/pvestatd |5 + www/manager/storage/StatusView.js |7 +-- 2 files changed, 2 insertions(+), 10 deletions(-)

Re: [pve-devel] [PATCH 8/9] add lxc.aa_profile = lxc-container-default-with-mounting

2015-08-17 Thread Dietmar Maurer
why do we need this? I thought we do all mounts on the host? On 08/16/2015 07:43 PM, Alexandre Derumier wrote: Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXC.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 04ff00d..c3f6685

Re: [pve-devel] [PATCH 9/9] mount hook : mount blockdevs

2015-08-17 Thread Dietmar Maurer
Not sure if we should mix that into the LXSetup code. Maybe it is better to use the lxc.hook.pre-mount hook? (see man lxc.container.conf) ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Re: [pve-devel] [PATCH 9/9] mount hook : mount blockdevs

2015-08-17 Thread Dietmar Maurer
Not sure if we should mix that into the LXSetup code. Maybe it is better to use the lxc.hook.pre-mount hook? (see man lxc.container.conf) AFAIK, the rootfs is not yet mounted in pre-mount hook. So I can't mount other mountpoints. Maybe we should also mount rootfs there? I mean, we do it

Re: [pve-devel] [PATCH 8/9] add lxc.aa_profile = lxc-container-default-with-mounting

2015-08-17 Thread Alexandre DERUMIER
why do we need this? I thought we do all mounts on the host? Indeed, you are right, this is not needed. you can't remove this patch. (I think I had tried in past to mount from the guest). - Mail original - De: dietmar diet...@proxmox.com À: aderumier aderum...@odiso.com, pve-devel

Re: [pve-devel] [PATCH 9/9] mount hook : mount blockdevs

2015-08-17 Thread Alexandre DERUMIER
Maybe we should also mount rootfs there? I mean, we do it for all other mountpoint, so why not for rootfs? I can try, but I'm not sure if lxc will not thrown error after, as it'll try to mount the rootfs again. - Mail original - De: dietmar diet...@proxmox.com À: aderumier

Re: [pve-devel] [PATCH 3/9] add find_loopdev sub

2015-08-17 Thread Dietmar Maurer
applied patch 1-3 On 08/16/2015 07:43 PM, Alexandre Derumier wrote: Signed-off-by: Alexandre Derumier aderum...@odiso.com --- src/PVE/LXC.pm | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index fbdc5bb..10a89f2 100644 --- a/src/PVE/LXC.pm +++