Fixed issue where deleting a virtual machine also deletes the assigned switch
This can cause issues if more than 1 VM are assigned to the same virtual switch
This commit is contained in:
parent
732adfd8cf
commit
14b28939bb
1 changed files with 4 additions and 2 deletions
|
@ -509,8 +509,10 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
{
|
||||
NetworkAdapterHelper.Delete(PowerShell, vm.Name, networkAdapter);
|
||||
|
||||
if (!string.IsNullOrEmpty(networkAdapter.SwitchName))
|
||||
DeleteSwitch(networkAdapter.SwitchName);
|
||||
// If more than 1 VM are assigned to the same switch, deleting the virtual machine also deletes the switch which takes other VM instances off line
|
||||
// There may be a reason for this that I am not aware of?
|
||||
//if (!string.IsNullOrEmpty(networkAdapter.SwitchName))
|
||||
//DeleteSwitch(networkAdapter.SwitchName);
|
||||
}
|
||||
|
||||
Command cmdSet = new Command("Remove-VM");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue