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:
parent
ac4329f3d8
commit
8914a711eb
@ -70,6 +70,12 @@ sub nexenta_create_lu {
|
|||||||
nexenta_request($scfg, 'create_lu', 'scsidisk', "$scfg->{pool}/$zvol", {});
|
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 {
|
sub nexenta_create_zvol {
|
||||||
my ($scfg, $zvol, $size) = @_;
|
my ($scfg, $zvol, $size) = @_;
|
||||||
|
|
||||||
@ -196,7 +202,7 @@ sub alloc_image {
|
|||||||
die "unsupported format '$fmt'" if $fmt ne 'raw';
|
die "unsupported format '$fmt'" if $fmt ne 'raw';
|
||||||
|
|
||||||
die "illegal name '$name' - sould be 'vm-$vmid-*'\n"
|
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'};
|
my $nexentapool = $scfg->{'pool'};
|
||||||
|
|
||||||
@ -205,7 +211,6 @@ sub alloc_image {
|
|||||||
die "unable de get zvol list" if !$volumes;
|
die "unable de get zvol list" if !$volumes;
|
||||||
|
|
||||||
for (my $i = 1; $i < 100; $i++) {
|
for (my $i = 1; $i < 100; $i++) {
|
||||||
|
|
||||||
my $tn = "vm-$vmid-disk-$i";
|
my $tn = "vm-$vmid-disk-$i";
|
||||||
if (!defined ($volumes->{$nexentapool}->{$tn})) {
|
if (!defined ($volumes->{$nexentapool}->{$tn})) {
|
||||||
$name = $tn;
|
$name = $tn;
|
||||||
@ -248,7 +253,6 @@ sub list_images {
|
|||||||
|
|
||||||
my $volid = "$storeid:$volname";
|
my $volid = "$storeid:$volname";
|
||||||
|
|
||||||
|
|
||||||
my $owner = $dat->{$volname}->{vmid};
|
my $owner = $dat->{$volname}->{vmid};
|
||||||
if ($vollist) {
|
if ($vollist) {
|
||||||
my $found = grep { $_ eq $volid } @$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_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);
|
nexenta_add_lun_mapping_entry($scfg, $volname);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user