Summary of the invention
In view of above content, be necessary to provide a kind of virtual machine management system and method, can dispose fast, in large quantities virtual machine, after virtual machine, login one by one virtual machine network is set having created without manager.
A kind of virtual machine management system, this system arranges dissimilar virtual machine template, and virtual machine template is stored in to memory device.In the time that needs create a large amount of virtual machines, this system is cloned virtual machine according to virtual machine template, on the main frame of specifying, generate clone's virtual machine by master agent, by DHCP proxy, the MAC Address of every clone's virtual machine is registered in Dynamic Host Configuration Protocol server, to ask the virtual machine distributing IP address of Dynamic Host Configuration Protocol server as every clone.Afterwards, the IP address that this system is distributed Dynamic Host Configuration Protocol server by master agent is assigned to every clone's virtual machine.
A kind of virtual machine management method, the method comprises: a kind of configuration information of virtual machine template (A) is set, comprises the CPU, internal memory, hard disk and the network interface card information that produce a virtual machine are set, and store this virtual machine template to this memory device; (B) clone one or more virtual machine according to this virtual machine template, and the media interviews control MAC Address of the network interface card of every clone's virtual machine is set; (C) by network, the configuration information of one or more virtual machine of this clone is sent to the master agent of given host, act on behalf of the virtual machine that produces predetermined number in given host by main control system; (D) send the mac address information of every clone's virtual machine to DHCP proxy by network, in Dynamic Host Configuration Protocol server, register the MAC Address of this clone's virtual machine by DHCP proxy, distribute to the IP address of this clone's virtual machine to obtain Dynamic Host Configuration Protocol server; And (E) by network, the IP address obtaining is sent to the master agent of main frame, act on behalf of the virtual machine that the IP address obtaining is assigned to corresponding clone by main control system.
Compared to prior art, virtual machine management system provided by the invention and method, login one by one virtual machine after virtual machine network be set having created without manager, can dispose fast, in large quantities virtual machine.
Embodiment
Consulting shown in Fig. 1, is the applied environment figure of virtual machine management system 10 preferred embodiments of the present invention.This virtual machine management system 10 was thrown network 3 and was connected one or more entity main frame 1, memory device 2, and DynamicHost arranges agreement (Dynamic Host Configuration Protocol, DHCP) server 4.
This virtual machine management system 10 arranges dissimilar virtual machine template 20, and virtual machine template 20 is stored in to memory device 2.The virtual machine template 20 of every type has defined a kind of virtual machine 40 that configures specification.This memory device 2 can be hard disk, the network hard disc of any main frame 1, or other memory.In the time that needs create a large amount of virtual machines 40, this virtual machine management system 10 is cloned virtual machine 40 according to virtual machine template 20, on the main frame 1 of specifying, generate clone's virtual machine 40 by master agent 30, by DHCP proxy 50 by the media interviews control of every clone's virtual machine 40 (media access control, MAC) register in Dynamic Host Configuration Protocol server 4 address, to ask the virtual machine 40 distributing IP addresses of Dynamic Host Configuration Protocol server 4 as every clone.Afterwards, the IP address that this virtual machine management system 10 distributes Dynamic Host Configuration Protocol server 4 by master agent 30 is assigned to every clone's virtual machine 40.
This virtual machine management system 10 can be arranged at any main frame 1, also can be arranged at described Dynamic Host Configuration Protocol server 4, or is independent of other server of main frame 1 and described Dynamic Host Configuration Protocol server.
Consulting shown in Fig. 2, is the functional block diagram of virtual machine management system 10 preferred embodiments of the present invention.This virtual machine management system 10 comprises template establishment module 11, clone's module 12 and communication module 13.Module 11-13 comprises computerization program command, these computerization program command can be stored in memory device 2, also can be stored in the memory of the property server that virtual machine management system 10 is installed, the processor of the property server of virtual machine management system 10 is installed and is carried out these computerization program command, the above-mentioned functions of virtual machine management system 10 is provided.Below in conjunction with the concrete function of Fig. 3 specification module 11-13.
Consulting shown in Fig. 3, is the flow chart of virtual machine management method preferred embodiments of the present invention.
Step S10, template establishment module 11 arranges a kind of configuration information of virtual machine template 20, comprises the CPU, internal memory, hard disk and the network interface card information that produce a virtual machine 40 are set, and store this virtual machine template to memory device 2.Wherein, CPU information comprises the quantity of the CPU that produces virtual machine 40 needs, memory information comprises the memory size that need to distribute to this virtual machine 40, hard disk information comprises the hard-disk capacity that need to distribute to this virtual machine 40, and network interface card information comprises the MAC Address of network interface card type, quantity and the network interface card that need to distribute to this virtual machine 40.
Step S20, clone's module 12 is according to virtual machine template 20 one or more virtual machines 40 of clone.Cloning a virtual machine 40 is mainly to copy and produce a hardware information that virtual machine 40 is essential from virtual machine template 20, comprises CPU quantity, memory size, hard-disk capacity and network interface card quantity.The hardware information of for example supposing virtual machine template 20 comprises " 1 core cpu; 2G internal memory; 100G hard disk; 1 network interface card ", virtual machine management system 10, at the virtual machine 40 of 10 this specifications of a main frame 1 deploy, is cloned module 12 configuration information of virtual machine template 20 is copied to 10 parts for generation of 10 virtual machines 40.Due to the MAC Address difference of every virtual machine 40, clone's module 12 also needs the MAC Address of the network interface card of the virtual machine that every clone is set.
Step S30, communication module 13 sends to the configuration information of one or more virtual machine 40 of this clone by network 3 master agent 30 of given host 1, acts on behalf of 30 virtual machines 40 that produce predetermined number in given host 1 by main control system.For example, 10 virtual machines 40 supposing above-mentioned clone are all deployed in identical main frame 1, communication module 13 is passed through network 3 by the configuration information of 10 virtual machines 40 of clone, comprise the MAC Address of CPU quantity, memory size, hard-disk capacity and network interface card, send to the master agent 30 of this main frame 1, the hardware resource of being acted on behalf of 30 assign host machine 1 and being provided by main control system produces 10 virtual machines 40 on this main frame 1.
Step S40, communication module 13 sends the mac address information of every clone's virtual machine 40 to Dynamic Host Configuration Protocol server 4 by network 3, in Dynamic Host Configuration Protocol server 4, register the MAC Address of this clone's virtual machine 40 by DHCP proxy 50, distribute to the IP address of this clone's virtual machine 40 to obtain Dynamic Host Configuration Protocol server 4.For example, communication module 13 is registered the MAC Address of 10 virtual machines 40 of above-mentioned clone by DHCP proxy 50 in Dynamic Host Configuration Protocol server 4, obtains Dynamic Host Configuration Protocol server 4 and distribute to 10 IP addresses of 10 virtual machines 40 of this clone.Each IP address is corresponding to a MAC Address.
Step S50, communication module 13 sends this IP address obtaining to by network 3 master agent 30 of main frame 1, acts on behalf of 30 the IP address obtaining is assigned to corresponding clone's virtual machine 40 by main control system.For example, communication module 13 is assigned to 10 IP addresses respectively the virtual machine 40 in 10 virtual machines 40 with corresponding MAC Address by master agent 30.Afterwards, communication module 13 can also be controlled by master agent 30 operation of every the virtual machine 40 producing, for example, start shooting, shutdown etc.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, those of ordinary skill in the art should be appreciated that and can modify or be equal to replacement technical scheme of the present invention, and do not depart from the spirit and scope of technical solution of the present invention.