본문 바로가기

Openstack

Openstack Livemigration 설정

기본적으로 동일한 CPU가 아니라면 아무 설정 없이 Live migration 기능을 사용할 수 없음

공통된 CPU model을 사용하도록 설정하여 이후에 생성된 VM 대상으로 Live migration이 가능하도록 함

 

각 compute node에서 사용할 수 있는 cpu model이 /usr/share/libvirt/cpu_map/ 에 정의 되어 있음

root@compute1:/usr/share/libvirt/cpu_map# ls
arm_FT-2000plus.xml               x86_Icelake-Server.xml
arm_Falkor.xml                    x86_IvyBridge-IBRS.xml
arm_Kunpeng-920.xml               x86_IvyBridge.xml
arm_Tengyun-S2500.xml             x86_Nehalem-IBRS.xml
arm_ThunderX299xx.xml             x86_Nehalem.xml
arm_cortex-a53.xml                x86_Opteron_G1.xml
arm_cortex-a57.xml                x86_Opteron_G2.xml
arm_cortex-a72.xml                x86_Opteron_G3.xml
arm_features.xml                  x86_Opteron_G4.xml
arm_vendors.xml                   x86_Opteron_G5.xml
index.xml                         x86_Penryn.xml
ppc64_POWER6.xml                  x86_SandyBridge-IBRS.xml
ppc64_POWER7.xml                  x86_SandyBridge.xml
ppc64_POWER8.xml                  x86_Skylake-Client-IBRS.xml
ppc64_POWER9.xml                  x86_Skylake-Client-noTSX-IBRS.xml
ppc64_POWERPC_e5500.xml           x86_Skylake-Client.xml
ppc64_POWERPC_e6500.xml           x86_Skylake-Server-IBRS.xml
ppc64_vendors.xml                 x86_Skylake-Server-noTSX-IBRS.xml
x86_486.xml                       x86_Skylake-Server.xml
x86_Broadwell-IBRS.xml            x86_Snowridge.xml
x86_Broadwell-noTSX-IBRS.xml      x86_Westmere-IBRS.xml
x86_Broadwell-noTSX.xml           x86_Westmere.xml
x86_Broadwell.xml                 x86_athlon.xml
x86_Cascadelake-Server-noTSX.xml  x86_core2duo.xml
x86_Cascadelake-Server.xml        x86_coreduo.xml
x86_Conroe.xml                    x86_cpu64-rhel5.xml
x86_Cooperlake.xml                x86_cpu64-rhel6.xml
x86_Dhyana.xml                    x86_features.xml
x86_EPYC-IBPB.xml                 x86_kvm32.xml
x86_EPYC-Milan.xml                x86_kvm64.xml
x86_EPYC-Rome.xml                 x86_n270.xml
x86_EPYC.xml                      x86_pentium.xml
x86_Haswell-IBRS.xml              x86_pentium2.xml
x86_Haswell-noTSX-IBRS.xml        x86_pentium3.xml
x86_Haswell-noTSX.xml             x86_pentiumpro.xml
x86_Haswell.xml                   x86_phenom.xml
x86_Icelake-Client-noTSX.xml      x86_qemu32.xml
x86_Icelake-Client.xml            x86_qemu64.xml
x86_Icelake-Server-noTSX.xml      x86_vendors.xml
root@compute1:/usr/share/libvirt/cpu_map# cat x86_Icelake-Client.xml
<cpus>
  <model name='Icelake-Client'>
  ...

model 이름이 정의되어 있으므로 nova.conf에 작성

[libvirt]

cpu_mode=custom
cpu_models=Icelake-Client

model을 지정하는 방법으로 virsh capabilities의 출력 값에서 <cpu> ... </cpu>를 저장

    <cpu>
      <arch>x86_64</arch>
      <model>Broadwell-IBRS</model>
      <vendor>Intel</vendor>
      <microcode version='184549440'/>
      <counter name='tsc' frequency='2599997000' scaling='no'/>
      <topology sockets='1' dies='1' cores='14' threads='2'/>
      <feature name='vme'/>
      <feature name='ds'/>
      <feature name='acpi'/>
      <feature name='ss'/>
      <feature name='ht'/>
      <feature name='tm'/>
      <feature name='pbe'/>
      <feature name='dtes64'/>
      <feature name='monitor'/>
      <feature name='ds_cpl'/>
      <feature name='vmx'/>
      <feature name='smx'/>
      <feature name='est'/>
      <feature name='tm2'/>
      <feature name='xtpr'/>
      <feature name='pdcm'/>
      <feature name='dca'/>
      <feature name='osxsave'/>
      <feature name='f16c'/>
      <feature name='rdrand'/>
      <feature name='arat'/>
      <feature name='tsc_adjust'/>
      <feature name='cmt'/>
      <feature name='intel-pt'/>
      <feature name='md-clear'/>
      <feature name='stibp'/>
      <feature name='ssbd'/>
      <feature name='xsaveopt'/>
      <feature name='mbm_total'/>
      <feature name='mbm_local'/>
      <feature name='pdpe1gb'/>
      <feature name='abm'/>
      <feature name='invtsc'/>
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
      <pages unit='KiB' size='1048576'/>
    </cpu>
root@compute1:~# virsh cpu-compare virsh-cpu-com1.xml
CPU described in virsh-cpu-com1.xml is identical to host CPU

root@compute1:~# virsh cpu-baseline virsh-cpu-com1.xml
<cpu mode='custom' match='exact'>
  <model fallback='forbid'>Broadwell-IBRS</model>
  <vendor>Intel</vendor>
  <feature policy='require' name='vme'/>
  <feature policy='require' name='ds'/>
  <feature policy='require' name='acpi'/>
  <feature policy='require' name='ss'/>
  <feature policy='require' name='ht'/>
  <feature policy='require' name='tm'/>
  <feature policy='require' name='pbe'/>
  <feature policy='require' name='dtes64'/>
  <feature policy='require' name='monitor'/>
  <feature policy='require' name='ds_cpl'/>
  <feature policy='require' name='vmx'/>
  <feature policy='require' name='smx'/>
  <feature policy='require' name='est'/>
  <feature policy='require' name='tm2'/>
  <feature policy='require' name='xtpr'/>
  <feature policy='require' name='pdcm'/>
  <feature policy='require' name='dca'/>
  <feature policy='require' name='f16c'/>
  <feature policy='require' name='rdrand'/>
  <feature policy='require' name='arat'/>
  <feature policy='require' name='tsc_adjust'/>
  <feature policy='require' name='intel-pt'/>
  <feature policy='require' name='md-clear'/>
  <feature policy='require' name='stibp'/>
  <feature policy='require' name='ssbd'/>
  <feature policy='require' name='xsaveopt'/>
  <feature policy='require' name='pdpe1gb'/>
  <feature policy='require' name='abm'/>
  <feature policy='require' name='invtsc'/>
</cpu>


위 명령어로 출력된 model을 지정

[libvirt]

cpu_mode=custom
cpu_models=Broadwell-IBRS

systemctl restart nova-compute

 

이후 생성된 VM들은 cpu model이 통일 되어 live migration이 가능