We had a client who had a snapshot on one of their virtual machines. The snapshot grew and grew and finally the datastore it was on ran out of space. The end result of this was that the virtual machine wouldn't bootup as the log file didn't have neough space to grow.
To resolve this problem I did the following.
First I cd into the directory where the troubled virtual machine is
cd /vmfs/volumes/guest-os2/vm
cp vm.vmdk vm.vmdk.bak
cp vm.vmdk remotedatastore/folder/vm.vmdk
Now you made a back of this file. Now do a cat on this file. You will see how it points to a file called vm-flat.vmdk. Now what I did to free up space was copy this flat file to another datastore then change the links in order for the machine to boot. That is what I'm going to describe here.
Also you must use the full path for the vmfs store and not the symlink shorthand. To find this cd into your remote datastore and then do a pwd.
That will give you the full length name of the folder.I would also recomend making a folder inside the datastore so that you can organize your files. It will take quite a long time to copy over this flat file if its any amount of size.
Next copy over the file named vm.vmsd
cp vm.vmsd /remotedatastore/folder/vm.vmsd
This is a snapshot file that hold config settings. Open it in nano and edit the snapshot0.disk0.filename = "fullfilepathtovm.vmdk"(this is the remote datastore one)
Also edit snapshot1.disk0.filename = "filledupdatastore/vm-0000001.vmdk"
Then hit control -X then Y to save it. Next we need to update the vm.vmdk that is the old datastore directory. Their is a line in their called extent descrip0tion. You need to change this to the full path of the remote volume. Then hit control -X then y to save and you should be good to go.
Don't act liek superman if you don't know what you are doing. Call or email me cmuench@gmail.com or ask vmware. Very very easy to screw something up. Make backups of these files before you edit them. This is probably not a support solution. The recomend fix for this is to install convertor on the box and reimage the box. I would NOT recomend deleting the snapshots. If the drive only has a little bit of space lef tyou will be in trouble if it goes and tyries to consolidate the snapshots. |