From a0ab377ecb998f0af9772f93fc34c0b338588b1d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 4 May 2016 17:04:25 -0400 Subject: [PATCH] call info() before deleting vm volume --- xCAT-server/lib/xcat/plugins/kvm.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index d3804e4f8..f804bb328 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -1735,7 +1735,7 @@ sub rmvm { if ($currstate eq 'on') { if ($force) { $currxml = $dom->get_xml_description(); - $dom->destroy(); + $dom->shutdown(); } else { xCAT::SvrUtils::sendmsg([ 1, "Cannot rmvm active guest (use -f argument to force)" ], $callback, $node); return; @@ -1753,6 +1753,8 @@ sub rmvm { my $file = $disk->getAttribute("file"); my $vol = $hypconn->get_storage_volume_by_path($file); if ($vol) { + # Need to call get_info() before deleting a volume, without that, delete() will fail. Issue #455 + $vol->get_info(); $vol->delete(); } }