VMware Cloud Community
Dav_s
Contributor
Contributor

Command line to commit snapshot

I have the xxxx.vmdk (Original disk) and xxxx-nnnn.vmdk (snapshot delta file). How can I commit the snapshot to the the virtual disk. I've lost the original vm and these two files are all I have.

0 Kudos
9 Replies
Paul_Lalonde
Commander
Commander

Assuming that there's only one snapshot...

vmkfstools -i xxxx-nnnn.vmdk newdisk.vmdk

This will commit the changes in the snapshot to the new vmdk file that gets created.

Paul

0 Kudos
mattpound
Hot Shot
Hot Shot

If thats all you've got left you could :

1. Create a new vm (similar to the orginal)

2. Take a snapshot

3. Replace the vmdk files with you recovered ones.

4. Try and commit the snapshot

I have no idea if this will work, so keep a copy of your original files.

0 Kudos
snapper_
Contributor
Contributor

I need to commit my (delta files) snapshot to a VM that cannot power on, from you posts i notice you say vmkfstools -i does offline commit?

After migrating SAN's one VM which had a snapshot called "Consolidate Helper", but we do not use VCB and have it nowhere installed, is not able to power on because it is unable to locate ons of 3 VMDK files.

After struggling with the VM, notice in VM settings in VC that it is unable to determine the size of the disks nolonger. Whe I tried to browse to file location of disks, I can only see the original VMDK files but then if I power on VM it goes back to 31Jan2007 before the snapshot.

This VM original had 3 VMDK files spread over two LUNs with similar names.

In VM folder there are multiple delta files for each of the 3 VMDK disk belong to the VM.

How can I commit the delta's to get latest info into one VMDK on command line, while VM is power off?

Tx

0 Kudos
hugop
Hot Shot
Hot Shot

Did you fix this problem?

0 Kudos
snapper_
Contributor
Contributor

yes i did manage to commit the snapshot offline, while VM was powered off.

I open the parent vmdk file with nano:

SRV01.vmdk

\----


version=1

CID=e3422786

parentCID=ffffffff

then made note of CID value to be used in delta vmdk reference.

I also made note of the LUN UUID under /vmfs/volumes/xxx-xxx-xxx/SRV01 because it is reference by the delta(child) vmdk file

then i opened the snapshot delta(child) vmdk file with nano:

SRV01-000010.vmdk

\----


version=1

CID=44da2775

parentCID=e3422786

Made sure the ParendCID match the parent initial vmdk file.

The line in the delta vmdk file referening to location of parent must be referening to correct UUID, I had my initial EVA LUN's and new EVA 8000 LUN presented and these UUID's changed thus it could not locate the parent disk.

then i used vmkfstools -i to commit or called clone the delta and parent vmdk file into single vmdk file with all changes into one.

"vmkfstools -i SRV01-000010.vmdk /vmfs/volumes/xxx-xxx-xxx/SRV01-version2/NewDisk1.vmdk

SRV01-000010.vmdk is the meta data file it does not contain actual data the file SRV01-000010-delta.vmdk contains the data and in the meta data file it referes to the parent vmdk file and this is how it nows which 2 files to combine and make into on new file call NewDisk1.vmdk at new folder location.

hope this help

0 Kudos
mberthiaume130
Contributor
Contributor

This worked perfectly. Thanks!!

0 Kudos
admin
Immortal
Immortal

Phew - this post is spot on thanks.

0 Kudos
rvandijck
Contributor
Contributor

Thanks for this spot on post.

I have a more difficult situation at hand: I have a VM machine with 3 delta files (xxxx-nnnn.vmdk) and the original disk (xxxx.vmdk) but no snapshot files (committing the snapshots from the VC GUI appears to succeed but the files still appear in the datastore).

Is it possible to commit the snapshots from the command-line using vmkfstools -i ?

Or is it possible to create a new VM on a different VMFS data store with the same name, then create 3 snapshots and replace the created delta files with the ones from the original VM?

Any help is muchely appreciated!

0 Kudos
nanair01
Enthusiast
Enthusiast

Hey Guys,

The Vm may not be powering on since the .vmx file may be pointing to a .vmdk file which is not present within the data store(it may have been deleted). So pointing it in the .vmx file to the newer .vmdk file should fix this problem.

And to commit snapshots from the console you can use vmware-cmd command. The following link will help you in it.

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

If you find this post helpful/rectify your problem do not forget to award points

If you find this post helpful/rectify your problem do not forget to award points
0 Kudos