- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|

楼主 |
发表于 2022-5-27 14:20:23
|
显示全部楼层
How to enable Nested virtualization in OpenStack Cloud
3 @0 U) ]. l- A$ W. h, mI have installed OpenStack using PackStack in our physical server. After successfully installed, verified that the setup is working fine.
$ A, ]# b i" `# k8 }. q$ `1 B7 r8 ^4 t# |6 z% c7 }1 n/ ^; j- r
We need to enable nested virtualization OpenStack cloud at the kernel level:
/ h1 z3 q. j4 U) t* n. A, r
, x" \2 A$ {, b7 j; M$ p# g Z; T[root@openstack]#echo "options kvm-intel nested=y" >> /etc/modprobe.d/dist.conf* V! c; U# E- H: G
Modify the following settings in nova.conf file.
4 E& W: O# K- v: }2 [1 c* {6 d: n2 Y# S+ B7 q* L) ^) T0 y
virt_type=kvm
" i n, W; k6 b, E...( E+ c3 k; ?+ }2 A& y# D
cpu_mode=host-passthrough
% w) S' C" |+ Y4 q* i1 z& {2 b/ b0 U“host-passthrough” – use the host CPU model exactly
8 j' }- `) p3 F% _: z: p( A
0 F, |# t# X# {7 J- g' Pthis causes libvirt to tell KVM to passthrough the host CPU with no modifications. The difference to host-model, instead of just matching feature flags, every last detail of the host CPU is matched., x B1 E/ `2 l* p/ f
9 {8 _/ g; y# H. I: @“host-model” – clone the host CPU feature flags& m6 L! N2 i& M& }
" L& Z9 B; v6 s H* Z+ ?
Reboot your compute Host, s) J+ x" P5 |5 M9 ~3 _8 m8 H* q
Validate that nested virtualization is enable at the kernel level:
r \1 v2 a$ i+ f: c9 @9 S6 V& z% F3 w. V9 y: C- o
[root@openstack]# cat /sys/module/kvm_intel/parameters/nested8 i7 M R! j# ~1 {
Y
- q7 D; Z& p7 ?: t8 R1 BLaunch new instance on this node, and validate that your instance at the vmx cpu flag enable:
; p9 `+ y+ Z( H! B) L3 j) z% F: J4 o* b$ m q+ g
[root@nested ~]# cat /proc/cpuinfo | grep vmx
: }" K- H( v8 q& f& k1 }! Cflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt1 T: S1 ^9 l1 G$ B3 j
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt: m) O. `7 N& D3 ]
That’s all. A new virtual machine will be running as a hypervisor. |
|