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.

vmm00

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:

vmm01

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} . I piped the result to the Set-SCVMHostNetworkAdapter -VMHost Lab00| ?{$_.UplinkPortProfileSet -ne $null}| Set-SCVMHostNetworkAdapter -RemoveUplinkPortProfileSet -Verbose , to remove the uplink port profile set which was the primary culprit:

vmm02

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 .

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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s