From 149e7eeae6e95e8c4c5dfdd93e09f54d9e4363b8 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 31 Aug 2010 15:01:24 +0000 Subject: [PATCH] -Chase down master storage prereqs git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7321 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/VMCommon.pm | 2 +- xCAT-server/lib/xcat/plugins/kvm.pm | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/VMCommon.pm b/perl-xCAT/xCAT/VMCommon.pm index 40fa4fcd7..a7f99ba43 100644 --- a/perl-xCAT/xCAT/VMCommon.pm +++ b/perl-xCAT/xCAT/VMCommon.pm @@ -26,7 +26,7 @@ sub grab_table_data{ #grab table data relevent to VM guest nodes if ($vpdtab) { $cfghash->{vpd} = $vpdtab->getNodesAttribs($noderange,['uuid']); } - $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','storagemodel','memory','cpus','nics','nicmodel','bootorder','virtflags']); + $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','storagemodel','memory','cpus','nics','nicmodel','bootorder','virtflags','master']); my $mactab = xCAT::Table->new("mac",-create=>1); my $nrtab= xCAT::Table->new("noderes",-create=>1); $cfghash->{mac} = $mactab->getAllNodeAttribs(['mac'],1); diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 739a7a4e3..b10009545 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -750,7 +750,19 @@ sub migrate { s/=.*//; get_storage_pool_by_url($_,$desthypconn,$targ); } - #TODO: VMCLONE if vm.master is set, got to vmmaster.storage for that master and add it to prereq resolution here + if ($confdata->{vm}->{$node}->[0]->{master}) { + my $vmmastertab=xCAT::Table->new('vmmaster',-create=>0); + my $masterent; + if ($vmmastertab) { + $masterent=$vmmastertab->getAttribs({name=>$confdata->{vm}->{$node}->[0]->{master}},['storage']); + } + if ($masterent and $masterent->{storage}) { + foreach (split /,/,$masterent->{storage}) { + s/=.*//; + get_storage_pool_by_url($_,$desthypconn,$targ); + } + } + } } my $sock = IO::Socket::INET->new(Proto=>'udp'); my $ipa=inet_aton($node); @@ -845,7 +857,19 @@ sub makedom { s/=.*//; get_storage_pool_by_url($_); } - #TODO: VMCLONE if vm.master is set, got to vmmaster.storage for that master and add it to prereq resolution here + if ($confdata->{vm}->{$node}->[0]->{master}) { + my $vmmastertab=xCAT::Table->new('vmmaster',-create=>0); + my $masterent; + if ($vmmastertab) { + $masterent=$vmmastertab->getAttribs({name=>$confdata->{vm}->{$node}->[0]->{master}},['storage']); + } + if ($masterent and $masterent->{storage}) { + foreach (split /,/,$masterent->{storage}) { + s/=.*//; + get_storage_pool_by_url($_); + } + } + } } $xml = $confdata->{kvmnodedata}->{$node}->[0]->{xml}; my $newxml = fixbootorder($node,$xml);