From 6f8c25488342b24fac721ecc8c730493bcc9ef98 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 24 Sep 2010 14:24:05 +0000 Subject: [PATCH] -Fix broken clones git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7614 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 0539fc7a3..b56994287 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -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 = "$filename".$sourceinfo{capacity}.""; 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="$filename0$srcfilename"; + my $sourcevol = $hypconn->get_storage_volume_by_path($srcfilename); + my %sourceinfo = %{$sourcevol->get_info()}; + my $newbasexml="$filename".$sourceinfo{capacity}."$srcfilename"; $newvol = $destinationpool->create_volume($newbasexml); $updatetable->{vm}->{$node}->{master}=$mastername; }