ESXi5.1上の仮想マシンでVT-xを有効にしてみた

Virtualization
Published: 2013-03-20

 tremaのお勉強をする為に、openvswitchに複数のサーバがぶら下がる環境が欲しかったので、自宅のESXi5.1(5.1.0,838463)上にKVMを構築しました。その際に仮想マシンのVT-x有効化にハマったのでメモしておきます。

 単純に仮想マシンの設定で「intel VT-xを使用する」的なオプションにチェックをしても、仮想マシン側ではVT-xが有効になりません。仮想マシン(Ubuntu12.10)上の表示結果は下記の通りです。

@kvmhost:~$ grep vm /proc/cpuinfo
 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm 

 公式な対応方法は「WebClientで設定を変更する」みたいなのですが、ご自宅にWebClientはない!

To enable virtualized HV, use the web client and navigate to the processor settings screen. Check the box next to “Expose hardware-assisted virtualization to the guest operating system.” This setting is not available under the traditional C# client.

Running Nested VMs

 ですが、@xerespmさんに教えて頂いた「How to Enable Nested ESXi & Other Hypervisors in vSphere 5.1」の方法を試したところ、上手く行きました。

A new parameter has been introduced called vhv.enable = “true” that is now defined on a per VM basis to provide finer granularity of VHV support. This also allows for better portability between VMware’s hosted products such as VMware Fusion and Workstation as they also support the vhv.enable parameter.

How to Enable Nested ESXi & Other Hypervisors in vSphere 5.1

 ESXiの/etc/vmware/configに「vhv.enable = “TRUE”」を追記すると、仮想マシン(Ubuntu12.10)上のflagにvmxが表示されます。

@kvmhost:~$ grep vmx /proc/cpuinfo 
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi ept vpid