VMware Cloud Community
stephenbirrell
Contributor
Contributor

Unknown (Invalid) VMs

Hi there,

Our ESXi server had an ungraceful restart and as a result when now I open vSphere it looks like this:

Screenshot1.PNG

I've read that to get them back all I need to do is right click on the relevant .vmx file in the datastore and select Add to Inventory, however that option is greyed out.

I'm really struggling here, as I'm new to this and not sure what to do.

Many thanks in advance.

Stephen

0 Kudos
17 Replies
Lee_Sargeant
Enthusiast
Enthusiast

Hi Stephen,

Usually a restart of the management agents will cause these to reappear as the correct guest names.  You can do this directly on the host if you log in via the F2 prompt or you can also do it by connecting to the host via SSH and running "service mgmt-vmware restart" and then "service vmware-vpxa restart".  This will not stop any running guests.  http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100349...

Hope this helps,

Lee

0 Kudos
aravinds3107
Virtuoso
Virtuoso

Is the VM are still running?

First remove the invalid VM's from inventory -> Right Click on Invalid VM -> Click  Remove from inventory

Then browse the datstore and try to add it datastore by right clicking VMX file

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
0 Kudos
stephenbirrell
Contributor
Contributor

Sorry, that doesn't work. The option to add them is greyed-out.

0 Kudos
iw123
Commander
Commander

Have you restarted the vcenter server service? If that doesnt work have a look at this Kb:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100374...

Thanks

*Please, don't forget the awarding points for "helpful" and/or "correct" answers
0 Kudos
stephenbirrell
Contributor
Contributor

Update: vSphere is becoming unresponsive. When I try to browse the datastore I get this:

Screenshot2.PNG

And if I try to SSH in it times out, even though I have the service running.

0 Kudos
stephenbirrell
Contributor
Contributor

When I log in after pressing F2, the screen just seems to hang there. The keyboard etc is still responsive though...

0 Kudos
Gkeerthy
Expert
Expert

if you are able to log the local shell, then do a rescan of hba and VMFS

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100398...

Command to use is

esxcfg-rescan --all

To search for new VMFS datastores, run this command:

vmkfstools -V

Note: This command does not generate any output.

If a new datastore has been detected, it is mounted in /vmfs/volumes/ using its friendly name (if it has one) or its UUID

Still if not worked, reboot and try the same

Please don't forget to award point for 'Correct' or 'Helpful', if you found the comment useful. (vExpert, VCP-Cloud. VCAP5-DCD, VCP4, VCP5, MCSE, MCITP)
0 Kudos
stephenbirrell
Contributor
Contributor

When I run the command to list the VMs I get this:

Screenshot3.PNG

Not good I'd contend.

0 Kudos
Lee_Sargeant
Enthusiast
Enthusiast

Can you try enabling Local Tech Support mode and then running the management restart commands from there?  You can enable Local Tech Support via the vSphere client under Configuration - Security profile or by running vim-cmd hostsvc/start_esx_shell from the cli.  Once enabled press Alt-F1 locally to switch to it and log in as your root user.

Cheers,

Lee

0 Kudos
heygokul
Contributor
Contributor

Hi,

Have you tried removing the virtual machines after rebooting the ESX host?

0 Kudos
stephenbirrell
Contributor
Contributor

I'm now able to get in and stay in as I rebooted the server and then set the its IP settings manually as when I left it to DHCP it worked for a short time beofre coming unresponsive.

I'm now in the SSH console and after I press ALT-F1 I get this

Screenshot5.PNG

Am I missing something?

0 Kudos
Lee_Sargeant
Enthusiast
Enthusiast

Sorry, the Alt-F1 needs to be done locally on the machine, not via SSH.  If the server is more responsive now it may be worth seeing if the F2 now works.  Having said that rebooting the server will have restarted the agents anyway so chances are this is not going to help.

0 Kudos
stephenbirrell
Contributor
Contributor

Do you mean remove their instances from vSphere?

0 Kudos
stephenbirrell
Contributor
Contributor

I got these error messages from vSphere when I tried to look at another tab while I had one of the invalid VMs selected.

Do these mean anything to you guys that might help me solve this?

0 Kudos
stephenbirrell
Contributor
Contributor

Hi again guys,

OK I *think* I've located the problem. The only trouble is I have no idea how to fix it.

When I run the vmkfstools -D command on vmx files located in the datastore it returns the owner as being 50069512-78ce6ec4-0c9b-001b21c130a4

Whereas in the datastore path shows the following :

/vmfs/volumes/datastore1/4ea2bf00-f6408240-43be-782bcb5aaed1\<PATH TO FILE>

Which if I'm correct would indicate that someone else owns the file.

Is there any way to change it or indeed to release the locks on the files in the datastore?

0 Kudos
Gkeerthy
Expert
Expert

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100385...

have you tried the above link

Please don't forget to award point for 'Correct' or 'Helpful', if you found the comment useful. (vExpert, VCP-Cloud. VCAP5-DCD, VCP4, VCP5, MCSE, MCITP)
0 Kudos
stephenbirrell
Contributor
Contributor

I've tried both and still no luck.

Even trying to just touch the vmx returns an Invalid Argument.

There must be a way of either unlocking the file or changing the UUID to that which it says is the owner.

0 Kudos