diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 6b5844596..e7d686ea9 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -788,11 +788,7 @@ sub migrate { return (1,"Unable to reach $targ to perform operation of $node, destination unusable."); } if (defined $confdata->{vm}->{$node}->[0]->{storage} and $confdata->{vm}->{$node}->[0]->{storage} =~ /^nfs:/) { - my $urls = $confdata->{vm}->{$node}->[0]->{storage} and $confdata->{vm}->{$node}->[0]->{storage}; - foreach (split /,/,$urls) { - s/=.*//; - get_storage_pool_by_url($_,$desthypconn,$targ); - } + #first, assure master is in place if ($confdata->{vm}->{$node}->[0]->{master}) { my $vmmastertab=xCAT::Table->new('vmmaster',-create=>0); my $masterent; @@ -806,6 +802,11 @@ sub migrate { } } } + my $urls = $confdata->{vm}->{$node}->[0]->{storage} and $confdata->{vm}->{$node}->[0]->{storage}; + foreach (split /,/,$urls) { + s/=.*//; + get_storage_pool_by_url($_,$desthypconn,$targ); + } } my $sock = IO::Socket::INET->new(Proto=>'udp'); my $ipa=inet_aton($node); @@ -895,12 +896,6 @@ sub makedom { if (not $xml and $confdata->{kvmnodedata}->{$node} and $confdata->{kvmnodedata}->{$node}->[0] and $confdata->{kvmnodedata}->{$node}->[0]->{xml}) { #we do this to trigger storage prereq fixup if (defined $confdata->{vm}->{$node}->[0]->{storage} and ($confdata->{vm}->{$node}->[0]->{storage} =~ /^nfs:/ or $confdata->{vm}->{$node}->[0]->{storage} =~ /^dir:/)) { - print "going by urls\n"; - my $urls = $confdata->{vm}->{$node}->[0]->{storage} and $confdata->{vm}->{$node}->[0]->{storage}; - foreach (split /,/,$urls) { - s/=.*//; - get_storage_pool_by_url($_); - } if ($confdata->{vm}->{$node}->[0]->{master}) { my $vmmastertab=xCAT::Table->new('vmmaster',-create=>0); my $masterent; @@ -914,6 +909,11 @@ sub makedom { } } } + my $urls = $confdata->{vm}->{$node}->[0]->{storage} and $confdata->{vm}->{$node}->[0]->{storage}; + foreach (split /,/,$urls) { + s/=.*//; + get_storage_pool_by_url($_); + } } $xml = $confdata->{kvmnodedata}->{$node}->[0]->{xml}; my $newxml = fixbootorder($node,$xml);