Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

VSPhere uses vMotion to realize Virtual Machine Hot Migration in detail

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

An external shared storage server is essential for a hot migration, as both the source ESXi host and the target ESXi host must have access to the virtual machine files, so the virtual machine configuration files must be migrated onto external shared storage prior to the hot migration.

Openfiler is a free NAS/ISCSI SAN server system, mainly used to provide independent storage systems for LAN hosts. Openfiler provides a variety of connection methods including NFS, SMB, ISCSI, target, etc., generally managed through http. It is the best tool for small and medium-sized enterprises wishing to build virtualization.

vMotion is the foundation for all of vSPhere's advanced features and enables hot migration.

Migration process for vMotion (VM reverts to original state and location if errors occur during migration):

When a vMotion migration is requested, vCenter server verifies that the state of the VM and ESXi host is stable; at this point, the source ESXi host clones VM memory to the new ESXi host; the source ESXi host records memory information that changed during the clone on the memory map (Some people also become ECG); when VM memory data is migrated to the new ESXi host, the source ESXi host puts the VM at rest, where the VM is out of service (just for a second or two), and then clones the memory map to the new ESXi host. The time required for quiescence is extremely short; the new ESXi recovers memory data according to the memory mapping map, and the memory of the two ESXi hosts for this virtual machine is completely consistent; finally, the virtual machine is run on the new ESXi host, and the memory data is deleted in the source ESXi host (automatically deleted, no operation required)

Compatibility requirements for running vMotion:

Do not allow connection of devices that can only be recognized by a single ESXi host, such as optical drives, floppy drives, etc. Connections to virtual switches without a physical network are not allowed. The migrated virtual machines must reside on external shared storage and be accessible to all ESXi hosts. ESXi hosts have at least 1 Gigabit NIC for vMotion. If using standard switches, you must ensure that port group network labels are consistent for all ESXi hosts. All ESXi hosts must use the same CPU vendor (Intel or AMD)

How to migrate virtual machines:

The topology diagram is as follows:

Now that we have a centos 7 on the ESXi 01 host with ip 192.168.1.6, we migrated to ESXi 02 without service disruption.

First, install openfiler, you can download the ISO image of openfiler through http://www.openfiler.com/ The installation steps for openfiler are as follows:

1. Mount the ISO image, boot it (it is recommended not to connect a hard disk other than the system disk now, otherwise it will be troublesome), and the following interface will appear. Press "enter" to wait for loading:

2. Click "Next":

3. Select the keyboard type. The default is American English. Keep default, click Next:

4, prompt whether to initialize the hard disk, select "yes":

5. Keep the default when selecting disk partitions, click Next:

6. Click "yes":

7. Click "edit" to edit the network card information. After setting the network card information, click "Next":

8. After setting the corresponding time zone, click "Next":

9. Set the root password and click "Next" until you install:

10. Installation completed:

11. So far, the rest of the management work can be done through https (now you need to mount the hard disk used to store data, and ensure that the system detects the newly mounted disk, openfiler This system is similar to the Linux operating system), the management address is as follows:

Second, openfiler system configuration iSCSI

1. Log in to the storage server management page:

2. Log in using the default username and password of the system. The default username is openfiler; the password is password. The initial username and password can be reset after the first login:

3. The interface after login is as follows, showing various initialization configuration information of the current system:

4. Under the system menu "system", you can check the IP address and other network information settings of the current system. If you want to reset the network information, you can click the "configure" link to reconfigure the system network, as shown below:

5. In the "Network Access configuration" area under the "system" menu, configure the security access control list that allows access to the openfiler system. Only the network or host address added to the access control list of the openfiler system allows access to the virtual storage service provided by the openfiler system. In the network access control list, you can add either a network segment or a single host address, as follows:

6. What you need to do next is the same principle as creating an LVM volume in a Linux system. First, create a physical volume, then create a volume group, and finally create an lvm. First, create a physical volume as shown in the following figure:

7. After entering the disk edit page, drop down to see the allocated disk partition information. Click "create" according to the default options in the figure below to complete the creation of physical volumes:

8. Follow the figure below to enter the Create Volume Group interface:

9. As shown in the figure below, group the physical volumes you just made into volume groups:

10. Click Add lvm Volume:

11. After entering the Add Volume page, drop down the page as follows:

Start the ISCIS target server service as follows:

13. After starting the iscis target server service, select the "volumes" menu and click "ISCSI Targets", as shown below:

14. Click ADD to add an ISCSI target:

15. Click LUN Mapping, keep default, click Map:

16. Click the "Network ACL" tab, set Access to "Allow", and then click "update". The "CHAP Authentication" tab can add users who access this target. It is optional, so there is no need to add:

Now that the storage server is set up, connect to the vCenter server to configure:

Log in to vCenter Server and create the required port group:

1. Create VMKernel port groups. First, create port groups for vMotion traffic:

2. Create vMotion port groups according to the wizard:

3、

4、

5、

6. Set the static IP address and click "Next" until it is completed:

7. After creating the vMotion port group, continue to add the port group iscsi used to connect to the storage server:

8、

9. Select "New Standard Switch" and click "Next":

10. Add physical network cards:

11、

12、

13、

14. Connect shared storage as shown in the figure below:

15. Click "Yes":

16、

17. Binding port group:

18、

19、

20、

21. Enter the IP address of the ISCSI host and click OK:

22. Continue to rescan:

23. Click "Devices" and you can see that you have connected to the openfiler storage server:

24. At this point, the preparations are almost complete, and now you need to perform steps 1 through 23 on another ESXi host, create vMotion and ISCSI port groups, and connect to the openfiler storage server. (Note that the network labels for vMotion and ISCSI port groups must be the same, or that the configuration must be the same except for the IP address.)

After both hosts are connected to the ISCSI storage server, you can do the following on either ESXi host:

1、

2、

3. Keep the default and click "Next":

4、

5. Keep the default and click "Next":

6. Allocate the storage space. Actual projects may vary. Keep the default here. Click Next:

7. Click "Done":

8. You can see that the connected shared storage is connected, and another ESXi host will automatically connect (provided that there is no problem with the previous configuration):

At this point, the preparation work is completely done. Another thing to note is that the virtual machine to be migrated cannot mount the CD, because the target host cannot access the mounted CD image, so one more step needs to be set, as follows:

Start migration:

To see if the VM has terminal services during the migration process, you can use the ping command to perform a death ping, and you will find that there will be a few packet delays or a few packets lost during the process. These are all insignificant:

1、

2、

3、

4. Select ISCSI storage server and click "Next":

5、

6. After confirmation, click Finish to start the virtual machine migration:

7. Use the ping command, plus the-t option for death ping, to observe the virtual machine status:

During the migration, delays and packet drops began to occur:

Wait for the progress bar to complete and the VM migration is successful:

It took me almost four hours to write a blog post. I hope all my hard work pays off! Wash up and go to bed...

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report