[pve-devel] [PATCH qemu-server 1/3] migrate: check if storage is available

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue May 3 14:14:31 CEST 2016


---
Note: this is modelled after PVE::LXC::Migrate

 PVE/QemuMigrate.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 6c734ca..41fc660 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -158,7 +158,13 @@ sub prepare {
     my $vollist = PVE::QemuServer::get_vm_volumes($conf);
     PVE::Storage::activate_volumes($self->{storecfg}, $vollist);
 
-    # fixme: check if storage is available on both nodes
+    foreach my $volid (@$vollist) {
+	my ($sid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
+
+	# check if storage is available on both nodes
+	my $scfg = PVE::Storage::storage_check_node($self->{storecfg}, $sid);
+	PVE::Storage::storage_check_node($self->{storecfg}, $sid, $self->{node});
+    }
 
     # test ssh connection
     my $cmd = [ @{$self->{rem_ssh}}, '/bin/true' ];
-- 
2.1.4





More information about the pve-devel mailing list