VM Encapsulation

VMware encapsulation makes VMs independent and portable.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.”

VI Client Datastore Browser can easily add a VM 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?

Hyper-V VM import failed.

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.

(Visited 4,290 times, 1 visits today)
This entry was posted in Virtualizationism and tagged , , , , , . Bookmark the permalink.

6 Responses to VM Encapsulation

  1. Shawn says:

    Always love reading these little tidbits.

    You should compile them all together into a new site called Hyper-V Annoyances.

    🙂

  2. Eric Gray says:

    Shawn, thanks for reading. That’s not a bad idea.

  3. Marcel says:

    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?

  4. Eric Gray says:

    Well said, Marcel.

  5. Pingback: RHEV virtual disks are buried in LVM volumes - not regular files as Red Hat claims | VCritical

  6. Sami says:

    LOL, liked the Humpty Dumpty thing 😀

Comments are closed.