Remove Orphaned Nexus 1000v DVS from vCenter

While deploying the Nexus 1000v DVS in one of my environments I ran into an issue where I had to create a new standby VSM. To do so I built a new standalone VSM, which connected to vCenter and had a switch name of dvs-test. I converted the standalone VSM to an HA-secondary VSM in the same domain ID as the primary and was good to go, or at least I thought I was.

While I had successfully deployed a new secondary VSM and had it operating in the HA pair, I still had this dvs-test DVS in my vCenter inventory, and I couldn’t get rid of it. A quick google search brought me to an article written back in 2010 by Frank Denneman, which you can find here, but I wanted to document the process in a more granular way. Below is the process I used, with steps to deploying a new temporary VSM and screenshots for the folks that don’t like to read. Thanks to Frank for laying out the basic on his blog.

For the example below we are removing an orphaned 1000v DVS with a name of dvs-test

Deploy a temporary VSM

  • Launch the vSphere client and login
  • Deploy an OVF template and browse to the location where you have the VSM install. If you have the VSM folder it should be located at:
    • Nexus1000v…\VSM\Install\nexus-1000v.4.2.1.SV2.1.1a –File name may be different depending on version
  • Choose the Nexus 1000V Secondary option

clip_image002

  • Choose a network location for the control, management and packet networks. You can use the same network since this is temporary
  • Enter in a domain ID — If you already have a 1000v installed choose a different domain ID
  • Enter in a password and set the IP/Subnet Mask and default gateway
  • Once the OVF has been deployed power on the VM
  • Once it is booted up, login and enter the following commands:
[sourcecode language=”powershell” padlinenumbers=”true”] conf t
hostname dvs-test <— This is the name of the orphaned switch you are trying to remove
interface mgmt0
ip address <ip address>/<prefix>
vrf context management
ip route 0.0.0.0/0 <ip for gateway>
copy run start

[/sourcecode]
  • Close the console and SSH into the VSM

Remove Orphaned 1000v

  • Get the VC extension ID for the orphaned DVS by doing the following:
  • Log in to the vSphere client and navigate to the networking view (View > Inventory > Networking)
    • Find the dvs-test switch and select it from the inventory tree
    • Find the extenstion ID for the switch by looking at the Annotations pane

clip_image004

    • Copy the ID to notepad or some other place
  • Go back to the SSH session of the VSM and type the following commands:
[sourcecode language=”powershell”] conf t
vmware vc extension-key <extension-id> — this is what you copied earlier
copy run start

#Example
vmware vc extension-key Cisco_Nexus_1000V_319338687
[/sourcecode]

 

 

 

  • Go and delete the extension-key from the MOB
    • Open a web browser and navigate to

                             https://<VC IP>/mob/?moid=ExtensionManager

    • Find extension labeled Cisco_Nexus_1000v_<extenstion id> and copy it

clip_image006

    • Under Methods, click the UnregisterExtension hyperlink

clip_image008

    • Paste in the extension-key you copied in the previous step and click the Invoke Method hyperlink. It should return a result of void

clip_image010

  • Open a web browser and navigate to the IP of the temporary VSM
  • Right-click the cisco_nexus_1000v_extension.xml hyperlink and save it somewhere on your machine

clip_image012

  • Launch the vSphere client and login
  • Click the Plug-ins menu and select Manage Plug-ins…

clip_image014

  • Right-click anywhere in the Plug-in Manager window where there is white space and click New Plug-in…

clip_image016

  • Browse and open the XML file you just downloaded and click the Regsiter Plug-in button

clip_image018

  • If you get a certificate warning click Ignore
  • Click OK to the success messageand close the Plug-in Manager
  • Go back to the console and type in the following commands
[sourcecode language=”powershell”] conf t
svs connection vcenter
remote ip address <ip of vcenter>
protocol vmware-vum
vmware dvs datacenter-name <datacenter name>
connect
no vmware dvs
[/sourcecode]
  • Press enter to confirm (default choice is yes)

clip_image020

You will also see the “dvs-test” switch being deleted from vCenter from within the vSphere client, specifically in the Recent Tasks pane

 

clip_image022

  • Now you can power off and delete the temporary VSM
  • Go back into the extension manager (like you did earlier) and remove the extension you added for the temporary VSM

Comments 2

Leave a Reply to zox Cancel reply

Your email address will not be published. Required fields are marked *

*