2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 01:56:39 +00:00

Merge pull request #1039 from gurevichmark/rmvm_volume_error

call info() before deleting vm volume
This commit is contained in:
Victor Hu 2016-05-04 19:48:45 -04:00
commit 1284ad5447

View File

@ -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();
}
}