Fix – Invalid Configuration for device ‘0’
You have a VM that is part of a port group on a distributed switch, however the network adapter is disconnected. When attempting to enable the network adapter for the VM by ticking Connected in Edit Settings, it fails and you get the error message of: Invalid Configuration for device '0'
.
I had the same problem and here is how I fixed it…
Scenario
First let me explain the situation I was in.
A few days ago, my Synology DS1813+ NAS decided to stop presenting iSCSI paths to both my hosts in my test lab and hence all of my VMs were not accessible and both hosts had no datastores available.
Having narrowed down the issue to the NAS, I deleted the existing iSCSI targets from the Synology NAS and re-created them in an attempt to resolve the issue. I then rescanned for datastores on both hosts and found that only one of my hosts could see the storage and not the other.
Assuming it was a host issue, I decided to delete the entire iSCSI configuration from the host and reconfigure it from scratch. The only thing was my port group used on my iSCSI software adapter was a distributed switch (vDS) port group and hence requiring vCenter Server to be operational before I could reconnect the vDS port group to the iSCSI software adapter.
To get vCenter Server running again, I needed to remove it (and a few other VMs) from the broken host and then add to inventory on the working host. I then powered them up and thought I was ready to roll.
I soon discovered that none of the VMs I manually migrated had network connection because their virtual NICs were not connected.
Now when attempting to connect the network adapter on each VM (Edit Settings on VM >> Network Adapter >> tick Connected), they all failed with the error of: Invalid Configuration for device '0'
.
Here is what the error looks like:
Solution
Ok now that you have heard my story, here is how I fixed it:
- On the host running the VMs, enable SSH
- Host Configuration tab
- Software >> Security Profile
- Services Properties
- SSH >> Options
- Click Start
-
SSH into the ESXi host
-
Get the VMID for the virtual machine that has the issue. To do this, run the following command, replacing
VMNAME
with the name of the VM that has the issue:vim-cmd vmsvc/getallvms | grep -i VMNAME
-
The result returned will be something like this:
WP-CTXDC-V01 [LUN-T1–01] WP-CTXDC-V01/WP-CTXDC-V01.vmx windows8Server64Guest vmx–10
Note: In this instance, the VMID of WP-CTXDC-V01 would be 9.
-
Next we need to reload the configuration of the VM on the host by running the following command and replacing
VMID
with the VMID of the affected VM (e.g. in my example this would be 9):vim-cmd vmsvc/reload VMID
-
Now connect the NIC on the virtual machine (VM >> Edit Settings >> Network Adapter >> tick Connected)
-
At this point, your network adapter should have connected successfully and your VM now has network access again
- Disable SSH on the ESXi host
- Host Configuration tab
- Software >> Security Profile
- Services Properties
- SSH >> Options
- Click Stop
Another reason for this error
Based on my research during the troubleshooting of this issue, you can also run into this same error when you perform a Storage vMotion on a virtual machine and it fails.
After the storage migration fails you cannot access the network from the VM and you discover that the NIC is not connected. When attempting to connect the network adapter on the VM of a failed Storage vMotion you receive the error: Invalid Configuration for device '0'
.
Alternative Solutions
The solution documented above is the way I decided to resolve the error message, however there are a few alternative options.
If you don’t like to get your hands dirty via SSH or want to use one of the other options, then have a look at VMware KB2014469.
If you have any comments or questions then let me know below.
Thanks
Luca
i just migrate to another host and the issue was fixed
Thanks man, it worked.
Thank you! This fix the issue with VCSA 6. NIC was not connected after ESXi host reboot.
Another cause can be that the MAC address on that vNIC is blank. In that case, once you set or generate the MAC address, the error goes away.
Luca – thank you, sir! Resolved the same issue with your help.
Thanx alot Dexter , i transfer to other host and it solve my issue .
Thnaks again
The output of the command does not show me what the VMID is. I don’t understand how you get a VMID of 9 from the output. The number 9 is nowhere to be found.
WP-CTXDC-V01 [LUN-T1–01] WP-CTXDC-V01/WP-CTXDC-V01.vmx windows8Server64Guest vmx–10
Migrating to a new host did not work for me. The SSH commands didn’t work either. I found that simply moving the NIC to a different port group, hit apply. Then, move it back resolved my issue.
Another quick-fix from https://kb.vmware.com/s/article/77134:
“Select a different network portgroup, reconnect NIC (on that different network portgroup), then change back to original network portgroup.”