CN109743417A - A method of for the virtual machine automatic IP address allocation on ESXI host - Google Patents

A method of for the virtual machine automatic IP address allocation on ESXI host Download PDF

Info

Publication number
CN109743417A
CN109743417A CN201910227459.8A CN201910227459A CN109743417A CN 109743417 A CN109743417 A CN 109743417A CN 201910227459 A CN201910227459 A CN 201910227459A CN 109743417 A CN109743417 A CN 109743417A
Authority
CN
China
Prior art keywords
address
virtual machine
vcenter
platform
management platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910227459.8A
Other languages
Chinese (zh)
Inventor
彭海燕
于昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Inspur Cloud Information Technology Co Ltd
Original Assignee
Shandong Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Inspur Cloud Information Technology Co Ltd filed Critical Shandong Inspur Cloud Information Technology Co Ltd
Priority to CN201910227459.8A priority Critical patent/CN109743417A/en
Publication of CN109743417A publication Critical patent/CN109743417A/en
Pending legal-status Critical Current

Links

Abstract

The present invention discloses a kind of method for the virtual machine automatic IP address allocation on ESXI host, it is related to field of cloud computer technology, resources of virtual machine operation interface wherein based on vmware api interface encapsulation vCenter management platform, platform, which is managed, by vCenter creates IP resource pool, vCenter management platform calls resources of virtual machine operation interface to create virtual machine on ESXI host, available IP address is selected from IP resource pool for virtual machine, virtual machine is written in IP address and corresponding network related information by resources of virtual machine operation interface to correspond in the IP configuration file of network interface card, restart network, IP configuration file is set to come into force, and confirm whether virtual machine creating is successful and whether binds corresponding IP address, complete the automatic distribution of IP address.

Description

A method of for the virtual machine automatic IP address allocation on ESXI host
Technical field
The present invention discloses a kind of method for the virtual machine automatic IP address allocation on ESXI host, is related to cloud computing technology Field.
Background technique
VCenter management ESXI host on create virtual machine, can not automatic IP address allocation, in the prior art generally Frequently with two ways:
DHCP service: for corresponding network, disposing DHCP service, sends out DHCP request automatically when binding network interface card and obtains IP Address.Advantage: IP address not will cause IP address conflict generally by Dynamic Host Configuration Protocol server management.Disadvantage: the distribution of IP address is complete Rely on DHCP service, if DHCP service goes wrong, when virtual machine again to Dynamic Host Configuration Protocol server request address when, such as It is switched on after organ's machine, it may appear that the case where not getting address causes virtual machine available without IP address.
Manual configuration: for virtual machine, manual configuration IP address is carried out.Advantage: relatively more flexible.Disadvantage: it is likely to occur mistake Operation, the degree of automation are low.
There is certain defect in above two mode, the present invention provides a kind of virtual machine on ESXI host and distributes automatically The method of IP address, application propose to safeguard IP resource pool based on cloud platform, automatic for the virtual machine on ESXI host by interface IP address is distributed, other services are not depended on, when realizing automatic distribution, and deleting virtual machine, the IP address can be recycled, Avoid the wasting of resources.
Summary of the invention
The present invention is directed to problem of the prior art, provides a kind of virtual machine automatic IP address allocation on ESXI host Method, by cloud platform management, for the virtual machine automatic IP address allocation on the ESXI host of vCenter management.
Concrete scheme proposed by the present invention is:
A method of for the virtual machine automatic IP address allocation on ESXI host, specific steps are as follows:
Step 1: the resources of virtual machine operation interface based on vmware api interface encapsulation vCenter management platform,
Step 2: platform is managed by vCenter and creates IP resource pool,
Step 3:vCenter management platform calls resources of virtual machine operation interface to create virtual machine on ESXI host, from Available IP address is selected for virtual machine in IP resource pool, by resources of virtual machine operation interface by IP address and corresponding network Relevant information write-in virtual machine corresponds in the IP configuration file of network interface card, restarts network, IP configuration file is made to come into force, and confirms virtual Whether machine creation is successful and whether binds corresponding IP address, so that IP address is come into force, to complete the automatic distribution of IP address.
IP address and the corresponding network related information of IP address are stored in IP resource pool in step 2 in the method VCenter is managed in the IP resource table of platform, and all IP address are initialized as unused state when using for the first time.
VCenter manages platform from IP resource pool as virtual machine with selecting available IP in step 3 in the method Location, and the state of the IP address in IP resource table is set to and has used state, if vCenter manage platform on ESXI host not at Function creates virtual machine, then the state of the IP address is set to unused state.
If vCenter manages platform and successfully creates virtual machine on ESXI host in step 3 in the method, VCenter manages platform and corresponds to IP address and corresponding network related information write-in virtual machine in the IP configuration file of network interface card, Restart network, IP configuration file made to come into force, obtains the IP address of the virtual machine,
Judge obtain IP address whether be vCenter management platform selecting IP address,
It is that virtual machine creating is successful and binds corresponding IP address, and IP address is allocated successfully automatically, is not, IP is provided The state that vCenter manages the IP address of platform selecting in the table of source is set to unused state, virtual machine creating failure.
It, will if virtual machine is deleted successfully when vCenter manages platform deletion virtual machine in step 3 in the method The state for the IP address for having distributed to the virtual machine in the IP resource table of vCenter management platform is set to unused state, such as Fruit virtual machine deletes failure, does not discharge IP address.
A kind of system for the virtual machine automatic IP address allocation on ESXI host, including vCenter management platform and ESXI host, wherein the resources of virtual machine operation interface based on vmware api interface encapsulation vCenter management platform, passes through VCenter manages platform and creates IP resource pool, and vCenter manages platform and calls resources of virtual machine operation interface on ESXI host Virtual machine is created, selects available IP address from IP resource pool for virtual machine, by IP by resources of virtual machine operation interface Location and corresponding network related information write-in virtual machine correspond in the IP configuration file of network interface card, restart network, make IP configuration file It comes into force, and confirms whether virtual machine creating is successful and whether binds corresponding IP address, so that IP address is come into force, so as to completing IP The automatic distribution of location.
IP address network corresponding to IP address is related in the IP resource pool of vCenter management platform in the system believes Breath is stored in IP resource table, and all IP address are initialized as unused state when using for the first time.
VCenter manages platform and selects available IP address from IP resource pool for virtual machine in the system, and will The state of the IP address, which is set to, in IP resource table has used state, if vCenter management platform creates not successfully on ESXI host The state of the IP address is then set to unused state by virtual machine.
If vCenter manages platform and successfully creates virtual machine on ESXI host in the system, vCenter management is flat Platform corresponds to IP address and corresponding network related information write-in virtual machine in the IP configuration file of network interface card, restarts network, makes IP Configuration file comes into force, and obtains the IP address of the virtual machine,
Judge obtain IP address whether be vCenter management platform selecting IP address,
It is that virtual machine creating is successful and binds corresponding IP address, and IP address is allocated successfully automatically, is not, IP is provided The state that vCenter manages the IP address of platform selecting in the table of source is set to unused state, virtual machine creating failure.
When vCenter manages platform deletion virtual machine in the system, if virtual machine is deleted successfully, by vCenter The state for managing the IP address for having distributed to the virtual machine in the IP resource table of platform is set to unused state, if virtual machine Failure is deleted, IP address is not discharged.
Usefulness of the present invention is:
The present invention provides a kind of method for the virtual machine automatic IP address allocation on ESXI host, passes through vmwareapi The resources of virtual machine operation interface of interface encapsulates, and vCenter manages platform maintenance IP resource pool, manages platform by vCenter It can specify IP address when creating virtual machine, IP address can not also be specified, by resources of virtual machine operation interface by IP address And the corresponding network information is write in the configuration file of virtual machine, if vCenter management platform specifies IP address, will specify Configuration file is written in IP address, if do not specified, an available IP address write-in configuration is may be selected in cloud platform from IP resource pool File realizes that IP address is distributed automatically;The whole life cycle of IP address follows virtual machine, and one is the allocated, then permanent bindings, and one Denier is deleted, then is released immediately.The method of the present invention does not depend on other services, realizes automatic distribution, reduces manual intervention;IP simultaneously Configuration file is written in address, the operation IP address such as can restart to avoid virtual machine and lose;VCenter is with managing platform control IP The problems such as location can release immediately IP address when deleting virtual machine, IP address is avoided to waste, can also be to avoid IP address conflict Occur.
Detailed description of the invention
Fig. 1 is the flow diagram of the method for the present invention creation virtual machine and automatic IP address allocation;
Fig. 2 is the flow chart deleted virtual machine in the present invention and discharge IP address automatically.
Specific embodiment
The present invention provides a kind of method for the virtual machine automatic IP address allocation on ESXI host, specific steps are as follows:
Step 1: the resources of virtual machine operation interface based on vmware api interface encapsulation vCenter management platform,
Step 2: platform is managed by vCenter and creates IP resource pool,
Step 3:vCenter management platform calls resources of virtual machine operation interface to create virtual machine on ESXI host, from Available IP address is selected for virtual machine in IP resource pool, by resources of virtual machine operation interface by IP address and corresponding network Relevant information write-in virtual machine corresponds in the IP configuration file of network interface card, restarts network, IP configuration file is made to come into force, and confirms virtual Whether machine creation is successful and whether binds corresponding IP address, so that IP address is come into force, to complete the automatic distribution of IP address.
There is provided simultaneously correspond to the above method be virtual machine automatic IP address allocation on ESXI host system, packet VCenter management platform and ESXI host are included, wherein the virtual machine based on vmware api interface encapsulation vCenter management platform Resource operation interface manages platform by vCenter and creates IP resource pool, and vCenter manages platform and calls resources of virtual machine behaviour Make interface and create virtual machine on ESXI host, selects available IP address from IP resource pool for virtual machine, pass through virtual machine Resource operation interface corresponds to IP address and corresponding network related information write-in virtual machine in the IP configuration file of network interface card, restarts Network makes IP configuration file come into force, and confirms whether virtual machine creating is successful and whether binds corresponding IP address, makes IP address It comes into force, to complete the automatic distribution of IP address.
The present invention will be further explained below with reference to the attached drawings and specific examples, so that those skilled in the art can be with It more fully understands the present invention and can be practiced, but illustrated embodiment is not as a limitation of the invention.
Platform is managed with a certain vCenter, for ESXI host automatic IP address allocation, with reference to Fig. 1, detailed process Are as follows:
Step 1: the resources of virtual machine operation interface based on vmwareapi interface encapsulation vCenter management platform supplies VCenter is called when managing platform to virtual machine operations,
Step 2: platform is managed by vCenter and creates IP resource pool,
Corresponding network is created, after network creates successfully on vCenter management platform, by available IP all under the network Address, the information preservations such as corresponding gateway, mask, network segment are in the IP resource table of vCenter management platform, and for the first time by institute Some IP address are initialized as unused state,
Step 3: platform is managed by vCenter and creates virtual machine,
Either linux system or Windows system, first install VMtools, and for linux system, inside is not needed Be embedded in script, for Windows system, need to guarantee to create after virtual machine can by password login,
When managing platform creation virtual machine by vCenter, specified IP address can choose, or from IP resource pool An available IP address is selected, after choosing, the state of the IP address in IP resource table is set to and has used state, prevents this The IP address is selected again during virtual machine creating,
Then vCenter manages platform calling resources of virtual machine operation interface and creates on the ESXI host that vCenter is managed Virtual machine is built, if virtual machine creating fails, the state of the IP address in IP resource table is set to unused state, while right The virtual machine of creation failure carries out rollback processing, if virtual machine creating success, vCenter management platform calling interface is opened Machine first powers on, and IP address, gateway, mask, dns information are passed to, after VMtools starting, use that interface passes through virtual machine Name in an account book password login virtual machine configures the IP that incoming IP address, gateway, mask, dns information write-in virtual machine correspond to network interface card In file, network is then restarted, the configuration file of write-in is made to come into force,
Then the IP address of the virtual machine is obtained, if the IP address obtained is not the IP of vCenter management platform selecting Address, the then state that vCenter in IP resource table is managed to the IP address of platform selecting are set to unused state, while to creation The virtual machine of failure carries out rollback processing;If it is the IP address of vCenter management platform selecting, then IP address comes into force, IP Location is allocated successfully automatically.It, can not the reselection IP address when creating virtual machine again.Configuration file is written into IP, ensure that void After quasi- machine restarts, shuts down after the operation such as booting, IP address will not lose, and will not change.
In addition, in the application, the management of virtual machine IP address can be carried out by managing platform by vCenter with reference to Fig. 2, When vCenter manages platform deletion virtual machine, the network information of virtual machine to be deleted, including allocated IP address are first obtained, Then the deletion for carrying out virtual machine will distribute to the virtual machine in the IP resource table of cloud platform if virtual machine is deleted successfully The state of IP address be set to unused state;If virtual machine deletes failure, IP address is not discharged temporarily, prevents from creating again Virtual machine selects distribution when the IP address to fail, and after virtual machine is really deleted, then will distribute in the IP resource table of cloud platform Unused state is set to the state of the IP address of the virtual machine.After IP address release, when creating virtual machine again, it can choose The IP address accomplishes that creation uses, deletes and discharge.
Meanwhile under certain network after all virtual machine is all deleted, vCenter management platform can delete network, delete After network, the information in the IP resource table of cloud platform about the network is also deleted, when preventing from creating virtual machine again, is passed through VCenter management platform can choose the IP address under the network.
It is automatic for the virtual machine on ESXI host that the method provided through the invention can manage cloud platform by vCenter Distribute IP address.Compared with distributing IP address by DHCP service, the dependence to other services is removed;With manual setting IP address It compares, realizes automation, reduce manual intervention.Configuration file is written in IP address by this method simultaneously, with realizing virtual machine IP The static of location guarantees that IP address will not lose, and will not change.
Embodiment described above is only to absolutely prove preferred embodiment that is of the invention and being lifted, protection model of the invention It encloses without being limited thereto.Those skilled in the art's made equivalent substitute or transformation on the basis of the present invention, in the present invention Protection scope within.Protection scope of the present invention is subject to claims.

Claims (10)

1. a kind of method for the virtual machine automatic IP address allocation on ESXI host, it is characterized in that specific steps are as follows:
Step 1: the resources of virtual machine operation interface based on vmware api interface encapsulation vCenter management platform,
Step 2: platform is managed by vCenter and creates IP resource pool,
Step 3:vCenter management platform calls resources of virtual machine operation interface to create virtual machine on ESXI host, provides from IP Source Chi Zhongwei virtual machine selects available IP address, by resources of virtual machine operation interface that IP address is related to corresponding network Information write-in virtual machine corresponds in the IP configuration file of network interface card, restarts network, IP configuration file is made to come into force, and confirms that virtual machine is created It builds and whether succeeds and whether bind corresponding IP address, so that IP address is come into force, to complete the automatic distribution of IP address.
2. according to the method described in claim 1, it is characterized in that IP address and the corresponding net of IP address in IP resource pool in step 2 Network relevant information is stored in the IP resource table of vCenter management platform, is initialized as all IP address when using for the first time Unused state.
3. according to the method described in claim 2, it is characterized in that it is empty from IP resource pool that vCenter, which manages platform, in step 3 Quasi- machine selects available IP address, and the state of the IP address in IP resource table is set to and has used state, if vCenter management is flat Platform creates virtual machine not successfully on ESXI host, then the state of the IP address is set to unused state.
4. according to the method in claim 2 or 3, if it is characterized in that vCenter manages platform on ESXI host in step 3 Virtual machine is successfully created, vCenter manages platform and IP address and corresponding network related information write-in virtual machine are corresponded to network interface card IP configuration file in, restart network, IP configuration file made to come into force, obtain the IP address of the virtual machine,
Judge obtain IP address whether be vCenter management platform selecting IP address,
It is that virtual machine creating is successful and binds corresponding IP address, and IP address is allocated successfully automatically, is not then by IP resource table The state of the IP address of middle vCenter management platform selecting is set to unused state, virtual machine creating failure.
5. according to the method described in claim 4, it is characterized in that in step 3 vCenter manage platform delete virtual machine when, if Virtual machine deletes the state that the IP address of the virtual machine will have successfully been distributed in the IP resource table of vCenter management platform It is set to unused state, if virtual machine deletes failure, does not discharge IP address.
6. a kind of system for the virtual machine automatic IP address allocation on ESXI host, it is characterized in that including that vCenter management is flat Platform and ESXI host, wherein the resources of virtual machine operation interface based on vmware api interface encapsulation vCenter management platform, leads to VCenter management platform creation IP resource pool is crossed, vCenter manages platform and calls resources of virtual machine operation interface in ESXI host Upper creation virtual machine selects available IP address from IP resource pool for virtual machine, by resources of virtual machine operation interface by IP Address and corresponding network related information write-in virtual machine correspond in the IP configuration file of network interface card, restart network, make IP configuration text Part comes into force, and confirms whether virtual machine creating is successful and whether binds corresponding IP address, so that IP address is come into force, completes IP address Automatic distribution.
7. system according to claim 6, it is characterized in that IP address and IP in the IP resource pool of vCenter management platform The corresponding network related information in location is stored in IP resource table, is initialized as all IP address when using for the first time shape is not used State.
8. system according to claim 7 selects it is characterized in that vCenter manages platform from IP resource pool for virtual machine Available IP address, and the state of the IP address in IP resource table is set to and has used state, if vCenter manages platform in ESXI Virtual machine is created on host not successfully, then the state of the IP address is set to unused state.
9. system according to claim 6 or 7, it is characterized in that if vCenter management platform is successfully created on ESXI host Virtual machine is built, vCenter manages platform and matches the IP that IP address and corresponding network related information write-in virtual machine correspond to network interface card It sets in file, restarts network, IP configuration file is made to come into force, obtain the IP address of the virtual machine,
Judge obtain IP address whether be vCenter management platform selecting IP address,
It is that virtual machine creating is successful and binds corresponding IP address, and IP address is allocated successfully automatically, is not then by IP resource table The state of the IP address of middle vCenter management platform selecting is set to unused state, virtual machine creating failure.
10. system according to claim 6 or 7, it is characterized in that when vCenter management platform deletes virtual machine, if empty Quasi- machine is deleted successfully, and the state for the IP address for having distributed to the virtual machine in the IP resource table of vCenter management platform is set IP address is not discharged if virtual machine deletes failure for unused state.
CN201910227459.8A 2019-03-25 2019-03-25 A method of for the virtual machine automatic IP address allocation on ESXI host Pending CN109743417A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910227459.8A CN109743417A (en) 2019-03-25 2019-03-25 A method of for the virtual machine automatic IP address allocation on ESXI host

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910227459.8A CN109743417A (en) 2019-03-25 2019-03-25 A method of for the virtual machine automatic IP address allocation on ESXI host

Publications (1)

Publication Number Publication Date
CN109743417A true CN109743417A (en) 2019-05-10

Family

ID=66371309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910227459.8A Pending CN109743417A (en) 2019-03-25 2019-03-25 A method of for the virtual machine automatic IP address allocation on ESXI host

Country Status (1)

Country Link
CN (1) CN109743417A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800824A (en) * 2020-05-28 2020-10-20 上海诺行信息技术有限公司 Data transmission system of intelligent instrument, driving interface packaging device and method
CN113992630A (en) * 2021-09-10 2022-01-28 新华三大数据技术有限公司 Network resource conflict processing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932498A (en) * 2012-10-24 2013-02-13 广州杰赛科技股份有限公司 Virtual machine internet protocol (IP) resource management method of cloud computing platform
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method
US20140189031A1 (en) * 2012-12-27 2014-07-03 Hon Hai Precision Industry Co., Ltd. Computing device and method of creating virtual machines in hosts
CN106250202A (en) * 2016-07-18 2016-12-21 北京首都在线科技股份有限公司 A kind of cloud platform automatization opens the device and method of virtual machine
CN107707687A (en) * 2017-10-10 2018-02-16 郑州云海信息技术有限公司 A kind of method and apparatus of virtual machine IP address configuration

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932498A (en) * 2012-10-24 2013-02-13 广州杰赛科技股份有限公司 Virtual machine internet protocol (IP) resource management method of cloud computing platform
US20140189031A1 (en) * 2012-12-27 2014-07-03 Hon Hai Precision Industry Co., Ltd. Computing device and method of creating virtual machines in hosts
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method
CN106250202A (en) * 2016-07-18 2016-12-21 北京首都在线科技股份有限公司 A kind of cloud platform automatization opens the device and method of virtual machine
CN107707687A (en) * 2017-10-10 2018-02-16 郑州云海信息技术有限公司 A kind of method and apparatus of virtual machine IP address configuration

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800824A (en) * 2020-05-28 2020-10-20 上海诺行信息技术有限公司 Data transmission system of intelligent instrument, driving interface packaging device and method
CN113992630A (en) * 2021-09-10 2022-01-28 新华三大数据技术有限公司 Network resource conflict processing method, device, equipment and storage medium
CN113992630B (en) * 2021-09-10 2023-08-22 新华三大数据技术有限公司 Network resource conflict processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109614226B (en) Kubernetes-based stateful application storage management method
CN108984266B (en) Virtual machine management method, device and system
CN102710814B (en) The control method of virtual machine IP address and device
US10423572B2 (en) Performing live updates to file system volumes
JP5172855B2 (en) Apparatus and method for resource reuse in data storage
CN107005426B (en) Method and device for managing life cycle of virtual network function
KR20110030447A (en) Synchronizing virtual machine and application life cycles
WO2015062193A1 (en) Implementing and deleting method and device for intelligent terminal multi-operation system
EP3879875A1 (en) Resource change method and device, apparatus, and storage medium
US11561818B1 (en) Monitoring VNFCs that are composed of independently manageable software modules
WO2020011214A1 (en) Method and device for managing virtualized resource
CN109743417A (en) A method of for the virtual machine automatic IP address allocation on ESXI host
CN106201773A (en) The upgrading of instance system, cloud system and instance system or restoration methods
CN106201660A (en) A kind of method of virtual machine automatic upgrading virtual hardware and software
CN105867962A (en) System upgrading method and device
CN105630607A (en) Resource pool management method, container creation method and electronic equipment
CN113254156B (en) Container group deployment method and device, electronic equipment and storage medium
CN112559127B (en) Virtual machine creation method, device, host and storage medium
CN111399866B (en) Updating method and device of VNF (virtual network function) package
CN106301877A (en) The upgrade method of a kind of Virtual NE and device
CN106803786B (en) Network element updating method and system based on network function virtualization
WO2016041202A1 (en) Deployment method and apparatus based on cloud environment system
CN112711469A (en) Cloud host migration method and device, computer equipment and storage medium
EP3783484A1 (en) Data processing method and computer device
CN115454580B (en) Node host resource management method and device and computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190510

RJ01 Rejection of invention patent application after publication