Re: [pve-devel] New installation with pvetest

2015-05-01 Thread Alexandre DERUMIER
There are still no ceph packages for jessie, sorry. 

I was talking with Sage from ceph, It's planned.
they need to integrated automated build with jenkins and their continuous 
integration platform.

I'll try to help them if I can. 

- Mail original -
De: dietmar diet...@proxmox.com
À: moula BADJI moul...@hotmail.com, pve-devel pve-devel@pve.proxmox.com
Envoyé: Jeudi 30 Avril 2015 21:33:08
Objet: Re: [pve-devel] New installation with pvetest

 On April 30, 2015 at 8:09 PM Moula BADJI moul...@hotmail.com wrote: 
 
 
 - A problem of installation dependencies ceph hammer : 

There are still no ceph packages for jessie, sorry. 

 One question: to make a new HA-PVE, a small howto ? 

Sorry, there is currently no docu. 

___ 
pve-devel mailing list 
pve-devel@pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] add subvolume support to pve-storage

2015-05-01 Thread Dietmar Maurer
Hi all,

I want to add subvolume support to improve our container implementation.
I stated using the ZFSPoolPlugin, and simply use a new 'format' called 'subvol'.

While that seems to work, I wonder if that would also work with the 'ZFSPlugin'?
Would
it be possible to create a subvolume one an external server, and export that via
NFS?
Would that work with nexenta or other storage boxes?

Here is a first patch:

diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm
index 605e455..1b09f53 100644
--- a/PVE/API2/Storage/Content.pm
+++ b/PVE/API2/Storage/Content.pm
@@ -2,6 +2,7 @@ package PVE::API2::Storage::Content;
 
 use strict;
 use warnings;
+use Data::Dumper;
 
 use PVE::SafeSyslog;
 use PVE::Cluster qw(cfs_read_file);
@@ -123,7 +124,7 @@ __PACKAGE__-register_method ({
},
'format' = {
type = 'string',
-   enum = ['raw', 'qcow2'],
+   enum = ['raw', 'qcow2', 'subvol'],
requires = 'size',
optional = 1,
},
diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index b3f3e37..2787426 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -17,6 +17,7 @@ sub type {
 sub plugindata {
 return {
content = [ {images = 1}, { images = 1 }],
+   format = [ { raw = 1, subvol = 1 } , 'raw' ],
 };
 }
 
@@ -92,25 +93,35 @@ sub zfs_parse_zvol_list {
 
 my @lines = split /\n/, $text;
 foreach my $line (@lines) {
-   if ($line =~ /^(.+)\s+([a-zA-Z0-9\.]+|\-)\s+(.+)$/) {
-   my $zvol = {};
-   my $size = $2;
-   my $origin = $3;
-   my @parts = split /\//, $1;
-   my $name = pop @parts;
-   my $pool = join('/', @parts);
-
-   next unless $name =~ m!^(\w+)-(\d+)-(\w+)-(\d+)$!;
-   $name = $pool . '/' . $name;
-
-   $zvol-{pool} = $pool;
-   $zvol-{name} = $name;
-   $zvol-{size} = zfs_parse_size($size);
-   if ($3 !~ /^-$/) {
-   $zvol-{origin} = $origin;
+   my ($dataset, $size, $origin, $type, $refquota) = split(/\s+/, $line);
+   next if !($type eq 'volume' || $type eq 'filesystem');
+
+   my $zvol = {};
+   
+   my @parts = split /\//, $dataset;
+   my $name = pop @parts;
+   my $pool = join('/', @parts);
+
+   next unless $name =~ m!^(\w+)-(\d+)-(\S+)$!;
+   $name = $pool . '/' . $name;
+
+   $zvol-{pool} = $pool;
+   $zvol-{name} = $name;
+   if ($type eq 'filesystem') {
+   if ($refquota eq 'none') {
+   $zvol-{size} = 0;
+   } else {
+   $zvol-{size} = zfs_parse_size($refquota);
}
-   push @$list, $zvol;
+   $zvol-{format} = 'subvol';
+   } else {
+   $zvol-{size} = zfs_parse_size($size);
+   $zvol-{format} = 'raw';
+   }
+   if ($origin !~ /^-$/) {
+   $zvol-{origin} = $origin;
}
+   push @$list, $zvol;
 }
 
 return $list;
@@ -119,7 +130,7 @@ sub zfs_parse_zvol_list {
 sub parse_volname {
 my ($class, $volname) = @_;
 
-if ($volname =~ m/^(((base|vm)-(\d+)-\S+)\/)?((base)?(vm)?-(\d+)-\S+)$/) {
+if ($volname =~
m/^(((base|vm)-(\d+)-\S+)\/)?((base)?(vm|subvol)?-(\d+)-\S+)$/) {
return ('images', $5, $8, $2, $4, $6);
 }
 
@@ -174,21 +185,32 @@ sub zfs_request {
 sub alloc_image {
 my ($class, $storeid, $scfg, $vmid, $fmt, $name, $size) = @_;
 
-die unsupported format '$fmt' if $fmt ne 'raw';
+my $volname = $name;
+
+if ($fmt eq 'raw') {
 
-die illegal name '$name' - sould be 'vm-$vmid-*'\n
-if $name  $name !~ m/^vm-$vmid-/;
+   die illegal name '$volname' - sould be 'vm-$vmid-*'\n
+   if $volname  $volname !~ m/^vm-$vmid-/;
+   $volname = $class-zfs_find_free_diskname($storeid, $scfg, $vmid) 
+   if !$volname;
 
-my $volname = $name;
- 
-$volname = $class-zfs_find_free_diskname($storeid, $scfg, $vmid) if
!$volname;
+   $class-zfs_create_zvol($scfg, $volname, $size);
+   my $devname = /dev/zvol/$scfg-{pool}/$volname;
 
-$class-zfs_create_zvol($scfg, $volname, $size);
+   run_command(udevadm trigger --subsystem-match block);
+   system(udevadm settle --timeout 10 --exit-if-exists=${devname});
 
-my $devname = /dev/zvol/$scfg-{pool}/$volname;
+} elsif ( $fmt eq 'subvol') {
+   
+   die subvolume allocation without name\n if !$volname;
+   die illegal name '$volname' - sould be 'subvol-$vmid-*'\n
+   if $volname !~ m/^subvol-$vmid-/;
 
-run_command(udevadm trigger --subsystem-match block);
-system(udevadm settle --timeout 10 --exit-if-exists=${devname});
+   $class-zfs_create_subvol($scfg, $volname, $size);  
+   
+} else {
+   die unsupported format '$fmt';
+}
 
 return $volname;
 }
@@ -238,7 +260,6 @@ sub list_images {
push @$res, $info;
}
 }
-
 return 

Re: [pve-devel] add subvolume support to pve-storage

2015-05-01 Thread Michael Rasmussen
On Fri, 1 May 2015 10:55:35 +0200 (CEST)
Dietmar Maurer diet...@proxmox.com wrote:

 Hi all,
 
 I want to add subvolume support to improve our container implementation.
 I stated using the ZFSPoolPlugin, and simply use a new 'format' called 
 'subvol'.
 
 While that seems to work, I wonder if that would also work with the 
 'ZFSPlugin'?
 Would
 it be possible to create a subvolume one an external server, and export that 
 via
 NFS?
 Would that work with nexenta or other storage boxes?
 
Theoretically it should provided you enable NFS for the dataset.
However, filtering out datasets which does not belong to Proxmox needs
to be taken into account. From what I read from the patch you will
create a dataset for each disk like:

pool 
|
- vm-100-disk-1 (zvol pool/vm-100-disk-1)
|
- vm-100-disk-2 (dataset pool/vm-100-disk-2)
|
- vm-100-disk-3 (dataset pool/vm-100-disk-3)


On Solaris based storage this should work since enabling NFS on a
dataset automatically export it through the NFS server. I think ZOL and
FreeBSD requires manually configuration of the native NFS server, only
an assumption though.

However, ACL is also something which has to be taken into account since
ZFS ACL is incompatible with Linux ACL so each dataset must be mounted
using option noacl. On the server side you will need the following
options on dataset (pve-server subnet 172.16.0.0/24):
aclmode   passthrough 
aclinheritpassthrough-x
sharenfs  rw=@172.16.0.0/24,root=@172.16.0.0/24

Above options is the once which is not default value.

-- 
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael at rasmussen dot cc
http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0xD3C9A00E
mir at datanom dot net
http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0xE501F51C
mir at miras dot org
http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0xE3E80917
--
/usr/games/fortune -es says:
It don't mean a THING if you ain't got that SWING!!


pgpX3byaVIg4V.pgp
Description: OpenPGP digital signature
___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] add subvolume support to pve-storage

2015-05-01 Thread Dietmar Maurer
 Theoretically it should provided you enable NFS for the dataset.
 However, filtering out datasets which does not belong to Proxmox needs
 to be taken into account. From what I read from the patch you will
 create a dataset for each disk like:

I use special names like:

pool 
|
- subvol-100-rootfs 

so it is easy to filter them.

 However, ACL is also something which has to be taken into account since
 ZFS ACL is incompatible with Linux ACL so each dataset must be mounted
 using option noacl. On the server side you will need the following
 options on dataset (pve-server subnet 172.16.0.0/24):
 aclmode   passthrough 
 aclinheritpassthrough-x
 sharenfs  rw=@172.16.0.0/24,root=@172.16.0.0/24
 
 Above options is the once which is not default value.

Thanks for those hints.

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel