]> git.proxmox.com Git - pve-storage.git/commitdiff
nexenta: use import_lu on rollback
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Sep 2012 06:16:58 +0000 (08:16 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Sep 2012 06:16:58 +0000 (08:16 +0200)
To avoid generation of new GUID.

PVE/Storage/NexentaPlugin.pm

index a030e454ba60828fb6cf8af4b2b91c05694df991..68658ede8065bd69ad9696b4e4c91ab11735f4ab 100644 (file)
@@ -70,6 +70,12 @@ sub nexenta_create_lu {
     nexenta_request($scfg, 'create_lu', 'scsidisk', "$scfg->{pool}/$zvol", {});
 }
 
+sub nexenta_import_lu {
+    my ($scfg, $zvol) = @_;
+
+    nexenta_request($scfg, 'import_lu', 'scsidisk', "$scfg->{pool}/$zvol");
+}
+
 sub nexenta_create_zvol {
     my ($scfg, $zvol, $size) = @_;
 
@@ -196,7 +202,7 @@ sub alloc_image {
     die "unsupported format '$fmt'" if $fmt ne 'raw';
 
     die "illegal name '$name' - sould be 'vm-$vmid-*'\n"
-       if  $name && $name !~ m/^vm-$vmid-/;
+       if $name && $name !~ m/^vm-$vmid-/;
 
     my $nexentapool = $scfg->{'pool'};
 
@@ -205,7 +211,6 @@ sub alloc_image {
        die "unable de get zvol list" if !$volumes;
 
        for (my $i = 1; $i < 100; $i++) {
-
            my $tn = "vm-$vmid-disk-$i";
            if (!defined ($volumes->{$nexentapool}->{$tn})) {
                $name = $tn;
@@ -248,7 +253,6 @@ sub list_images {
 
             my $volid = "$storeid:$volname";
 
-
             my $owner = $dat->{$volname}->{vmid};
             if ($vollist) {
                 my $found = grep { $_ eq $volid } @$vollist;
@@ -325,7 +329,7 @@ sub volume_snapshot_rollback {
 
     nexenta_request($scfg, 'rollback', 'snapshot', "$scfg->{pool}/$volname\@$snap", '');
     
-    nexenta_create_lu($scfg, $volname);
+    nexenta_import_lu($scfg, $volname);
     
     nexenta_add_lun_mapping_entry($scfg, $volname);
 }