Removing phantom vmk nics from Cisco 1000V DVS switches

It’s not possible to use the esxcfg-vmknic command with the “-d” option with Cisco Switches.

The easiest way I found was to edit the /etc/vmware/esx.conf file and then reread:

Before:

~ # esxcfg-vmknic -l
Interface  Port Group/DVPort   IP Family IP Address                              Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type
vmk3       366                 IPv4      192.168.230.15                          255.255.254.0   192.168.231.255 00:50:56:7f:56:02 1500    65535     true    STATIC
vmk2       378                 IPv4      192.168.226.15                          255.255.255.0   192.168.226.255 00:50:56:79:68:c6 1500    65535     true    STATIC
vmk1       306                 IPv4      10.47.40.16                             255.255.255.0   10.47.40.255    00:00:c9:c8:64:68 1500    65535     true    STATIC
vmk0       304                 IPv4      10.47.40.15                             255.255.255.0   10.47.40.255    00:50:56:77:75:e8 0       0         false   STATIC

~ # vi /etc/vmware/esx.conf
change:
/adv/Net/ManagementIface = "vmk0"
/adv/Migrate/Vmknic = "vmk1"
/adv/FT/Vmknic = "vmk2"

change the index to go, 0000, 0001, 0002, etc for vmkN:
eg vmk0:
/net/vmkernelnic/child[0000]/connectionId = "1961091145"
/net/vmkernelnic/child[0000]/dhcp = "false"
/net/vmkernelnic/child[0000]/dhcpDns = "false"
/net/vmkernelnic/child[0000]/dhcpv6 = "false"
/net/vmkernelnic/child[0000]/dvpId = "306"
/net/vmkernelnic/child[0000]/dvsId = "de 0b 2e 50 7a 5e 86 3d-91 44 25 e5 34 f3
/net/vmkernelnic/child[0000]/enable = "true"
/net/vmkernelnic/child[0000]/ipv4address = "10.47.40.16"
/net/vmkernelnic/child[0000]/ipv4broadcast = "10.47.40.255"
/net/vmkernelnic/child[0000]/ipv4netmask = "255.255.255.0"
/net/vmkernelnic/child[0000]/mac = "00:00:c9:c8:64:68"
/net/vmkernelnic/child[0000]/macFromPnic = "vmnic4"
/net/vmkernelnic/child[0000]/mtu = "1500"
/net/vmkernelnic/child[0000]/name = "vmk0"
/net/vmkernelnic/child[0000]/routAdv = "false"
/net/vmkernelnic/child[0000]/tsoMss = "0"
/net/vmkernelnic/child[0001]/connectionId = "976695119"
/net/vmkernelnic/child[0001]/dhcp = "false"

After:

~ # esxcfg-vmknic -r
[2012-08-08 04:09:50 'NotifyDCUI' warning] Notifying the DCUI of configuration change
[2012-08-08 04:09:50 'NotifyDCUI' warning] Notifying the DCUI of configuration change
[2012-08-08 04:09:50 'IpSecConfig' warning] Ipv6 not Enabled

~ # esxcfg-vmknic -l
Interface  Port Group/DVPort   IP Family IP Address                              Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type
vmk0       306                 IPv4      10.47.40.16                             255.255.255.0   10.47.40.255    00:00:c9:c8:64:68 1500    65535     true    STATIC
vmk1       378                 IPv4      192.168.226.15                          255.255.255.0   192.168.226.255 00:50:56:79:68:c6 1500    65535     true    STATIC
vmk2       366                 IPv4      192.168.230.15                          255.255.254.0   192.168.231.255 00:50:56:7f:56:02 1500    65535     true    STATIC


Advertisements

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

%d bloggers like this: