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.

Related posts:

  1. Register a LUN full of VMs with PowerCLI
  2. These are not the files you are looking for
  3. Hyper-V snapshots: not for production
  4. Snapshots that shoot back
  5. Easy recovery from a full VMware ESX datastore

Tags: , , , , ,

  1. Shawn’s avatar

    Always love reading these little tidbits.

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

    :)

    Reply

  2. Eric Gray’s avatar

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

    Reply

  3. Marcel’s avatar

    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?

    Reply

Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">