Last updated on Monday 4th of October 2021 11:16:54 AM

©VMWare ©ESXi backup most common questions

Frequently asked questions in regards to ©VMWare ©ESXi backup

Can you restore a VM from a snapshot?

The short answer is no.
A snapshot only contains the data commited to disk since it was created, thus a snapshot is useless without the base disks.

Taking a snapshot consists in creating an empty file (it's really not only one, but a set of them) where to store the data commited to disk by any process producing I/O since that moment.

The hypervisor will still show you the VM as if all data in the snapshot chain was a whole, still, it will be splitted into different layers that you can merge or discard, going to any of the intermediate points, namely: the states the VM was prior to taking that particular snapshot.

Thus the snapshot contains just partial data and cannot be used to restore the whole from a part, unless the rest of the whole is present.

How can I tell if a VM is running on a snapshot?

It's easy to tell that by just taking a look at the VM "Manage Snapshots" section in the vSphere web client. Any existing snapshot there will be presented as a node branching from the VM icon. You can there create new snapshots, delete one or more of them or take the VM to any of the states in between the existing snapshots.

VMWare ESXi: VM Snapshot general view In case you are using the SSH shell, you just have to list the contents of the main VM directory. Should any snapshot be present in the VM data hierarchy, you will see some files compounding the snapshot, which are easily identifyable, as they will include a set of files zero padded to six digits and one or more -delta.vmdk files.

VMWare ESXi: VM SSH Snapshot general view

How long should I keep VM snapshots?

That's up to you. Keeping a snapshot means being able to restore your VM to some previous state, which is good. Nevertheless, keeping snapshots in a production VM will degrade its performance which is not that good.

Most of the times you will keep your snapshots until you have tested the new VM state, per instance: after a software upgrade or after trying some new configuration.

In case of test labs, you might want to keep a big number of snapshots, as performance may not be that important to you.

Can I delete VM snapshots?

Sure, but before doing it you should understand what 'deleting a snapshot' means in ©ESXi terminology.

When you delete a snapshot, what you really do is to delete the recovery point, in other words: commiting all the pending I/O operations to the base disk. What the base disk will be will depend on what position the snapshot you are deleting occupies in the snapshot chain.

Deleting a snapshot means merging its data to the previous disk in the snapshot chain, be it other snapshot or the base disk itself, in case the snapshot you are deleting is the last one.

How do I delete all VM snapshots?

You have a dedicated button to do so in the main screen of the Snapshot Management feature of the vSphere web client, as shown in the first image of this post.

You can also perform a snapshot deletion by using the SSH shell through the vim-cmd command line utility.

vim-cmd vmsvc/snapshot.removeall VMID

Where the VMID string is the numeric Id of the virtual machine as shown by

vim-cmd vmsvc/getallvms

How do I SSH into ESXi host?

SSH protocol is disabled by default. Enabling it is fairly easy, just unfold the 'Actions' cogweel from the 'Host' node in the vSphere web client. You will see an option to enable/disable the SSH protocol daemon in the ©ESXi host.

VMWare ESXi: enable the SSH protocol

Still, since ©ESXi 6.7.0 the SSH access is disabled after each host reboot, forcing the sysadmin to manually reenable it everytime the host is rebooted. This can be annoying sometimes, so we provide a simple way to make sure it is restarted with the host in case you want to.

Enable the SSH shell permanently in VMWare ESXi 6.7.0 and above

©VMWare points at eventual security issues, nonetheless SSH is an industry standard and is indeed secure. At least as much as the web interface, which is enabled by default.

Daniel J. Garcia Fidalgo