3

I have a serious problem here. After I forced a reboot of a freezed ESXi 4.1 server, a VM is literally gone. When I ssh to the host and run ls -lah inside the datastore, it returnes:

/vmfs/volumes/51193143-2de76e36-d365-001b21b87f7c # ls -lah
ls: ./MISSING-VM: No such file or directory
drwxr-xr-t    1 root     root         2.6k Sep  8  2013 .
drwxr-xr-x    1 root     root          512 Apr 30 00:23 ..
-r--------    1 root     root         3.6M Feb 11  2013 .fbb.sf
-r--------    1 root     root        60.2M Feb 11  2013 .fdc.sf
-r--------    1 root     root       243.8M Feb 11  2013 .pbc.sf
-r--------    1 root     root       248.3M Feb 11  2013 .sbc.sf
-r--------    1 root     root         4.0M Feb 11  2013 .vh.sf
drwxr-xr-x    1 root     root          560 Jan  2 13:16 vm1
drwxr-xr-x    1 root     root         1.5k Apr 29 23:07 vm2

In other words: A VM named 'MISSING-VM' has vanished. It seems to be on the disk, because the free space on the disk has not grown. How can I get my VM back?

Edit: Additional information, thanks to those who replied so far:

# echo *
MISSING-VM vm1 vm2 [...]
# ls -ld MISSING-VM
ls: MISSING-VM: No such file or directory
# cd MISSING-VM
-ash: cd: can't cd to MISSING-VM

Edit 2: If I run a command like find, something similar as with ls happens:

~ # find / | grep anything
find: /vmfs/volumes/51193143-2de76e36-d365-001b21b87f7c/MISSING-VM: No such file or directory
HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
Steffen
  • 31
  • 3
  • Have you tried browsing the datastore from the vSphere client to try and locate the VM? – joeqwerty Apr 30 '14 at 01:01
  • Yes, it doesn't appear there, either. The inventory list shows 'Unknown (no access)' instead of the vm name. – Steffen Apr 30 '14 at 01:24
  • 1
    I'd think the frozen ESXi server is an indicator of the deeper problem. Do you know the details of the hardware and storage solution? Did you have a failure of the storage array? – ewwhite Apr 30 '14 at 02:05
  • To clarify: I don't mean just looking at the inventory in the vSphere client, I mean using the datastore browser to try and find the VM folder and files. Did you do that? – joeqwerty Apr 30 '14 at 04:25
  • 1. What says an `echo *` in the same directory? Does this list the MISSING-VM directory? 2. What is the output of an `ls -ld MISSING-VM`? 3. And finally: what happens if you try a `cd MISSING-VM`? – peterh Apr 30 '14 at 07:39
  • @PeterHorvath: Thank you. `echo *` lists the MISSING-VM directory! Output of `ls -ld MISSING-VM` is `ls: MISSING-VM: No such file or directory`. If I try to cd to the MISSING-VM, it says `-ash: cd: can't cd to MISSING-VM` (as it does with a not existing dir). Any further ideas? – Steffen Apr 30 '14 at 16:51
  • @joeqwerty: Yes, I did use the datastore browser where I found the directories of other VMs, but not that of the missing one. – Steffen Apr 30 '14 at 16:54
  • Did you check the filesystem? Does the vmkernel log tell anything strange? – Marki Oct 19 '14 at 14:57

2 Answers2

1

Your vm is still in your datastore but is locked (raw format). Do you have fault tolerance activated ? Put your server on maintenance mode and on tab machine try to move the vm on other esx.

0

This answer about undeleting files might be useful Unix/Linux undelete/recover deleted files if the file is still recoverable.

Matt
  • 2,711
  • 1
  • 13
  • 20