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; }