Why is a smaller number of virtual CPUs better?

Note: This article is designed to serve as a high level introduction to the topic and as such uses a very basic explanation. Papers for those that wish to dive into more technical details of the topic are available elsewhere.

In a virtual environment such as VMware or Hyper-V, multiple virtual machines (VMs) operate on the same physical hardware. In order to make this function, a small piece of software, called a hypervisor operates to schedule the virtual resources with the physical hardware. As a virtual machine enters a state where CPU resources are required the VM is placed into a CPU ready state until enough physical CPUs are available to match the number of virtual CPUs.

The hypervisor will schedule VMs to available physical resources until all resources that can be scheduled are used.

Each VM will run on the physical CPUs until either it needs to wait for an I/O operation or the VM uses up its time slice. At that point the VM will either be placed into the I/O wait state until the I/O completes or be placed back in the ready queue, waiting for available physical resources.

As physical resources become available, they hypervisor will schedule VMs to run on those resources. In some cases, not all physical resources will be in use, due to the number of virtual CPUs required by the VMs in the ready state.

The process continues as VMs either wait for I/O or use their time slice on the physical CPUs.

In some cases there are no VMs in the ready state, at which point the scheduled VM will not time out until another VM requires the resources

Often a VM with fewer virtual CPUs will be able to be scheduled before one with more virtual CPUs due to resource availability.

In some cases a VM will complete an I/O operation and immediately be scheduled on available physical resources.

Algorithms are in place to ensure that no VM completely starves for CPU resources but the VMs with more virtual CPUs will be scheduled less frequently and will also impact the amount of time the smaller VMs can utilize the physical resources.

A VM with high CPU utilization and little I/O will move between the ready queue and running on the CPUs more frequently. In this case, the operating system will report high CPU utilization, even though the VM may not be running for a majority of the real time involved.

In these situations, operating system tools that run within the VM may indicate that more CPUs are required when, in reality, the opposite is actually the case. A combination of metrics at the hypervisor and at the operating system level is usually required to truly understand the underlying issues.

BIOS Settings for Hyper-V Role in Windows 8 on Lenovo W-Series

Image

Recently I upgraded to Windows 8 on my Lenovo W510 in order to setup a virtual lab in Hyper-V. Hoping to save others the frustration I experienced during BIOS configuration, I thought I’d share the Intel hardware virtualization settings necessary for the role. The order that settings are made and complete power downs after certain settings changes are significant. Don’t save time with warm boots!

Step 1. Boot the machine, press F1 to enter setup, and you’ll be presented with this menu.  Make sure that the BIOS is the most recent version (1.45 as of this post).  Press enter on Config.

BIOS top level menu

BIOS top level menu

Step 2. In Config menu, arrow down to CPU and press enter.

Config Menu on Lenovo W510 BIOS

Config Menu on Lenovo W510 BIOS

Step 3. In the CPU menu, make sure the settings are:
• Intel Hyper-Threading = Enabled
• Intel Virtualization Technology = Enabled
• Intel VT-d Feature = Enabled

Core Multi-Processing Enabled, Intel Hyper-Threading Technology Enabled, Intel Virtualization Technology Enabled, Intel VT-d Feature Enabled

Hardware Virtualization BIOS Settings on Lenovo W510

If any settings in Step 3 had to be changed, hit F10 to save the settings and then power the machine off. Re-enter the BIOS by pressing F1 on the next startup.

Step 4. Return to the Main Menu in Step 1, and select Security. This menu will appear.
Arrow down to Memory Protection and press enter.

Security Menu on Lenovo W510

Security Menu on Lenovo W510

Step 5. In Memory Protection, make sure Execution Prevention is set to Enabled
Press ESC to return to the Security menu from Step 4

Execution Prevention Enabled

Memory Protection BIOS Settings on Lenovo W510

Step 6. Confirm the following settings:
• Security Chip = Active
• Intel TXT Feature = Disabled

Security Chip Active, Intel TXT Feature ***Disabled***

Security Chip BIOS Settings on Lenovo W510

Press F10 to save settings, and power down the machine. After restart, the Hyper-V role can be installed.

Cisco AnyConnect vs. Internet Connection Sharing in Windows 8

Having recently installed Windows 8 on my laptop to take advantage of the Client Hyper-V, I’m working through the kinks that come with a new OS on my daily driver. Hyper-V leverages the built-in Internet Connection Sharing (ICS) to provide NAT and DHCP for internet access for VM’s running on the hypervisor. This isn’t quite as intuitive as the network implementations in VMware Workstation or Oracle’s VirtualBox, but that’s a different discussion.

I recently had some trouble establishing the VPN connection, and set about re-installing Cisco AnyConnect as a result. During the install, a notification box popped up numerous times to warn me: “The VPN client agent was unable to create the interprocess communication depot.”

Cisco AnyConnect Install Error

The VPN client agent was unable to create the interprocess communication depot.

The install completed after clicking OK on the notifications, but would not establish a VPN connection, with a not so informative message “Unable to establish VPN”.  A bit of searching later, I found that AnyConnect is not compatible with Internet Connection Sharing, which Cisco states in the AnyConnect VPN Client FAQ.

The solution is to disable the ICS service before installing AnyConnect.  Subsequently, when trying to connect, I encountered connection failures:

AnyConnect Unable to Establish Connection

AnyConnect was not able to establish a connection to the specified secure gateway. Please try connecting again.

The solution is again to disable the ICS service, establish the AnyConnect VPN connection, and then enable ICS.  Oddly, it seems that after the first failed connection attempt followed by stop / connect / restart cycle of the ICS service, AnyConnect can be reconnected without any trouble.  Tedious, but it works.  Ping me back if you know a better way!

Hyper-V Memory Overcommit

This has been a long standing complaint of mine when people bring up Hyper-V…memory overcommit.  I have heard the arguments against this and I’d really rather be the one choosing rather than lacking a feature I think really helps reduce the cost of virtualization and help the ROI impact that server (and soon desktop) virtualization can make.  Now we’ll see when this gets rolled out, which is my other complaint of Hyper-V…tying a hypervisor to a OS release schedule.

http://www.virtualization.info/2010/02/hyper-v-to-get-memory-overcommitment.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Virtualization_info+%28virtualization.info%29

Microsoft Desktop Licensing in a Virtual Environment (VDI)

We’ve already posted some useful info on licensing servers for a virtual environment, but we also get the question a lot of how virtualization changes licensing for hosted desktop (aka VDI) environments. Well, here are some very useful links.

Here’s a high level:

Virtualization brings about new use cases that did not previously exist in traditional desktop environments. These use cases include the ability to create multiple desktops dynamically, enable user access to multiple virtual machines (VMs) simultaneously, and move desktop VMs across multiple platforms, especially in load-balancing and disaster recovery situations. Microsoft designed Windows Virtual Enterprise Centralized Desktop (VECD) to enable organizations to license virtual copies of Windows client operating systems in virtual environments.

Virtual Enterprise Centralized Desktop Licensing:
http://www.microsoft.com/windows/enterprise/solutions/virtualization/licensing.aspx

More Licensing Details:
http://blogs.technet.com/virtualization/archive/2009/07/13/Microsoft_1920_s-new-VDI-licensing_3A00_-VDI-Suites.aspx

Desktop Virtualization (VDI) Info:
http://www.microsoft.com/virtualization/products/desktop/default.mspx
http://www.vmware.com/products/view/

 Hope it helps!