Re: [pve-devel] pve-storage : volume_lock && volume_unlock

2012-12-03 Thread Dietmar Maurer
> The idea is to have a repo where we can track all patches. Right now > someone sends a patch to the mailinglist. Some of them might not be > included directly. And then after some month it might get lost. The idea is to get all those ideas into the main repository asap. I am currently just a li

Re: [pve-devel] [PATCH 06/20] lvm : add volume_protect && volume_unprotect

2012-12-03 Thread Dietmar Maurer
> I check on citrix xenserver, it seem to be possible to do linked clone from a > lvm template. > > I don't know how it's works. maybe the clone is simply a snapshot ? does it > work across cluster? (If the parent lvm volume is readonly and activate on > each host ?) No, lvm snapshot have problem

Re: [pve-devel] pve-storage : volume_lock && volume_unlock

2012-12-03 Thread Stefan Priebe
Am 03.12.2012 17:06, schrieb Dietmar Maurer: Cc: pve-devel@pve.proxmox.com; Stefan Priebe - Profihost AG Subject: Re: [pve-devel] pve-storage : volume_lock && volume_unlock Why (beside beeing 'cool')? I think Stefan want to test without manual patching. Then it would make sense for a short

Re: [pve-devel] [PATCH 06/20] lvm : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre DERUMIER
response to myself: http://sysopers.wordpress.com/2012/05/20/lvm-snapshot-based-kvm-virtual-machines-deploying-automation-part-i/ So it seem easy to implement with lvm snapshot as clone. I'll test it tomorrow - Mail original - De: "Alexandre DERUMIER" À: "Dietmar Maurer" Cc: pve-de

Re: [pve-devel] [PATCH 06/20] lvm : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre DERUMIER
I check on citrix xenserver, it seem to be possible to do linked clone from a lvm template. I don't know how it's works. maybe the clone is simply a snapshot ? does it work across cluster? (If the parent lvm volume is readonly and activate on each host ?) - Mail original - De: "Diet

Re: [pve-devel] qemu-server : template & clones V2

2012-12-03 Thread Dietmar Maurer
> -Original Message- > From: Alexandre DERUMIER [mailto:aderum...@odiso.com] > Sent: Montag, 03. Dezember 2012 17:03 > To: Dietmar Maurer > Cc: pve-devel@pve.proxmox.com > Subject: Re: [pve-devel] qemu-server : template & clones V2 > > >>Why do you use two different subroutines? A simple

Re: [pve-devel] pve-storage : volume_lock && volume_unlock

2012-12-03 Thread Dietmar Maurer
> Cc: pve-devel@pve.proxmox.com; Stefan Priebe - Profihost AG > Subject: Re: [pve-devel] pve-storage : volume_lock && volume_unlock > > >> Why (beside beeing 'cool')? > > I think Stefan want to test without manual patching. Then it would make sense for a short period of time. But I want to get t

Re: [pve-devel] qemu-server : template & clones V2

2012-12-03 Thread Alexandre DERUMIER
>>Why do you use two different subroutines? A simple Boolean parameter >>would also work: >>volume_protect(bool value); Ok, no problem, I'll do it like this. - Mail original - De: "Dietmar Maurer" À: "Alexandre Derumier" , pve-devel@pve.proxmox.com Envoyé: Lundi 3 Décembre 2012

Re: [pve-devel] [PATCH 06/20] lvm : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre DERUMIER
>>Can't we use 'lvchange -p r ...'? Sure, But it was for protect before clone, so I don't know if we need it. (But maybe it can be use for other thing ? Or do we want lvm cloning ?) I'm not expert with lvm, so tell me what you want ;) - Mail original - De: "Dietmar Maurer" À: "Alexa

Re: [pve-devel] [PATCH 06/20] lvm : add volume_protect && volume_unprotect

2012-12-03 Thread Dietmar Maurer
> Subject: [pve-devel] [PATCH 06/20] lvm : add volume_protect && > volume_unprotect > > we can't protect a lvm volume. Can't we use 'lvchange -p r ...'? ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinf

Re: [pve-devel] qemu-server : template & clones V2

2012-12-03 Thread Dietmar Maurer
> usr PVE::Storage::volume_protect and volume_unprotect instead > volume_lock && volume_unlock Why do you use two different subroutines? A simple Boolean parameter would also work: volume_protect(bool value); ___ pve-devel mailing list pve-devel@pve.

[pve-devel] [PATCH 20/20] nexenta: add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/NexentaPlugin.pm | 14 ++ 1 file changed, 14 insertions(+) diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm index 25a097c..c1f7874 100644 --- a/PVE/Storage/NexentaPlugin.pm +++ b/PVE/Storage/NexentaPlugin.pm

[pve-devel] [PATCH 19/20] iscsi: add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/ISCSIPlugin.pm |6 ++ 1 file changed, 6 insertions(+) diff --git a/PVE/Storage/ISCSIPlugin.pm b/PVE/Storage/ISCSIPlugin.pm index 0edef6e..d8609af 100644 --- a/PVE/Storage/ISCSIPlugin.pm +++ b/PVE/Storage/ISCSIPlugin.pm @@ -393,5 +393,11

[pve-devel] [PATCH 18/20] iscsidirect : add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/ISCSIDirectPlugin.pm |6 ++ 1 file changed, 6 insertions(+) diff --git a/PVE/Storage/ISCSIDirectPlugin.pm b/PVE/Storage/ISCSIDirectPlugin.pm index ee9179a..b1c2e66 100644 --- a/PVE/Storage/ISCSIDirectPlugin.pm +++ b/PVE/Storage/ISCSIDire

[pve-devel] [PATCH 17/20] lvm: add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/LVMPlugin.pm |7 +++ 1 file changed, 7 insertions(+) diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm index 4fb786a..f708fe0 100644 --- a/PVE/Storage/LVMPlugin.pm +++ b/PVE/Storage/LVMPlugin.pm @@ -450,4 +450,11 @@ sub vo

[pve-devel] [PATCH 16/20] sheepdog: add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/SheepdogPlugin.pm | 11 +++ 1 file changed, 11 insertions(+) diff --git a/PVE/Storage/SheepdogPlugin.pm b/PVE/Storage/SheepdogPlugin.pm index e9f2675..ffeb384 100644 --- a/PVE/Storage/SheepdogPlugin.pm +++ b/PVE/Storage/SheepdogPlugin.

[pve-devel] [PATCH 14/20] plugin : add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/Plugin.pm | 17 + 1 file changed, 17 insertions(+) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 406fa1a..5328f20 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -568,6 +568,23 @@ sub volume

[pve-devel] [PATCH 09/20] plugin : add find_free_volname

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/Plugin.pm | 45 - 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 7648863..406fa1a 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Stor

[pve-devel] [PATCH 15/20] rbd: add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/RBDPlugin.pm | 12 1 file changed, 12 insertions(+) diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index 143804e..0fc9c94 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -402,6 +402,18 @@

[pve-devel] [PATCH 13/20] storage : add volume_clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage.pm | 16 1 file changed, 16 insertions(+) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index d654d6f..d7ccbd8 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -183,6 +183,22 @@ sub volume_snapshot_delete { } } +sub

[pve-devel] [PATCH 12/20] nexenta: add find_free_volname

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/NexentaPlugin.pm | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm index e4fc7f1..25a097c 100644 --- a/PVE/Storage/NexentaPlugin.pm +

[pve-devel] [PATCH 07/20] iscsidirect : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre Derumier
we can't protect an iscsi volume Signed-off-by: Alexandre Derumier --- PVE/Storage/ISCSIDirectPlugin.pm | 10 ++ 1 file changed, 10 insertions(+) diff --git a/PVE/Storage/ISCSIDirectPlugin.pm b/PVE/Storage/ISCSIDirectPlugin.pm index e2490e8..ee9179a 100644 --- a/PVE/Storage/ISCSIDirec

[pve-devel] [PATCH 08/20] iscsi : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre Derumier
we can't protect an iscsi device Signed-off-by: Alexandre Derumier --- PVE/Storage/ISCSIPlugin.pm | 10 ++ 1 file changed, 10 insertions(+) diff --git a/PVE/Storage/ISCSIPlugin.pm b/PVE/Storage/ISCSIPlugin.pm index 173ca1d..0edef6e 100644 --- a/PVE/Storage/ISCSIPlugin.pm +++ b/PVE/Sto

[pve-devel] [PATCH 10/20] rbd : add find_free_volname

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/RBDPlugin.pm | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index c388cab..143804e 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storag

[pve-devel] [PATCH 11/20] sheepdog : add find_free_volname

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage/SheepdogPlugin.pm | 34 +- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/PVE/Storage/SheepdogPlugin.pm b/PVE/Storage/SheepdogPlugin.pm index 1f4d29a..e9f2675 100644 --- a/PVE/Storage/SheepdogPlu

[pve-devel] [PATCH 06/20] lvm : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre Derumier
we can't protect a lvm volume. Signed-off-by: Alexandre Derumier --- PVE/Storage/LVMPlugin.pm | 12 1 file changed, 12 insertions(+) diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm index 9199db1..4fb786a 100644 --- a/PVE/Storage/LVMPlugin.pm +++ b/PVE/Storage/LVM

[pve-devel] [PATCH 05/20] nexenta : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre Derumier
return undef, as nexenta have a implicit protection system when creatin clones Signed-off-by: Alexandre Derumier --- PVE/Storage/NexentaPlugin.pm | 12 1 file changed, 12 insertions(+) diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm index 386656f..e4fc7f1

[pve-devel] [PATCH 04/20] sheepdog : add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre Derumier
return undef, as sheepdog doesn't need protection Signed-off-by: Alexandre Derumier --- PVE/Storage/SheepdogPlugin.pm | 12 1 file changed, 12 insertions(+) diff --git a/PVE/Storage/SheepdogPlugin.pm b/PVE/Storage/SheepdogPlugin.pm index 3e5839e..1f4d29a 100644 --- a/PVE/Storage/

[pve-devel] [PATCH 03/20] rbd: add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre Derumier
We use the rbd protect command to protect a snapshot. This is mandatory for clone a snapshot. The rbd volume need to be at format V2 Signed-off-by: Alexandre Derumier --- PVE/Storage/RBDPlugin.pm | 55 +- 1 file changed, 50 insertions(+), 5 deletion

[pve-devel] [PATCH 02/20] Plugin : add volume_protect && volume_unprotect (and also fix backing file regex parsing)

2012-12-03 Thread Alexandre Derumier
for files, we protect the volume file with chattr. So we can only read it, but can't delete or move it. Signed-off-by: Alexandre Derumier --- PVE/Storage/Plugin.pm | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/PVE/Storage/Plugin.pm b/PVE/Stor

[pve-devel] [PATCH 01/20] storage: add volume_protect && volume_unprotect

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/Storage.pm | 30 ++ 1 file changed, 30 insertions(+) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index b13df21..d654d6f 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -183,6 +183,36 @@ sub volume_snapshot_delete {

[pve-devel] pve-storage : volume_protect, volume_unprotect, volume_clone

2012-12-03 Thread Alexandre Derumier
changelog since V1: rename volume_lock to volume_protect rename volume_unlock to volume_unprotect - add volume_clone - add find_free_volname (to not have duplicate code in vdisk_alloc && volume_clone) ___ pve-devel mailing list pve-devel@pve.proxmox

[pve-devel] [PATCH 7/7] add clone_disks

2012-12-03 Thread Alexandre Derumier
qm create --clonefrom vmid --snapname snap Signed-off-by: Alexandre Derumier --- PVE/API2/Qemu.pm | 89 -- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index d2dba3c..548987f 100644 --- a/

[pve-devel] [PATCH 6/7] forbid offline migration of a non shared volume if it's a clone

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/QemuMigrate.pm |6 ++ 1 file changed, 6 insertions(+) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 0711681..eae28a6 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -245,6 +245,12 @@ sub sync_disks { die "c

[pve-devel] [PATCH 4/7] forbid rollback if current config is a template.

2012-12-03 Thread Alexandre Derumier
if a qcow2 current is a template, we can't rollback to a previous snapshot. (note that file readonly protection do already the job, but we need a clear error message for user) Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm |2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/Q

[pve-devel] [PATCH 5/7] forbid vm_start if current config is a template.

2012-12-03 Thread Alexandre Derumier
if files (raw,qcow2) are a template, we forbid vm_start. note : the readonly protection do already the job, but we need a clear message for users Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm |2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.

[pve-devel] [PATCH 3/7] forbid vm_destroy if templates exists

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm |2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b6b5d4e..3ca8494 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3224,6 +3224,8 @@ sub vm_sendkey { sub vm_destroy { my ($

[pve-devel] [PATCH 1/7] add template_create and template_delete feature.

2012-12-03 Thread Alexandre Derumier
template_create: we need to check if we can create a template from a snapshot or current. qcow2,raw : template from current rbd,sheepdog,nexenta : template from snapshot then we lock volume if storage need it for clone (files or rbd) then we add template:1 to the config (current or snapshot)

[pve-devel] [PATCH 2/7] forbid snapshot delete if it's a template

2012-12-03 Thread Alexandre Derumier
Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 21 + 1 file changed, 21 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 04fb3be..b6b5d4e 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2867,6 +2867,8 @@ sub qemu_volume_snapshot

[pve-devel] qemu-server : template & clones V2

2012-12-03 Thread Alexandre Derumier
Changelog since V1: usr PVE::Storage::volume_protect and volume_unprotect instead volume_lock && volume_unlock add clone_disks qm create --clonefrom --snapname ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/ma

Re: [pve-devel] pve-storage : volume_lock && volume_unlock

2012-12-03 Thread Alexandre DERUMIER
>> Why (beside beeing 'cool')? I think Stefan want to test without manual patching. - Mail original - De: "Dietmar Maurer" À: "Alexandre DERUMIER" , "Stefan Priebe - Profihost AG" Cc: pve-devel@pve.proxmox.com Envoyé: Lundi 3 Décembre 2012 12:04:24 Objet: RE: [pve-devel] pve-st

Re: [pve-devel] pve-storage : volume_lock && volume_unlock

2012-12-03 Thread Dietmar Maurer
Why (beside beeing 'cool')? > -Original Message- > From: pve-devel-boun...@pve.proxmox.com [mailto:pve-devel- > boun...@pve.proxmox.com] On Behalf Of Alexandre DERUMIER > Sent: Montag, 03. Dezember 2012 11:15 > To: Stefan Priebe - Profihost AG > Cc: pve-devel@pve.proxmox.com > Subject: Re:

Re: [pve-devel] pve-storage : volume_lock && volume_unlock

2012-12-03 Thread Alexandre DERUMIER
>>It would be cool if we have these git repos public containing new >>features / work in progress ideas. >> >>What about mirroring to github and working there with Feature branches? Why not. Does Dietmar agree with this ? - Mail original - De: "Stefan Priebe - Profihost AG" À:

Re: [pve-devel] pve-storage : volume_lock && volume_unlock

2012-12-03 Thread Stefan Priebe - Profihost AG
Hi Alexandre, Am 03.12.2012 08:53, schrieb Alexandre DERUMIER: I think you should not use the term 'lock/unlock' here. Maybe something like: volume_protect(true/false) volume_protect seem good. (as snapshot are not really readonly, and rbd already use protect for the rbd command) I'll chan