5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-01-10 01:18:05 +03:00

nexenta: use import_lu on rollback

To avoid generation of new GUID.
This commit is contained in:
Dietmar Maurer 2012-09-19 08:16:58 +02:00
parent ac4329f3d8
commit 8914a711eb

View 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);
}