Openstack-M版(双节点)热迁移记录

举报
指剑 发表于 2022/09/03 01:17:02 2022/09/03
【摘要】 本次测试采用如下配置 主机名配置IP地址controller4G4核192.168.100.10compute4G4核192.168.100.20 1.编辑/etc/sysconfig/libvirtd...

本次测试采用如下配置

主机名 配置 IP地址
controller 4G4核 192.168.100.10
compute 4G4核 192.168.100.20

1.编辑/etc/sysconfig/libvirtd文件

2.编辑/etc/libvirtd/libvirtd.conf文件

3.重启libvirtd服务

4.测试virsh链接

5.编辑/etc/nova/nova.conf文件

6.重启nova服务

7.开始热迁移

8.检查

1.编辑/etc/sysconfig/libvirtd文件

[root@controller ~]# vi /etc/sysconfig/libvirtd 
# Override the default config file
# NOTE: This setting is no longer honoured if using
# systemd. Set '--config /etc/libvirt/libvirtd.conf'
# in LIBVIRTD_ARGS instead.
LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf

# Listen for TCP/IP connections
# NB. must setup TLS/SSL keys prior to using this
LIBVIRTD_ARGS="--listen"

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
[root@compute ~]# vi /etc/sysconfig/libvirtd 
# Override the default config file
# NOTE: This setting is no longer honoured if using
# systemd. Set '--config /etc/libvirt/libvirtd.conf'
# in LIBVIRTD_ARGS instead.
LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf

# Listen for TCP/IP connections
# NB. must setup TLS/SSL keys prior to using this
LIBVIRTD_ARGS="--listen"

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

在这里插入图片描述
+
+
+
+
+
+

2.编辑/etc/libvirtd/libvirtd.conf文件

 22 listen_tls = 0
 23 
 24 # Listen for unencrypted TCP connections on the public TCP/IP port.
 25 # NB, must pass the --listen flag to the libvirtd process for this to
 26 # have any effect.
 27 #
 28 # Using the TCP socket requires SASL authentication by default. Only
 29 # SASL mechanisms which support data encryption are allowed. This is
 30 # DIGEST_MD5 and GSSAPI (Kerberos5)
 31 #
 32 # This is disabled by default, uncomment this to enable it.
 33 listen_tcp = 1
 163 auth_tcp = "none"

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

在这里插入图片描述在这里插入图片描述

3.重启libvirtd服务

[root@controller ~]# systemctl restart libvirtd
[root@controller ~]# systemctl restart libvirtd    

  
 
  • 1
  • 2

在这里插入图片描述

4.测试virsh链接

[root@controller ~]# virsh -c qemu+tcp://compute/system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # 


[root@conmpute ~]# virsh -c qemu+tcp://controller/system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # 

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

在这里插入图片描述

5.编辑/etc/nova/nova.conf文件

两个节点都需要操作

   3734 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_LIVE, VIR_MIGRATE_TUNNELLED
   3735 
   3736 # Migration flags to be set for block migration (string value)
   3737 # This option is deprecated for removal.
   3738 # Its value may be silently ignored in the future.
   3739 # Reason: The correct block migration flags can be inferred from the new
   3740 # live_migration_tunnelled config option. block_migration_flag will be removed
   3741 # to avoid potential misconfiguration.
   3742 block_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_LIVE, VIR_MIGRATE_NON_SHARED_INC

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

在这里插入图片描述

6重启nova服务

[root@controller ~]# systemctl restart openstack-nova*
[root@compute ~]# systemctl restart openstack-nova*

  
 
  • 1
  • 2

7.开始热迁移

查看实例ID (这里的test为实例名称)

[root@controller ~]# nova show test |awk -F '|' NR==29'{print $3}'
 7a3ba94d-da58-4108-b927-29d3469da357 

  
 
  • 1
  • 2

开始迁移(这里的test实例原本在compute节点,这里需要热迁移到controller节点)

[root@controller ~]# nova live-migration 7a3ba94d-da58-4108-b927-29d3469da357 controller

  
 
  • 1

8.检查

[root@controller ~]# nova show test
+--------------------------------------+----------------------------------------------------------+
| Property                             | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-SRV-ATTR:host                 | controller                                               |
| OS-EXT-SRV-ATTR:hostname             | test                                                     |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | controller                                               |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000004                                        |
| OS-EXT-SRV-ATTR:kernel_id            |                                                          |
| OS-EXT-SRV-ATTR:launch_index         | 0                                                        |
| OS-EXT-SRV-ATTR:ramdisk_id           |                                                          |
| OS-EXT-SRV-ATTR:reservation_id       | r-coe0peip                                               |
| OS-EXT-SRV-ATTR:root_device_name     | /dev/vda                                                 |
| OS-EXT-SRV-ATTR:user_data            | -                                                        |
| OS-EXT-STS:power_state               | 1                                                        |
| OS-EXT-STS:task_state                | -                                                        |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2019-11-05T07:00:26.000000                               |
| OS-SRV-USG:terminated_at             | -                                                        |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| config_drive                         |                                                          |
| created                              | 2019-11-05T06:59:24Z                                     |
| description                          | -                                                        |
| flavor                               | m1.small (2)                                             |
| hostId                               | 8ffe301f6f31cde750b8a8ce296684831da56b737e0ef3580d86f305 |
| host_status                          | UP                                                       |
| id                                   | 7a3ba94d-da58-4108-b927-29d3469da357                     |
| image                                | centos7.2 (8d98c502-70ee-44d1-8c75-bfef2d1ca444)         |
| int-net network                      | 10.0.0.6                                                 |
| key_name                             | -                                                        |
| locked                               | False                                                    |
| metadata                             | {}                                                       |
| name                                 | test                                                     |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| security_groups                      | default                                                  |
| status                               | ACTIVE                                                   |
| tenant_id                            | 01bf9902a50c4fddb601a0e3edf37c32                         |
| updated                              | 2019-11-05T11:11:16Z                                     |
| user_id                              | 8a163fbfcf80471883d1c3d34ae2aeef                         |
+--------------------------------------+----------------------------------------------------------+

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

文章来源: blog.csdn.net,作者:指剑,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/fly1574/article/details/102922487

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。