Quick deployment method under the virtualized environment
Technical field
The present invention relates to quick deployment method under a kind of virtualized environment.
Background technology
Terminological interpretation:
Virtual: the virtual computer components that are meant are moving on the virtual basis rather than on the real basis.Intel Virtualization Technology can enlarge the capacity of hardware, simplifies the process that reconfigures of software.It is parallel that the Intel Virtualization Technology of CPU can single CPU be simulated many CPU, allows a platform to move a plurality of operating systems simultaneously, and application program can move in separate space and be independent of each other, thereby significantly improve the operating efficiency of computer.
Virtual server: virtual server (Virtual server) refer to by software simulation have the complete hardware system function, operate in a complete computer in the complete isolation environment.Use virtually, a plurality of computer systems of operation just are virtual server simultaneously on a platform.
Xen:Xen is the virtualization product of increasing income.Xen uses a software layer that is called hypervisor to regulate visit to real hardware, is implemented in operation a plurality of child-operation systems (just a plurality of virtual machine) on the independent computer.
Node server: in virtual platform, being used to provide the server of virtualization capability, is the server that is used for creating virtual server.
Management server: in middle-size and small-size virtual platform, exist a station server that management function is provided, manage other node server and the virtual machine on the server, and the function of mirror image issue and CD issue is provided.
Supervising the network: be used for connection management server and node server, major function is carried out the network of Virtual Service management, node server management and mirror image issue, and this network belongs to the private network of virtual platform.
Introduce Xen and Intel Virtualization Technology background below again
Virtual: the notion of virtual machine the earliest by IBM Corporation last century six the seventies propose, and it is applied in the VM/370 system to share expensive large computer system (Main Frame).Development afterwards rises and falls, and the appearance owing to time sharing operating system once stays cool.Last century, the nineties was along with the release of JAVA virtual machine, especially the release of Vmware ESX server of Vmware company and Vmware workstation virtual machine makes the popular research topic that the research of virtual machine technique is become once more processor designer, software design personnel, server design personnel and network security designer after.Intel Virtualization Technology adds thin virtual machine monitor (the Virtual Machine Monitor of one deck by going up at existing platform (machine), be called for short VMM) software and realize virtual to system, as virtual processor, VMM (MMU) and virtual i/o system etc.Virtual machine monitor is referred to as supervisory process (Hypervisor) again.From the angle of application program, program running is the same with operating on its corresponding entity computer on the virtual machine.Virtual machine technique makes a physical computer can generate a plurality of different virtual machines and moves a plurality of similar and different operating systems respectively.Virtual machine technique can be avoided interfering with each other between the different application by different application is operated on the different virtual machines, and for example the collapse of an application can not have influence on other application etc.This have the meaning that is even more important by the server field that is isolated in fully between each application of virtual machine technique realization; virtual machine technique also can be so that enterprise simultaneously; colleges and universities or research institute can realize under the situation that needn't purchase a large amount of physical computers that large-scale computer network is to be engaged in production and research; for example network and network application research, the exploitation of operating system nucleus (Kernel) software and the exploitation of operating system of user etc.
The virtual brief introduction of xen: the instruction set Instruction Set Architecture that makes a physical platform move the abstract virtual machine of a plurality of Client OS VMM simultaneously is called for short ISA) can be equal to the physical machine that its moves, also can revise slightly.When the instruction set of virtual instruction set and physics was identical, this virtual machine can move without any the operating system of revising; And when both were incomplete same, the operating system of client computer just must be made corresponding modify at source code level or binary code level.Whether according to needs are revised the source code of Client OS, and Intel Virtualization Technology can be divided into (1) general virtual (Paravirtualization) and (2) virtual fully (Full-virtualization) again.Virtual fully owing to do not need to revise Client OS, therefore have good compatibility and support xenogenesis operating system simultaneously or the ability of different editions operating system.Opposite general Intel Virtualization Technology then has usually than complete Intel Virtualization Technology more performance.General Intel Virtualization Technology just uses on IBM VM/370 the earliest, but its use only is in order to support traditional operating system, therefore to be limited in very little scope.The Steven D.Gribble leader's of Washington, DC university computer scientific and engineering system Denali project and the Ian Pratt of univ cambridge uk's computer laboratory and KeirFraster leader's Xen project team has realized general virtual on the X86/PC making general Intel Virtualization Technology become one of the most popular Intel Virtualization Technology again.Along with Intel
Company releases the Intel Virtualization Technology (Intel based on processor hardware at the beginning of 2005
Virtualization Technology is called for short Intel
The VT technology), support the complete Intel Virtualization Technology of the operating system of unmodified equally to become two mains direction of studying in the current virtual field with general Intel Virtualization Technology.
XEN is a system virtual machine based on (Open Source) code of increasing income, and designs and develops based on 32 X86 architectures at first, supports to move simultaneously about 100 virtual machines of as many as.Management interface (Hypercalls) and incident (Events) mechanism that XEN introduces, and the shared drive data exchange mechanism between predefined virtual machine and the VMM all makes new client computer architectural framework (XEN virtual machine architecture) have higher overall performance, but also just has been doomed that it must revise the Client OS source code simultaneously.
Xen is referred to as virtual Domain (Domain) with client computer, and wherein No. 0 virtual Domain provides the management service of system as the expansion of monitoring program for service-domain.Monitoring program has part Hardware I resource such as timer equipment, interrupting device PIC/Local APIC/IO APIC etc., and other virtual Domain also can have IO resource partly such as hard disk network interface card etc.The virtual Domain that has physical equipment is called xegregating unit and drives territory (Isolated Driver Domain) or be called for short equipment driving domain (Driver Domain).Common virtual Domain has only virtual unit and does not have direct hardware device resources access right.The XEN project also is called XEN with Hypervisor.
Emulator: in hardware virtual machine, for realizing sharing of physical equipment, the I/O visit (containing memory mapping I/O-Memory Mapped IO) of client computer must be caught by Xen, and (Device Model) carries out emulation by device model.The hardware virtualization technology provides the support of catching to client computer I/O operation, and for memory mapping I/O, is then caught by Xen by page or leaf disappearance (Page fault).But Xen monitoring program not driver itself removes directly to visit these equipment, so the emulation of these I/O visits is finally transferred to virtual Domain 0 by Xen and finished.From the angle of Client OS, emulator is with the not difference of real physical equipment.The device model (Device Model) that is positioned at Dom0 provides a virtual PC platform (virtual unit) to hardware virtual machine.Each hardware virtual machine can be seen a complete Virtual PC platform, comprises keyboard, mouse, real-time clock, programmable timer 8254), programmable interrupt controller (8259), CMOS, floppy disk, IDE hard disk, CDROM and VGA graphics card etc.
NBD introduces: the ability that network block equipment (Network Block Device) provides a transparent manipulation to be positioned at the block device (refering in particular to hard disk here) on the remote machine, can visit long-range block device as the local block device of visit.Attention: it is different with NFS (as NFS), file system normally is based upon on the block device, that is to say that NBD than NFS bottom more, therefore can set up any file system on it, as ext2/exit3/reiserfs etc.
The virtual platform topological structure: system platform is divided into 3 layers, be operation layer near the user, be responsible for mutual with the user, the processing of data such as user data, finance shows that the intermediate layer is the virtual management layer, just the level at management server place, the main things such as virtual server, physical server and mirror image distribution of handling, the bottom is a virtualization layer, is the level at node server place, and the virtual resource of physics mainly is provided.
The customizing virtual mirror image: deploy virtual server is that disk starts deployment with virtual mirror image, carrying in the virtual mirror image operating system and on application and application data.Virtual mirror image at the customizing virtual server is to have done some general configurations in the operating system in mirror image, but all can detect the Run Script whether create name is arranged in the CD-ROM drive when starting, if having then move this script.
When virtualization services is provided, need consider that the user satisfies the quick of demand of virtual server, need provide fast the demand of naked physical resource according to the user is configured.Naked physical resource herein refers to the virtual machine that does not have installing operating system, is the set of a physical resource for virtual machine.By manual resource acquisition, allocating operating system and the basic system configuration of finishing a virtual server, the time that needs O﹠M personnel to drop into more than 2 hours finishes, and not only the cycle that need wait for of user is long and increase human cost.
Deploy virtual server is that disk starts deployment with virtual mirror image, carrying in the virtual mirror image operating system and on application and application data.Virtual mirror image at the customizing virtual server is to have done some general configurations in the operating system in mirror image, but all can detect the Run Script whether create name is arranged in the CD-ROM drive when starting, if having then move this script.Present universal method is by making the virtual image of customization, virtual server provides template applications by the virtual image of customization, but for information such as user name passwords, need use to give tacit consent to, login manual configuration for informational needs such as networks by the keeper, perhaps distribute by Dynamic Host Configuration Protocol server.
Be password default for the virtualized system password that provides of opening fast at present, after opening virtual server, login between the modification password like this that there is the management blind area in virtual server to the user.Also have by the system manager to start directly login of back at virtual server, the change password sends to the user by business platform with password then, has increased service response speed and human cost so greatly.
Normally used method is to provide ssh login mode in the linux system, this is a kind of at resource scheduling system (resource scheduling system employing virtual platform topological structure, be positioned at each above the independently virtual data center management system, can allocate the system of scheduling all data center's resources of the whole nation.) mode of password is provided, and windows uses remote desktop, also is to provide password at resource scheduling system.Such mode lacks the assurance of fail safe.
Summary of the invention
The purpose of this invention is to provide quick deployment method under a kind of virtualized environment, it can be realized under virtualized environment the opening fast of virtual machine, configuration fast, safe and reliable quick payment.
The technical solution that the present invention adopts is:
Quick deployment method under a kind of virtualized environment is characterized in that may further comprise the steps:
(1) mirror image copies of the operating system of reservation free time in physical server;
(2) resource scheduling system finds the management server of available resource, and virtual server is opened essential system information send to this management server, this management server is according to the system information that obtains and the kind of operating system, select the initialization script and create configuration file, compact disc image files with configuration file and the establishment of initialization script is put into designated directory then, and management server is mapped to this compact disc image files in the device space of node server by the service mechanism nbd of network block equipment by supervising the network;
(3) management server sends instruction by the system virtual machine to node server and creates virtual machine, the virtual disk that turns to virtual server of mirror image copies of described operating system with customization, the equipment simulating that nbd is mapped to node server is the CD-ROM drive of virtual server, initiates the virtual server enabled instruction simultaneously;
(4) after virtual server starts, at first starting the startup shell script of seeking the create name on the CD-ROM drive in the script in system customization, is that the parameter operation starts script with the configuration file on the CD-ROM drive then;
(5) meanwhile, resource scheduling system is encrypted the user name password according to the PKI that the user provides, ciphertext after the encryption is submitted to the foreground user from service platform, and the user is decrypted ciphertext by existing private key, uses then to obtain cleartext information by decryption information and login.
The invention has the advantages that:
1. realized the user name for virtual server, the automation deployment of password, conventional method provides the user name password of an acquiescence, and there is the safe vacuum phase before the user logins virtual server in this mode.Perhaps revise the user name password, can increase the human cost of system maintenance like this by the O﹠M personnel.
2. realized for network ip address, dns address, gateway address.The realization function is served by DHCP and is finished in conventional method.But need in network, increase the dhcp service by the dhcp service configuration,, thereby also need to manage dozens of dhcp service, increase management complexity because resource scheduling system need be managed national dozens of virtual data center.
3. user cipher delivery method, traditional approach by expressly finish virtual server information is published to before end subscriber from service platform, perhaps by there being business platform to create key to carrying out the distribution of key.The inventive method generates key to distributing by the user, and the management of user key is more safe and reliable.
Embodiment
The present invention relates to quick deployment method under a kind of virtualized environment, may further comprise the steps:
(1) mirror image copies of the operating system of reservation free time in physical server;
(2) resource scheduling system finds the management server of available resource, and virtual server is opened essential system information send to this management server, this management server is according to the system information that obtains and the kind of operating system, select the initialization script and create configuration file, iso file (compact disc image files) with configuration file and the establishment of initialization script is put into designated directory then, and management server is mapped to this iso file in the device space of node server by nbd service mechanism (service mechanism of network block equipment) by supervising the network;
(3) management server sends instruction by the system virtual machine to node server and creates virtual machine, the virtual disk that turns to virtual server of mirror image copies of described operating system with customization, the equipment simulating that nbd is mapped to node server is the CD-ROM drive of virtual server, initiates the virtual server enabled instruction simultaneously;
(4) after virtual server starts, at first starting the startup shell script of seeking the create name on the CD-ROM drive in the script in system customization, is that the parameter operation starts script with the configuration file on the CD-ROM drive then;
(5) meanwhile, resource scheduling system is encrypted the user name password according to the PKI that the user provides, ciphertext after the encryption is submitted to the foreground user from service platform, and the user is decrypted ciphertext by existing private key, uses then to obtain cleartext information by decryption information and login.
The present invention keeps idle operating system mirror image copies by the method for pre-copy in physical server, can effectively save the time of virtual mirror image inverse.Resource scheduling system is by dispatching homegrown resource, find the management server that available resource is arranged, and virtual server is opened essential system information (as user name, password, host name, ip address, DNS address of service or the like) send to this management server, this management server is selected the initialization script and is created configuration file according to the system information that obtains and the kind of operating system.Then configuration file and initialization script establishment iso file are put into designated directory, management server is mapped to iso in the device space of node server by supervising the network by the nbd service mechanism.
Management server sends instruction by the xen to node server and creates virtual machine, and with the virtual disk that turns to virtual server of customization operations system image, the equipment simulating that nbd is mapped to node server is the CD-ROM drive of virtual server.After virtual server starts, at first can start the startup shell script of seeking the create name on the CD-ROM drive in the script, and be that the parameter operation starts script with the configuration file on the CD-ROM drive in system customization.This starts script is to customize at operating system version, can finish according to configuration file the automation of system is disposed.
Meanwhile, resource scheduling system can be submitted to the foreground user from service platform with information such as user name passwords according to the PKI that the user provides, the user can be decrypted ciphertext again by existing private key, use then by decryption information and obtain expressly information such as user name, password, ip, dns, gateway.If what the user used is the operating system of windows series, can login remote desktop by password, if provide Linux series operating system to the user, the user can use the private cipher key of oneself to login, in this case, because custom-built system has only kept the login interface of key, also is unknown so be equivalent to user's systematic account information for operator, has strengthened fail safe.
When node operating system is idle relatively, import the virtual mirror image of usefulness with the operating system mirror image copies on the supplemental node server, so that use next time from management server.If when deploy virtual server, do not have the virtual image copy on the node server, then need to import at once a new copy.Though also can automation dispose, can increase the time that virtual server is disposed like this.
Illustrate:
Management server operating system CentOS5.2
Node server operating system Sles 10 sp1
Virtual server operating system CentOS5.2
Virtual server automation configuration information: user name, password, PKI, ip address, gateway, DNS.
The instrument of using:
Mkisofs makes reflect tool (third party's instrument)
Nbdserver starts nbd service aid (third party's instrument)
Nbdclient connects the instrument (third party's instrument) of nbd service
Qprovision.sh system start-up automation configuration script (custom script program)
Congfig provides configuration information file.
Prepare: the customizing virtual mirror image, check the existence of CD-ROM drive when customized content need be included in system start-up, if exist then it is hung over/the mnt/cdrom catalogue under.Under the pre-copy mechanism, finish the virtual importing that is mirrored to node server.
Step 1: the user's download key generator, it is right to generate key, and it is right to preserve key.Submit to the virtual server request to business platform, upload the publicly-owned key of cipher key pair simultaneously.
Step 2: business platform is selected suitable management server according to the resource allocation strategy, and publicly-owned key, ip address, user name, password, gateway, dns address are sent to management server.
Step 3: after management system is received configuration information, generate configuration file Congfig according to ip address, user name, password, gateway, dns address, then file Config, Qprovision.sh and publicly-owned key file are generated the iso file with the mkisofs instrument.Be that parameter starts nbdserver with this iso file then, nbd is provided service.Initiate the virtual machine activation instruction simultaneously.
Step 4: node server receives the virtual machine activation instruction, according to the configuration information in the virtual machine configuration, starts nbdclient and connects corresponding nbd service, generation/dev/nbdx equipment (x is the integer of 1-32) on node server at this moment.Xen starts virtual machine according to the virtual server configuration file then, and with generate previously /dev/nbdx is mapped as the CD-ROM drive of virtual server, the virtual Mirroring Mapping of above-mentioned customization is the disk of virtual server.Behind the os starting of virtual server, the carry CD-ROM drive is carried out the QProvision.sh program automatically, and this program is finished the configuration of virtual server operating system according to Config.
Step 5: virtual server send to start the report that finishes to management server, and management server reports to resource scheduling system, the publicly-owned secret key encryption that resource scheduling system uses the user to provide the private information of virtual server.
Step 6: the user obtains the virtual server system information of encryption, with the private cipher key deciphering, then can be according to the information after the deciphering, and the login virtual server.So far finish a user's request.
Whole process need not the O﹠M personnel and participate in, and whole process is no more than 5 minutes at the angle full automation of operator.