当前位置:网站首页>Virtual machine online migration based on openstack
Virtual machine online migration based on openstack
2022-06-29 23:51:00 【Brother Xing plays with the clouds】
Virtual machine migration refers to the movement of virtual machine operating systems and applications running on the source physical host to the target physical host or virtual machine , And it can run normally on the target host . stay openstack in ,openstack The migration function of the built-in virtual machine , Allow one to be running Virtual machine instance from a compute node Move to another one compute node. Now I would like to recommend a relevant practical case , The author is the technical director of UFIDA public cloud , Senior member of China computer society , Member of the big data special committee , Former associate researcher of the Chinese Academy of Sciences .
The following is the author's original text :
I have always wanted to share with you the online migration of virtual machines , Considering the stability , After we have been running online for several months, it is stable , Then sum it up and share with you .
Describe the scenario roughly : The system adopts a computing storage loosely coupled structure , The image file of the virtual machine is on the remote shared storage , So the migration speed is very fast . In our system , The fastest one used 6 second , That is, the online migration has been completed , This is real live migration, As we move , While deliberately writing data in the virtual machine , Also completed normally .
Configuration scheme
1. modify Nova.conf file
add to : image_cache_manager_interval=0 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_UNSAFE modify : vncserver_listen=0.0.0.0
2. The names of the participating computing node machines can ping through .
3. Modify the calculation node /etc/libvirt/libvirtd.conf:
before : #listen_tls = 0 after : listen_tls = 0 before : #listen_tcp = 1 after : listen_tcp = 1 add: auth_tcp = "none"
4. modify /etc/sysconfig/libvirtd:
before :# LIBVIRTD_ARGS="--listen" after :LIBVIRTD_ARGS="–listen"
5. Modify the virtual machine to be migrated on the source computing node /var/run/libvirt/qemu/instance–xxx.xml file , Delete migrate-qemu-fd This business , take vnc Change the parameter to 0.0.0.0
6. Restart the compute node nova
7 remarks :
1. Because the cloud machine has not been configured for online migration , Before migrating the virtual machine , The virtual machine needs to be restarted . 2.. Because on the computing node libvirtd In the configuration of auth_tcp="none", It's a security vulnerability , We need to find a safer way , Or after the migration , Comment out the line , restart libvirt 3 An auxiliary program has been written for automatic migration
Problems encountered and solutions
1. Virtual disk Of cache mode by writethrough, An error is reported during migration
openstack Think in CentOS On disk cache mod by writethrough when , Migration is not secure . The solution : stay nova.conf live_migration_flag Add... After the parameter VIR_MIGRATE_UNSAFE, There is no such parameter in the official online migration configuration file .
2.qemu1.4 One of the bug Causes the migration to fail
Migration failed , On the destination node /var/log/libvrit/qemu/instances--xxxx.log in : char device redirected to /dev/pts/1 (label charserial1) qemu: warning: error while loading state section id 2 load of migration failed terms of settlement : 1. Modify the virtual machine to be migrated on the source computing node /var/run/libvirt/qemu/instance–xxx.xml Deleted in the text migrate-qemu-fd This business 2. Restart the on the source compute node libvirtd 3. And then execute nova live-migration command This operation has been programmed to execute automatically .
3.vncserver The problem of , You need to restart the virtual machine before you can migrate .
Because before Nova.conf in vncserver_listen= Computer node ip, So in the virtual machine Kvm In process parameter vnc= Compute the ip, An error is reported during migration , The destination node cannot be bound to the source node IP, So it needs to be modified Libvirt.xml The configuration file , Restart the virtual machine , Then you can migrate . terms of settlement : 1. On the source compute node /var/run/libvirt/qemu/instance–xxx.xml In the text vnc The parameter of is modified to 0.0.0.0 2. Restart the source compute node libvirtd 3. And then execute nova live-migration command This operation has been programmed to complete automatically
4. After migration console.log,disk The owner became root/root
After migration , Find the virtual machine console.log and disk The document is owned by qemu.qumu Turned into root.root, This estimate is openstack Problems with the migration program , This problem does not affect the virtual machine at present . terms of settlement : The owner of the modified document , This operation has been programmed to complete automatically
5. Source and destination nodes cpu Incompatibilities
Migration failed , stay /var/log/nova/compute Log : "InvalidCPUInfo: Unacceptable CPU info: CPU doesn't have compatibility.\n\n0\n\nRefer to <a href="http://libvirt.org/html/libvirt-libvirt.html#virCPUCompareResult\n" ]"="" style="cursor: pointer; color: rgb(0, 102, 204); text-decoration: none;">http://libvirt.org/html/libvirt-libvirt.html#virCPUCompareResult\n"] terms of settlement : There is no solution yet
6. The destination node memory is negative ,
Migration failed , From the control node api.log The error output on is that the memory of the destination node is -3400, Can not meet the needs of migration . terms of settlement : use nova The command specifies to create a virtual machine on the computing node , Can succeed . It is estimated that the scheduling algorithm at the time of migration is inconsistent with that at the time of virtual machine creation .
7. Error log , stay 2.4 On api.log
The logs that you usually see during migration are : 1. On the destination node /var/log/libvirt/qemu/instances–xxx.log 2. On the destination node /var/log/nova/compute.log 3. On the source node /var/log/nova/compute.log Sometimes migration fails , An error is reported after the command line is executed : ERROR: Live migration of instance bd785968-72f6-4f70-a066-b22b63821c3b to host compute-13 failed (HTTP 400) (Request-ID: req-180d27b5-9dc7-484f-9d9a-f34cccd6daa2) However, no error messages can be seen in the above three log files . terms of settlement : On the control node or the node that operates the migration command /var/log/nova/api.log There is an error message
The detour
1. Try not to modify nova.conf Inside vncserver_listen Parameter is 0.0.0.0,
take /var/run/log/libvirt/qemu/instances--xxx.log Inside vnc Change to the destination node ip, restart libvritd, Then move on , Can succeed , But if the migration fails , When you need to restart the virtual machine , Virtual machine startup failed , stay /var/log/libvrit/qemu/instances-xx.log The mistake is Failed to start VNC server on `172.18.2.15:0': Failed to bind socket: Cannot assign requested address and /mnt/instances/instance--xxx/libvirt.xml There is no change to the destination node in Ip. I don't know where this parameter is saved
2.vnc Port problem
After a migration failure , At the destination node /var/log/libvirt/qemu/instance--xxx.log The mistake in is : 2013-11-05 05:42:39.401+0000: shutting down qemu: terminating on signal 15 from pid 10271, The guess is that the virtual machine is on the source node vnc The listening port is occupied on the destination node , So it can not be started . Later, it was tested on other machines and found that , After migrating to the destination node vnc The port of can be adjusted by itself .
Reference resources :
How to Migrate an Instance with Zero Downtime: OpenStack Live Migration with KVM Hypervisor and NFS Shared Storage
边栏推荐
- C pointer advanced 1-- > character pointer, array pointer, pointer and array parameter transfer, function pointer
- Leetcode 1385. Distance value between two arrays
- Binary search tree 230 The element with the smallest K in the binary search tree 1038 From binary search tree to larger sum tree
- FPGA开发(1)——串口通信
- Sword finger offer 14- ii Cutting rope II
- Sword finger offer 13 Range of motion of robot
- [leetcode] a number that appears only once [136]
- Pain points and solutions of M1 notebook home office | community essay solicitation
- AI empowers new retail, the way to win "wisdom" lies in ecological thinking | selected excerpts from digital intelligence night talk live broadcast
- LC: maximum subarray and
猜你喜欢

打造一个 API 快速开发平台,牛逼!

均值、方差、标准差、协方差的概念及意义

声网自研传输层协议 AUT 的落地实践丨Dev for Dev 专栏

Paper writing tool: latex online website

FPGA Development (2) -- IIC communication

SQL question brushing 595 Big country

HPE launched ARM CPU general server product
![[译]在软件开发行业工作 6 年后,那些年我曾改过的观念](/img/69/c9829b14223f1e8fd3137d0750d8f7.png)
[译]在软件开发行业工作 6 年后,那些年我曾改过的观念

Halcon practical: design idea of solder joint detection

LC:最大子数组和
随机推荐
我想知道今天还可以开户么?另外想问,现在在线开户安全么?
Jetpack之Room的使用,结合Flow
除子
CE second operation
Solr基础操作
架构实战营模块5作业
剑指 Offer 14- II. 剪绳子 II
matplotlib matplotlib中plt.hist()参数解释
Binary search tree 230 The element with the smallest K in the binary search tree 1038 From binary search tree to larger sum tree
请指教同花顺软件究竟是什么?究竟网上开户是否安全么?
Procurement intelligence is about to break out, and the "3+2" system of Alipay helps enterprises build core competitive advantages
Solr basic operation 2
6.28 problem solving
Applet plug-in access, development and precautions
绿树公司官方网站
333333333333333333333333333333
After working in the software development industry for six years, I changed my ideas in those years
Solr基础操作2
Use of jetpack's room in combination with flow
二叉搜索树 230. 二叉搜索树中第K小的元素 1038. 从二叉搜索树到更大和树