#Vmware esxi 6.7 clone vm command line mac
LinkedClone1-000001-delta.vmdk LinkedClone1-000001.vmdk LinkedClone1.vmx Then we rename files: $ mv $dst/*-delta.vmdk $dst/LinkedClone1-000001-delta.vmdk vmdk (including the -delta file) corresponding to our reference snapshot: $ cat $src/CentosTest.vmx | grep fileName To have more understandable command lines, we set in variable the reference and destination path: src="/vmfs/volumes/LocalDatastore_001/CentosTest"ĭst="/vmfs/volumes/LocalDatastore_001/LinkedClone1"įirst step for a linked clone from command line, is to create a destination folder : mkdir $dst Snapshot Desciption : Used for linked clones of Centos VM $ vim-cmd vmsvc/snapshot.create 3 "ReferenceSnapshot" "Used for linked clones of Centos VM" Create a linked cloneĬreate a reference snapshot on a source VM. Without access to the parent, you cannot use a linked clone. A linked clone must have access to the parent. Ongoing changes to the virtual disk of the parent do not affect the linked clone, and changes to the disk of the linked clone do not affect the parent. All files available on the parent at the moment you take the snapshot continue to remain available to the linked clone.
#Vmware esxi 6.7 clone vm command line software
|-> Virtual machine is restored with power-off stateĪ linked clone is a copy of a virtual machine that shares virtual disks with the parent virtual machine in an ongoing manner.īecause a linked clone is made from a snapshot of the parent, disk space is conserved and multiple virtual machines can use the same software installation. |-> Virtual machine is restored with power-on state Last option is to revert to snapshot with or without memory content: suppressPowerOff = 0 This will restore VM, powered-on (!), at the state where you take the first snapshot. So to revert to the first snapshot of the VM with Vmid 3: $ vim-cmd vmsvc/snapshot.revert 3 1 0 Usage: snapshot.revert vmid snapshotId suppressPowerOff To do so, you can use the snapshot.revert argument. It's to be able to revert the VM state to the moment you take the snapshot. Goal of VM snapshot is not to only create, list or remove snapshots. There is also a snapshot.removeall argument to remove. Usage: snapshot.remove vmid snapId $ vim-cmd vmsvc/snapshot.remove 3 4 Deletion operation is also called the "commit" as all recent changes made from the moment the snapshot is taken, are committed to the based disk or the parent snapshot disk file. Remove/Commit a snapshotĪs you can create and list snapshot(s) for a VM, you can remove them. The list is displayed as a tree according to the parents or children of a snapshot. Snapshot Desciption : snap04 description Snapshot Desciption : snap03 description Snapshot Desciption : snap02 description Snapshot Desciption : snap01 description You may need to get the list of VM snapshots: $ vim-cmd vmsvc/snapshot.get 3 So you can make a snapshot with VM memory and quiesced: vim-cmd vmsvc/snapshot.create 3 "SnapName" "Snap Description" 1 1 To create a snapshot, you can use the 'vim-cmd' command: $ vim-cmd vmsvc/snapshot.create 3 snap01 'snap01 description' A snapshot preserves the virtual machine just as it was when you took the snapshot - the state of the data on all the virtual machine's disks and whether the virtual machine was powered on, powered off or suspended. You can take a snapshot while a virtual machine is powered on, powered off or suspended. You can take a snapshot of a virtual machine at any time and revert to that snapshot at any time. The snapshot feature is most useful when you want to preserve the state of the virtual machine so you can return to the same state repeatedly. Here is the VMware definition of VM snapshot feature ( source): 2 Vmid Name File Guest OS Version Annotationģ 3 CentosTest CentosTest/CentosTest.vmx otherLinuxGuest vmx-10 Snapshots