5/16/2009

VMware's ESXi snapshot removal problem solution.

In my job one of my responsibilities is to manage a bunch of virtual machines that are used for testing purposes. They are running under control of VMware's ESXi. Recently I had a problem with one of those VMs. It was created as a so-called linked clone. I created several snapshots and after a while I wanted do delete some of them. But there was a problem. I was unable to delete any of the snapshots created of this VM. It looked like it was a problem with file permissions, so I logged in as a root and "chmod-ed" snapshots and .vmdk files as well as .vmsd configuration file. It didn't work. I googled for this only to find that other people had the same problem with their VMs. And the only solution seemed to be manually deleting snapshots and flattening the machine's .vmdk file, which obviously was not good for me. After a few tries of messing with the files the clone became worthless anyway so I decided to mess with the VM's configuration. The solution was striking in its simplicity. The so-called Gold Machine was switched to a template mode. The script I used to create the linked clone (which is a very good tool btw.) did not change this setting. The problem of undeletable snapshots disappeared when I changed value of templateVM in the clone's configuration file from true to false. It saved me lots of frustration.

No comments: