vSphere vs. Hyper-V: Difference of Virtual Machine States

While reading articles about Microsoft Hyper-V, I found that Hyper-V seemed to have different states for virtual machines from VMware vSphere. The virtual machine in Hyper-V is represented by the Msvm_ComputerSystem class. If you are familiar with VMware vSphere, you know the equivalent in vSphere is VirtualMachine. At first sight, the Hyper-V APIs may not look straight-forward. The Hyper-V APIs is actually based on Windows Management Instrumentation (WMI), which is essentially CIM from DMTF.

The Msvm_ComputerSystem class defineds the RequestStateChange method that can be used to set the state to one of these:

Hyper-V VM States Action Equivalent vSphere States VirtualMachinePowerState
Enabled 2 Turns the VM on. Powered on
Disabled 3 Turns the VM off. Powered off
Reboot 10 A hard reset of the VM. Similar to resetVM_Task() method
Reset 11 For future use. NA
DMTF Reserved 13–32767 Reserved. NA
Paused 32768 Pauses the VM. NA
Suspended 32769 Saves the state of the VM. Suspended
Vendor Reserved 32770–65535 Reserved. NA

As you can tell, there are good mappings between these two. After all, both are virtual machines. Somehow, the Hyper-V APIs mixes the real states and actions together. Requesting a state change results in actions that deliver the change. VMware vSphere APIs uses the real methods for state changes, for example, powerOnVM_Task(), powerOffVM_Task(), resetVM_Task().

The real difference is the paused state, which does not have equivalent in vSphere. Coming from VMware world, I was at little confused about the paused and suspended at first. Then I found this link offers pretty good explanation of the difference:

“…You can also pause or save a virtual machine in a given state. When you pause or save a virtual machine, it stays in its current state for as long as you want.
Although pausing a virtual machine does not free up the memory that is allocated to that virtual machine, it frees up main processor resources. Saving a virtual machine frees up memory and main processor resources so that they can be used by other virtual machines or by the virtualization server.”

It’s worthwhile to point out that the GUI from Microsoft has a different terminology – it uses saving instead of suspending. If you are familiar with Windows terms, the pausing is like sleep while saving like hibernate.

With the difference clear, the question is whether the extra paused state is useful or not. As described earlier, the key difference between paused and suspended is memory. Having the memory in place can surely speed up the resuming of a virtual machine, especially when the virtual machine has big memory footprint. At the same time, the allocated memory cannot be used by other virtual machines.

If you need instant recover of virtual machines, pausing them may be helpful. You may wonder why not keep them always running because the difference of paused and powered on is whether the virtual machine gets CPU allocation. If a virtual machine does not use much CPU power, it’s probably not worthwhile to pause it  – just keep it running. I think the best use cases of pausing feature is for virtual machines that 1. use little memory. 2. consume many CPU cycles while idle. 3. need to resume instantly.

This entry was posted in Virtualization and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

7 Comments

  1. Posted January 6, 2013 at 10:30 pm | Permalink

    vSphere vs. Hyper-V: Difference of Virtual Machine States (DoubleCloud) http://t.co/ylUucbJ2

  2. Posted January 6, 2013 at 11:04 pm | Permalink

    vSphere vs. Hyper-V: Difference of Virtual Machine States (DoubleCloud) http://t.co/cvqwTcC9

  3. Posted January 7, 2013 at 1:29 pm | Permalink

    #vSphere vs. Hyper-V: Difference of Virtual Machine States http://t.co/1c3jqfXw #HyperV #VMware

  4. Posted January 7, 2013 at 1:48 pm | Permalink

    I think one of the best uses for the Pause VM state in Hyper-V is to quickly recover from low host disk space scenarios when using dynamic virtual hard disks. When Hyper-V detects that a volume storing VM components has less than 200MB of disk space, it automatically pauses VMs with dynamic virtual hard disks stored on those volumes to protect them and prevent disk errors and/or application crashes from occurring. Once disk space is freed up, the VMs can be quickly resumed and pick back up from where they left off.

  5. Posted January 7, 2013 at 3:40 pm | Permalink

    vSphere vs. Hyper-V: Difference of Virtual Machine States – http://t.co/mVmc84Fb

  6. Posted January 7, 2013 at 6:40 pm | Permalink

    Thanks Keith, I agree with you that it’s a great use case for the pausing VMs.
    Steve

  7. Posted January 11, 2013 at 6:01 am | Permalink

    Still not a key difference, VMware vSphere vs. Hyper-V: Difference of Virtual Machine States http://t.co/mObOB7lO

One Trackback

  • [...] you know the equivalent in vSphere is VirtualMachine. At first sight, the Hyper-V APIs may not [...]vSphere vs. Hyper-V: Difference of Virtual Machine States originally appeared on DoubleCloud by Steve Jin, author of VMware VI and vSphere SDK (Prentice [...]

Post a Comment

Your email is never published nor shared. 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>

  • NEED HELP?


    My consulting helps clients with virtualization and cloud computing, including VMware infrastructure automation and orchestration, vSphere management APIs, and deep product integration with hypervisors. Current training offerings include vSphere APIs training, vCenter Orchestrator training, and etc. Should you, or someone you know, need these consulting services or training, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.