[pve-devel] Implement "resize" for the DRBD backend.

2015-08-03 Thread Philipp Marek
Please see attached a patch to implement "resize" for the DRBD backend. I hope it matches all your coding style guidelines; feedback is welcome, of course. Regards, Phil >From 4ceb4d737d4c604dcf99bbd46d60d731626e9781 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 3 Aug 2015 16:15:33 +0200 Subj

Re: [pve-devel] Implement "resize" for the DRBD backend.

2015-08-04 Thread Philipp Marek
> > Please see attached a patch to implement "resize" for the DRBD backend. > > > > I hope it matches all your coding style guidelines; > > feedback is welcome, of course. > > Please can you send patches inline? That way it is easier to review code > and add comments. I copied the code for this p

Re: [pve-devel] Implement "resize" for the DRBD backend.

2015-08-04 Thread Philipp Marek
> > Anyways, I tested the patch, and volume_resize() now returns without errors. > > The problem is that it does not resize the underlying LVM volume. > > > > Do I need to install any drbdmanage updates/patches to make that work? > > I just scanned the drbdmanage sources, and the corresponding im

Re: [pve-devel] Implement "resize" for the DRBD backend.

2015-08-04 Thread Philipp Marek
> > > -my $path = $class->path($scfg, $volname); > > > +die "illegal name '$name' - should be 'vm-*-*'\n" > > > + if $name !~ m/^vm-\d+-/; > > > > > > And reason for above check? Or did you just copied that code from > > > alloc_image? > > Right. And that's why I changed the name - to keep

Re: [pve-devel] Implement "resize" for the DRBD backend.

2015-09-03 Thread Philipp Marek
Hi Dietmar, > > > The problem is that it does not resize the underlying LVM volume. > > > > > > Do I need to install any drbdmanage updates/patches to make that work? > > > > I just scanned the drbdmanage sources, and the corresponding implementation > > is empty (always return success)? > > >

[pve-devel] Snapshot questions

2015-09-03 Thread Philipp Marek
Hi, I'm currently implementing the snapshot functions for the DRBD backend; but a few questions have popped up, so I'm asking them here. *) The first question is - how would these get called? "pvesm" shows no matching arguments, and the GUI has no "snapshot" buttons either. Does that hide beh

Re: [pve-devel] [PATCH_V2 2/2] check is mounted before try to unmount disk.

2015-09-04 Thread Philipp Marek
> this is neccessay because otherwise when a storage is not mounted, like when > it is offline, the migration crash. > --- > src/PVE/LXC.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm > index cf45fff..7e5cc7d 100644 > --- a/src/PVE/

Re: [pve-devel] Snapshot questions

2015-09-07 Thread Philipp Marek
we want to put that in drbdmanage core - I'll discuss that. > Normally, we only allow cloning from 'base' volumes, which are created > with vdisk_create_base(). If most cases, this just marks the volumes as > 'read-only' and renames them. I guess dm-thin could > make

Re: [pve-devel] Snapshot questions

2015-09-07 Thread Philipp Marek
> > > Above container management toolkit 'pct' already supports drbd, and it > > > would > > > be really cool to have snapshots, so that we can make snapshot and > > > snapshot backups ;-) > > The same should be easily possible for KVM, too. > > Yes, but we do not need that for KVM backup purpos

[pve-devel] [PATCH] Shorter implementation of random_ether_addr().

2015-10-07 Thread Philipp Marek
--- src/PVE/Tools.pm | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 3f3958e..cda0797 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -940,21 +940,13 @@ sub random_ether_addr { my $rand = Digest::SHA

Re: [pve-devel] [PATCH] Shorter implementation of random_ether_addr().

2015-10-07 Thread Philipp Marek
> First, many thanks for the patch! > > > +my $mac = sprintf("%02X:" x 6, unpack("C6", $rand)); > > + > > +# remove superfluous ":" at end > > +chop($mac); > > I wonder if it would be simpler to use a static format string instead? > > my $mac = sprintf("%02X:%02X:%02X:%02X:%02X:%02X"

[pve-devel] [PATCH 1/5] DRBD: Implement "resize".

2015-10-08 Thread Philipp Marek
Needs a recent DRBDmanage and DRBD 9 version - 9.0.0 has a known bug. --- PVE/Storage/DRBDPlugin.pm | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/PVE/Storage/DRBDPlugin.pm b/PVE/Storage/DRBDPlugin.pm index b780829..565fb4c 100644 --- a/PVE/Storage/DRBDPlugin.p

[pve-devel] [PATCH 2/5] DRBD: Remove search loop, limit results via the query.

2015-10-08 Thread Philipp Marek
--- PVE/Storage/DRBDPlugin.pm | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/PVE/Storage/DRBDPlugin.pm b/PVE/Storage/DRBDPlugin.pm index 565fb4c..91addc5 100644 --- a/PVE/Storage/DRBDPlugin.pm +++ b/PVE/Storage/DRBDPlugin.pm @@ -304,15 +304,11 @@ sub activate_volume

[pve-devel] [PATCH 4/5] DRBD: indentation fixes as produced by vim.

2015-10-08 Thread Philipp Marek
--- PVE/Storage/DRBDPlugin.pm | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PVE/Storage/DRBDPlugin.pm b/PVE/Storage/DRBDPlugin.pm index b150b16..14f232b 100644 --- a/PVE/Storage/DRBDPlugin.pm +++ b/PVE/Storage/DRBDPlugin.pm @@ -364,7 +364,7 @@ sub volume_resize {

[pve-devel] [PATCH 3/5] DRBD: Fix typo in comment.

2015-10-08 Thread Philipp Marek
--- PVE/Storage/DRBDPlugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/Storage/DRBDPlugin.pm b/PVE/Storage/DRBDPlugin.pm index 91addc5..b150b16 100644 --- a/PVE/Storage/DRBDPlugin.pm +++ b/PVE/Storage/DRBDPlugin.pm @@ -314,7 +314,7 @@ sub activate_volume { ($rc,

[pve-devel] [PATCH 5/5] DRBD: Implement snapshots.

2015-10-08 Thread Philipp Marek
--- PVE/Storage/DRBDPlugin.pm | 88 --- 1 file changed, 84 insertions(+), 4 deletions(-) diff --git a/PVE/Storage/DRBDPlugin.pm b/PVE/Storage/DRBDPlugin.pm index 14f232b..3cc7f0b 100644 --- a/PVE/Storage/DRBDPlugin.pm +++ b/PVE/Storage/DRBDPlugin.pm @@

Re: [pve-devel] [PATCH 5/5] DRBD: Implement snapshots.

2015-10-08 Thread Philipp Marek
Sorry, I used "git email-send" badly -- I wanted to write preface email, as usual, but forgot the --compose commandline argument (and "compose=true" in .git/config doesn't seem to work). About this patch I wanted to mention a few things: * This implementation works with the small script at

Re: [pve-devel] [PATCH 1/5] DRBD: Implement "resize".

2015-10-14 Thread Philipp Marek
Hi Dietmar, > Does not work for me - you already uploaded required versions to public drbd > git repository? Yes, the DRBD 9 is upstream: http://git.drbd.org/drbd-9.0.git/commit/03431bc8a61ca022e4149c546ade1e1e86c2deea The DRBDmanage one not yet - this needs a cluster-wide operation (first

Re: [pve-devel] [PATCH 1/5] DRBD: Implement "resize".

2015-10-15 Thread Philipp Marek
> Please can you resend this one when the required drbdmanage changes are > online? > I cannot commit this one because it fails with current drbdmanage code. Okay, will do. ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bi

Re: [pve-devel] [PATCH 5/5] DRBD: Implement snapshots.

2015-10-15 Thread Philipp Marek
> First, code looks reasonable to me, but I am unable to test > without a working rollback. Some comments inline: > > -die "Snapshot not implemented on DRBD\n" if $snapname; > > +return activate_volume_from_snapshot(@_) if $snapname; > > I would prefer to list all parameters by name (inste

Re: [pve-devel] [PATCH 5/5] DRBD: Implement snapshots.

2015-10-15 Thread Philipp Marek
> > * There's no implementation for volume_snapshot_rollback() yet. > >Is there a way to change the volume name on rollback? > >The problem is that DRBDmanage (as of now) won't allow to _replace_ > >the current contents with the ones from the snapshot -- > >but perhaps we want to i

Re: [pve-devel] [PATCH 5/5] DRBD: Implement snapshots.

2015-11-13 Thread Philipp Marek
Hi Dietmar, > I just started to implement a PVE storage driver for lvmthin: > > https://git.proxmox.com/?p=pve-storage.git;a=blob;f=PVE/Storage/LvmThinPlugin.pm > > So far I just use: > > sub volume_snapshot_rollback { > my ($class, $scfg, $storeid, $volname, $snap) = @_; > > my $vg =