Hi all,
We have an issue where restored VM's get an invalid Port ID in the virtual portgroup. The VM is connected to the network, and at first glance working as expected. But when trying to migrate the VM, we will get an error (vim.fault.notfound)
The solution is to change the port id to a valid one. Usually the invalid Port ID will begin with "c-" so the c dash will indicate we have an invalid Port ID and we need to fix it.
I am trying to create a script to locate VM's with a Port ID starting with "c-" but until now i havent been able to extract the Port ID value with powercli. Maybe someone in here are able to help?
FYI, the restores are donw with CommValut, maybe some of you have experienced the same issue?
Best Regards, Kasper
Yes, I have seen the same with CV restores.
The restored VM tries to connect to the original port, which might have been taken in the mean time (since the backup).
But I'm not sure how the c- prefix fits in there.
Could you perhaps share a screenshot of a VM with the issue, and where this c- prefix is displayed?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Check this KB # 2014469 - VMware Knowledge Base and I believe it will solve the problem
or try this PowerCLI script if it helps to identify VMs which were have error Invalid or inaccessible
Get-View -ViewType VirtualMachine | Where {-not $_.Config.Template} | Where{$_.Runtime.ConnectionState -eq “invalid” -or $_.Runtime.ConnectionState -eq “inaccessible”} | Select Name
Does the following also show the c-prefix?
Use the name of a VM that has the issue.
Get-VM <VM-with-error> |
Get-NetworkAdapter |
Select Name,@{N='PortKey';E={$_.ExtensionData.Backing.Port.PortKey}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That did the trick, thanks LucD.
I have been traversing through almost all other objects in extensiondata with no luck.
Great 🙂
BTW. I have made a request to our backup dept. to investigate if they are able to prevent this when doing restores. I think the issue is that we do not delete the original VM, and this is holding the Port ID, but giving it this invalid ID is not a nice solution.
If anyone is curious, i ended up with this:
get-vm | where {($_ | Get-NetworkAdapter).ExtensionData.backing.port.portkey -like "c-*"} | select Name,PowerState,@{N="Port ID";E={($_ | Get-NetworkAdapter).ExtensionData.backing.port.portkey}}
/Kasper
That would make a nice vCheck plugin :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference