|
|
楼主 |
发表于 2022-5-27 14:20:23
|
显示全部楼层
How to enable Nested virtualization in OpenStack Cloud$ ^: z3 w% X X7 o* t4 F# g4 n
I have installed OpenStack using PackStack in our physical server. After successfully installed, verified that the setup is working fine.4 W) {; G( d9 {) m N$ }9 ^
6 R' ~/ Q: e7 ^# v# H
We need to enable nested virtualization OpenStack cloud at the kernel level:
: r7 D: W: k. k. Q' f% E. @' ?/ X3 M
6 L$ C8 \6 k2 ?[root@openstack]#echo "options kvm-intel nested=y" >> /etc/modprobe.d/dist.conf
* |. e2 J9 l0 A3 @- wModify the following settings in nova.conf file.
* D2 R( m' i. C9 o. L
" o6 k2 S' b7 u0 l: X2 Xvirt_type=kvm
1 Q) n8 W6 }) E) Z...
, D! j/ M/ M; c" gcpu_mode=host-passthrough
" |( Y. k5 W8 H' q) Z4 o“host-passthrough” – use the host CPU model exactly
# f3 L/ Z5 i" B2 B$ r: A" y$ a
: p9 t4 A' w" B# n) kthis 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.
% v/ ?0 j( ]9 h6 T" H& {* f$ l P% v4 p" q
“host-model” – clone the host CPU feature flags4 D1 l, y# H5 B. I ?. v
8 F* |/ q: ^/ d" L4 s- s
Reboot your compute Host9 K3 C2 R! K) F; K& O0 M9 x+ K
Validate that nested virtualization is enable at the kernel level:+ }) r" L ^% f
9 C- B* c$ ~. F" c9 }2 W[root@openstack]# cat /sys/module/kvm_intel/parameters/nested
% s1 ^ P( ~) G' OY' q. | t2 M% j' J) @1 ?
Launch new instance on this node, and validate that your instance at the vmx cpu flag enable:1 @1 w3 E4 S8 ?" n( |
$ @8 S$ s( Q. Y+ @& ^ D
[root@nested ~]# cat /proc/cpuinfo | grep vmx- ?* |# O9 o8 Q
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
3 G- u9 B# B9 A* u/ p6 P0 Q: x6 ~) hflags : 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/ u+ Y7 q- S- D; s, Q% n2 |
That’s all. A new virtual machine will be running as a hypervisor. |
|