-Fix broken clones

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7614 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2010-09-24 14:24:05 +00:00
parent c9933c75e8
commit 6f8c254883

View File

@ -1718,7 +1718,7 @@ sub clone_vm_from_master {
my $format=$1;
my $newvol;
if ($detach) {
my $sourcevol = $hypconn->get_volume_by_path($srcfilename);
my $sourcevol = $hypconn->get_storage_volume_by_path($srcfilename);
my %sourceinfo = %{$sourcevol->get_info()};
my $targxml = "<volume><name>$filename</name><target><format type='$format'/></target><capacity>".$sourceinfo{capacity}."</capacity></volume>";
xCAT::SvrUtils::sendmsg("Cloning ".$sourcevol->get_name()." (currently is ".($sourceinfo{allocation}/1048576)." MB and has a capacity of ".($sourceinfo{capacity}/1048576)."MB)",$callback,$node);
@ -1726,7 +1726,9 @@ sub clone_vm_from_master {
$newvol =$destinationpool->clone_volume($targxml,$sourcevol);
};
} else {
my $newbasexml="<volume><name>$filename</name><target><format type='$format'/></target><capacity>0</capacity><backingStore><path>$srcfilename</path><format type='$format'/></backingStore></volume>";
my $sourcevol = $hypconn->get_storage_volume_by_path($srcfilename);
my %sourceinfo = %{$sourcevol->get_info()};
my $newbasexml="<volume><name>$filename</name><target><format type='$format'/></target><capacity>".$sourceinfo{capacity}."</capacity><backingStore><path>$srcfilename</path><format type='$format'/></backingStore></volume>";
$newvol = $destinationpool->create_volume($newbasexml);
$updatetable->{vm}->{$node}->{master}=$mastername;
}