RedHat 7 KVM Virtual machine Online migration between two host hosts

Source: Internet
Author: User

This article mainly uses two Redhat 7 KVM host and NFS shares to migrate virtual machines located in shared storage between the two host hosts online.

The original source of this article: Jiangjianrong Technical Blog http://jiangjianlong.blog.51cto.com/3735273/1793913


Environment Introduction:

650) this.width=650; "title=" Migration 23-1.png "src=" http://s4.51cto.com/wyfs02/M01/83/6C/ Wkiol1dzp5nbztydaaag7-i6d2m497.png "alt=" Wkiol1dzp5nbztydaaag7-i6d2m497.png "/>


configuration process:

1, configure the NFS service on RH7-02, share the/share directory.

650) this.width=650; "title=" Migration 01.png "style=" Float:none; "alt=" wkiom1dwwinrns2laaacqx8n3fk720.png "src=" http:/ S3.51cto.com/wyfs02/m01/83/53/wkiom1dwwinrns2laaacqx8n3fk720.png "/>

2. Add the NFS shared directory to the storage pool for both hosts, and add a storage pool by clicking the + sign in the lower left corner, as an example of rh7-02 add storage pool

650) this.width=650; "title=" Migration 02.png "style=" Float:none; "alt=" wkiol1dwwirx-o9-aacdzhoyf3k415.png "src=" http:/ S4.51cto.com/wyfs02/m02/83/52/wkiol1dwwirx-o9-aacdzhoyf3k415.png "/>

3. The name of the input storage pool is share, select the type netfs:network exported Directory

650) this.width=650; "title=" Migration 03.png "style=" Float:none; "alt=" wkiom1dwwiqtviwuaachjhbypho963.png "src=" http:/ S4.51cto.com/wyfs02/m02/83/53/wkiom1dwwiqtviwuaachjhbypho963.png "/>

4, fill in the information of the storage pool, where target path path must be the same two host, format must choose NFS, and then enter the host name of NFS server, here directly fill in the IP address, Source path refers to the NFS server provides a shared directory

650) this.width=650; "title=" Migration 04.png "style=" Float:none; "alt=" wkiol1dwwiqqhem4aab-viq3hrg389.png "src=" http:/ S1.51cto.com/wyfs02/m00/83/52/wkiol1dwwiqqhem4aab-viq3hrg389.png "/>

5. Complete the Storage pool additions

650) this.width=650; "title=" Migration 05.png "style=" Float:none; "alt=" wkiom1dwwivzcxiiaacn66csn-q523.png "src=" http:/ S1.51cto.com/wyfs02/m00/83/53/wkiom1dwwivzcxiiaacn66csn-q523.png "/>

6. After the storage pool is created, the share subdirectory is automatically created in the target path path

650) this.width=650; "title=" Migration 06.png "style=" Float:none; "alt=" wkiol1dwwivj3j2haaapiffg2qi095.png "src=" http:/ S5.51cto.com/wyfs02/m01/83/52/wkiol1dwwivj3j2haaapiffg2qi095.png "/>

7. After the storage pool is created, the NFS shared directory is automatically mounted to the target Path

650) this.width=650; "title=" Migration 07.png "style=" Float:none; "alt=" wkiom1dwwivyd8b6aabuhaqoj2u856.png "src=" http:/ S1.51cto.com/wyfs02/m01/83/53/wkiom1dwwivyd8b6aabuhaqoj2u856.png "/>

8, create a new storage volume, click New Volume, enter the storage volume parameters, such as the name test-vm.img, format qcow2, size 8G storage volume

650) this.width=650; "title=" Migration 08.png "style=" Float:none; "alt=" wkiol1dwwizbm4h_aadvglqgj_4277.png "src=" http:/ S2.51cto.com/wyfs02/m02/83/52/wkiol1dwwizbm4h_aadvglqgj_4277.png "/>

9, complete the creation of the storage volume, the volume will be used as the hard disk of the virtual machine

650) this.width=650; "title=" Migration 09.png "style=" Float:none; "alt=" wkiom1dwwiyq6jpwaacy6cqip9g882.png "src=" http:/ S2.51cto.com/wyfs02/m02/83/53/wkiom1dwwiyq6jpwaacy6cqip9g882.png "/>

10, the storage volume created after the permissions are very low, can not be used by the virtual machine, need to change permissions, directly granted 777 permissions

650) this.width=650; "title=" Migration 13-1.png "style=" Float:none; "alt=" wkiom1dwwkbral60aabdvr1juo4860.png "src=" http:/ S3.51cto.com/wyfs02/m01/83/53/wkiom1dwwkbral60aabdvr1juo4860.png "/>

11. Create virtual machine, name TEST-VM, select Import existing disk image

650) this.width=650; "title=" Migration 10.png "style=" Float:none; "alt=" wkiol1dwwi2dwb3maab_3ufjoki396.png "src=" http:/ S2.51cto.com/wyfs02/m00/83/52/wkiol1dwwi2dwb3maab_3ufjoki396.png "/>

12. Import the storage volume we created above

650) this.width=650; "title=" Migration 11.png "style=" Float:none; "alt=" wkiol1dwwi3jikscaaboejgulkc942.png "src=" http:/ S5.51cto.com/wyfs02/m02/83/52/wkiol1dwwi3jikscaaboejgulkc942.png "/>

13. Select the CPU and memory configuration for the virtual machine

650) this.width=650; "title=" Migration 12.png "style=" Float:none; "alt=" wkiom1dwwi2ilxetaabtsr2gzzy123.png "src=" http:/ S5.51cto.com/wyfs02/m00/83/53/wkiom1dwwi2ilxetaabtsr2gzzy123.png "/>

14, complete the creation of virtual machine

650) this.width=650; "title=" Migration 13.png "style=" Float:none; "alt=" wkiol1dwwi2xkcc4aabzn55r78y377.png "src=" http:/ S5.51cto.com/wyfs02/m01/83/52/wkiol1dwwi2xkcc4aabzn55r78y377.png "/>

15. Adjust the virtual machine hardware, add New hardware, select the IDE CDROM under storage, and load the mirror to install the operating system


650) this.width=650; "Width=" 832 "height=" 538 "title=" Migrate 14.png "style=" Width:726px;height:486px;float:none; "alt=" Wkiom1dwwkegybvyaagwqwjxasc398.png "src=" Http://s3.51cto.com/wyfs02/M02/83/53/wKiom1dwwKegybvyAAGWQwjXAsc398.png "/>

16, under the IDE CDROM1 interface, click Connect, select a Redhat 7 installation image to connect

650) this.width=650; "Width=" 826 "height=" 544 "title=" Migrate 15.png "style=" Width:729px;height:473px;float:none; "alt=" Wkiol1dwwkezfdm3aaeoqplugdy443.png "src=" Http://s3.51cto.com/wyfs02/M02/83/52/wKioL1dwwKezFdM3AAEoQPLUgDY443.png "/>

17, under the Boot options interface, tick CDROM as the boot preferences for booting from the optical drive

650) this.width=650; "Width=" 834 "height=" 572 "title=" Migrate 16.png "style=" Width:731px;height:495px;float:none; "alt=" Wkiom1dwwkijukyjaaeizhgbfto519.png "src=" Http://s2.51cto.com/wyfs02/M02/83/53/wKiom1dwwKijukyJAAEIZHGBFto519.png "/>

18, turn on the virtual machine power supply, install the operating system, after installing the operating system, remember to remove the boot options cdrom or downgrade the CDROM priority, to ensure that the hard disk boot

650) this.width=650; "Width=" 830 "height=" 690 "title=" Migrate 17.png "style=" Width:742px;height:611px;float:none; "alt=" Wkiol1dwwkiw2v9faabepjjuqti822.png "src=" Http://s2.51cto.com/wyfs02/M00/83/52/wKioL1dwwKiw2V9FAABEpjJuqTI822.png "/>

650) this.width=650; "Width=" 1029 "height=" 702 "title=" Migrate 18.png "style=" Width:724px;height:456px;float:none; "alt=" Wkiom1dwwkndumahaagplauxh70111.png "src=" Http://s1.51cto.com/wyfs02/M00/83/53/wKiom1dwwKnDUMahAAGPLAuxH70111.png "/>

19, another host rh7-01 configuration: As with rh7-02, configure the NFS storage pool.

20, Domain name resolution: In the two host/etc/hosts file, add each other's IP and host name for the hosts resolution

21. In rh7-02 virtual Machine Manager, connect 192.168.10.40 (i.e. rh7-01), then right-click on TEST-VM under localhost and select migrate

650) this.width=650; "title=" Migration 19.png "style=" Float:none; "alt=" wkiol1dwwkuyvesbaaby_a3skqo224.png "src=" http:/ S1.51cto.com/wyfs02/m00/83/52/wkiol1dwwkuyvesbaaby_a3skqo224.png "/>

22. In the Migration dialog box, select New host as 192.168.10.40 (i.e. rh7-01) and click Migrate to


650) this.width=650; "title=" Migration 20.png "style=" Float:none; "alt=" wkiol1dwwlcshrjwaactqcu56iw948.png "src=" http:/ S4.51cto.com/wyfs02/m01/83/52/wkiol1dwwlcshrjwaactqcu56iw948.png "/>

650) this.width=650; "title=" Migration 21.png "style=" Float:none; "alt=" wkiom1dwwllddoojaacd8jm0dii678.png "src=" http:/ S4.51cto.com/wyfs02/m01/83/53/wkiom1dwwllddoojaacd8jm0dii678.png "/>

23, only a few seconds has been the virtual machine TEST-VM online migration to another host 192.168.10.40 (that is, rh7-01), and rh7-02 on the original TEST-VM is in the shutdown state, through the migration of the virtual machine before the long ping, packet loss 0~1 packets

650) this.width=650; "title=" Migration 22.png "style=" Float:none; "alt=" wkiol1dwwlohvvtiaabnmqlyxs0029.png "src=" http:/ S4.51cto.com/wyfs02/m02/83/52/wkiol1dwwlohvvtiaabnmqlyxs0029.png "/>

24. However, if you migrate the virtual machine TEST-VM from 192.168.10.40 (that is, rh7-01) back online to localhost (that is, rh7-02), you will lose twenty or thirty packets for reasons not yet known.


This article is from the "Jiangjianrong Technology blog" blog, make sure to keep this source http://jiangjianlong.blog.51cto.com/3735273/1793913

RedHat 7 KVM Virtual machine Online migration between two host hosts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.