Restore a VM if it's still in datastore? Issue after restarting host to fix Removing Snapshot issue.

I'm on esxi 5.5, vSphere 6.5. Something happened where a VM got stuck removing snapshot after a Veeam backup and been running for over 72 hours. We saw no file size changes on files in the VM folder on the host so we restarted management agent on the host.
After the host rebooted, this VM became invalid/inaccessible (it alternates between those two states continuously).
I removed it from Inventory and am not sure how to add it back. When I browse to the datastore and try to right-click the vmx file, the only options I see are Download, delete, copy, move, rename...
garryshapeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
VMX file is corrupted, you will need to re-create.

This actually simpler than it sounds, just create a new VM (vmx configuration), following the wizard, and then select Add existing Virtual Hard Disk.

try and remember what hardware was present in existing VM, e.g. CPU, Memory, NICs, etc

OR Restore from backup, just the VMX file.

You have the OS/Data in the VMDKs, which may or may not be corrupted, and requires so additional effort to get correct, if snapshots are still hanging around.

VMs with snapshots, never a good idea to restart agents, restart host - basically mess around, hoping something good is going to come through.....
0
garryshapeAuthor Commented:
Am I supposed to see more options than that upon right-clicking?  
Because all of my other VMs are running fine yet I don’t see any options to Import when right clicking their VMX files.  
Is it maybe a permission issue? I’ve tried local Admin and another Admin.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
If you right click a VMX file you should see Add to Inventory.

But if you look closely at the datastore, does it show it as a VMX file, if not it's corrupted or it could be in use and locked.

Screenshot please.
0
garryshapeAuthor Commented:
Ok yeah I think it’s locked then. I can’t copy the VMWare.log file either says it’s locked. Sorry don’t have screenshot now but can take in a few.
I’m not sure how it’d be locked after restarting services
0
garryshapeAuthor Commented:
Here is a screenshot  
And the VM is currently not in Inventory.
219B617E-F5B5-49E2-B282-92128BF8552B.png
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
the fact that it has no icon associated with it, looks like a corrupt VMX file, compare with a good VMX file, and you should see an ICON.

The icon should be three overlapping little blue squares!

vSphere/ESXi does not recognise it as a configuration (VMX) file to Register with Inventory.

It's corrupt.
0
garryshapeAuthor Commented:
Could it be not-corrupt but also "locked" somehow thus not revealing the "Register VM" menu item?
Because when I also try and copy the "vmware.log" that is residing in this same directory as the .vmx to another folder, I get "Unable to access file [Datastore] VMname/vmware.log"
0
garryshapeAuthor Commented:
There's a .lck file in the directory as well
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Anything is possible, if that is the case you will need to search and try and find what is locking it.

Quickest solution is to restart host!

Veeam is still not trying to back it up! or have the parent virtual disk connected to the Veeam VM ?
0
garryshapeAuthor Commented:
Yeah something has it locked I couldn’t reboot host it was taking forever to go to maintenance mode.  
I created a new VM and added existing disks and got it backup. Not sure if that will create conflict again however
.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
It will not cause any conflicts.
0
garryshapeAuthor Commented:
Ok thanks. I'll at least try maintenance mode on the host next later tonight.
Problem last night is it was getting to 17%, 18%, then 19% and stopped for abotu 30 mins. Not sure why. I cancelled it
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
what was getting to 17% etc ?
0
garryshapeAuthor Commented:
The Host's status of Entering Maintenance Mode
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
something is running on the host which is stopping it entering maintenance mode, like a VM running.... (ghost VM)
0
garryshapeAuthor Commented:
So if I reboot the host, it should automatically migrate off the VM's (like in maintenance mode) but still continue to reboot even if a ghost VM is running?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
You will need to move the VMs (migrate manually).

but it may still not go into maintenance mode, if it thinks something is running...

and you'll just have to power off or reboot the host.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Veeam

From novice to tech pro — start learning today.