VMware Cloud Community
dreic
Contributor
Contributor

Nested hyper-v 2012r2 role breaking ESXI 5.1 host

I followed this Hyper-V in vSphere 5.1 | How to Run Hyper-V article to enable hyper-v role inside Windows 2012r2 guest but after i did that ESXi host started crashing. Anyone else experienced same problem?

Reply
0 Kudos
10 Replies
admin
Immortal
Immortal

Nested Hyper-V 2012 on ESXi 5.1

Today I needed to get a Hyper-V host up and running so that I could mount the Citrix XenApp 6 EVA (Evaluation Appliance). Unfortunately I could not find the a VMware version of the appliance so I went ahead and downloaded the Hyper-V version. I know I could always convert the VHD to a VMDK, but I figured I’d learn a little Hyper-V while I am at it!

Having a lab, I figured why not try and get the Windows Server 2012 Hyper-V going as a Virtual Machine on one of my ESXi hosts. I tried getting Windows Server 2008 R2 Hyper-V working, but no matter what I did, the VM’s would not start.

hv1

Doing some more research I came across successful configurations with Windows Server 2012 Hyper-V running as a nested hypervisor on an ESXi 5.0/5.1. In my case, I was running ESXi 5.1 so the steps we need to take to get Hyper-V working are little different from 5.0. To give credit where it’s due, I found William Lam and David Davis‘ articles on how to get nested Hyper-V working really helpful. To summarize the steps we need to take to get all of this going is as follows:

1. SSH on to the ESXi host or hosts (in my case its two hosts) and add the parameter vhv.enable = “TRUE” (ESXi 5.1) or vhv.allow = “TRUE” (ESXi 5.0) to /etc/vmware/config, in my case I used VI editor (vi /etc/vmware/config)

hv2

2. Next, we need to modify the vmx configuration file of the virtual machine in order to trick Hyper-V to think it’s running on a physical server. To do this, we need to add the following parameter hypervisor.cpuid.v0 = “FALSE” like this:

hv3

3. That’s it, we should now be able to install and launch a virtual machine within the nested Hyper-V virtual machine:

hv4

Reply
0 Kudos
admin
Immortal
Immortal

There seems to be some confusion regarding the difference between vhv.enable and vhv.allow.

Under ESXi 5.0, vhv.allow is a host-wide setting that must go in /etc/vmware/config to allow the use of virtualized hardware-assisted virtualization on that host.  This option is unsupported.

Under ESXi 5.1, vhv.enable is a per-VM setting that should go in the individual .vmx files to enable virtualized hardware-assisted virtualization for that VM.  This option is supported, and it can also be set using the web client.

Adding vhv.enable to /etc/vmware/config will enable virtualized hardware-assisted virtualization for all of the VMs on that host, which may not be what you want.  Moreover, if the setting is not in the.vmx file, it can cause problems for vMotion.

Reply
0 Kudos
admin
Immortal
Immortal

Do you have any additional information about the crash?  Did you get a PSOD?  Is there anything pertaining to the crash in your log files?

Reply
0 Kudos
dreic
Contributor
Contributor

Well host crashed after some minutes after that VM with hyper-v was turned on. It was purple screen but i can't find dump log on the host... It crashed 2 times and 2 different VMs were mentioned (that should be unrelated to this). Since it's production i did not try to power on hyper-v VM. To bad i didn't take screenshot with mobile phone 😕

Reply
0 Kudos
mauser_
Enthusiast
Enthusiast

Hi,

i have tried this procedure with esxi 5.5 and hyper-v server 2012r2.

When starting the vm :

hyperv.JPG

What to do?

Thx

Reply
0 Kudos
admin
Immortal
Immortal

Please post the vmware.log file for the Hyper-V VM (as an attachment).

Reply
0 Kudos
mauser_
Enthusiast
Enthusiast

Here is is!

Thx

Reply
0 Kudos
admin
Immortal
Immortal

You need to:

1) Upgrade your virtual hardware to version 9 or later.

2) Set vhv.enable = TRUE.  (You have vhv.allow = TRUE in /etc/vmware/config, which is irrelevant for ESX 5.5).

3) Set the guestOS type to "winhyperv" or disable Windows enlightenments with hypervisor.cpuid.v0 = FALSE.

Reply
0 Kudos
mauser_
Enthusiast
Enthusiast

Hi,

point 2 and 3 was the trick ! Upgrade to Hardware version 9 wasn`t needed...

Or does it help with other things?

Thx!

Reply
0 Kudos
admin
Immortal
Immortal

Virtualized hardware-assisted virtualization isn't supported with hardware version 8.  Though you can set it by manually editing the configuration file, and it should work, you can't set it through the UI, and we don't test it.

Reply
0 Kudos