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

楼主 |
发表于 2022-5-27 14:20:23
|
显示全部楼层
How to enable Nested virtualization in OpenStack Cloud
2 X2 q" c& M4 s4 O) _0 \% CI have installed OpenStack using PackStack in our physical server. After successfully installed, verified that the setup is working fine.
6 ~0 q6 J! R. r1 W9 K1 G' H" \) G- T0 J% L, L- l- l' Y1 V
We need to enable nested virtualization OpenStack cloud at the kernel level:
8 q9 o- U; |/ _" F# C/ t; d0 `3 O
* `' o0 p# w' X3 N; k2 k3 ^[root@openstack]#echo "options kvm-intel nested=y" >> /etc/modprobe.d/dist.conf+ t5 h1 m3 s# |) M% a, y9 C
Modify the following settings in nova.conf file.
# f1 g7 R6 d. {/ I0 {! \; g' o, V
virt_type=kvm
: u( l0 F7 m* n9 V/ _...
- @4 K" `# y4 Ccpu_mode=host-passthrough
( _1 r& _0 J o9 {“host-passthrough” – use the host CPU model exactly, i# D0 B8 k; }; N+ Y" C6 M7 O
5 l9 {& ?) d, P5 ^( d3 D: Q
this 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.1 R; o" Q; C) |" Q, P
" a( k1 v* j, r9 e+ A4 L3 z
“host-model” – clone the host CPU feature flags
3 f3 \$ M7 ]5 @( P, W
) |1 J# [1 s) K- s1 y. q+ cReboot your compute Host6 y O X2 l% e2 [; [( \
Validate that nested virtualization is enable at the kernel level:
) ` {$ ]) U( \, `# E" N8 O5 U) g' h ?; @: o
[root@openstack]# cat /sys/module/kvm_intel/parameters/nested
4 \5 p( T+ T& M: |3 q4 s4 mY
5 [2 k3 Y& X3 }8 Q. }0 ~Launch new instance on this node, and validate that your instance at the vmx cpu flag enable:
$ b; o0 C# K4 f f) A$ d: D4 r4 V
) {! }" Q% a) X4 J[root@nested ~]# cat /proc/cpuinfo | grep vmx- H, d2 j( Y7 V' B) V
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& B7 z# b' D$ f/ B9 |7 t# {' K* 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
9 G! s9 n& w6 X& {That’s all. A new virtual machine will be running as a hypervisor. |
|