当前位置:网站首页>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 .
- 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.
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 .
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 .
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 .
Access through a browser or cmd Go to ping Baidu can connect , explain Windows Server Virtual machines are available .
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 .
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 .
“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 .
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 .
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 .
- 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 .
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 .
- 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 .
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 ”.
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 .
“ Choose computing resources ” Part is to choose which virtual machine to migrate esxi On a host .
“ Choose storage ” and “ Select the network ” Just keep the default options .
“ 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 .
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 .
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 .
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 .
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 .
边栏推荐
- golang mqtt/stomp/nats/amqp
- [EI conference sharing] the Third International Conference on intelligent manufacturing and automation frontier in 2022 (cfima 2022)
- For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
- Pointer - character pointer
- 免费的聊天机器人API
- [groovy] XML serialization (use markupbuilder to generate XML data | set XML tag content | set XML tag attributes)
- 如何制作自己的機器人
- Intensive learning weekly, issue 52: depth cuprl, distspectrl & double deep q-network
- MDK debug时设置数据实时更新
- Leetcode 450 deleting nodes in a binary search tree
猜你喜欢
cf:C. The Third Problem【关于排列这件事】
Extracting profile data from profile measurement
Uniapp development, packaged as H5 and deployed to the server
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
How to use the flutter framework to develop and run small programs
[groovy] XML serialization (use markupbuilder to generate XML data | set XML tag content | set XML tag attributes)
免费的聊天机器人API
Free chat robot API
Spark SQL空值Null,NaN判断和处理
随机推荐
小程序容器可以发挥的价值
For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
Classic CTF topic about FTP protocol
[simple implementation of file IO]
esxi的安装和使用
How spark gets columns in dataframe --column, $, column, apply
Notepad + + regular expression replace String
【EI会议分享】2022年第三届智能制造与自动化前沿国际会议(CFIMA 2022)
程序员成长第九篇:真实项目中的注意事项
Pointer - character pointer
Meta AI西雅图研究负责人Luke Zettlemoyer | 万亿参数后,大模型会持续增长吗?
Cve-2017-11882 reappearance
How to make your own robot
The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
State mode design procedure: Heroes in the game can rest, defend, attack normally and attack skills according to different physical strength values.
MySQL存储引擎
cf:D. Insert a Progression【关于数组中的插入 + 绝对值的性质 + 贪心一头一尾最值】
Notepad++ regular expression replacement string
[groovy] compile time meta programming (AST syntax tree conversion with annotations | define annotations and use groovyasttransformationclass to indicate ast conversion interface | ast conversion inte