Unable to manage a vm's nic being enabled or disabled from the GUI interface from host or vCenter
Use the following commands on the Node to determine if the network adapter is not connected and re-connect if needed.
vim-cmd vmsvc/getallvms
Sample output
Vmid Name File Guest OS Version Annotation
541 test-windows test-windows/test-windows.vmx windows8Server64Guest vmx-11
vim-cmd vmsvc/device.getdevices 541
Sample output
connectable = (vim.vm.device.VirtualDevice.ConnectInfo)
dynamicType = <unset>,
startConnected = true,
allowGuestControl = true,
connected = false, <-----
status = "ok",
(vim.vm.device.VirtualVmxnet3) {
dynamicType = <unset>,
key = 8235,
deviceInfo = (vim.Description) {
dynamicType = <unset>,
label = "Network adapter 1",
summary = "VM Network",
vim-cmd vmsvc/device.connection <Vmid from Step # 2> <DEVICEID = Key from Step # 4> <1 for enable / 0 for disable>
Sample
Enable the network:
vim-cmd vmsvc/device.connection 541 8235 1
Disable the network:
vim-cmd vmsvc/device.connection 541 8235 0