john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Vmware vim cmd snapshots

vim-cmd vmsvc/getallvms vim-cmd vmsvc/power.off 48 vmware-cmd -l (list the vm's)

alternatively:

ps aux | grep vmfs vmware-cmd /vmfs/volumes/datastore1/foldername/vmname.vmx stop trysoft hard


VMware Snapshots creates a "difference in time" reference file - perhaps a close analogy is a Windows Restore Point. Taking and restoring from a snapshot can as little as a minute (if the VM's new state is powered off) or very long (large complex VM powered on). Normally VMware creates a tree of snapshots (But VMware Server only allows you to create a single snapshot & revert back to it)

VMware Snapshots are not exactly backups of the virtual machine image, but rather like a log files. As the VM runs, it is adding data to the last difference file, related to the difference between the current live state and the one previous to it.

One alternative to taking snapshots that can be used in VMware Server is to shutdown the virtual machine and copy the vmdk, vmem, vmx, and nvram files. Later you could replace these files and your virtual machine would be back at the point of when that copy was made.

When a snapshot is created a number of files are created in the directory for that virtual machine.

-SnapshotX.vmsn (Where X is the number of the snapshot taken) This file stores the state of the virtual machine when the snapshot was taken.

-SnapshotX.vmem (Where X is the number of the snapshot taken) This file stores the state of the virtual machine memory when the snapshot was taken.

-nnnnnn.vmdk (where nnnnnn is the number of the disk image, not corresponding to the snapshot number) These are log files which store changes to the virtual machine, since snapshot was taken. There may be many of these files over time...


COMMAND LINE MANIPULATION

vim-cmd vmsvc/snapshot.get vmid ROOT CHILD CHILD

deleted the first snapshot (the ROOT) now the two children both become two roots

vim-cmd vmsvc/snapshot.get vmid ROOT ROOT

HOW TO REVERT TO THE SECOND ROOT

vim-cmd vmsvc/snapshot.revert vmid 1 0 1

vim-cmd vmsvc/power.on vmid


UNFORTUNATELY THE ID'S FOR A SNAPSHOT DON'T QUITE CORRELATE TO REVERTS YET vim-cmd vmsvc/get.snapshotinfo vmid

(vim.vm.SnapshotInfo) { dynamicType = , currentSnapshot = 'vim.vm.Snapshot:3-snapshot-3', rootSnapshotList = (vim.vm.SnapshotTree) [ (vim.vm.SnapshotTree) { dynamicType = , snapshot = 'vim.vm.Snapshot:3-snapshot-2', vm = 'vim.VirtualMachine:3', name = "clean-autoboot-10.10.10.217", description = "", id = 2, createTime = "2011-12-28T23:45:25.371832Z", state = "poweredOff", quiesced = false, revertible = true, backupManifest = , replaySupported = false, }, (vim.vm.SnapshotTree) { dynamicType = , snapshot = 'vim.vm.Snapshot:3-snapshot-3', vm = 'vim.VirtualMachine:3', name = "test", description = "", id = 3, createTime = "2012-01-04T02:54:06.953081Z", state = "poweredOff", quiesced = false, revertible = true, backupManifest = , replaySupported = false, } ], }


  • « system command verifyssl v1
  • Ldap apacheds create dc ou structure »

Published

Jan 4, 2012

Category

virtualization

~398 words

Tags

  • cmd 14
  • snapshots 2
  • vim 4
  • virtualization 87
  • vmware 25