Error Deleting Logical Switch from System Center Virtual Machine Manager 2012R2 (SCVMM2012R2)

I recently encountered an error trying to remove a Logical Switch in SCVMM2012R2 . The SCVMM2012R2 error prompt was that the Switch still had a dependency and I had to remove the dependency before successfully removing the switch. I checked the Logical Switch dependency and it showed the switch to be attached to one of the hyper-v cluster hosts.

I double clicked on the host- properties- hardware, scrolled down to the physical adapters and unchecked all logical network selections.Still in host properties, I navigated to the Virtual switch tab and deleted the logical switch assigned to the host adapter.


I clicked ok, refreshed the host and tried to delete the Switch from the Fabric work space but still got the same error prompt stating that I could not delete the switch because of a dependency.
I started and stopped maintenance mode for the host and refreshed again, but still could not delete the logical switch . I checked the host properties again and confirmed there was no logical switch assignments on the host, but still could not remove the logical switch.
The View Dependency button showed the logical switch was still somehow assigned to the hyper-v host, but I couldn’t find any logical switch and Host mapping by looking at the GUI.I even removed the uplink port profile mapping to the switch, but still no success.
At this point ,after some research, I turned to PowerShell and found the Get-SCVMHostNetworkAdapter cmdlet. Running the cmdlet, gave me a list of all SCVMM hosts’ in the cluster, their adapters and corresponding switch and uplink port profile assignments and settings among other properties. The cmdlet query result showed that the uplink port profile which is a property of the logical switch, was still attached to the host:


I ran the cmdlet again, this time on the specific host, filtered by the uplink port profile value not equal to null: Get-SCVMHostNetworkAdapter -VMHost Lab00| ?{$_.UplinkPortProfileSet -ne $null} and piping the result to the Set-SCVMHostNetworkAdapter . The full one line script is: Get-SCVMHostNetworkAdapter -VMHost Lab00| ?{$_.UplinkPortProfileSet -ne $null}| Set-SCVMHostNetworkAdapter -RemoveUplinkPortProfileSet -Verbose , to remove the uplink port profile set which was the primary culprit. It is also indicated in the following screen shot:


At this point, I was immediately able to delete both the logical switch and uplink port profile using the GUI and continue the tedious job of configuring SCVMM2012 R2 .

This entry was posted in SCVMM2012R2, System Center 2012 R2, VMM2012R2 and tagged , , , , , , , . Bookmark the permalink.

2 Responses to Error Deleting Logical Switch from System Center Virtual Machine Manager 2012R2 (SCVMM2012R2)

  1. iskari says:

    Set-SCVMHostNetworkAdapter -VMHost lvhncvs01| ?{$_.UplinkPortProfileSet -ne $null}| Set-SCVMHostNetworkAdapter -RemoveUplinkPortProfileSet -Verbose

    this needs to be “GET-SCVMHOSTNETWORKADAPTER” not Set

  2. jbernec says:

    Hey Iskari, thank you much for taking the time to review my post and catch the error. I see it was a typo because in the screen shot, I use the Get-SCVMHostNetworkAdapter -VMHost lab00| ?{$_.UplinkPortProfileSet -ne $null} and piped the result to the Set-SCVMHostNetworkAdapter -RemoveUplinkPortProfileSet -Verbose to remove the object. I have corrected it. Thank you again. I appreciate. I’ll be interested to read your posts if you write. Have a great day.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s