mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-09 11:29:43 +00:00
live storage migration : fix check of target storage availability
if we define a different target storeid for remote node,
and that storage is not available on source node
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
(cherry picked from commit d80ad67f9d
)
This commit is contained in:
parent
59c2b3a8ca
commit
08f918daab
@ -2827,7 +2827,12 @@ __PACKAGE__->register_method({
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $storecfg = PVE::Storage::config();
|
my $storecfg = PVE::Storage::config();
|
||||||
|
|
||||||
|
if( $param->{targetstorage}) {
|
||||||
|
PVE::Storage::storage_check_node($storecfg, $param->{targetstorage}, $target);
|
||||||
|
} else {
|
||||||
PVE::QemuServer::check_storage_availability($storecfg, $conf, $target);
|
PVE::QemuServer::check_storage_availability($storecfg, $conf, $target);
|
||||||
|
}
|
||||||
|
|
||||||
if (PVE::HA::Config::vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {
|
if (PVE::HA::Config::vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {
|
||||||
|
|
||||||
|
@ -255,8 +255,10 @@ sub sync_disks {
|
|||||||
|
|
||||||
next if @{$dl->{$storeid}} == 0;
|
next if @{$dl->{$storeid}} == 0;
|
||||||
|
|
||||||
|
my $targetsid = $self->{opts}->{targetstorage} ? $self->{opts}->{targetstorage} : $storeid;
|
||||||
|
|
||||||
# check if storage is available on target node
|
# check if storage is available on target node
|
||||||
PVE::Storage::storage_check_node($self->{storecfg}, $storeid, $self->{node});
|
PVE::Storage::storage_check_node($self->{storecfg}, $targetsid, $self->{node});
|
||||||
$sharedvm = 0; # there is a non-shared disk
|
$sharedvm = 0; # there is a non-shared disk
|
||||||
|
|
||||||
PVE::Storage::foreach_volid($dl, sub {
|
PVE::Storage::foreach_volid($dl, sub {
|
||||||
@ -293,7 +295,7 @@ sub sync_disks {
|
|||||||
my $targetsid = $self->{opts}->{targetstorage} ? $self->{opts}->{targetstorage} : $sid;
|
my $targetsid = $self->{opts}->{targetstorage} ? $self->{opts}->{targetstorage} : $sid;
|
||||||
# check if storage is available on both nodes
|
# check if storage is available on both nodes
|
||||||
my $scfg = PVE::Storage::storage_check_node($self->{storecfg}, $sid);
|
my $scfg = PVE::Storage::storage_check_node($self->{storecfg}, $sid);
|
||||||
PVE::Storage::storage_check_node($self->{storecfg}, $sid, $self->{node});
|
PVE::Storage::storage_check_node($self->{storecfg}, $targetsid, $self->{node});
|
||||||
|
|
||||||
return if $scfg->{shared};
|
return if $scfg->{shared};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user