2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 20:30:56 +00:00

Handle purging block or raw VM disks when removing a VM

This commit is contained in:
Mark Gurevich
2017-03-10 14:33:55 -05:00
parent 5ce172a932
commit e265d5401d

View File

@ -1775,6 +1775,14 @@ sub rmvm {
foreach $disk (@purgedisks) {
my $disktype = $disk->parentNode()->getAttribute("device");
if ($disktype eq "cdrom") { next; }
my @driver = $disk->parentNode()->findnodes("driver");
my $drivertype = $driver[0]->getAttribute("type");
if (($drivertype eq "raw") || ($disktype eq "block")) {
#For raw or block devices, do not remove, even if purge was specified. Log info message.
xCAT::MsgUtils->trace(0, "i", "Not purging raw or block storage device: $disk");
next;
}
my $file = $disk->getAttribute("file");
# try to check the existence first, if cannot find, do nothing.