Encapsulation is one of the four key benefits of VMware virtual machines. On the surface it may seem like this is a common feature across all virtualization platforms — but it’s not.
If you are a VMware ESX administrator, you know that a VMware virtual machine consists of several files, normally contained in a single directory. There is a configuration file, virtual disk files, and a few other supporting files. Having all necessary VM files in one directory is the essence of encapsulation.
Let’s say that you have a development environment — not protected by VMware HA — that experiences a host failure. You repair the host, reinstall ESX, and reattach the disk that contains your virtual machines. In order to have ESX recognize a VM, it must be registered. This is easily done with the Datastore Browser, just right-click on the .vmx file and select “Add to Inventory.”
This task can also be performed on the ESX service console (i.e., not ESXi) by using the vmware-cmd utility. Here is an easy technique, just cd into the VM directory first:
vmware-cmd -s register $PWD/whatever.vmx
After that you are ready to power on your VMs and get back to work — snapshots and all.
Recovering Hyper-V VMs
Unfortunately, with Hyper-V you need to be more proactive — unless a VM is explicitly “exported” it cannot be “imported.” There is no supported method of importing a VM from a failed host, especially if it has snapshots. Or is that checkpoints?
Don’t believe me?
For the curious, there evidently is an unsupported technique to put Humpty Dumpty a Hyper-V VM back together again — for data recovery purposes only. If making symlinks to XML files is your thing, go check it out.
When choosing a virtualization platform, don’t forget about the little things that can make a big difference.
Always love reading these little tidbits.
You should compile them all together into a new site called Hyper-V Annoyances.
Shawn, thanks for reading. That’s not a bad idea.
At the MCT EMEA Summit in Prague (January this year) Ronald Beekelaar had a “solution” for this as well. I cannot download his presentation yet but I think he’s made something which does the XML symlink thing without having to do this yourself.
As the previous commenter noted, it’s another small but very annoying thing about Hyper-V. If you’re coming from Virtual Server 2005 you won’t notice it, but if you’ve got experience with VMware of Xen then you’re looking at this type of thing with disbelief; how could they have forgotten this?
Well said, Marcel.
Pingback: RHEV virtual disks are buried in LVM volumes - not regular files as Red Hat claims | VCritical
LOL, liked the Humpty Dumpty thing 😀