Here we are going to use the command line on a esxi host to create, revert, and delete snapshots.
First ssh into your host.
Important thing is to get the VMID of your target vm.
GET VMID : vim-cmd vmsvc/getallvms
Now find your VM and the first column is your VMID
Example for vm: 250-clonestorageprofile
The vmid is 20
CREATE SNAPSHOT: vim-cmd snapshot.create vmid [snapshotName] [snapshotDescription] [includeMemory] [quiesced]
Now we are going to make a snapshot
snapshot.create vmid [snapshotName] [snapshotDescription] are the most important things.
For our example: we will use snapshot.create 20 testclone1
LIST SNAPSHOT: vim-cmd snapshot.get vmid
Let us now see the snapshot that was made!
For our example: we will use vim-cmd snapshot.get 20
For our example the server has a random name:
Lets change the name to : vmsnapshot
Name has been changed.
Now lets revert the snapshot. Since it isnt on a domain, it doesn’t matter.
revert root snapshot:: vim-cmd snapshot.revert vmid root
You have to power on the vm now.
Now if we go back to the vm after its powered on you will see the name is back to the old one.
Remove all snapshots:
Cleanup: vim-cmd vmsvc/snapshot.removeall [VMID]
No more snapshots!
0 comments:
Post a Comment