当前位置:网站首页>VSphere implements virtual machine migration

VSphere implements virtual machine migration

2022-07-06 00:44:00 51CTO

     Use vSphere Virtual machine migration can be divided into shared storage and non shared storage , When there is no shared storage , Slow migration 、 Business will be affected ; When there is shared storage , Fast migration , Business opportunities will not be affected .

     In the use of vSphere When implementing virtual machine migration , We need to use VMware vSphere vCenter Management procedure , The program depends on the operating system , Must be installed on Windows Server System and the system version is not lower than Windows Server 2008 SP2, If using Windows Server 2008 You also need to install some patches , I'll take it here Windows Server 2016 To demonstrate how to install VMware vSphere vCenter Program .

  1. install VMware vCenter Server

1.1 install Windows Server virtual machine

1.1.1 establish Windows Server virtual machine

     stay VMware Workstation install Windows Server The steps are similar to installing other virtual machines , Mainly pay attention to the choice of client operating system , In addition, the disk score is higher , And the memory setting cannot be lower than 8G.

vSphere Realize virtual machine migration _vSphere

vSphere Realize virtual machine migration _vCenter_02

1.1.2 install Windows Server virtual machine

    VMware Workstation Install in Windows Server Virtual machine and the second esxi install Windows The virtual machine steps are the same , The specific process is as follows .

vSphere Realize virtual machine migration _vSphere_03

vSphere Realize virtual machine migration _vCenter_04

vSphere Realize virtual machine migration _ Data Center _05

vSphere Realize virtual machine migration _ transfer _06

vSphere Realize virtual machine migration _ Data Center _07

vSphere Realize virtual machine migration _ Shared memory _08

vSphere Realize virtual machine migration _vCenter_09

vSphere Realize virtual machine migration _vCenter_10

vSphere Realize virtual machine migration _ transfer _11

vSphere Realize virtual machine migration _vCenter_12

vSphere Realize virtual machine migration _ Shared memory _13

vSphere Realize virtual machine migration _ Shared memory _14

1.1.3 Windows Server Virtual machine settings

     Default installed Windows Server Virtual machines are dynamic addresses , But the later stage is to carry out ssl Encrypted , So you must change it to a static address .

vSphere Realize virtual machine migration _ Data Center _15

     Besides ,Windows Server The virtual machine needs to turn off the firewall , Otherwise, many default ports in the later stage will not be able to open to provide services .

vSphere Realize virtual machine migration _ Data Center _16

    Access through a browser or cmd Go to ping Baidu can connect , explain Windows Server Virtual machines are available .

vSphere Realize virtual machine migration _vSphere_17


1.2 install VMware vCenter Server

1.2.1 mount ISO File and install

    VMware vSphere vCenter programmatic ISO You can search the Internet for access , Just one of my learning materials was directly used . stay Windows Server When the virtual machine is powered on , adopt VMware Workstation The settings for will ISO Change the file to be used vSphere vCenter Program ISO file .

vSphere Realize virtual machine migration _vCenter_18

     add to ISO After the document , You can see Windows Server The virtual machine has been able to recognize the drive , stay “ file ”—“ This computer ” There is already a drive in , Double click to open to start installation . The first part of the installation process is basically to click next ,“ System network name ” Some need to be Windows Server Service IP Bind to the domain name , Later, access and login through the domain name web Manage Pages , Domain names are generally in vcenter start , You can also customize it , It is best to ping Let's see if it works .

vSphere Realize virtual machine migration _ Shared memory _19

vSphere Realize virtual machine migration _vSphere_20

vSphere Realize virtual machine migration _ Data Center _21

vSphere Realize virtual machine migration _ Data Center _22

vSphere Realize virtual machine migration _vCenter_23

vSphere Realize virtual machine migration _vCenter_24

vSphere Realize virtual machine migration _vCenter_25

vSphere Realize virtual machine migration _ transfer _26

vSphere Realize virtual machine migration _vSphere_27

vSphere Realize virtual machine migration _vCenter_28

vSphere Realize virtual machine migration _vCenter_29

    “vCenter Single Sign-On To configure ” Part is login web When managing pages , The user name defaults to administrator, The domain name defaults to vsphere.local, The login name is [email protected], The login password part needs to be set to case 、 Special characters and numbers , And not less than 8 position .

vSphere Realize virtual machine migration _vSphere_30

     The rest can be left as default ,“ Ready to install ” If the part is confirmed to be correct, you can click “ complete ” Start installation , The length of installation depends on the hardware configuration , It usually takes about ten minutes , If it is a mechanical hard disk, it may take dozens of minutes .

vSphere Realize virtual machine migration _vCenter_31

vSphere Realize virtual machine migration _ Shared memory _32

vSphere Realize virtual machine migration _vSphere_33

vSphere Realize virtual machine migration _vSphere_34

vSphere Realize virtual machine migration _ Data Center _35

vSphere Realize virtual machine migration _vCenter_36

vSphere Realize virtual machine migration _ transfer _37

vSphere Realize virtual machine migration _ Shared memory _38

1.2.2 Sign in web Manage Pages

     Local computer modification hosts After the document , You can pass “ System network name ” Some set domain names enter the login interface , And pass “vCenter Single Sign-On To configure ” Part of the user name and password set to log in .

vSphere Realize virtual machine migration _ transfer _39

vSphere Realize virtual machine migration _vSphere_40

vSphere Realize virtual machine migration _ Shared memory _41


  1. add to esxi Host to vCenter Server

2.1 esxi The host machine is ready

     The author has prepared two esxi host , One is created in the previous experiment IP by 10.0.0.180 Of VMware ESXi 6.7-1( Hereinafter referred to as esxi1), And created a IP by 10.0.0.186 Of CentOS7.9 virtual machine ; Prepare another one VMware ESXi 6.7-2( Hereinafter referred to as esxi2),IP by 10.0.0.190, Also create one on it CentOS7.9 virtual machine ,IP by 10.0.0.196,VMware ESXi 6.7-2 The creation process of is not demonstrated , For details, please refer to the previous two experiments .

2.2 add to esxi Host to vCenter Server

     Right click vCenter Server Left menu bar , choice “ New data center ”, Enter the name of the data center to create . Right click the new data center , choice “ Add host ”, add to esxi1 The host IP And account information , Just keep the default options for the other items , Check the information on the confirmation page and click “finish” Can be esxi1 Added to the vCenter Server Data Center . In the same way, add esxi2 To the data center .

vSphere Realize virtual machine migration _ Shared memory _42

vSphere Realize virtual machine migration _ transfer _43

vSphere Realize virtual machine migration _vSphere_44

vSphere Realize virtual machine migration _vSphere_45

vSphere Realize virtual machine migration _ transfer _46

vSphere Realize virtual machine migration _vCenter_47

vSphere Realize virtual machine migration _ transfer _48

vSphere Realize virtual machine migration _ Shared memory _49

vSphere Realize virtual machine migration _ Data Center _50

2.3 To configure vMotion The Internet

     If you want to be in vSphere Realize the migration of virtual machines in , You need to configure two for migration esxi The host vMotion The Internet . Right click esxi1, choice “ To configure ”—“ Virtual switch ”—“ Add network ” Set it up .“ Connection type ” and “ Target device ” Keep some of the default options ,“ Port properties ” Check the part vMotion,“IPv4 Set up ” Part changed to static IP, Fill in a esxi The same network segment of the host is not used IP, And the subnet mask should be consistent , Confirm that the information on the page is checked and click “finish” complete esxi1 Of vMotion The network configuration . Empathy ,esxi2 The host should also be configured vMotion The Internet .

vSphere Realize virtual machine migration _ Shared memory _51

vSphere Realize virtual machine migration _ transfer _52

vSphere Realize virtual machine migration _vCenter_53

vSphere Realize virtual machine migration _ transfer _54

vSphere Realize virtual machine migration _ Shared memory _55

vSphere Realize virtual machine migration _ Data Center _56

vSphere Realize virtual machine migration _ Data Center _57

vSphere Realize virtual machine migration _ transfer _58

vSphere Realize virtual machine migration _ transfer _59


  1. Migrate virtual machines

     Use vSphere There are two ways to migrate virtual machines: no shared storage and shared storage .

3.1 No shared storage

     Before virtual machine migration , To uncheck virtual machine “ Edit settings ” Part of the drive connection , Otherwise, the goal esxi When the host has no files in the corresponding directory, the migration will fail , And the migrated virtual machine cannot be started in a short time 、 Close or delete .

vSphere Realize virtual machine migration _ transfer _60

     With esxi2 In the host CentOS Virtual machine migration to esxi1 For example , The virtual machine to be migrated can be in the boot state , Right click the virtual machine to be migrated , choice “ transfer ”.

vSphere Realize virtual machine migration _ Data Center _61

     There are three types of migration , Respectively, only change computing resources 、 Change storage only and both , The author wants to esxi2 All virtual machines on the host are migrated , Then choose the third .

vSphere Realize virtual machine migration _ Shared memory _62

    “ Choose computing resources ” Part is to choose which virtual machine to migrate esxi On a host .

vSphere Realize virtual machine migration _ Data Center _63

    “ Choose storage ” and “ Select the network ” Just keep the default options .

vSphere Realize virtual machine migration _ transfer _64

vSphere Realize virtual machine migration _vCenter_65

    “ choice vMotion priority ” part , If it is during the day or when the server is busy , It is suggested to choose the second , If the server is not under pressure , You can choose the first .

vSphere Realize virtual machine migration _vCenter_66

     Click finish after confirming that the information on the page is correct , wait for vCenter Server After the task status at the bottom of the management page is completed , You can complete the migration of virtual machines . Because there are no services installed in the virtual machine migrated by the author , So even migration without storage , The speed is also relatively fast , If there is a lot of server data in production , Using this method for migration will be much slower , And may cause the business to be greatly affected .

vSphere Realize virtual machine migration _ transfer _67

vSphere Realize virtual machine migration _ transfer _68

3.2 There's shared storage

     In the enterprise , Usually through deployment nfs Server to realize shared storage ,nfs The server creates a shared directory , And mount to each esxi On a host .esxi When creating or migrating virtual machines on the host, it seems that they are done locally , In fact, disk data is placed in nfs On the server , Its advantage lies in the later data migration and high availability . When a virtual machine fails and is unavailable , Its disk files are still available , And keep it in nfs Server , Just put the nfs The file of the corresponding virtual machine in the server can be imported into other normal servers to continue to use .

     The author has opened a new virtual machine as nfs The server , install nfs-utils service , And create /data/vmware Directory as a shared directory .

vSphere Realize virtual machine migration _vSphere_69

vSphere Realize virtual machine migration _vCenter_70

    esxi1 and esxi2 You need to add nfs Server shared directory storage , Right click esxi Host selection “ Storage ”—“ New data store ”,“ type ” Part of the choice NFS, Version selection NFS4.1,“ Name and configuration ” Some names can be customized , Folders and servers should be added with corresponding nfs server information , The authentication section remains the default option , Check the confirmation page and click Finish .

vSphere Realize virtual machine migration _ Data Center _71

vSphere Realize virtual machine migration _vSphere_72

vSphere Realize virtual machine migration _vCenter_73

vSphere Realize virtual machine migration _vCenter_74

vSphere Realize virtual machine migration _ Shared memory _75

vSphere Realize virtual machine migration _vCenter_76

     Migrate to esxi1 Take the virtual machine of the host as an example , Right click the virtual machine and select “ transfer ”, The migration process is roughly the same as that of unshared storage , Mainly “ Choose storage ” Part of the choice nfs. Although the migration is still the previous virtual machine , But you can also feel that the migration speed has increased , And you can nfs See the migrated virtual machine disk files in the shared directory of the server , If you want to migrate the virtual machine later , Only through nfs Server migration computing resources , Instead of migrating storage , It will be faster than the first time .

vSphere Realize virtual machine migration _vSphere_77

vSphere Realize virtual machine migration _vCenter_78

vSphere Realize virtual machine migration _ transfer _79

vSphere Realize virtual machine migration _vCenter_80

原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060033053242.html