WO2017166785A1 - Method for deploying virtual machines, host machine, and system - Google Patents

Method for deploying virtual machines, host machine, and system Download PDF

Info

Publication number
WO2017166785A1
WO2017166785A1 PCT/CN2016/102161 CN2016102161W WO2017166785A1 WO 2017166785 A1 WO2017166785 A1 WO 2017166785A1 CN 2016102161 W CN2016102161 W CN 2016102161W WO 2017166785 A1 WO2017166785 A1 WO 2017166785A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
script
image template
host
boot
Prior art date
Application number
PCT/CN2016/102161
Other languages
French (fr)
Chinese (zh)
Inventor
罗思标
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2017166785A1 publication Critical patent/WO2017166785A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • the present invention relates to the field of application technologies of a cloud management platform, and in particular, to a method, a host, and a system for deploying a virtual machine.
  • the existing infrastructure is virtualized according to the needs of the needs, and the physical resources are allocated to the users as needed.
  • virtual machines are deployed in batches when virtualizing desktops (English name: Virtual Machine)
  • the VM is deployed in the virtual machine mode.
  • the VM image template is the operating system and software. Combined system image.
  • the virtual machine image template is copied to the virtual machine.
  • the operating system and environment data of the virtual machine are the same as the virtual machine image template.
  • the environment data includes the security ID of the virtual machine.
  • Existing solution 2 During the deployment of the virtual machine, create a client customization file and select "Make Customize with the existing custom specification, select the established client customization file, and re-encapsulate the deployed virtual machine by calling the Sysprep tool through the pre-installed proxy service program in the virtual machine, so that the newly deployed virtual machine is started for the first time.
  • the above environment data is automatically set according to the client customization file.
  • the embodiments of the present invention provide a method, a host, and a system for deploying a virtual machine, which can solve the problem of low efficiency of deploying virtual machines in batches in the existing mechanism.
  • a first aspect of the embodiments of the present invention provides a method for deploying a virtual machine, where the method includes:
  • the virtualized resource manager runs the package script downloaded from the cloud management platform, and sets a preset script in the image file of the first virtual machine to encapsulate the first virtual machine into a virtual machine image template, where the virtual machine image template includes a preset. script.
  • the virtualized resource manager clones the virtual machine image template to the destination host of the virtual machine to be deployed, and the destination host of the virtual machine to be deployed may be the first virtual machine.
  • the host machine may also be a second host other than the first host.
  • the destination host After obtaining the virtual machine image template, the destination host starts the virtual machine image template as a virtual disk of the second virtual machine;
  • the second virtual machine is deployed on the destination host by using the virtual machine image template, and further
  • the preset script implements the automatic modification of the custom parameters of the virtual machine image template on the second virtual machine, thereby improving the efficiency of deploying the virtual machine and achieving fully automated deployment.
  • a preset script wherein the preset script includes a batch script and a boot script.
  • the custom parameter in the virtual machine image template may be modified according to the target custom parameter obtained from the cloud management platform. details as follows:
  • the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, and the network management conflict is avoided.
  • the batch script is executed and booted. Start the script without manual modification or guided manual operation, and fully customize the custom parameters.
  • the target customization parameter includes a domain management and a network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, an administrator account of the second virtual machine, and the administrator An administrator password of the second virtual machine corresponding to the account;
  • the domain management includes a domain and a domain
  • the network configuration includes a configuration of a dynamic network address and a configuration of a static network address;
  • the batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol DHCP acquisition network;
  • the booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying an SID of the second virtual machine, and The second virtual machine performs domain addition, cancels automatic login of the second virtual machine, and cleans up the system environment.
  • the two virtual scripts can be used to implement the automatic modification of the custom parameters in the second virtual machine stage without manual intervention. effectiveness.
  • the custom parameters of the virtual machine image template include:
  • the batch script is executed to perform the Windows system genuine activation, dequeue, and setting the DHCP to obtain the network address, and trigger the cloud on the second virtual machine.
  • the management platform configures the target custom parameter for the second virtual machine
  • the domain name of the second virtual machine is modified according to the target custom parameter, the static network address of the second virtual machine is modified, the administrator password of the second virtual machine is modified, and the second virtual machine is modified.
  • SID as well as clean up the system environment (delete package scripts and configuration files) after canceling the automatic login of the Windows virtual machine by restoring the registry and system environment;
  • the second virtual machine is restarted by setting the startup script to ensure that the modified custom parameters take effect, the operating system is automatically activated, the virtual machine name is successfully modified, and the virtual machine name is automatically added after the virtual machine name is modified.
  • the domain avoids the de-allocation phenomenon after the manual domain is added.
  • the static network address, password, and SID of the second virtual machine are successfully modified to avoid the management conflict caused by the consistent setting of the custom parameters.
  • the virtual machine image template in order to implement the modification of the custom parameters in the virtual machine image template in the stage of deploying the second virtual machine, the virtual machine image template may be performed before the virtual machine image template is created. Encapsulate and set the above preset script for use when deploying the second virtual machine. Therefore, before the obtaining the virtual machine image template, the method further includes:
  • the image file of the first virtual machine is encapsulated into the virtual machine image template.
  • the encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template.
  • the method also includes:
  • a virtual machine image template when creating a virtual machine image template using a virtual machine with Linux deployed, it can be set in the virtual machine image template for automatic modification of the virtual machine during the package preparation phase.
  • a preset script of a custom parameter in the image template wherein the preset script includes a boot script.
  • the custom parameter in the virtual machine image template may be modified according to the target custom parameter obtained from the cloud management platform. details as follows:
  • the booting script is executed to obtain the target custom parameter of the second virtual machine from the cloud management platform, and modify the virtual machine image template on the second virtual machine according to the target custom parameter. Define parameters.
  • the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, and the network management conflict is avoided, and the startup startup script is executed, and no manual modification or manual manual is required. Operation, fully automatic modification of custom parameters.
  • the target custom parameter includes a network configuration, a virtual machine name of the second virtual machine, a virtual machine name of the second virtual machine, and a super user of the second virtual machine corresponding to the super user name root of the second virtual machine. a password; wherein the network configuration includes a configuration of a static network address;
  • the booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying a super user password of the second virtual machine, modifying a host name configuration file, and DNS domain name resolution, and This may include cleaning up the operating system environment of the second virtual machine.
  • the modification when the Linux virtual machine is deployed, the modification is effective by executing the boot script and restarting the virtual machine's network service.
  • Performing the boot startup script to acquire target custom parameters of the second virtual machine from the cloud management platform, and modifying the virtual machine image template on the second virtual machine according to the target custom parameter Custom parameters including:
  • modifying a virtual machine name of the second virtual machine according to the target custom parameter After receiving the target custom parameter sent by the cloud management platform, modifying a virtual machine name of the second virtual machine according to the target custom parameter, configuring a DNS domain name resolution, and modifying the second virtual machine. a static network address of the virtual machine and a super user password of the second virtual machine;
  • Restarting the network service of the second virtual machine enables the above network configuration to take effect.
  • the network service of the virtual machine is restarted by using the boot script to ensure that the modified custom parameters take effect, and the virtual machine name is successfully modified.
  • the static network address and password of the second virtual machine are also successfully modified to avoid management conflicts caused by consistent setting of custom parameters.
  • the virtual machine image template may be performed before the virtual machine image template is created. Encapsulate and set the above preset script for use when deploying the second virtual machine. Therefore, Before the obtaining the virtual machine image template, the method further includes:
  • the encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template.
  • the method further includes: before the virtual machine image template is started as the virtual disk of the second virtual machine on the second host, the method further includes:
  • the manner in which the second host obtains the required virtual machine image template from the first host is different.
  • the cloning virtual machine image template to the second host includes at least one of the following items:
  • first virtual machine and the second virtual machine belong to the same cluster, obtain the virtual machine image template from the shared storage of the same cluster, in this case, the first virtual machine and the second virtual machine It may also run on the same host or on different hosts in the same cluster.
  • first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, use the virtualized resource manager to locate the first host where the first virtual machine is located
  • the virtual machine image template in the corresponding shared storage is cloned and exported to the shared storage corresponding to the second host where the second virtual machine is located, and stored in the shared storage corresponding to the second host.
  • the virtual machine image template is cloned and exported to the second host;
  • first virtual machine and the second virtual machine belong to different virtualized resource managers, share the network attached storage NAS by using the universal Internet file system CIFS protocol to locate the first virtual machine.
  • the virtual machine image template in the shared storage corresponding to the first virtual machine is cloned and exported to the NAS, and the virtual machine image template stored in the NAS is cloned and exported to the second virtual machine.
  • the second host is used to store the virtual machine image template in the shared storage corresponding to the first virtual machine.
  • the purpose of sharing a virtual machine image template is achieved by shared storage in the cluster and NAS between the clusters.
  • a second aspect of the embodiments of the present invention provides a host machine having a function of implementing a method for deploying a virtual machine corresponding to the package provided by the foregoing first aspect.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more units corresponding to the functions described above, which may be software and/or hardware.
  • the host machine includes:
  • An obtaining unit configured to obtain a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script;
  • a processing unit configured to start, by using the virtual machine image template obtained by the acquiring unit, as a virtual disk of a second virtual machine, execute the preset script, to modify the virtual machine image on the second virtual machine Custom parameters for the template.
  • the host machine includes:
  • the memory is used to store program code
  • the processor is configured to invoke program code in the memory to perform the following operations:
  • the virtual machine image template obtained by the obtaining unit is started as a virtual disk of the second virtual machine, and the preset script is executed to modify the custom parameter of the virtual machine image template on the second virtual machine. .
  • a third aspect of the embodiments of the present invention provides a system for deploying a virtual machine, including the host and the virtualized resource manager according to the second aspect, wherein the virtualized resource manager is configured to clone a virtual machine image template to The host machine.
  • the system for deploying a virtual machine has a function of implementing a method corresponding to the package deployment virtual machine provided by the above first aspect.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more units corresponding to the above functions, which may be software And / or hardware.
  • the second virtual machine is created by using the virtual machine image template that is configured with the preset script, so that after the virtual machine image template is started as the virtual disk of the second virtual machine,
  • the preset script is executed to automatically modify the custom parameters of the virtual machine image template on the second virtual machine to improve the efficiency of deploying the virtual machine.
  • FIG. 1 is a schematic flowchart of a method for deploying a virtual machine in this embodiment
  • FIG. 2 is another schematic flowchart of a method for deploying a virtual machine in this embodiment
  • FIG. 3 is another schematic flowchart of a method for deploying a virtual machine in this embodiment
  • FIG. 4 is another schematic flowchart of a method for deploying a virtual machine in this embodiment
  • FIG. 5 is another schematic flowchart of a method for deploying a virtual machine in this embodiment
  • FIG. 6 is a schematic structural diagram of a host machine in the embodiment.
  • FIG. 7 is a schematic structural diagram of a system for deploying a virtual machine in this embodiment.
  • FIG. 8 is another schematic structural diagram of the host machine in the embodiment.
  • the direct coupling or the communication connection may be through some interfaces, and the indirect coupling or communication connection between the units may be electrical or the like, which is not limited herein.
  • the illustrated unit or subunit may or may not be physically separated, may or may not be a physical unit, or may be divided into a plurality of circuit units, and some or all of the units may be selected according to actual needs to implement the present invention. The purpose of the embodiments of the invention.
  • the embodiments of the present invention provide a method, a host, and a system for deploying a virtual machine, which are used in the technical field of a cloud management platform. The details are described below.
  • the system for deploying a virtual machine in this document includes a cloud management platform, at least one virtualized resource manager (English full name: Virtual Resouce Manager, English abbreviation: VRM), at least one host machine, and the user operates on the cloud management platform to implement each sink. Management and control of the virtual machines running on the host and each host.
  • the cloud management platform is mainly used for scheduling physical resource pools according to the deployment request of the user, and may be a cloud host management platform, a cloud computing platform, a cloud host, a computer, a cloud computing node, etc.
  • the VRM is mainly used for scheduling physical resources and virtual resources.
  • each VRM is responsible for resource scheduling for all hosts within the corresponding cluster.
  • Each cluster has shared storage for storing files shared by each host in the cluster (such as virtual machine image templates, applications, etc.).
  • a host is a physical computer that requires virtual machine software to be installed.
  • the package script includes a command to invoke the Sysprep tool, the Sysprep tool performs a reconfiguration system, and the Sysprep tool executes the parameters to be modified according to the preset answer file.
  • the XML response file can run the program under the Sysprep folder before running the package. "setupmgr.exe" is generated.
  • the default script is automatically executed to modify the custom parameters of the VM image template on the VM to be deployed.
  • a method for deploying a virtual machine in the embodiment of the present invention is described below, in order to implement automatic modification of a custom parameter in a virtual machine image template in a stage of deploying a new virtual machine, and the virtual machine image is created.
  • the virtual machine that meets the requirements is determined according to the requirements of the host, for example, the operating system type deployed in the virtual machine, the version information of the operating system in the virtual machine, the deployed application and service, and the like.
  • the embodiment of the present invention includes:
  • the VRM executes the package script downloaded from the cloud management platform to set a preset script in the image file of the first virtual machine of the first host, and encapsulates the image file of the first virtual machine into the virtual Machine mirror template.
  • the encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template.
  • the VRM clones the virtual machine image template to the second host.
  • the operator can deploy the second virtual machine on the first host to which the first virtual machine belongs, that is, the second host and the second host.
  • the first host is the same host; the second virtual machine may be deployed on the host other than the first host.
  • the VRM is the destination host for selecting the virtual machine to be deployed according to the resource scheduling algorithm, and is not limited.
  • the second host starts the obtained virtual machine image template as a virtual disk of the second virtual machine.
  • the virtual machine image template includes a preset script, and the virtual machine image template is obtained according to an image file of the first virtual machine of the first host.
  • the default scripts that are set when the image file of the first VM is encapsulated are different.
  • the two scenarios are as follows:
  • the virtual machine image template can be encapsulated, and a batch script and a boot script are set in the virtual machine image template for use in deploying the second virtual machine. Specifically, before the virtual machine image template is cloned to the second host, the VRM performs the following encapsulation operation on the first virtual machine:
  • the encapsulation is the virtual machine image template.
  • the package script is a one-button automatic package script, which can automatically perform subsequent package operations with one button selection, without manual intervention, thereby reducing error rate and improving package efficiency.
  • the encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template.
  • the batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol (English full name: Dynamic host configuration protocol, English abbreviation: DHCP).
  • a dynamic host configuration protocol English full name: Dynamic host configuration protocol, English abbreviation: DHCP.
  • the booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying a SID of the second virtual machine, and Adding the domain to the second virtual machine may further include canceling the automatic login of the second virtual machine and cleaning up the system environment, wherein adding the domain refers to joining a set of servers and computers, the set Used in conjunction with a group of computers to share a common secure database, any computer can access other computers within the same domain.
  • the modification of the custom parameters in the VM image template is completed automatically before the VM image template is created.
  • the virtual machine image template can be encapsulated, and the above startup script is set in the virtual machine image template for use in deploying the second virtual machine. Specifically, before the virtual machine image template is cloned to the second host, the following steps can be performed:
  • the package script is a one-button automatic package script, which can automatically perform subsequent package operations with one button selection, without manual intervention, thereby reducing error rate and improving package efficiency.
  • the booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying a super user password of the second virtual machine, and the host name configuration file may further include a DNS domain name. Parse and clean up the operating system environment of the second virtual machine.
  • the boot startup script set in step 101 is a registry configuration file and cannot be directly executed, in the stage of deploying the second virtual machine, it is necessary to implement automatic modification of the custom parameters.
  • the VRM After executing the boot automatic login script, the VRM first needs to be performed.
  • the cloned virtual machine image template is mounted on the domain of the computer node agent (English name: Computer Node Agent, English abbreviation: CNA) (English name: Domain 0, English abbreviation: Dom0), and then the virtual machine monitor is used.
  • the full name: Virtual Machine Monitor (English abbreviation: VMM) injects the boot script and the target custom parameters into the second virtual machine. There is a VMM on each host, and this injection method is applicable when deploying Windows VM and Linux VM. This document is not limited.
  • the second host executes the preset script to modify a custom parameter of the virtual machine image template on the second virtual machine.
  • the custom parameters of the virtual machine image template include a domain, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, and a second virtual machine.
  • the configuration parameters of the virtual machine image template include the virtual machine name of the second virtual machine, the super user password of the second virtual machine, and the network configuration.
  • the second virtual machine is created by using the virtual machine image template that is configured with the preset script, so that after the virtual machine image template is started as the virtual disk of the second virtual machine, the preset is executed.
  • the script implements the automatic modification of the custom parameters of the virtual machine image template on the second virtual machine to improve the efficiency of deploying the virtual machine.
  • the second virtual machine Since the boot automatic login, the batch script, and the boot script are set in the virtual machine image template during the packaging phase, the second virtual machine is deployed, and after the automatic login is started, the batch script is triggered.
  • the cloud management platform configures the target virtual parameter for the second virtual machine, so that when the boot startup script is executed subsequently, the second virtual machine is modified according to the target custom parameter obtained from the cloud management platform.
  • Custom parameters for the virtual machine image template When the second virtual machine is deployed, the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, and network management conflicts are avoided, and the automatic login script and the startup startup script are executed by the booting, without manual operation. Modify or guide manual operation to fully modify the custom parameters.
  • the target custom parameter includes a network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, a user name of the second virtual machine, and a second virtual machine corresponding to the user name.
  • the administrator password wherein the network configuration includes a domain configuration, a configuration of a dynamic network address, a configuration of a domain plus a static network address.
  • the cloud management platform will be randomly generated for the newly deployed virtual machine (randomly generated can be a well-known rule or algorithm, this article is not limited) corresponding target custom parameters, and through cloud management
  • the platform channel, mail, etc. are transmitted to the user, which can increase the security of the information, and prevent the virtual machine user from using the third-party tools pre-installed by the VM vendor (such as driver or agent software) to call the Sysprep tool to set the user-defined information (such as the above-mentioned target custom parameters) pushed to the virtual machine for security risks caused by package deployment.
  • the VM vendor such as driver or agent software
  • the batch script is executed to perform the Windows system genuine activation, dequeue, and setting the DHCP to obtain the network address, and trigger the cloud on the second virtual machine.
  • the management platform configures the target custom parameter for the second virtual machine
  • Restarting the second virtual machine causes the modified virtual machine name of the second virtual machine to take effect.
  • the booting script is executed to add a domain to the second virtual machine according to the target custom parameter, modify a static network address of the second virtual machine, and modify the The administrator password of the second virtual machine and modifying the SID of the second virtual machine, and cleaning the system environment (deleting the package script and configuration file) after canceling the automatic login of the Windows virtual machine by restoring the registry and the system environment;
  • the second virtual machine is restarted by setting the boot script twice to ensure that the modified custom parameters take effect, automatically activate the operating system, successfully modify the virtual machine name, and automatically add the domain after modifying the virtual machine name. Avoid the de-domain phenomenon that occurs after the manual domain is added. At the same time, the static network address, administrator password, and SID of the second virtual machine are successfully modified to avoid management conflicts caused by consistent custom parameter settings.
  • the following is an example of deploying a second virtual machine on a second host.
  • the user deploys the required applications and services in VM1, selects VM1 on the cloud management platform, and clicks the “Make Image” button.
  • the VRM shuts down VM1 and copies a VM1 image.
  • the VRM mirrors the VM1 image and downloads and decompresses the package script package through the channel of the cloud management platform, and then executes the package script. After the execution, the VRM shuts down the VM1 image. Clean the package script and shut down the VM1 image to be packaged into a virtual machine image template.
  • the user then deploys the VM in batches. When the VM is deployed, the VRM mounts the copied image to the dom0 of the CNA.
  • the VMM will boot.
  • the startup script and the virtual machine name, IP address, password and other custom parameters delivered by the cloud management platform are injected into the VM2, and the virtual machine image template in the VM2 is booted.
  • the batch script is executed, and the boot script is executed. Script, modify the virtual machine name, IP address, administrator password, etc. of VM2 and add domain-related configuration, and then clean up the live configuration file and boot boot footer.
  • the VRM returns the message of creating the virtual machine VM2 success to the cloud management platform, and the cloud management platform will name the virtual machine.
  • Custom parameters such as IP address, user name, and password are sent to the user of the virtual machine by email.
  • the boot process may be obtained from the cloud management platform.
  • the target custom parameter modifies the custom parameters in the virtual machine image template, as follows:
  • the booting script is executed to obtain the target custom parameter of the second virtual machine from the cloud management platform, and modify the virtual machine image template on the second virtual machine according to the target custom parameter. Define parameters.
  • the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, thereby avoiding network management conflicts, and the boot startup script is executed without manual modification or guiding. Manual operation, fully automatic modification of custom parameters.
  • the target custom parameter includes a network configuration, a virtual machine name of the second virtual machine, and a super user password of the second virtual machine corresponding to the super user of the second virtual machine; wherein the network configuration includes a static network address. Configuration.
  • modifying a virtual machine name of the second virtual machine according to the target custom parameter After receiving the target custom parameter sent by the cloud management platform, modifying a virtual machine name of the second virtual machine according to the target custom parameter, configuring a DNS domain name resolution, and modifying the second virtual machine. a static network address of the virtual machine and a super user password of the second virtual machine;
  • Restarting the network service of the second virtual machine makes the last network setting take effect.
  • the network service of the virtual machine is restarted by the startup startup script to ensure that the modified custom parameters take effect, that is, the virtual machine name, the static network address of the second virtual machine, and the super user password are successfully modified to avoid the consistency of the custom parameter settings. Management conflict.
  • the preset script is set in a mirror of the first virtual machine, where When the second virtual machine is deployed subsequently, the VMM will need the boot script and the target custom parameters. Inject the second virtual machine. Specifically, after the virtual machine image template is cloned to the second host, before the virtual machine image template is started as the virtual disk of the second virtual machine on the second host, the following is also performed:
  • the first host and the second host may belong to the same cluster or different clusters, so that the second host obtains the required virtual machine image template from the first host.
  • the method is different as follows: the clone virtual machine image template to the second host includes at least one of the following items:
  • the virtual machine image template is obtained from the shared storage of the same cluster; in this case, the first virtual machine and the second virtual machine are further It may run on the same host or on different hosts in the same cluster.
  • first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, use the virtualized resource manager to locate the first host where the first virtual machine is located
  • the virtual machine image template in the corresponding shared storage is cloned and exported to the shared storage corresponding to the second host where the second virtual machine is located, and stored in the shared storage corresponding to the second host.
  • the virtual machine image template is cloned and exported to the second host where the second virtual machine is located;
  • NAS Network Attached Storage: clones and exports the virtual machine image template in the shared storage corresponding to the first virtual machine where the first virtual machine is located to the NAS, and stores the data in the NAS.
  • the virtual machine image template in the virtual machine is cloned and exported to the second host where the second virtual machine is located.
  • the NAS is a dedicated data storage server that occupies one node in a local area network, allowing users to store data on the network while centrally managing and processing all data in the local area network.
  • the shared virtual machine image template is implemented by the shared storage in the cluster and the inter-cluster NAS to meet the diversification of user requirements. For example, if the virtual machine version of a host user in the cluster is not met in the same cluster, The NAS looks for a virtual machine version that meets the needs in other clusters. Of course, the software that meets the requirements can be pre-installed in a virtual machine and then encapsulated into a virtual machine image template.
  • a set of NAS is planned as a peripheral mirror storage device in each local area network, and all clusters in the NAS and a local area network are connected through the network, and the image file of the virtual machine is stored on the NAS.
  • For the image of the inventory copy directly to the NAS, and then configure the image management data on the cloud management platform; for the newly created image of the user, export to the NAS through VRM, and then store the NAS through the VRM when creating a new VM. Import the VM image template into the new host and finish creating the new VM.
  • the VM1 on the Host1 in the cluster under the VRM1 is encapsulated by the cloud management platform to be converted into a VM image template, and the template is exported.
  • the VRM1 exports the VM image template from the shared storage of the cluster to the NAS.
  • the VM image template is registered to the cloud management platform, so that the cloud management platform configures corresponding image management data for the VM image template.
  • VRM2 imports the VM image template to Host2 in the cluster under the VRM, and creates VM2 on Host2, so that the cluster between different VRMs can share the VM through the NAS. Template mirroring. In the same way, the sharing of virtual machine template images can be shared by different host hosts in the same cluster.
  • the host 60 for deploying a virtual machine that implements the foregoing method. Referring to FIG. 6, the host 60 includes:
  • the obtaining unit 601 is configured to obtain a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script.
  • the processing unit 602 is configured to start the virtual machine image template acquired by the obtaining unit 601 as a virtual disk of the second virtual machine, and execute the preset script to modify the virtual on the second virtual machine. Custom parameters for the machine image template.
  • the processing unit 602 creates a second virtual machine by using a virtual machine image template that is configured with the preset script, so that after the virtual machine image template is started as the virtual disk of the second virtual machine,
  • the preset script implements the automatic modification of the custom parameters of the virtual machine image template on the second virtual machine to improve the efficiency of deploying the virtual machine.
  • Encapsulation phase the processing unit 602 executes a package script downloaded from the cloud management platform, Reset the first virtual machine's administrator password, turn off Windows updates, disable user account control UAC, disable error reporting, disable firewall, dequeue, and turn on Windows core memory dump in the first virtual machine of the first host. Configure the Windows auto-login and the default script. Run the Sysprep to reconfigure the Windows system based on the XML response file. After the first virtual machine is shut down, the image file of the first virtual machine is encapsulated into the virtual machine image template.
  • the preset scripts set in the virtual machine image template include a batch script and a boot script.
  • the processing unit 602 executes the batch script and the boot script, and acquires, by using the acquiring unit 601, a target custom parameter of the second virtual machine from the cloud management platform, and according to the target Defining parameters modify the custom parameters of the virtual machine image template on the second virtual machine.
  • the target customization parameter includes a domain management and network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, and an administrator password of the second virtual machine; wherein the domain management includes Retiring domain and adding domain, the network configuration includes configuration of a dynamic network address and configuration of a static network address;
  • the batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol DHCP acquisition network;
  • the booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying an SID of the second virtual machine, and The second virtual machine performs domain addition and cancels the second virtual machine automatic login.
  • the host device 60 further includes a sending unit 603, in the process of executing the booting script, the virtual machine name may be isolated from the domain-adding operation by restarting the virtual machine twice, so that the modification of the customized parameter takes effect. And avoid the de-domain phenomenon that occurs after adding the domain. details as follows:
  • the processing unit 602 executes the batch processing script to perform domain revocation and set DHCP acquisition with the network address, and pass the sending unit 603. Triggering the cloud management platform to configure the target custom parameter for the second virtual machine;
  • the booting script is executed to modify the virtual machine name of the second virtual machine according to the target custom parameter from the cloud management platform received by the obtaining unit 601;
  • the booting script is executed to add a domain to the second virtual machine according to the target custom parameter, modify a static network address of the second virtual machine, and modify the An administrator password of the second virtual machine, and modifying a SID of the second virtual machine;
  • the boot script and the target custom parameters need to be injected into the second virtual machine through the VMM.
  • the processing unit 601 After the processing unit 601 clones the virtual machine image template to the second host, the processing unit 601 starts the virtual machine image template as the virtual disk of the second virtual machine on the second host, and further Used for:
  • Encapsulation stage the processing unit 602 executes an encapsulation script downloaded from the cloud management platform to delete a network card naming and maintaining rule file, and set a dynamic host configuration protocol DHCP to obtain a network address, in the first virtual machine of the first host
  • the preset script is set in the image file, and the package script is cleared. After the first virtual machine is shut down, the image file of the first virtual machine is encapsulated into the virtual machine image template.
  • the preset script set in the virtual machine image template includes a boot script.
  • the processing unit 602 executes the boot startup script to acquire target custom parameters of the second virtual machine from the cloud management platform, and modify the second virtual machine according to the target custom parameter.
  • the custom parameter of the virtual machine image template is a deployment phase: the processing unit 602 executes the boot startup script to acquire target custom parameters of the second virtual machine from the cloud management platform, and modify the second virtual machine according to the target custom parameter.
  • the custom parameter of the virtual machine image template is a deployment phase
  • the target custom parameter includes a network configuration, a virtual machine name of the second virtual machine, and a super user password of the second virtual machine corresponding to the super user name root of the second virtual machine; wherein the network configuration includes a static network. Address configuration;
  • the booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying a super user password of the second virtual machine, modifying a host name configuration file, and DNS domain name resolution.
  • the processing unit 602 is specifically configured to:
  • modifying the virtual machine name of the second virtual machine according to the target custom parameter, and the second The virtual machine configures the DNS domain name resolution, modifies the static network address of the second virtual machine, and modifies the super user password of the second virtual machine;
  • the first host and the second host may belong to the same cluster or different clusters, so that the second host obtains the required virtual machine image template from the first host.
  • the method is different.
  • the processing unit 602 satisfies at least one of the following items when the clone virtual machine mirrors the template to the second host:
  • the virtual machine image template is obtained from the shared storage of the same cluster.
  • the first virtual machine and the second virtual machine are further It may run on the same host or on different hosts in the same cluster.
  • first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, use the virtualized resource manager to locate the first host where the first virtual machine is located
  • the virtual machine image template in the corresponding shared storage is cloned and exported to the shared storage corresponding to the second host where the second virtual machine is located, and stored in the shared storage corresponding to the second host.
  • the virtual machine image template is cloned and exported to the second host;
  • first virtual machine and the second virtual machine belong to different virtualized resource managers, share the NAS in the shared storage corresponding to the first virtual machine where the first virtual machine is located by using the CIFS protocol sharing NAS.
  • the machine image template is cloned and exported to the NAS, and the virtual machine image template stored in the NAS is cloned and exported to the second host where the second virtual machine is located.
  • processing unit 602 after acquiring the virtual machine image template, before the virtual machine image template is started as the virtual disk of the second virtual machine on the second host, is further used to:
  • the physical device corresponding to the obtaining unit 601 in the embodiment shown in FIG. 6 of the present invention may be a receiver, and the physical device corresponding to the sending unit 603 may be a transmitter, and the physical devices corresponding to all processing units may be For the processor.
  • Each of the devices shown in FIG. 6 may have a structure as shown in FIG. 8.
  • the processor, the transmitter, and the receiver in FIG. 8 implement the aforementioned host device.
  • the device unit 602, the transmitting unit 603, and the obtaining unit 601 provided by the apparatus embodiment of 60 have the same or similar functions, and the memory storage processor in FIG. 8 performs the above deployment.
  • the embodiment of the present invention further provides a system for deploying a virtual machine.
  • the system for deploying a virtual machine includes:
  • the host machine 60 and the virtualization resource manager in the embodiment corresponding to FIG. 6 are used to clone the virtual machine image template to the host.
  • the virtualized resource manager is specifically configured to clone and export the virtual machine image template stored in the shared storage of the same cluster to The host machine;
  • the virtualized resource manager is specifically configured to clone and export the virtual machine image template in the shared storage corresponding to the first host to the shared storage corresponding to the second host, and store the data in the first storage
  • the virtual machine image template in the shared storage corresponding to the second host is cloned and exported to the second host;
  • the first virtual machine and the second virtual machine belong to different virtualization resource managers, the first virtual machine and the second virtual machine are located on different hosts, and the virtualized resource manager Specifically, the virtual machine image template in the shared storage corresponding to the first virtual machine is cloned and exported to the NAS by using a common Internet file system (CIFS) shared NAS, and the storage is stored in the NAS. The virtual machine image template is cloned and exported to the second host.
  • CIFS Internet file system
  • the present invention also provides a computer storage medium storing a program, the program including the host machine 60 or the system 70 deploying the virtual machine executing part of the method of deploying the virtual machine in the embodiment corresponding to FIG. 1 or All steps.
  • the host 60 herein includes a processor, a receiver, and a transmitter configured to support the host 60 in performing the corresponding functions of the methods described above.
  • the receiver and the transmitter are configured to support communication between the host 60 and the cloud management platform, and send information or instructions involved in the foregoing method to the cloud management platform or the virtualized resource manager.
  • the virtualized resource manager 60 can also include a memory for coupling with the processor that holds the program code and data necessary for the operator server.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (English full name: Read-Only Memory, English abbreviation: ROM), a random access memory (English full name: Random Access Memory, English abbreviation: RAM), magnetic A variety of media that can store program code, such as a disc or a disc.

Abstract

A method for deploying virtual machines, a host machine, and a system. The method comprises: setting a preset script in an image file of a first virtual machine, and packaging the image file of the first virtual machine running on a first host machine into a virtual machine image template; starting the virtual machine image template as a virtual disk of a second virtual machine; and executing the preset script to modify a customization parameter of the virtual machine image template on the second virtual machine. By executing the preset script to implement fully automatic modification of the customization parameter of the virtual machine image template on the second virtual machine, the virtual machine deployment efficiency is improved and fully automatic deployment is implemented.

Description

一种部署虚拟机的方法、宿主机及系统Method, host and system for deploying virtual machine
本申请要求于2016年4月1日提交中国专利局、申请号为201610202864.0、发明名称为“一种部署虚拟机的方法、宿主机及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201610202864.0, entitled "A Method, Host, and System for Deploying Virtual Machines", filed on April 1, 2016, the entire contents of which are incorporated by reference. Combined in this application.
技术领域Technical field
本发明涉及云管理平台应用技术领域,尤其涉及一种部署虚拟机的方法、宿主机及系统。The present invention relates to the field of application technologies of a cloud management platform, and in particular, to a method, a host, and a system for deploying a virtual machine.
背景技术Background technique
目前,根据需求多样化需要对现有的基础设施虚拟化,将物理资源按需分配给用户使用,由于资源需求量增加,在虚拟化桌面时,一般采用批量部署虚拟机(英文全称:Virtual Machine,英文简称:VM)的方式部署虚拟机,在部署虚拟机前,根据需要将一台主机上运行的虚拟机的镜像文件转化为虚拟机镜像模板,其中,虚拟机镜像模板为操作系统和软件组合的系统镜像。在部署虚拟机时,通过拷贝该虚拟机镜像模板达到部署的目的,但部署后的虚拟机的操作系统、环境数据等均与该虚拟机镜像模板一模一样,其中,环境数据包括虚拟机的安全标识符(英文全称:Security Identifiers,英文简称:SID)、虚拟机名称、网络协议(英文全称:Internet Protocol,英文简称:IP)地址、管理员密码、工作域等,由于新部署的虚拟机与虚拟机镜像模板的设置相同,在批量部署虚拟机后,会导致虚拟机管理出现问题,故需要对每台新部署的虚拟机的环境数据进行修改。目前一般通过对虚拟机镜像模板进行重新封装达到修改的目的,主要有以下两种方案:Currently, the existing infrastructure is virtualized according to the needs of the needs, and the physical resources are allocated to the users as needed. Due to the increased demand for resources, virtual machines are deployed in batches when virtualizing desktops (English name: Virtual Machine) The VM is deployed in the virtual machine mode. Before the VM is deployed, the image file of the VM running on the host is converted into a VM image template. The VM image template is the operating system and software. Combined system image. When the virtual machine is deployed, the virtual machine image template is copied to the virtual machine. The operating system and environment data of the virtual machine are the same as the virtual machine image template. The environment data includes the security ID of the virtual machine. (English full name: Security Identifiers, English abbreviation: SID), virtual machine name, network protocol (English full name: Internet Protocol, English abbreviation: IP) address, administrator password, work domain, etc., due to newly deployed virtual machine and virtual The settings of the machine image template are the same. After the VMs are deployed in batches, the VM management is faulty. Therefore, you need to modify the environment data of each newly deployed VM. Currently, the virtual machine image template is re-encapsulated to achieve the purpose of modification. The following two solutions are mainly used:
现有方案一:在制作虚拟机镜像模板的最后过程中,通过虚拟机里预安装的代理服务程序调用系统准备(英文全称:System Prepatation,英文简称:Sysprep)工具,根据预配置好的自动应答文件对虚拟机镜像模板中的操作系统进行重新封装(手动修改上述环境数据),并生成自动应答文件,使得在新部署虚拟机后,新部署的虚拟机启动时,选择“主机不自定义”,按照自动应答文件自动设置上述环境数据。该方案中,手动修改工作量较大且容易出错,效率较低。Existing solution 1: In the final process of creating a virtual machine image template, the system preparation (English full name: System Prepatation, English abbreviation: Sysprep) tool is invoked through a pre-installed proxy service program in the virtual machine, according to the pre-configured automatic response. The file re-encapsulates the operating system in the virtual machine image template (manually modify the above environment data) and generates an automatic answer file, so that after the newly deployed virtual machine is started, when the newly deployed virtual machine starts, select "host is not customized". , the above environment data is automatically set according to the automatic answer file. In this scheme, the manual modification workload is large and error-prone, and the efficiency is low.
现有方案二:在部署完虚拟机过程中,建立客户机自定义文件,并选择“使 用现有自定义规范自定义”,选择建立好的客户机自定义文件,通过虚拟机里预安装的代理服务程序,调用Sysprep工具重新封装部署好的虚拟机,使得在首次启动新部署的虚拟机时,按照客户机自定义文件自动设置上述环境数据。Existing solution 2: During the deployment of the virtual machine, create a client customization file and select "Make Customize with the existing custom specification, select the established client customization file, and re-encapsulate the deployed virtual machine by calling the Sysprep tool through the pre-installed proxy service program in the virtual machine, so that the newly deployed virtual machine is started for the first time. In the case of the machine, the above environment data is automatically set according to the client customization file.
上述两种方案中,均无法实现全自动封装过程,安全性得不到保障,且部署效率较低,不适合虚拟化和云计算环境中大规模批量部署虚拟机。In the above two solutions, the fully automatic packaging process cannot be implemented, the security is not guaranteed, and the deployment efficiency is low. It is not suitable for large-scale batch deployment of virtual machines in virtualization and cloud computing environments.
发明内容Summary of the invention
本发明实施例提供一种部署虚拟机的方法、宿主机及系统,能够解决现有机制中批量部署虚拟机的效率较低的问题。The embodiments of the present invention provide a method, a host, and a system for deploying a virtual machine, which can solve the problem of low efficiency of deploying virtual machines in batches in the existing mechanism.
本发明实施例第一方面提供一种部署虚拟机的方法,所述方法包括:A first aspect of the embodiments of the present invention provides a method for deploying a virtual machine, where the method includes:
虚拟化资源管理器运行从云管理平台下载的封装脚本,在第一虚拟机的镜像文件中设置预设脚本,将第一虚拟机封装为虚拟机镜像模版,所述虚拟机镜像模板包括预设脚本。The virtualized resource manager runs the package script downloaded from the cloud management platform, and sets a preset script in the image file of the first virtual machine to encapsulate the first virtual machine into a virtual machine image template, where the virtual machine image template includes a preset. script.
在部署第二虚拟机时,虚拟化资源管理器将所述虚拟机镜像模板克隆至待部署虚拟机的目的宿主机,该待部署虚拟机的目的宿主机可以是第一虚拟机所在的第一宿主机,也可以是第一宿主机之外的第二宿主机。When the second virtual machine is deployed, the virtualized resource manager clones the virtual machine image template to the destination host of the virtual machine to be deployed, and the destination host of the virtual machine to be deployed may be the first virtual machine. The host machine may also be a second host other than the first host.
目的宿主机在获取上述虚拟机镜像模版后,将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动;After obtaining the virtual machine image template, the destination host starts the virtual machine image template as a virtual disk of the second virtual machine;
执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。Executing the preset script to modify a custom parameter of the virtual machine image template on the second virtual machine.
通过将第一虚拟机的镜像文件封装为虚拟机镜像模板,且虚拟机镜像模板中封装有预设脚本,通过使用该虚拟机镜像模板在目的宿主机上部署第二虚拟机,进一步通过执行所述预设脚本,实现在第二虚拟机上全自动化修改虚拟机镜像模板的自定义参数,从而提高部署虚拟机的效率,实现全自动化部署。By embedding the image file of the first virtual machine into a virtual machine image template, and the virtual machine image template is encapsulated with a preset script, the second virtual machine is deployed on the destination host by using the virtual machine image template, and further The preset script implements the automatic modification of the custom parameters of the virtual machine image template on the second virtual machine, thereby improving the efficiency of deploying the virtual machine and achieving fully automated deployment.
以下分别从部署了视窗电脑操作系统(Windows)的虚拟机和部署了Linux操作系统的虚拟机的角度对本发明进行阐述:The following is a description of the present invention from the perspective of a virtual machine on which a Windows operating system (Windows) is deployed and a virtual machine on which a Linux operating system is deployed:
在一种可能的设计中,在使用部署了Windows的虚拟机创建虚拟机镜像模板时,可以在封装准备阶段,在虚拟机镜像模板中设置用于实现全自动修改虚拟机镜像模板中自定义参数的预设脚本,其中,所述预设脚本包括批处理脚本和开机启动脚本。在执行所述预设脚本时,可以根据从云管理平台获取的目标自定义参数修改虚拟机镜像模板中的自定义参数。具体如下:In a possible design, when creating a virtual machine image template using a virtual machine with Windows deployed, you can set the custom parameters in the virtual machine image template for automatic modification of the virtual machine image template in the package preparation stage. a preset script, wherein the preset script includes a batch script and a boot script. When the preset script is executed, the custom parameter in the virtual machine image template may be modified according to the target custom parameter obtained from the cloud management platform. details as follows:
执行所述批处理脚本和所述开机启动脚本,以从云管理平台获取所述第二 虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。在部署第二虚拟机时,获取云管理平台随机生成的目标自定义参数,使得部署的各虚拟机的自定义参数不同,避免网络管理冲突,在开机自动登录后,通过执行批处理脚本和开机启动脚本,无需手动修改或引导式手动操作,实现全自动化修改自定义参数。Executing the batch script and the boot script to obtain the second from the cloud management platform A target custom parameter of the virtual machine, and modifying a custom parameter of the virtual machine image template on the second virtual machine according to the target custom parameter. When the second virtual machine is deployed, the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, and the network management conflict is avoided. After the automatic login, the batch script is executed and booted. Start the script without manual modification or guided manual operation, and fully customize the custom parameters.
可选的,所述目标自定义参数包括域管理和网络配置、第二虚拟机的安全标识符SID、第二虚拟机的虚拟机名称、第二虚拟机的管理员账户以及与所述管理员账户对应的第二虚拟机的管理员密码;其中,所述域管理包括退域和加域,所述网络配置包括动态网络地址的配置和静态网络地址的配置;Optionally, the target customization parameter includes a domain management and a network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, an administrator account of the second virtual machine, and the administrator An administrator password of the second virtual machine corresponding to the account; wherein the domain management includes a domain and a domain, and the network configuration includes a configuration of a dynamic network address and a configuration of a static network address;
所述批处理脚本包括:激活第二虚拟机中的操作系统、对所述第二虚拟机进行退域以及设置动态主机配置协议DHCP获取网络;The batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol DHCP acquisition network;
所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码、修改所述第二虚拟机的SID、对所述第二虚拟机进行加域、取消所述第二虚拟机自动登录以及清理系统环境。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying an SID of the second virtual machine, and The second virtual machine performs domain addition, cancels automatic login of the second virtual machine, and cleans up the system environment.
通过在虚拟机镜像模版中设置开机自动登录、批处理脚本和开机启动脚本,使得在部署第二虚拟机阶段能够按照这两个脚本来实现自定义参数的全自动修改,无需人工参与,提高部署效率。By setting the boot automatic login, batch script and boot script in the virtual machine mirror template, the two virtual scripts can be used to implement the automatic modification of the custom parameters in the second virtual machine stage without manual intervention. effectiveness.
在一种可能的设计中,在部署Windows虚拟机时,启动第二虚拟机后,首先调用系统文件(windeploy.exe)进入系统部署阶段,并立即激活内置管理员(Administrator)账户,在Windows开机自动登录后,通过执行批处理脚本和开机启动脚本,以及重启两次虚拟机达到自动修改自定义参数以及修改生效的目的。所述执行所述批处理脚本和所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数,包括:In a possible design, when deploying the Windows virtual machine, after starting the second virtual machine, first call the system file (windeploy.exe) to enter the system deployment phase, and immediately activate the built-in administrator account, boot in Windows. After the automatic login, the automatic modification of the custom parameters and the modification take effect are achieved by executing the batch script and the startup script, and restarting the virtual machine twice. Performing the batch processing script and the boot startup script to acquire target custom parameters of the second virtual machine from the cloud management platform, and modifying the second virtual machine according to the target custom parameter The custom parameters of the virtual machine image template include:
在所述第二虚拟机开机自动登录后,执行所述批处理脚本,以对所述第二虚拟机进行Windows系统正版激活、退域和设置所述DHCP以获取网络地址,以及触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;After the second virtual machine is powered on automatically, the batch script is executed to perform the Windows system genuine activation, dequeue, and setting the DHCP to obtain the network address, and trigger the cloud on the second virtual machine. The management platform configures the target custom parameter for the second virtual machine;
执行所述开机启动脚本,以根据接收到的来自所述云管理平台的所述目标自定义参数修改所述第二虚拟机的虚拟机名称;Executing the boot startup script to modify a virtual machine name of the second virtual machine according to the received target custom parameter from the cloud management platform;
重启所述第二虚拟机,所述第二虚拟机自动登录后,执行所述开机启动脚 本,以根据所述目标自定义参数对所述第二虚拟机进行加域、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码和修改所述第二虚拟机的SID,以及通过还原注册表和系统环境取消Windows虚拟机自动登录后清理系统环境(删除封装脚本和配置文件);Restarting the second virtual machine, and after the second virtual machine automatically logs in, executing the booting foot The domain name of the second virtual machine is modified according to the target custom parameter, the static network address of the second virtual machine is modified, the administrator password of the second virtual machine is modified, and the second virtual machine is modified. SID, as well as clean up the system environment (delete package scripts and configuration files) after canceling the automatic login of the Windows virtual machine by restoring the registry and system environment;
重启所述第二虚拟机。Restart the second virtual machine.
上述可能的设计中,通过开机启动脚本设定两次重启第二虚拟机,保证所修改的自定义参数生效,实现自动激活操作系统,成功修改虚拟机名称,以及在修改虚拟机名称后自动加域,避免手动加域后出现的脱域现象,同时,也成功修改第二虚拟机的静态网络地址、密码和SID,避免自定义参数设置一致带来的管理冲突。In the above possible design, the second virtual machine is restarted by setting the startup script to ensure that the modified custom parameters take effect, the operating system is automatically activated, the virtual machine name is successfully modified, and the virtual machine name is automatically added after the virtual machine name is modified. The domain avoids the de-allocation phenomenon after the manual domain is added. At the same time, the static network address, password, and SID of the second virtual machine are successfully modified to avoid the management conflict caused by the consistent setting of the custom parameters.
在一些可能的设计中,为实现在部署第二虚拟机阶段,全自动完成对虚拟机镜像模板中的自定义参数的修改,在制作该虚拟机镜像模板前,可以对该虚拟机镜像模板进行封装,并设置上述预设脚本以供部署第二虚拟机时使用。故,所述获取虚拟机镜像模板之前,所述方法还包括:In some possible designs, in order to implement the modification of the custom parameters in the virtual machine image template in the stage of deploying the second virtual machine, the virtual machine image template may be performed before the virtual machine image template is created. Encapsulate and set the above preset script for use when deploying the second virtual machine. Therefore, before the obtaining the virtual machine image template, the method further includes:
执行从所述云管理平台下载的封装脚本,以在所述第一虚拟机中重置第一虚拟机的管理员密码、关闭Windows更新、禁用用户账户控制UAC、关闭错误报告、禁用防火墙、退域和打开Windows核心内存转储功能,配置Windows开机自动登录和开机启动脚本注册表,根据可扩展标识语言XML应答文件运行Sysprep重新配置Windows系统,以及设置所述开机启动脚本,关闭第一虚拟机后将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。Executing a package script downloaded from the cloud management platform to reset an administrator password of the first virtual machine in the first virtual machine, turn off Windows update, disable user account control UAC, close error report, disable firewall, back Domain and open Windows core memory dump function, configure Windows boot automatic login and boot script registry, run Sysprep according to Extensible Markup Language XML answer file to reconfigure Windows system, and set the boot script to close the first virtual machine The image file of the first virtual machine is encapsulated into the virtual machine image template.
即通过执行上述封装脚本,完成对所述第一虚拟机中的操作系统进行封装,从而使用所述第一虚拟机的镜像文件创建所述虚拟机镜像模板,实现对虚拟机镜像模板全自动封装。The encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template. .
在一些可能的设计中,所述克隆虚拟机镜像模板至第二宿主机之后,在所述第二宿主机上将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动之前,所述方法还包括:In some possible designs, after the clone virtual machine mirrors the template to the second host, before the virtual machine image template is started as the virtual disk of the second virtual machine on the second host, the method Also includes:
将克隆的虚拟机镜像模板挂载在计算机节点代理CNA上的所述第二虚拟机上,利用虚拟机监控器VMM将所述开机启动脚本和用于描述所述目标自定义参数的配置文件注入到所述第二虚拟机的镜像文件中。Mounting the cloned virtual machine image template on the second virtual machine on the computer node agent CNA, and injecting the boot script and a configuration file for describing the target custom parameter by using a virtual machine monitor VMM Go to the image file of the second virtual machine.
在一种可能的设计中,在使用部署了Linux的虚拟机创建虚拟机镜像模板时,可以在封装准备阶段在虚拟机镜像模板中设置用于实现全自动修改虚拟机 镜像模板中自定义参数的预设脚本,其中,所述预设脚本包括开机启动脚本。在执行所述预设脚本时,可以根据从云管理平台获取的目标自定义参数修改虚拟机镜像模板中的自定义参数。具体如下:In a possible design, when creating a virtual machine image template using a virtual machine with Linux deployed, it can be set in the virtual machine image template for automatic modification of the virtual machine during the package preparation phase. A preset script of a custom parameter in the image template, wherein the preset script includes a boot script. When the preset script is executed, the custom parameter in the virtual machine image template may be modified according to the target custom parameter obtained from the cloud management platform. details as follows:
执行所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。在部署第二虚拟机时,获取云管理平台随机生成的目标自定义参数,使得部署的各虚拟机的自定义参数不同,避免网络管理冲突,通过执行开机启动脚本,无需手动修改或引导式手动操作,实现全自动化修改自定义参数。The booting script is executed to obtain the target custom parameter of the second virtual machine from the cloud management platform, and modify the virtual machine image template on the second virtual machine according to the target custom parameter. Define parameters. When the second virtual machine is deployed, the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, and the network management conflict is avoided, and the startup startup script is executed, and no manual modification or manual manual is required. Operation, fully automatic modification of custom parameters.
可选的,所述目标自定义参数包括网络配置、第二虚拟机的虚拟机名称、第二虚拟机的虚拟机名称、第二虚拟机的超级用户名root对应的第二虚拟机的超级用户密码;其中,所述网络配置包括静态网络地址的配置;Optionally, the target custom parameter includes a network configuration, a virtual machine name of the second virtual machine, a virtual machine name of the second virtual machine, and a super user of the second virtual machine corresponding to the super user name root of the second virtual machine. a password; wherein the network configuration includes a configuration of a static network address;
所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的超级用户密码、修改主机名配置文件和DNS域名解析,还可以包括清理第二虚拟机的操作系统环境。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying a super user password of the second virtual machine, modifying a host name configuration file, and DNS domain name resolution, and This may include cleaning up the operating system environment of the second virtual machine.
在一些可能的设计中,在部署Linux虚拟机时,通过执行开机启动脚本,以及重启虚拟机的网络服务达到修改生效的目的。所述执行所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数,包括:In some possible designs, when the Linux virtual machine is deployed, the modification is effective by executing the boot script and restarting the virtual machine's network service. Performing the boot startup script to acquire target custom parameters of the second virtual machine from the cloud management platform, and modifying the virtual machine image template on the second virtual machine according to the target custom parameter Custom parameters, including:
执行所述开机启动脚本,以触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;Executing the boot startup script to trigger the cloud management platform to configure the target custom parameter for the second virtual machine;
在接收所述云管理平台发送的所述目标自定义参数后,根据所述目标自定义参数修改所述第二虚拟机的虚拟机名称、为所述第二虚拟机配置DNS域名解析、修改第二虚拟机的静态网络地址和修改所述第二虚拟机的超级用户密码;After receiving the target custom parameter sent by the cloud management platform, modifying a virtual machine name of the second virtual machine according to the target custom parameter, configuring a DNS domain name resolution, and modifying the second virtual machine. a static network address of the virtual machine and a super user password of the second virtual machine;
重启第二虚拟机的网络服务使得上述网络配置生效。Restarting the network service of the second virtual machine enables the above network configuration to take effect.
上述可能的设计中,通过开机启动脚本设定重启虚拟机的网络服务,保证所修改的自定义参数生效,实现成功修改虚拟机名称,同时。也成功修改第二虚拟机的静态网络地址、密码,避免自定义参数设置一致带来的管理冲突。In the above-mentioned possible design, the network service of the virtual machine is restarted by using the boot script to ensure that the modified custom parameters take effect, and the virtual machine name is successfully modified. The static network address and password of the second virtual machine are also successfully modified to avoid management conflicts caused by consistent setting of custom parameters.
在一些可能的设计中,为实现在部署第二虚拟机阶段,全自动完成对虚拟机镜像模板中的自定义参数的修改,在制作该虚拟机镜像模板前,可以对该虚拟机镜像模板进行封装,并设置上述预设脚本以供部署第二虚拟机时使用。故, 所述获取虚拟机镜像模板之前,所述方法还包括:In some possible designs, in order to implement the modification of the custom parameters in the virtual machine image template in the stage of deploying the second virtual machine, the virtual machine image template may be performed before the virtual machine image template is created. Encapsulate and set the above preset script for use when deploying the second virtual machine. Therefore, Before the obtaining the virtual machine image template, the method further includes:
执行从所述云管理平台下载的封装脚本,以删除网卡命名保持规则文件、设置动态主机配置协议DHCP以获取网络地址,在第一宿主机的第一虚拟机的镜像文件中设置所述开机启动脚本,并清理所述封装脚本,将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。Performing a package script downloaded from the cloud management platform to delete a network card naming and maintaining rule file, setting a dynamic host configuration protocol DHCP to obtain a network address, and setting the booting in an image file of the first virtual machine of the first host machine. And compressing the package script to encapsulate the image file of the first virtual machine into the virtual machine image template.
即通过执行上述封装脚本,完成对所述第一虚拟机中的操作系统进行封装,从而使用所述第一虚拟机的镜像文件创建所述虚拟机镜像模板,实现对虚拟机镜像模板全自动封装。The encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template. .
在一些可能的设计中,在制作所述虚拟机镜像模板时,在第一虚拟机的镜像中设置了所述预设脚本,在后续部署第二虚拟机时,需要虚拟机监控器VMM将开机启动脚本和目标自定义参数注入第二虚拟机。具体为,所述克隆虚拟机镜像模板至第二宿主机之后,在所述第二宿主机上将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动之前,所述方法还包括:In some possible designs, when the virtual machine image template is created, the preset script is set in the image of the first virtual machine, and when the second virtual machine is deployed, the virtual machine monitor VMM is required to be powered on. The startup script and target custom parameters are injected into the second virtual machine. Specifically, before the merging the virtual machine image template to the second host, the method further includes: before the virtual machine image template is started as the virtual disk of the second virtual machine on the second host, the method further includes:
将克隆的虚拟机镜像模板挂载在计算机节点代理CNA的域domain0上,以及将所述开机启动脚本和所述目标自定义参数发送给虚拟机监控器VMM,以使所述VMM将所述开机启动脚本和所述目标自定义参数注入到所述第二虚拟机中。Mounting the cloned virtual machine image template on the domain domain0 of the computer node proxy CNA, and sending the boot script and the target custom parameter to the virtual machine monitor VMM, so that the VMM will boot the boot A startup script and the target custom parameter are injected into the second virtual machine.
在一些可能的设计中,由于第一宿主机和第二宿主机可能属于同一个集群或不同的集群,使得第二宿主机从第一宿主机获得需要的虚拟机镜像模板的获取方式有所区别,具体如下:所述克隆虚拟机镜像模板至第二宿主机,至少包括以下项之一:In some possible designs, since the first host and the second host may belong to the same cluster or different clusters, the manner in which the second host obtains the required virtual machine image template from the first host is different. Specifically, the cloning virtual machine image template to the second host includes at least one of the following items:
若所述第一虚拟机和所述第二虚拟机属于同一集群,则从所述同一集群的共享存储中获取所述虚拟机镜像模板,此种情况下,第一虚拟机和第二虚拟机还可能运行在同一台宿主机上,也可能运行在同一集群的不同宿主机上。If the first virtual machine and the second virtual machine belong to the same cluster, obtain the virtual machine image template from the shared storage of the same cluster, in this case, the first virtual machine and the second virtual machine It may also run on the same host or on different hosts in the same cluster.
若所述第一虚拟机和所述第二虚拟机属于同一虚拟化资源管理器,但不属于同一集群,则通过所述虚拟化资源管理器将所述第一虚拟机所在的第一宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机对应的共享存储,并将存储在所述第二宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二宿主机;If the first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, use the virtualized resource manager to locate the first host where the first virtual machine is located The virtual machine image template in the corresponding shared storage is cloned and exported to the shared storage corresponding to the second host where the second virtual machine is located, and stored in the shared storage corresponding to the second host. The virtual machine image template is cloned and exported to the second host;
若所述第一虚拟机和所述第二虚拟机属于不同虚拟化资源管理器,则通过通用互联网文件系统CIFS协议共享网络附属存储NAS将所述第一虚拟机所在的 第一虚拟机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述NAS,并将存储在所述NAS中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机。If the first virtual machine and the second virtual machine belong to different virtualized resource managers, share the network attached storage NAS by using the universal Internet file system CIFS protocol to locate the first virtual machine. The virtual machine image template in the shared storage corresponding to the first virtual machine is cloned and exported to the NAS, and the virtual machine image template stored in the NAS is cloned and exported to the second virtual machine. The second host.
通过集群中的共享存储以及集群间的NAS来实现共享虚拟机镜像模板的目的。The purpose of sharing a virtual machine image template is achieved by shared storage in the cluster and NAS between the clusters.
本发明实施例第二方面提供一种宿主机,具有实现对应于上述第一方面提供的封装部署虚拟机的方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的单元,所述单元可以是软件和/或硬件。A second aspect of the embodiments of the present invention provides a host machine having a function of implementing a method for deploying a virtual machine corresponding to the package provided by the foregoing first aspect. The functions may be implemented by hardware or by corresponding software implemented by hardware. The hardware or software includes one or more units corresponding to the functions described above, which may be software and/or hardware.
一种可能的设计中,所述宿主机包括:In a possible design, the host machine includes:
获取单元,用于获取虚拟机镜像模板,所述虚拟机镜像模板根据第一虚拟机封装的镜像文件得到,所述虚拟机镜像模板包括预设脚本;An obtaining unit, configured to obtain a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script;
处理单元,用于将所述获取单元获取的所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动,执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。a processing unit, configured to start, by using the virtual machine image template obtained by the acquiring unit, as a virtual disk of a second virtual machine, execute the preset script, to modify the virtual machine image on the second virtual machine Custom parameters for the template.
一种可能的设计中,所述宿主机包括:In a possible design, the host machine includes:
接收器、处理器和存储器;Receiver, processor and memory;
其中,所述存储器用于存储程序代码,所述处理器用于调用所述存储器中的程序代码来执行以下操作:The memory is used to store program code, and the processor is configured to invoke program code in the memory to perform the following operations:
通过所述接收器获取虚拟机镜像模板,所述虚拟机镜像模板根据第一虚拟机封装的镜像文件得到,所述虚拟机镜像模板包括预设脚本;And obtaining, by the receiver, a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script;
将所述获取单元获取的所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动,执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。The virtual machine image template obtained by the obtaining unit is started as a virtual disk of the second virtual machine, and the preset script is executed to modify the custom parameter of the virtual machine image template on the second virtual machine. .
本发明实施例第三方面提供一种部署虚拟机的系统,包括上述第二方面所述的宿主机和虚拟化资源管理器,所述虚拟化资源管理器,用于将虚拟机镜像模板克隆至所述宿主机。A third aspect of the embodiments of the present invention provides a system for deploying a virtual machine, including the host and the virtualized resource manager according to the second aspect, wherein the virtualized resource manager is configured to clone a virtual machine image template to The host machine.
该部署虚拟机的系统具有实现对应于上述第一方面提供的封装部署虚拟机的方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的单元,所述单元可以是软件 和/或硬件。The system for deploying a virtual machine has a function of implementing a method corresponding to the package deployment virtual machine provided by the above first aspect. The functions may be implemented by hardware or by corresponding software implemented by hardware. The hardware or software includes one or more units corresponding to the above functions, which may be software And / or hardware.
跟现有机制相比,本发明中,通过使用设置了上述预设脚本的虚拟机镜像模板创建第二虚拟机,使得在虚拟机镜像模板作为所述第二虚拟机的虚拟磁盘启动后,通过执行所述预设脚本实现在第二虚拟机上全自动化修改虚拟机镜像模板的自定义参数,提高部署虚拟机的效率。Compared with the existing mechanism, in the present invention, the second virtual machine is created by using the virtual machine image template that is configured with the preset script, so that after the virtual machine image template is started as the virtual disk of the second virtual machine, The preset script is executed to automatically modify the custom parameters of the virtual machine image template on the second virtual machine to improve the efficiency of deploying the virtual machine.
附图说明DRAWINGS
图1为本实施例中部署虚拟机的方法的一种流程示意图;FIG. 1 is a schematic flowchart of a method for deploying a virtual machine in this embodiment;
图2为本实施例中部署虚拟机的方法的另一种流程示意图;FIG. 2 is another schematic flowchart of a method for deploying a virtual machine in this embodiment;
图3为本实施例中部署虚拟机的方法的另一种流程示意图;FIG. 3 is another schematic flowchart of a method for deploying a virtual machine in this embodiment;
图4为本实施例中部署虚拟机的方法的另一种流程示意图;FIG. 4 is another schematic flowchart of a method for deploying a virtual machine in this embodiment;
图5为本实施例中部署虚拟机的方法的另一种流程示意图;FIG. 5 is another schematic flowchart of a method for deploying a virtual machine in this embodiment;
图6为本实施例中宿主机的一种结构示意图;FIG. 6 is a schematic structural diagram of a host machine in the embodiment; FIG.
图7为本实施例中部署虚拟机的系统的一种结构示意图;FIG. 7 is a schematic structural diagram of a system for deploying a virtual machine in this embodiment;
图8为本实施例中宿主机的另一种结构示意图。FIG. 8 is another schematic structural diagram of the host machine in the embodiment.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments, based on All other embodiments obtained by those skilled in the art without creative efforts are within the scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元,本文中所出现的单元的划分,仅仅是一种逻辑上的划分,实际应用中实现时可以有另外的划分方式,例如多个单元可以结合成或集成在另一个系统中,或一些特征可以忽略,或不执行,另外,所显示的或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元之间的间接耦合或通信连接可以是电性或其他类似的形式,本文中均不作限定。并且,作为分离部件 说明的单元或子单元可以是也可以不是物理上的分离,可以是也可以不是物理单元,或者可以分不到多个电路单元中,可以根据实际的需要选择其中的部分或全部单元来实现本发明实施例方案的目的。The terms "first", "second" and the like in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a particular order or order. It is to be understood that the data so used may be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than what is illustrated or described herein. In addition, the terms "comprises" and "comprises" and "the" and "the" are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to Those steps or units, but may include other steps or units not explicitly listed or inherent to such processes, methods, products or devices, the division of elements appearing herein is merely a logical division. There may be additional ways of dividing when implemented in an actual application, for example, multiple units may be combined or integrated into another system, or some features may be omitted or not performed, and in addition, the displayed or discussed mutual coupling. The direct coupling or the communication connection may be through some interfaces, and the indirect coupling or communication connection between the units may be electrical or the like, which is not limited herein. And as a separate component The illustrated unit or subunit may or may not be physically separated, may or may not be a physical unit, or may be divided into a plurality of circuit units, and some or all of the units may be selected according to actual needs to implement the present invention. The purpose of the embodiments of the invention.
本发明实施例提供了一种部署虚拟机的方法、宿主机及系统,用于云管理平台技术领域。以下进行详细说明。The embodiments of the present invention provide a method, a host, and a system for deploying a virtual machine, which are used in the technical field of a cloud management platform. The details are described below.
本文中的部署虚拟机的系统包括云管理平台、至少一个虚拟化资源管理器(英文全称:Virtual Resouce Manager,英文简称:VRM),至少一个宿主机,用户在云管理平台上操作实现对各宿主机及各宿主机上运行的虚拟机的管理和控制。其中,云管理平台主要用于根据用户的部署请求调度物理资源池,可以是云主机管理平台、云计算平台、云主机、计算机、云计算节点等,VRM主要用于调度物理资源和虚拟资源,以及部署虚拟机,每个VRM负责相应的集群内的所有宿主机的资源调度。每个集群具有共享存储,用于存储集群内各宿主机所共享的文件(例如虚拟机镜像模板、应用等)。宿主机是指需要安装虚拟机软件的物理计算机。The system for deploying a virtual machine in this document includes a cloud management platform, at least one virtualized resource manager (English full name: Virtual Resouce Manager, English abbreviation: VRM), at least one host machine, and the user operates on the cloud management platform to implement each sink. Management and control of the virtual machines running on the host and each host. The cloud management platform is mainly used for scheduling physical resource pools according to the deployment request of the user, and may be a cloud host management platform, a cloud computing platform, a cloud host, a computer, a cloud computing node, etc., and the VRM is mainly used for scheduling physical resources and virtual resources. As well as deploying virtual machines, each VRM is responsible for resource scheduling for all hosts within the corresponding cluster. Each cluster has shared storage for storing files shared by each host in the cluster (such as virtual machine image templates, applications, etc.). A host is a physical computer that requires virtual machine software to be installed.
由于现有机制中,由于在批量部署虚拟机时需要手动修改虚拟机镜像模板的自定义参数,导致部署效率较低,为解决该技术问题,本发明主要采用以下技术方案:The existing technical solutions are mainly used in the prior art because the configuration of the virtual machine mirroring template is required to be manually modified.
1、在制作虚拟机镜像模板时,在虚拟机镜像中设置用于实现全自动修改虚拟机镜像模板中自定义参数的预设脚本。1. When creating a VM image template, set a preset script for implementing the automatic modification of the custom parameters in the VM image template in the VM image.
即在选定的源虚拟机中安装好操作系统、应用、服务等,执行封装脚本,根据预设置的可扩展标示语言(英文全称:Extensive Markup Language,英文简称:XML)应答文件调用Sysprep工具重新配置Windows虚拟机,以及在源虚拟机的镜像中设置所述预设脚本,从而完成对源虚拟机的镜像的封装,关闭源虚拟机后得到虚拟机镜像模板。其中,封装脚本包括调用Sysprep工具的命令、Sysprep工具执行重新配置系统、Sysprep工具根据预置应答文件执行所要修改的参数等,其中,XML应答文件可以在运行封装之前,运行Sysprep文件夹下的程序“setupmgr.exe”生成。That is, install the operating system, applications, services, etc. in the selected source virtual machine, execute the package script, and call the Sysprep tool according to the preset extensible markup language (English full name: Extensive Markup Language, English abbreviation: XML) answer file. Configure the Windows virtual machine and set the default script in the image of the source VM to encapsulate the image of the source VM. After the source VM is shut down, the VM image template is obtained. The package script includes a command to invoke the Sysprep tool, the Sysprep tool performs a reconfiguration system, and the Sysprep tool executes the parameters to be modified according to the preset answer file. The XML response file can run the program under the Sysprep folder before running the package. "setupmgr.exe" is generated.
2、克隆设置了预设脚本的虚拟机镜像模板至待部署虚拟机的宿主机。2. Clone the virtual machine image template of the preset script to the host of the virtual machine to be deployed.
3、启动克隆的虚拟机镜像模板后,自动执行预设脚本,实现在待部署的虚拟机上修改虚拟机镜像模板的自定义参数。3. After the cloned VM image template is started, the default script is automatically executed to modify the custom parameters of the VM image template on the VM to be deployed.
通过使用设置了预设脚本的虚拟机镜像模板部署虚拟机,实现启动克隆的 虚拟机镜像模板时,执行上述预设脚本,从而全自动的修改上述自定义参数,避免网络管理的冲突现象,提高虚拟机部署效率。Start a clone by deploying a virtual machine using a virtual machine image template with a preset script set When the virtual machine mirrors the template, the above preset script is executed to automatically modify the above custom parameters to avoid network management conflicts and improve virtual machine deployment efficiency.
请参照图1,以下对本发明实施例中的部署虚拟机的方法进行描述,为实现在部署新虚拟机阶段中对虚拟机镜像模板中的自定义参数进行全自动修改,在制作该虚拟机镜像模板之前,可以对该虚拟机镜像模板进行封装,并设置上述预设脚本以供部署新虚拟机时使用。具体为:在制作虚拟机镜像模板之前,先按照宿主机的需求确定符合需求的虚拟机,例如判断虚拟机中部署的操作系统类型、虚拟机中操作系统的版本信息、部署的应用和服务等,然后在云管理平台选定需要的目标虚拟机,点击“制作镜像”按钮触发制作镜像,然后通过VRM将目标虚拟机关机后,拷贝出一份虚拟机镜像,然后启动所述虚拟机镜像,并通过云管理平台通道下载并解压封装脚本包,则本发明实施例包括:Referring to FIG. 1 , a method for deploying a virtual machine in the embodiment of the present invention is described below, in order to implement automatic modification of a custom parameter in a virtual machine image template in a stage of deploying a new virtual machine, and the virtual machine image is created. Before the template, you can encapsulate the virtual machine image template and set the above preset script for use when deploying a new virtual machine. Specifically, before the virtual machine image template is created, the virtual machine that meets the requirements is determined according to the requirements of the host, for example, the operating system type deployed in the virtual machine, the version information of the operating system in the virtual machine, the deployed application and service, and the like. Then, select the desired target virtual machine in the cloud management platform, click the "Make Mirror" button to trigger the production of the image, and then copy the virtual machine image by the target virtual machine through the VRM, and then start the virtual machine image. And downloading and decompressing the package script package through the cloud management platform channel, the embodiment of the present invention includes:
101、VRM执行从所述云管理平台下载的封装脚本,以在第一宿主机的第一虚拟机的镜像文件中设置预设脚本,将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。The VRM executes the package script downloaded from the cloud management platform to set a preset script in the image file of the first virtual machine of the first host, and encapsulates the image file of the first virtual machine into the virtual Machine mirror template.
即通过执行上述封装脚本,完成对所述第一虚拟机中的操作系统进行封装,从而使用所述第一虚拟机的镜像文件创建所述虚拟机镜像模板,实现对虚拟机镜像模板全自动封装。The encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template. .
102、VRM克隆虚拟机镜像模板至第二宿主机。102. The VRM clones the virtual machine image template to the second host.
可以理解的是,由于一台宿主机可以同时运行2台以上的虚拟机,故,操作人员可以在第一虚拟机所属的第一宿主机上部署第二虚拟机,即上述第二宿主机与第一宿主机为相同的宿主机;也可以在第一宿主机之外的宿主机上部署第二虚拟机,VRM是根据资源调度算法来选择待部署虚拟机的目的宿主机,具体不限定。It can be understood that, since one host can run more than two virtual machines at the same time, the operator can deploy the second virtual machine on the first host to which the first virtual machine belongs, that is, the second host and the second host. The first host is the same host; the second virtual machine may be deployed on the host other than the first host. The VRM is the destination host for selecting the virtual machine to be deployed according to the resource scheduling algorithm, and is not limited.
103、第二宿主机将获取的所述虚拟机镜像模板作为所述第二虚拟机的虚拟磁盘启动。103. The second host starts the obtained virtual machine image template as a virtual disk of the second virtual machine.
其中,所述虚拟机镜像模板包括预设脚本,所述虚拟机镜像模板根据第一宿主机的第一虚拟机的镜像文件得到。The virtual machine image template includes a preset script, and the virtual machine image template is obtained according to an image file of the first virtual machine of the first host.
由于虚拟机中部署的操作系统的类型不同,在步骤101中制作虚拟机镜像模板时,对第一虚拟机的镜像文件进行封装时设置的预设脚本也不同,具体包括两种情况:The default scripts that are set when the image file of the first VM is encapsulated are different. The two scenarios are as follows:
a、在使用部署了Windows的虚拟机创建虚拟机镜像模板时,可以在封装准 备阶段在虚拟机镜像模板中设置开机自动登录、批处理脚本和开机启动脚本。a. When creating a VM image template using a VM with Windows deployed, you can apply it in the package. In the standby phase, set the power-on automatic login, batch script, and boot script in the virtual machine image template.
b、在使用部署了Linux的虚拟机创建虚拟机镜像模板时,可以在封装准备阶段在虚拟机镜像模板中设置开机启动脚本。b. When creating a VM image template using a VM with Linux deployed, you can set the boot script in the VM image template during the package preparation phase.
可以理解的是,由于Windows操作系统和Linux操作系统原理不同,使得上述a&b两种场景中的开机启动脚本所包含的策略不同。It can be understood that, due to the different principles of the Windows operating system and the Linux operating system, the startup startup scripts in the above a&b scenarios have different strategies.
一、部署Windows VM场景中的封装阶段First, the packaging phase in the deployment of the Windows VM scenario
在使用部署了Windows的虚拟机创建虚拟机镜像模板时,为实现在部署第二虚拟机阶段,全自动的完成对虚拟机镜像模板中的自定义参数的修改,在制作该虚拟机镜像模板前,可以对该虚拟机镜像模板进行封装,并在虚拟机镜像模板中设置批处理脚本和开机启动脚本以供部署第二虚拟机时使用。具体体现为,在克隆虚拟机镜像模板至第二宿主机之前,VRM对第一虚拟机执行以下封装操作:When creating a VM image template using a VM configured with Windows, you can fully modify the custom parameters in the VM image template before deploying the VM image template. The virtual machine image template can be encapsulated, and a batch script and a boot script are set in the virtual machine image template for use in deploying the second virtual machine. Specifically, before the virtual machine image template is cloned to the second host, the VRM performs the following encapsulation operation on the first virtual machine:
重置管理员密码、关闭Windows更新、禁用用户帐户控制(英文全称:User Account Control,英文简称:UAC)、关闭错误报告、禁用防火墙、退域和打开Windows核心转储功能等,并设置Windows开机自动登录、批处理脚本和开机启动脚本,然后根据应答文件运行Sysprep工具,重新配置Windows系统、激活Windows系统的管理员帐户,并关闭第一虚拟机,从而将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。其中,封装脚本为一键全自动式的封装脚本,只需操作人员一键选中,即可自动执行后续的封装操作,全程无需人工参与,从而减少出错率以及提高封装效率。Reset the administrator password, turn off Windows updates, disable user account control (English account: User Account Control, English abbreviation: UAC), turn off error reporting, disable firewall, dequeue and open Windows core dump function, and set Windows boot Automatic login, batch script, and boot script, then run the Sysprep tool according to the answer file, reconfigure the Windows system, activate the administrator account of the Windows system, and shut down the first virtual machine, thereby mirroring the first virtual machine The encapsulation is the virtual machine image template. The package script is a one-button automatic package script, which can automatically perform subsequent package operations with one button selection, without manual intervention, thereby reducing error rate and improving package efficiency.
即通过执行上述封装脚本,完成对所述第一虚拟机中的操作系统进行封装,从而使用所述第一虚拟机的镜像文件创建所述虚拟机镜像模板,实现对虚拟机镜像模板全自动封装。The encapsulation of the operating system in the first virtual machine is performed by using the foregoing package script, so that the virtual machine image template is created by using the image file of the first virtual machine to implement automatic packaging of the virtual machine image template. .
其中,所述批处理脚本包括:激活第二虚拟机中的操作系统、对所述第二虚拟机进行退域以及设置动态主机配置协议(英文全称:Dynamic host configuration protocol,英文简称:DHCP)获取网络,其中,退域是指从一组服务器和计算机的集合中退出。The batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol (English full name: Dynamic host configuration protocol, English abbreviation: DHCP). A network in which a domain is referred to as exiting from a collection of servers and computers.
所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码、修改所述第二虚拟机的SID、以及对所述第二虚拟机进行加域,还可以包括取消所述第二虚拟机自动登录以及清理系统环境,其中,加域是指加入一组服务器和计算机的集合,该集 合用于一组计算机共享公共用的安全数据库,任一计算机可以在同一域内访问其他计算机。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying a SID of the second virtual machine, and Adding the domain to the second virtual machine may further include canceling the automatic login of the second virtual machine and cleaning up the system environment, wherein adding the domain refers to joining a set of servers and computers, the set Used in conjunction with a group of computers to share a common secure database, any computer can access other computers within the same domain.
通过设置批处理脚本和开机启动脚本,使得在部署第二虚拟机阶段能够按照这两个脚本来实现自定义参数的全自动修改,无需人工参与,提高部署效率。By setting a batch script and a boot-up script, it is possible to implement automatic modification of the custom parameters according to the two scripts during the deployment of the second virtual machine stage, without manual participation, and improve deployment efficiency.
二、部署Linux VM场景中的封装阶段Second, the packaging phase in the deployment of Linux VM scenarios
在使用部署了Linux的虚拟机创建虚拟机镜像模板时,为实现在部署第二虚拟机阶段,全自动的完成对虚拟机镜像模板中的自定义参数的修改,在制作该虚拟机镜像模板前,可以对该虚拟机镜像模板进行封装,并在虚拟机镜像模板中设置上述开机启动脚本以供部署第二虚拟机时使用。具体体现为,在克隆虚拟机镜像模板至第二宿主机之前,还可以执行以下步骤:When creating a VM image template using a Linux-based VM, the modification of the custom parameters in the VM image template is completed automatically before the VM image template is created. The virtual machine image template can be encapsulated, and the above startup script is set in the virtual machine image template for use in deploying the second virtual machine. Specifically, before the virtual machine image template is cloned to the second host, the following steps can be performed:
执行从所述云管理平台下载的封装脚本,以删除网卡命名保持规则文件、设置DHCP以获取网络地址,在第一宿主机的第一虚拟机的镜像文件中设置所述开机启动脚本,并清理所述封装脚本,关闭第一虚拟机后,将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。其中,封装脚本为一键全自动式的封装脚本,只需操作人员一键选中,即可自动执行后续的封装操作,全程无需人工参与,从而减少出错率以及提高封装效率。Executing a package script downloaded from the cloud management platform, deleting a network card naming and maintaining rule file, setting DHCP to obtain a network address, setting the boot script in an image file of the first virtual machine of the first host, and cleaning After the first virtual machine is shut down, the image file of the first virtual machine is encapsulated into the virtual machine image template. The package script is a one-button automatic package script, which can automatically perform subsequent package operations with one button selection, without manual intervention, thereby reducing error rate and improving package efficiency.
其中,所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的超级用户密码、主机名配置文件还可以包括DNS域名解析和清理第二虚拟机的操作系统环境。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying a super user password of the second virtual machine, and the host name configuration file may further include a DNS domain name. Parse and clean up the operating system environment of the second virtual machine.
另外,由于步骤101中设置的开机启动脚本为注册表配置文件,无法直接执行,故在部署第二虚拟机阶段,要实现全自动修改自定义参数,在执行开机自动登录脚本后,VRM首先需要将克隆的虚拟机镜像模板挂载在计算机节点代理(英文全称:Computer Node Agent,英文简称:CNA)上的域(英文全称:Domain0,英文简称:Dom0)上,然后利用虚拟机监控器(英文全称:Virtual Machine Monitor,英文简称:VMM)将所述开机启动脚本和所述目标自定义参数注入到所述第二虚拟机中。每个宿主机上有一个VMM,且该注入方式在部署Windows VM和Linux VM时均适用,本文不作限定。In addition, since the boot startup script set in step 101 is a registry configuration file and cannot be directly executed, in the stage of deploying the second virtual machine, it is necessary to implement automatic modification of the custom parameters. After executing the boot automatic login script, the VRM first needs to be performed. The cloned virtual machine image template is mounted on the domain of the computer node agent (English name: Computer Node Agent, English abbreviation: CNA) (English name: Domain 0, English abbreviation: Dom0), and then the virtual machine monitor is used. The full name: Virtual Machine Monitor (English abbreviation: VMM) injects the boot script and the target custom parameters into the second virtual machine. There is a VMM on each host, and this injection method is applicable when deploying Windows VM and Linux VM. This document is not limited.
104、第二宿主机执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。104. The second host executes the preset script to modify a custom parameter of the virtual machine image template on the second virtual machine.
其中,在部署Windows VM场景时,所述虚拟机镜像模板的自定义参数包括域、第二虚拟机的安全标识符SID、第二虚拟机的虚拟机名称、第二虚拟机的 管理员密码、网络配置等;在部署Linux VM场景时,所述虚拟机镜像模板的自定义参数包括第二虚拟机的虚拟机名称、第二虚拟机的超级用户密码、网络配置等。The custom parameters of the virtual machine image template include a domain, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, and a second virtual machine. The administrator password, the network configuration, and the like. The configuration parameters of the virtual machine image template include the virtual machine name of the second virtual machine, the super user password of the second virtual machine, and the network configuration.
本发明实施例中,通过使用设置了上述预设脚本的虚拟机镜像模板创建第二虚拟机,使得在虚拟机镜像模板作为所述第二虚拟机的虚拟磁盘启动后,通过执行所述预设脚本实现在第二虚拟机上全自动化修改虚拟机镜像模板的自定义参数,提高部署虚拟机的效率。In the embodiment of the present invention, the second virtual machine is created by using the virtual machine image template that is configured with the preset script, so that after the virtual machine image template is started as the virtual disk of the second virtual machine, the preset is executed. The script implements the automatic modification of the custom parameters of the virtual machine image template on the second virtual machine to improve the efficiency of deploying the virtual machine.
以下分别从部署Windows VM和部署Linux VM的角度对本发明进行阐述:The present invention is described below from the perspective of deploying a Windows VM and deploying a Linux VM:
一、部署Windows VMFirst, deploy Windows VM
由于在封装阶段,在虚拟机镜像模板中设置了开机自动登录、批处理脚本和开机启动脚本,则在部署第二虚拟机阶段,在开机自动登录后,通过执行所述批处理脚本时,触发云管理平台为所述第二虚拟机配置目标自定义参数,使得后续执行所述开机启动脚本时,根据从云管理平台获取的所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。在部署第二虚拟机时,获取云管理平台随机生成的目标自定义参数,使得部署的各虚拟机的自定义参数不同,避免网络管理冲突,通过执行开机自动登录脚本和开机启动脚本,无需手动修改或引导式手动操作,实现全自动化修改自定义参数。Since the boot automatic login, the batch script, and the boot script are set in the virtual machine image template during the packaging phase, the second virtual machine is deployed, and after the automatic login is started, the batch script is triggered. The cloud management platform configures the target virtual parameter for the second virtual machine, so that when the boot startup script is executed subsequently, the second virtual machine is modified according to the target custom parameter obtained from the cloud management platform. Custom parameters for the virtual machine image template. When the second virtual machine is deployed, the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, and network management conflicts are avoided, and the automatic login script and the startup startup script are executed by the booting, without manual operation. Modify or guide manual operation to fully modify the custom parameters.
其中,所述目标自定义参数包括网络配置、第二虚拟机的安全标识符SID、第二虚拟机的虚拟机名称、第二虚拟机的用户名以及与所述用户名对应的第二虚拟机的管理员密码;其中,所述网络配置包括退域、动态网络地址的配置、加域和静态网络地址的配置。The target custom parameter includes a network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, a user name of the second virtual machine, and a second virtual machine corresponding to the user name. The administrator password; wherein the network configuration includes a domain configuration, a configuration of a dynamic network address, a configuration of a domain plus a static network address.
另外,由于每新部署一个虚拟机时,云管理平台都会为新部署的虚拟机随机生成(随机生成的方式可以是公知规则或算法,本文不作限定)对应的目标自定义参数,并通过云管理平台通道、邮件等方式传送给用户,可以增加信息的安全性,避免虚拟机用户使用VM厂商预装的第三方工具(如驱动程序或代理软件等)调用Sysprep工具,将用户自定义的信息(如上述目标自定义参数)推送到虚拟机中进行封装部署所引起的安全隐患。部署Linux VM时同理,后续类似之处均不再赘述。In addition, each new deployment of a virtual machine, the cloud management platform will be randomly generated for the newly deployed virtual machine (randomly generated can be a well-known rule or algorithm, this article is not limited) corresponding target custom parameters, and through cloud management The platform channel, mail, etc. are transmitted to the user, which can increase the security of the information, and prevent the virtual machine user from using the third-party tools pre-installed by the VM vendor (such as driver or agent software) to call the Sysprep tool to set the user-defined information ( Such as the above-mentioned target custom parameters) pushed to the virtual machine for security risks caused by package deployment. The same is true when deploying a Linux VM. Subsequent similarities are not repeated here.
举例来说,在部署Windows VM时,启动第二虚拟机后,首先调用系统文件(windeploy.exe)进入系统部署阶段,并立即激活内置管理员(英文全称:Administrator)账户,在Windows开机自动登录后,执行批处理脚本和开机启 动脚本,并且在执行开机启动脚本的过程中,通过重启两次虚拟机将修改虚拟机名称和加域操作隔离,使得上述自定义参数修改生效。具体如下:For example, when deploying a Windows VM, after starting the second virtual machine, first call the system file (windeploy.exe) to enter the system deployment phase, and immediately activate the built-in administrator (English full name: Administrator) account, automatically log in at Windows boot After executing the batch script and booting The script is executed, and in the process of executing the boot script, the virtual machine name is isolated from the plus domain operation by restarting the virtual machine twice, so that the above custom parameter modification takes effect. details as follows:
在所述第二虚拟机开机自动登录后,执行所述批处理脚本,以对所述第二虚拟机进行Windows系统正版激活、退域和设置所述DHCP以获取网络地址,以及触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;After the second virtual machine is powered on automatically, the batch script is executed to perform the Windows system genuine activation, dequeue, and setting the DHCP to obtain the network address, and trigger the cloud on the second virtual machine. The management platform configures the target custom parameter for the second virtual machine;
执行所述开机启动脚本,以根据接收到的来自所述云管理平台的所述目标自定义参数修改所述第二虚拟机的虚拟机名称;Executing the boot startup script to modify a virtual machine name of the second virtual machine according to the received target custom parameter from the cloud management platform;
重启所述第二虚拟机使得修改后的第二虚拟机的虚拟机名称生效。Restarting the second virtual machine causes the modified virtual machine name of the second virtual machine to take effect.
在所述第二虚拟机自动登录后,执行所述开机启动脚本,以根据所述目标自定义参数对所述第二虚拟机进行加域、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码和修改所述第二虚拟机的SID,以及通过还原注册表和系统环境取消Windows虚拟机自动登录后清理系统环境(删除封装脚本和配置文件);After the second virtual machine is automatically logged in, the booting script is executed to add a domain to the second virtual machine according to the target custom parameter, modify a static network address of the second virtual machine, and modify the The administrator password of the second virtual machine and modifying the SID of the second virtual machine, and cleaning the system environment (deleting the package script and configuration file) after canceling the automatic login of the Windows virtual machine by restoring the registry and the system environment;
重启所述第二虚拟机。Restart the second virtual machine.
由此可见,通过开机启动脚本设定两次重启第二虚拟机,保证所修改的自定义参数生效,实现自动激活操作系统,成功修改虚拟机名称,以及在修改虚拟机名称后自动加域,避免手动加域后出现的脱域现象,同时,也成功修改第二虚拟机的静态网络地址、管理员密码和SID,避免自定义参数设置一致带来的管理冲突。It can be seen that the second virtual machine is restarted by setting the boot script twice to ensure that the modified custom parameters take effect, automatically activate the operating system, successfully modify the virtual machine name, and automatically add the domain after modifying the virtual machine name. Avoid the de-domain phenomenon that occurs after the manual domain is added. At the same time, the static network address, administrator password, and SID of the second virtual machine are successfully modified to avoid management conflicts caused by consistent custom parameter settings.
以下以在第二宿主机上部署第二虚拟机为例,如图2所示,用户在VM1里部署好所需要的应用和服务,在云管理平台上选择VM1后点击“制作镜像”按钮,以一键触发制作镜像的操作,VRM将VM1关机,并拷贝出一份VM1镜像,VRM将VM1镜像开机,并通过云管理平台的通道下载并解压封装脚本包,然后执行封装脚本,执行完后清理封装脚本,将VM1镜像关机以封装成虚拟机镜像模板,用户再以该虚拟机镜像模板批量部署虚拟机,在部署虚拟机时VRM将拷贝的镜像挂载到CNA的dom0上,VMM将开机启动脚本和云管理平台下发的虚拟机名称名、IP地址、密码等自定义参数一起注入到VM2,将VM2中的虚拟机镜像模板开机,开机自动登录后,执行批处理脚本,执行开机启动脚本,对VM2的虚拟机名称、IP地址、管理员密码等进行修改和加域相关配置,然后清理现场配置文件和开机启动脚本以恢复原始环境,成功完成在Host2上部署VM2。VRM将创建虚拟机VM2成功的消息返回给云管理平台,云管理平台将虚拟机名 称、IP地址、用户名和密码等自定义参数通过邮件的形式发送给该虚拟机的用户。The following is an example of deploying a second virtual machine on a second host. As shown in FIG. 2, the user deploys the required applications and services in VM1, selects VM1 on the cloud management platform, and clicks the “Make Image” button. The VRM shuts down VM1 and copies a VM1 image. The VRM mirrors the VM1 image and downloads and decompresses the package script package through the channel of the cloud management platform, and then executes the package script. After the execution, the VRM shuts down the VM1 image. Clean the package script and shut down the VM1 image to be packaged into a virtual machine image template. The user then deploys the VM in batches. When the VM is deployed, the VRM mounts the copied image to the dom0 of the CNA. The VMM will boot. The startup script and the virtual machine name, IP address, password and other custom parameters delivered by the cloud management platform are injected into the VM2, and the virtual machine image template in the VM2 is booted. After the automatic login, the batch script is executed, and the boot script is executed. Script, modify the virtual machine name, IP address, administrator password, etc. of VM2 and add domain-related configuration, and then clean up the live configuration file and boot boot footer. To restore the original environment, successfully completed the deployment of VM2 on Host2. The VRM returns the message of creating the virtual machine VM2 success to the cloud management platform, and the cloud management platform will name the virtual machine. Custom parameters such as IP address, user name, and password are sent to the user of the virtual machine by email.
二、部署Linux VMSecond, deploy Linux VM
在使用部署了Linux的虚拟机创建虚拟机镜像模板时,由于在封装准备阶段在虚拟机镜像模板中设置开机启动脚本,故在执行所述开机启动脚本的过程中,可以根据从云管理平台获取的目标自定义参数修改虚拟机镜像模板中的自定义参数,具体如下:When a virtual machine image template is created using a virtual machine in which the Linux is deployed, since the boot script is set in the virtual machine image template during the package preparation phase, the boot process may be obtained from the cloud management platform. The target custom parameter modifies the custom parameters in the virtual machine image template, as follows:
执行所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。在部署第二虚拟机时,获取云管理平台随机生成的目标自定义参数,使得部署的各虚拟机的自定义参数不同,从而避免网络管理冲突,通过执行开机启动脚本,无需手动修改或引导式手动操作,实现全自动化修改自定义参数。The booting script is executed to obtain the target custom parameter of the second virtual machine from the cloud management platform, and modify the virtual machine image template on the second virtual machine according to the target custom parameter. Define parameters. When the second virtual machine is deployed, the target custom parameters randomly generated by the cloud management platform are obtained, so that the customized parameters of the deployed virtual machines are different, thereby avoiding network management conflicts, and the boot startup script is executed without manual modification or guiding. Manual operation, fully automatic modification of custom parameters.
其中,所述目标自定义参数包括网络配置、第二虚拟机的虚拟机名称、第二虚拟机的超级用户对应的第二虚拟机的超级用户密码;其中,所述网络配置包括静态网络地址的配置。The target custom parameter includes a network configuration, a virtual machine name of the second virtual machine, and a super user password of the second virtual machine corresponding to the super user of the second virtual machine; wherein the network configuration includes a static network address. Configuration.
举例来说,在部署Linux VM时,还可以在执行开机启动脚本的过程中,重启第二虚拟机的网络服务以达到修改生效的目的,具体如下:For example, when deploying a Linux VM, you can also restart the network service of the second virtual machine in the process of executing the boot script to achieve the purpose of the modification, as follows:
执行所述开机启动脚本,以触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;Executing the boot startup script to trigger the cloud management platform to configure the target custom parameter for the second virtual machine;
在接收所述云管理平台发送的所述目标自定义参数后,根据所述目标自定义参数修改所述第二虚拟机的虚拟机名称、为所述第二虚拟机配置DNS域名解析、修改第二虚拟机的静态网络地址和修改所述第二虚拟机的超级用户密码;After receiving the target custom parameter sent by the cloud management platform, modifying a virtual machine name of the second virtual machine according to the target custom parameter, configuring a DNS domain name resolution, and modifying the second virtual machine. a static network address of the virtual machine and a super user password of the second virtual machine;
重启第二虚拟机的网络服务使得上次网络设置生效。Restarting the network service of the second virtual machine makes the last network setting take effect.
通过开机启动脚本设定重启虚拟机的网络服务,保证所修改的自定义参数生效,即成功修改虚拟机名称、第二虚拟机的静态网络地址和超级用户密码,避免自定义参数设置一致带来的管理冲突。The network service of the virtual machine is restarted by the startup startup script to ensure that the modified custom parameters take effect, that is, the virtual machine name, the static network address of the second virtual machine, and the super user password are successfully modified to avoid the consistency of the custom parameter settings. Management conflict.
可选的,在一些发明实施例中,在制作所述虚拟机镜像模板时(包括部署Windows VM和部署Linux VM的场景),在第一虚拟机的镜像中设置了所述预设脚本,在后续部署第二虚拟机时,需要VMM将开机启动脚本和目标自定义参数 注入第二虚拟机。具体为,在克隆虚拟机镜像模板至第二宿主机之后,在所述第二宿主机上将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动之前,还需要执行:Optionally, in some embodiments of the present invention, when the virtual machine image template is created, including a scenario in which a Windows VM is deployed and a Linux VM is deployed, the preset script is set in a mirror of the first virtual machine, where When the second virtual machine is deployed subsequently, the VMM will need the boot script and the target custom parameters. Inject the second virtual machine. Specifically, after the virtual machine image template is cloned to the second host, before the virtual machine image template is started as the virtual disk of the second virtual machine on the second host, the following is also performed:
将克隆的虚拟机镜像模板挂载在CNA上的所述第二虚拟机上,以及将所述开机启动脚本和用于描述所述目标自定义参数的配置文件发送给虚拟机监控器VMM,以使所述VMM将所述开机启动脚本和用于描述所述目标自定义参数的配置文件注入到所述第二虚拟机中。Mounting the cloned virtual machine image template on the second virtual machine on the CNA, and sending the boot script and a configuration file for describing the target custom parameter to the virtual machine monitor VMM to And causing the VMM to inject the boot script and a configuration file for describing the target custom parameter into the second virtual machine.
可选的,在一些发明实施例中,由于第一宿主机和第二宿主机可能属于同一个集群或不同的集群,使得第二宿主机从第一宿主机获得需要的虚拟机镜像模板的获取方式有所区别,具体如下:所述克隆虚拟机镜像模板至第二宿主机,至少包括以下项之一:Optionally, in some embodiments of the present invention, the first host and the second host may belong to the same cluster or different clusters, so that the second host obtains the required virtual machine image template from the first host. The method is different as follows: the clone virtual machine image template to the second host includes at least one of the following items:
若所述第一虚拟机和所述第二虚拟机同一集群,则从所述同一集群的共享存储中获取所述虚拟机镜像模板;此种情况下,第一虚拟机和第二虚拟机还可能运行在同一台宿主机上,也可能运行在同一集群的不同宿主机上。If the first virtual machine and the second virtual machine are in the same cluster, the virtual machine image template is obtained from the shared storage of the same cluster; in this case, the first virtual machine and the second virtual machine are further It may run on the same host or on different hosts in the same cluster.
若所述第一虚拟机和所述第二虚拟机属于同一虚拟化资源管理器,但不属于同一集群,则通过所述虚拟化资源管理器将所述第一虚拟机所在的第一宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机对应的共享存储,并将存储在所述第二宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机;If the first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, use the virtualized resource manager to locate the first host where the first virtual machine is located The virtual machine image template in the corresponding shared storage is cloned and exported to the shared storage corresponding to the second host where the second virtual machine is located, and stored in the shared storage corresponding to the second host. The virtual machine image template is cloned and exported to the second host where the second virtual machine is located;
若所述第一虚拟机和所述第二虚拟机属于不同虚拟化资源管理器,则通过通用互联网文件系统(英文全称:Common Internet File Systems,英文简称:CIFS)协议共享网络附属存储(英文全称:Network Attached Storage,英文简称:NAS)将所述第一虚拟机所在的第一虚拟机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述NAS,并将存储在所述NAS中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机。其中NAS为专用数据存储服务器,在一个局域网占用一个节点,允许用户在网络存储数据,同时集中管理和处理局域网内的所有数据。If the first virtual machine and the second virtual machine belong to different virtualized resource managers, share the network auxiliary storage through a common Internet file system (English name: Common Internet File Systems, English abbreviation: CIFS) protocol (English full name) Network Attached Storage (NAS): clones and exports the virtual machine image template in the shared storage corresponding to the first virtual machine where the first virtual machine is located to the NAS, and stores the data in the NAS. The virtual machine image template in the virtual machine is cloned and exported to the second host where the second virtual machine is located. The NAS is a dedicated data storage server that occupies one node in a local area network, allowing users to store data on the network while centrally managing and processing all data in the local area network.
通过集群中的共享存储以及集群间的NAS来实现共享虚拟机镜像模板的目的,满足用户需求的多样化,例如,同一集群内没有满足该集群内某宿主机用户的虚拟机版本时,可以通过NAS在其它集群中寻找满足需求的虚拟机版本, 当然也可以在某个虚拟机内预装符合需求的软件后再封装为虚拟机镜像模板,诸如此类方式本文不作限定。The shared virtual machine image template is implemented by the shared storage in the cluster and the inter-cluster NAS to meet the diversification of user requirements. For example, if the virtual machine version of a host user in the cluster is not met in the same cluster, The NAS looks for a virtual machine version that meets the needs in other clusters. Of course, the software that meets the requirements can be pre-installed in a virtual machine and then encapsulated into a virtual machine image template.
举例来说,如图3所示,在每个局域网规划一套NAS作为外围的镜像存储设备,NAS与一个局域网内所有的集群通过网络连通,虚拟机的镜像文件存放在NAS上。对于存量的镜像,直接拷贝到NAS上,然后在云管理平台上配置镜像管理数据;对于用户新制作的镜像,通过VRM导出至NAS上存储,在后续创建新VM时,通过VRM将NAS上存储的VM镜像模板导入新的宿主机,完成创建新VM。For example, as shown in FIG. 3, a set of NAS is planned as a peripheral mirror storage device in each local area network, and all clusters in the NAS and a local area network are connected through the network, and the image file of the virtual machine is stored on the NAS. For the image of the inventory, copy directly to the NAS, and then configure the image management data on the cloud management platform; for the newly created image of the user, export to the NAS through VRM, and then store the NAS through the VRM when creating a new VM. Import the VM image template into the new host and finish creating the new VM.
具体来说,通过云管理平台将VRM1下辖的集群中的Host1上的VM1进行封装,以转换为VM镜像模板,点击“模板导出”,VRM1将VM镜像模板从集群的共享存储导出至NAS上,然后将该VM镜像模板注册到云管理平台,使得云管理平台为该VM镜像模板配置相应的镜像管理数据。当用户在云管理平台触发创建虚拟机时,VRM2将该VM镜像模板导入到VRM下辖的集群中的Host2,并在Host2上创建虚拟机VM2,从而实现在不同VRM间的集群通过NAS共享VM模板镜像。同理也可以在同一集群里不同Host主机通过共享存储来完成虚拟机模板镜像的共享,此处不再赘述。Specifically, the VM1 on the Host1 in the cluster under the VRM1 is encapsulated by the cloud management platform to be converted into a VM image template, and the template is exported. The VRM1 exports the VM image template from the shared storage of the cluster to the NAS. Then, the VM image template is registered to the cloud management platform, so that the cloud management platform configures corresponding image management data for the VM image template. When the user creates a virtual machine on the cloud management platform, VRM2 imports the VM image template to Host2 in the cluster under the VRM, and creates VM2 on Host2, so that the cluster between different VRMs can share the VM through the NAS. Template mirroring. In the same way, the sharing of virtual machine template images can be shared by different host hosts in the same cluster.
以上对本发明中的一种部署虚拟机的方法进行描述,以下对实现上述方法的部署虚拟机的宿主机60进行描述,参阅图6,宿主机60包括:The method for deploying a virtual machine in the present invention is described above. The following describes the host 60 for deploying a virtual machine that implements the foregoing method. Referring to FIG. 6, the host 60 includes:
获取单元601,用于获取虚拟机镜像模板,所述虚拟机镜像模板根据第一虚拟机封装的镜像文件得到,所述虚拟机镜像模板包括预设脚本;The obtaining unit 601 is configured to obtain a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script.
处理单元602,用于将所述获取单元601获取的所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动,执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。The processing unit 602 is configured to start the virtual machine image template acquired by the obtaining unit 601 as a virtual disk of the second virtual machine, and execute the preset script to modify the virtual on the second virtual machine. Custom parameters for the machine image template.
本发明实施例中,处理单元602使用设置了上述预设脚本的虚拟机镜像模板创建第二虚拟机,使得在虚拟机镜像模板作为所述第二虚拟机的虚拟磁盘启动后,通过执行所述预设脚本实现在第二虚拟机上全自动化修改虚拟机镜像模板的自定义参数,提高部署虚拟机的效率。In the embodiment of the present invention, the processing unit 602 creates a second virtual machine by using a virtual machine image template that is configured with the preset script, so that after the virtual machine image template is started as the virtual disk of the second virtual machine, The preset script implements the automatic modification of the custom parameters of the virtual machine image template on the second virtual machine to improve the efficiency of deploying the virtual machine.
以下分别从部署Windows VM和部署Linux VM的角度对本发明进行阐述:The present invention is described below from the perspective of deploying a Windows VM and deploying a Linux VM:
一、部署Windows VM场景:First, deploy the Windows VM scenario:
封装阶段:所述处理单元602执行从所述云管理平台下载的封装脚本,以 在第一宿主机的第一虚拟机中重置第一虚拟机的管理员密码、关闭Windows更新、禁用用户账户控制UAC、关闭错误报告、禁用防火墙、退域和打开Windows核心内存转储功能,配置Windows开机自动登录和预设脚本,根据XML应答文件运行Sysprep重新配置Windows系统,关闭第一虚拟机后将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。Encapsulation phase: the processing unit 602 executes a package script downloaded from the cloud management platform, Reset the first virtual machine's administrator password, turn off Windows updates, disable user account control UAC, disable error reporting, disable firewall, dequeue, and turn on Windows core memory dump in the first virtual machine of the first host. Configure the Windows auto-login and the default script. Run the Sysprep to reconfigure the Windows system based on the XML response file. After the first virtual machine is shut down, the image file of the first virtual machine is encapsulated into the virtual machine image template.
其中,在虚拟机镜像模版中设置的预设脚本包括批处理脚本和开机启动脚本。Among them, the preset scripts set in the virtual machine image template include a batch script and a boot script.
部署阶段:所述处理单元602执行所述批处理脚本和所述开机启动脚本,通过所述获取单元601从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。a deployment stage: the processing unit 602 executes the batch script and the boot script, and acquires, by using the acquiring unit 601, a target custom parameter of the second virtual machine from the cloud management platform, and according to the target Defining parameters modify the custom parameters of the virtual machine image template on the second virtual machine.
其中,所述目标自定义参数包括域管理和网络配置、第二虚拟机的安全标识符SID、第二虚拟机的虚拟机名称以及第二虚拟机的管理员密码;其中,所述域管理包括退域和加域,所述网络配置包括动态网络地址的配置和静态网络地址的配置;The target customization parameter includes a domain management and network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, and an administrator password of the second virtual machine; wherein the domain management includes Retiring domain and adding domain, the network configuration includes configuration of a dynamic network address and configuration of a static network address;
所述批处理脚本包括:激活第二虚拟机中的操作系统、对所述第二虚拟机进行退域以及设置动态主机配置协议DHCP获取网络;The batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol DHCP acquisition network;
所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码、修改所述第二虚拟机的SID、对所述第二虚拟机进行加域以及消所述第二虚拟机自动登录。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying an SID of the second virtual machine, and The second virtual machine performs domain addition and cancels the second virtual machine automatic login.
可选的,所述宿主机60还包括发送单元603,在执行开机启动脚本的过程中,还可以通过重启两次虚拟机将修改虚拟机名称和加域操作隔离,使得上述自定义参数修改生效,以及避免加域后出现的脱域现象。具体如下:Optionally, the host device 60 further includes a sending unit 603, in the process of executing the booting script, the virtual machine name may be isolated from the domain-adding operation by restarting the virtual machine twice, so that the modification of the customized parameter takes effect. And avoid the de-domain phenomenon that occurs after adding the domain. details as follows:
所述处理单元602在所述第二虚拟机开机自动登录后,执行所述批处理脚本,以对所述第二虚拟机进行退域和设置DHCP获取以网络地址,以及通过所述发送单元603触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;After the second virtual machine is powered on automatically, the processing unit 602 executes the batch processing script to perform domain revocation and set DHCP acquisition with the network address, and pass the sending unit 603. Triggering the cloud management platform to configure the target custom parameter for the second virtual machine;
执行所述开机启动脚本,以根据所述获取单元601接收到的来自所述云管理平台的所述目标自定义参数修改所述第二虚拟机的虚拟机名称;The booting script is executed to modify the virtual machine name of the second virtual machine according to the target custom parameter from the cloud management platform received by the obtaining unit 601;
重启所述第二虚拟机后,执行所述开机启动脚本,以根据所述目标自定义参数对所述第二虚拟机进行加域、修改第二虚拟机的静态网络地址、修改所述 第二虚拟机的管理员密码、修改所述第二虚拟机的SID;After the second virtual machine is restarted, the booting script is executed to add a domain to the second virtual machine according to the target custom parameter, modify a static network address of the second virtual machine, and modify the An administrator password of the second virtual machine, and modifying a SID of the second virtual machine;
重启所述第二虚拟机。Restart the second virtual machine.
为实现第二宿主机获取随机生成的目标自定义参数,在部署第二虚拟机时,需要通过VMM将开机启动脚本和目标自定义参数注入第二虚拟机。所述处理单元601在克隆虚拟机镜像模板至第二宿主机之后,所述处理单元601在所述第二宿主机上将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动之前,还用于:In order to implement the second host to obtain the randomly generated target custom parameters, when the second virtual machine is deployed, the boot script and the target custom parameters need to be injected into the second virtual machine through the VMM. After the processing unit 601 clones the virtual machine image template to the second host, the processing unit 601 starts the virtual machine image template as the virtual disk of the second virtual machine on the second host, and further Used for:
将克隆的虚拟机镜像模板挂载在CNA上的所述第二虚拟机上,以及将所述开机启动脚本和所述目标自定义参数发送给VMM,以使所述VMM将所述开机启动脚本和所述目标自定义参数注入到所述第二虚拟机的镜像文件中。Mounting the cloned virtual machine image template on the second virtual machine on the CNA, and sending the boot script and the target custom parameter to the VMM, so that the VMM will use the boot script And injecting the target custom parameter into an image file of the second virtual machine.
二、部署Linux VM场景Second, deploy the Linux VM scenario
封装阶段:所述处理单元602执行从所述云管理平台下载的封装脚本,以删除网卡命名保持规则文件、设置动态主机配置协议DHCP以获取网络地址,在第一宿主机的第一虚拟机的镜像文件中设置所述预设脚本,并清理所述封装脚本,关闭所述第一虚拟机后,将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。其中,在虚拟机镜像模版中设置的预设脚本包括开机启动脚本。Encapsulation stage: the processing unit 602 executes an encapsulation script downloaded from the cloud management platform to delete a network card naming and maintaining rule file, and set a dynamic host configuration protocol DHCP to obtain a network address, in the first virtual machine of the first host The preset script is set in the image file, and the package script is cleared. After the first virtual machine is shut down, the image file of the first virtual machine is encapsulated into the virtual machine image template. The preset script set in the virtual machine image template includes a boot script.
部署阶段:所述处理单元602执行所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。a deployment phase: the processing unit 602 executes the boot startup script to acquire target custom parameters of the second virtual machine from the cloud management platform, and modify the second virtual machine according to the target custom parameter. The custom parameter of the virtual machine image template.
其中,所述目标自定义参数包括网络配置、第二虚拟机的虚拟机名称、第二虚拟机的超级用户名root对应的第二虚拟机的超级用户密码;其中,所述网络配置包括静态网络地址的配置;The target custom parameter includes a network configuration, a virtual machine name of the second virtual machine, and a super user password of the second virtual machine corresponding to the super user name root of the second virtual machine; wherein the network configuration includes a static network. Address configuration;
所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的超级用户密码、修改主机名配置文件和DNS域名解析。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying a super user password of the second virtual machine, modifying a host name configuration file, and DNS domain name resolution.
在部署Linux VM时,还可以在执行开机启动脚本的过程中,重启虚拟机的网络服务达到修改生效的目的,所述处理单元602具体用于:When the Linux VM is deployed, the network service of the virtual machine can be restarted for the purpose of the modification to take effect. The processing unit 602 is specifically configured to:
执行所述开机启动脚本,以通过所述发送单元603触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;Executing the booting startup script to trigger the cloud management platform to configure the target custom parameter for the second virtual machine by using the sending unit 603;
在通过所述获取单元601接收所述云管理平台发送的所述目标自定义参数后,根据所述目标自定义参数修改所述第二虚拟机的虚拟机名称、为所述第二 虚拟机配置DNS域名解析、修改第二虚拟机的静态网络地址和修改所述第二虚拟机的超级用户密码;After receiving the target custom parameter sent by the cloud management platform by the acquiring unit 601, modifying the virtual machine name of the second virtual machine according to the target custom parameter, and the second The virtual machine configures the DNS domain name resolution, modifies the static network address of the second virtual machine, and modifies the super user password of the second virtual machine;
重启第二虚拟机的网络服务。Restart the network service of the second virtual machine.
可选的,在一些发明实施例中,由于第一宿主机和第二宿主机可能属于同一个集群或不同的集群,使得第二宿主机从第一宿主机获得需要的虚拟机镜像模板的获取方式有所区别,所述处理单元602在所述克隆虚拟机镜像模板至第二宿主机时,至少满足以下项之一:Optionally, in some embodiments of the present invention, the first host and the second host may belong to the same cluster or different clusters, so that the second host obtains the required virtual machine image template from the first host. The method is different. The processing unit 602 satisfies at least one of the following items when the clone virtual machine mirrors the template to the second host:
若所述第一虚拟机和所述第二虚拟机同一集群,则从所述同一集群的共享存储中获取所述虚拟机镜像模板,此种情况下,第一虚拟机和第二虚拟机还可能运行在同一台宿主机上,也可能运行在同一集群的不同宿主机上。If the first virtual machine and the second virtual machine are in the same cluster, the virtual machine image template is obtained from the shared storage of the same cluster. In this case, the first virtual machine and the second virtual machine are further It may run on the same host or on different hosts in the same cluster.
若所述第一虚拟机和所述第二虚拟机属于同一虚拟化资源管理器,但不属于同一集群,则通过所述虚拟化资源管理器将所述第一虚拟机所在的第一宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机对应的共享存储,并将存储在所述第二宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二宿主机;If the first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, use the virtualized resource manager to locate the first host where the first virtual machine is located The virtual machine image template in the corresponding shared storage is cloned and exported to the shared storage corresponding to the second host where the second virtual machine is located, and stored in the shared storage corresponding to the second host. The virtual machine image template is cloned and exported to the second host;
若所述第一虚拟机和所述第二虚拟机属于不同虚拟化资源管理器,则通过CIFS协议共享NAS将所述第一虚拟机所在的第一虚拟机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述NAS,并将存储在所述NAS中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机。If the first virtual machine and the second virtual machine belong to different virtualized resource managers, share the NAS in the shared storage corresponding to the first virtual machine where the first virtual machine is located by using the CIFS protocol sharing NAS. The machine image template is cloned and exported to the NAS, and the virtual machine image template stored in the NAS is cloned and exported to the second host where the second virtual machine is located.
另外,所述处理单元602在获取虚拟机镜像模板之后,在所述第二宿主机上将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动之前,还用于:In addition, the processing unit 602, after acquiring the virtual machine image template, before the virtual machine image template is started as the virtual disk of the second virtual machine on the second host, is further used to:
将克隆的虚拟机镜像模板挂载在CNA上的所述第二虚拟机上,以及将所述开机启动脚本和所述目标自定义参数发送给VMM,以使所述VMM将所述开机启动脚本和所述目标自定义参数注入到所述第二虚拟机的镜像文件中。Mounting the cloned virtual machine image template on the second virtual machine on the CNA, and sending the boot script and the target custom parameter to the VMM, so that the VMM will use the boot script And injecting the target custom parameter into an image file of the second virtual machine.
需要说明的是,在本发明图6所示的实施例中的获取单元601对应的实体设备可以为接收器,发送单元603对应的实体设备可以为发射器,所有的处理单元对应的实体设备可以为处理器。图6所示的各装置均可以具有如图8所示的结构,当宿主机60具有如图8所示的结构时,图8中的处理器、发射器和接收器实现前述对应该宿主机60的装置实施例提供的处理单元602、发送单元603和获取单元601相同或相似的功能,图8中的存储器存储处理器执行上述部署 虚拟机的方法时需要调用的程序代码。It should be noted that the physical device corresponding to the obtaining unit 601 in the embodiment shown in FIG. 6 of the present invention may be a receiver, and the physical device corresponding to the sending unit 603 may be a transmitter, and the physical devices corresponding to all processing units may be For the processor. Each of the devices shown in FIG. 6 may have a structure as shown in FIG. 8. When the host machine 60 has the structure shown in FIG. 8, the processor, the transmitter, and the receiver in FIG. 8 implement the aforementioned host device. The device unit 602, the transmitting unit 603, and the obtaining unit 601 provided by the apparatus embodiment of 60 have the same or similar functions, and the memory storage processor in FIG. 8 performs the above deployment. The program code to be called when the virtual machine method is used.
本发明实施例还提供一种部署虚拟机的系统,如图7所示,所述部署虚拟机的系统包括:The embodiment of the present invention further provides a system for deploying a virtual machine. As shown in FIG. 7, the system for deploying a virtual machine includes:
图6所对应的实施例中的宿主机60和虚拟化资源管理器,所述虚拟化资源管理器,用于将虚拟机镜像模板克隆至所述宿主机。The host machine 60 and the virtualization resource manager in the embodiment corresponding to FIG. 6 are used to clone the virtual machine image template to the host.
所述虚拟化资源管理器在将所述虚拟机镜像模版克隆并导出至所述宿主机时,还需满足以下情况之一:When the virtualized resource manager clones and exports the virtual machine image template to the host, one of the following situations is also required:
若所述第一虚拟机和所述第二虚拟机属于同一集群,所述虚拟化资源管理器具体用于将存储在所述同一集群的共享存储中的所述虚拟机镜像模板克隆并导出至所述宿主机;If the first virtual machine and the second virtual machine belong to the same cluster, the virtualized resource manager is specifically configured to clone and export the virtual machine image template stored in the shared storage of the same cluster to The host machine;
若所述第一虚拟机和所述第二虚拟机属于同一虚拟化资源管理器,但不属于同一集群,则所述第一虚拟机和所述第二虚拟机位于不同的宿主机上,所述虚拟化资源管理器具体用于将所述第一宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二宿主机对应的共享存储,并将存储在所述第二宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二宿主机;If the first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, the first virtual machine and the second virtual machine are located on different hosts. The virtualized resource manager is specifically configured to clone and export the virtual machine image template in the shared storage corresponding to the first host to the shared storage corresponding to the second host, and store the data in the first storage The virtual machine image template in the shared storage corresponding to the second host is cloned and exported to the second host;
若所述第一虚拟机和所述第二虚拟机属于不同虚拟化资源管理器,则所述第一虚拟机和所述第二虚拟机位于不同的宿主机上,所述虚拟化资源管理器具体用于通过通用互联网文件系统CIFS协议共享NAS将所述第一虚拟机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述NAS,并将存储在所述NAS中的所述虚拟机镜像模板克隆并导出至所述第二宿主机。If the first virtual machine and the second virtual machine belong to different virtualization resource managers, the first virtual machine and the second virtual machine are located on different hosts, and the virtualized resource manager Specifically, the virtual machine image template in the shared storage corresponding to the first virtual machine is cloned and exported to the NAS by using a common Internet file system (CIFS) shared NAS, and the storage is stored in the NAS. The virtual machine image template is cloned and exported to the second host.
本发明还提供一种计算机存储介质,该介质存储有程序,该程序执行时包括上述宿主机60或部署虚拟机的系统70执行图1对应的实施例中的部署虚拟机的方法中的部分或者全部步骤。The present invention also provides a computer storage medium storing a program, the program including the host machine 60 or the system 70 deploying the virtual machine executing part of the method of deploying the virtual machine in the embodiment corresponding to FIG. 1 or All steps.
例如,本文中的宿主机60的结构中包括处理器、接收器和发射器,所述处理器被配置为支持宿主机60执行上述方法中相应的功能。所述接收器和所述发射器用于支持宿主机60与云管理平台之间的通信,向云管理平台或虚拟化资源管理器发送上述方法中所涉及的信息或者指令。所述虚拟化资源管理器60还可以包括存储器,所述存储器用于与处理器耦合,其保存运营商服务器必要的程序代码和数据。For example, the host 60 herein includes a processor, a receiver, and a transmitter configured to support the host 60 in performing the corresponding functions of the methods described above. The receiver and the transmitter are configured to support communication between the host 60 and the cloud management platform, and send information or instructions involved in the foregoing method to the cloud management platform or the virtualized resource manager. The virtualized resource manager 60 can also include a memory for coupling with the processor that holds the program code and data necessary for the operator server.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详 述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are all focused, and in some embodiments, there is no detailed description. For a description of the parts, reference may be made to the related description of other embodiments.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(英文全称:Read-Only Memory,英文简称:ROM)、随机存取存储器(英文全称:Random Access Memory,英文简称:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (English full name: Read-Only Memory, English abbreviation: ROM), a random access memory (English full name: Random Access Memory, English abbreviation: RAM), magnetic A variety of media that can store program code, such as a disc or a disc.
以上对本发明所提供的技术方案进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。 The technical solutions provided by the present invention are described in detail above. The principles and implementations of the present invention are described in the specific examples. The description of the above embodiments is only used to help understand the method and core ideas of the present invention; In the meantime, the present invention is not limited by the scope of the present invention.

Claims (24)

  1. 一种部署虚拟机的方法,其特征在于,所述方法包括:A method for deploying a virtual machine, the method comprising:
    获取虚拟机镜像模板,所述虚拟机镜像模板根据第一虚拟机封装的镜像文件得到,所述虚拟机镜像模板包括预设脚本;Obtaining a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script;
    将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动,执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。The virtual machine image template is started as a virtual disk of the second virtual machine, and the preset script is executed to modify the custom parameter of the virtual machine image template on the second virtual machine.
  2. 根据权利要求1所述的方法,其特征在于,所述预设脚本包括批处理脚本和开机启动脚本;The method according to claim 1, wherein the preset script comprises a batch script and a boot script;
    所述执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数,包括:The performing the preset script to modify the custom parameters of the virtual machine image template on the second virtual machine, including:
    执行所述批处理脚本和所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。Performing the batch script and the boot script to obtain target custom parameters of the second virtual machine from the cloud management platform, and modifying the second virtual machine according to the target custom parameter. Custom parameters for the virtual machine image template.
  3. 根据权利要求2所述的方法,其特征在于,所述目标自定义参数包括域管理和网络配置、第二虚拟机的安全标识符SID、第二虚拟机的虚拟机名称以及第二虚拟机的管理员密码;其中,所述域管理包括退域和加域,所述网络配置包括动态网络地址的配置和静态网络地址的配置;The method according to claim 2, wherein the target customization parameter comprises a domain management and network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, and a second virtual machine An administrator password; wherein the domain management includes a domain and a domain, and the network configuration includes a configuration of a dynamic network address and a configuration of a static network address;
    所述批处理脚本包括:激活第二虚拟机中的操作系统、对所述第二虚拟机进行退域以及设置动态主机配置协议DHCP获取网络;The batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol DHCP acquisition network;
    所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码、修改所述第二虚拟机的SID、对所述第二虚拟机进行加域以及消所述第二虚拟机自动登录。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying an SID of the second virtual machine, and The second virtual machine performs domain addition and cancels the second virtual machine automatic login.
  4. 根据权利要求3所述的方法,其特征在于,所述执行所述批处理脚本和所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数,包括:The method according to claim 3, wherein said executing said batch processing script and said boot startup script to acquire target custom parameters of said second virtual machine from said cloud management platform, and according to said The target custom parameter modifies the custom parameters of the virtual machine image template on the second virtual machine, including:
    在所述第二虚拟机开机自动登录后,执行所述批处理脚本,以对所述第二 虚拟机进行退域和设置DHCP获取以网络地址,以及触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;After the second virtual machine is powered on automatically, the batch script is executed to the second Deleting a domain and setting a DHCP acquisition with a network address, and triggering the cloud management platform to configure the target custom parameter for the second virtual machine;
    执行所述开机启动脚本,以根据接收到的来自所述云管理平台的所述目标自定义参数修改所述第二虚拟机的虚拟机名称;Executing the boot startup script to modify a virtual machine name of the second virtual machine according to the received target custom parameter from the cloud management platform;
    重启所述第二虚拟机后,执行所述开机启动脚本,以根据所述目标自定义参数对所述第二虚拟机进行加域、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码,以及修改所述第二虚拟机的SID;After the second virtual machine is restarted, the booting script is executed to add a domain to the second virtual machine according to the target custom parameter, modify a static network address of the second virtual machine, and modify the second The administrator password of the virtual machine, and modifying the SID of the second virtual machine;
    重启所述第二虚拟机。Restart the second virtual machine.
  5. 根据权利要求2至4任一所述的方法,其特征在于,所述获取虚拟机镜像模板之前,所述方法还包括:The method according to any one of claims 2 to 4, wherein before the obtaining the virtual machine image template, the method further comprises:
    执行从所述云管理平台下载的封装脚本,以在所述第一虚拟机中重置第一虚拟机的管理员密码、关闭Windows更新、禁用用户账户控制UAC、关闭错误报告、禁用防火墙、退域和打开Windows核心内存转储功能,配置Windows开机自动登录和开机启动脚本注册表,根据可扩展标识语言XML应答文件运行Sysprep重新配置Windows系统,以及设置所述开机启动脚本,关闭第一虚拟机后将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。Executing a package script downloaded from the cloud management platform to reset an administrator password of the first virtual machine in the first virtual machine, turn off Windows update, disable user account control UAC, close error report, disable firewall, back Domain and open Windows core memory dump function, configure Windows boot automatic login and boot script registry, run Sysprep according to Extensible Markup Language XML answer file to reconfigure Windows system, and set the boot script to close the first virtual machine The image file of the first virtual machine is encapsulated into the virtual machine image template.
  6. 根据权利要求1所述的方法,其特征在于,所述预设脚本包括开机启动脚本;The method according to claim 1, wherein the preset script comprises a boot script;
    所述执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数,包括:The performing the preset script to modify the custom parameters of the virtual machine image template on the second virtual machine, including:
    执行所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。The booting script is executed to obtain the target custom parameter of the second virtual machine from the cloud management platform, and modify the virtual machine image template on the second virtual machine according to the target custom parameter. Define parameters.
  7. 根据权利要求6所述的方法,其特征在于,所述目标自定义参数包括网络配置、第二虚拟机的虚拟机名称、第二虚拟机的超级用户名root对应的第二虚拟机的超级用户密码;其中,所述网络配置包括静态网络地址的配置;The method according to claim 6, wherein the target custom parameter comprises a network configuration, a virtual machine name of the second virtual machine, and a super user of the second virtual machine corresponding to the super user name root of the second virtual machine. a password; wherein the network configuration includes a configuration of a static network address;
    所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机 的静态网络地址、修改所述第二虚拟机的超级用户密码、修改主机名配置文件和DNS域名解析。The booting startup script includes: modifying a virtual machine name of the second virtual machine, and modifying the second virtual machine Static network address, modify the super user password of the second virtual machine, modify the host name configuration file, and DNS domain name resolution.
  8. 根据权利要求7所述的方法,其特征在于,所述执行所述开机启动脚本,以从云管理平台获取所述第二虚拟机的目标自定义参数,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数,包括:The method according to claim 7, wherein the executing the boot-up script to acquire target custom parameters of the second virtual machine from the cloud management platform, and customizing the parameters according to the target The custom parameters of the virtual machine image template are modified on the second virtual machine, including:
    执行所述开机启动脚本,以触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;Executing the boot startup script to trigger the cloud management platform to configure the target custom parameter for the second virtual machine;
    在接收所述云管理平台发送的所述目标自定义参数后,根据所述目标自定义参数修改所述第二虚拟机的虚拟机名称、为所述第二虚拟机配置DNS域名解析、修改第二虚拟机的静态网络地址和修改所述第二虚拟机的超级用户密码;After receiving the target custom parameter sent by the cloud management platform, modifying a virtual machine name of the second virtual machine according to the target custom parameter, configuring a DNS domain name resolution, and modifying the second virtual machine. a static network address of the virtual machine and a super user password of the second virtual machine;
    重启所述第二虚拟机的网络服务。Restarting the network service of the second virtual machine.
  9. 根据权利要求6至8任一所述的方法,其特征在于,所述获取虚拟机镜像模板之前,所述方法还包括:The method according to any one of claims 6 to 8, wherein before the obtaining the virtual machine image template, the method further comprises:
    执行从所述云管理平台下载的封装脚本,以删除网卡命名保持规则文件、设置动态主机配置协议DHCP以获取网络地址,在第一虚拟机的镜像文件中设置所述开机启动脚本,并清理所述封装脚本,关闭所述第一虚拟机后,将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。Performing a package script downloaded from the cloud management platform to delete a network card naming and maintaining rule file, setting a dynamic host configuration protocol DHCP to obtain a network address, setting the boot script in an image file of the first virtual machine, and cleaning the After the first virtual machine is shut down, the image file of the first virtual machine is encapsulated into the virtual machine image template.
  10. 根据权利要求2至9任一所述的方法,其特征在于,所述获取虚拟机镜像模板,至少包括以下项之一:The method according to any one of claims 2 to 9, wherein the obtaining a virtual machine image template comprises at least one of the following items:
    若所述第一虚拟机和所述第二虚拟机属于同一集群,则从所述同一集群的共享存储中获取所述虚拟机镜像模板;If the first virtual machine and the second virtual machine belong to the same cluster, obtain the virtual machine image template from the shared storage of the same cluster;
    若所述第一虚拟机和所述第二虚拟机属于同一虚拟化资源管理器,但不属于同一集群,则通过所述虚拟化资源管理器将所述第一虚拟机所在的第一宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机对应的共享存储,并将存储在所述第二宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二宿主机;If the first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, use the virtualized resource manager to locate the first host where the first virtual machine is located The virtual machine image template in the corresponding shared storage is cloned and exported to the shared storage corresponding to the second host where the second virtual machine is located, and stored in the shared storage corresponding to the second host. The virtual machine image template is cloned and exported to the second host;
    若所述第一虚拟机和所述第二虚拟机属于不同虚拟化资源管理器,则通过 通用互联网文件系统CIFS协议共享网络附属存储NAS将所述第一虚拟机所在的第一宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述NAS,并将存储在所述NAS中的所述虚拟机镜像模板克隆并导出至所述第二虚拟机所在的第二宿主机。If the first virtual machine and the second virtual machine belong to different virtualization resource managers, pass The common Internet file system CIFS protocol sharing network attached storage NAS clones and exports the virtual machine image template in the shared storage corresponding to the first host where the first virtual machine is located to the NAS, and stores the The virtual machine image template in the NAS is cloned and exported to the second host where the second virtual machine is located.
  11. 根据权利要求2或6所述的方法,其特征在于,所述获取虚拟机镜像模板之后,在将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动之前,所述方法还包括:The method according to claim 2 or 6, wherein, after the obtaining the virtual machine image template, before the virtual machine image template is started as the virtual disk of the second virtual machine, the method further includes:
    将所述虚拟机镜像模板挂载在计算节点代理CNA的Dom0上,以及将所述开机启动脚本和所述目标自定义参数发送给虚拟机监控器VMM,以使所述VMM将所述开机启动脚本和所述目标自定义参数注入到所述第二虚拟机的镜像文件中。Mounting the virtual machine image template on the Dom0 of the compute node proxy CNA, and sending the boot script and the target custom parameter to the virtual machine monitor VMM, so that the VMM starts the boot The script and the target custom parameter are injected into an image file of the second virtual machine.
  12. 一种宿主机,其特征在于,所述宿主机包括:A host machine, characterized in that the host machine comprises:
    获取单元,用于获取虚拟机镜像模板,所述虚拟机镜像模板根据第一虚拟机封装的镜像文件得到,所述虚拟机镜像模板包括预设脚本;An obtaining unit, configured to obtain a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script;
    处理单元,用于将所述获取单元获取的所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动,执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。a processing unit, configured to start, by using the virtual machine image template obtained by the acquiring unit, as a virtual disk of a second virtual machine, execute the preset script, to modify the virtual machine image on the second virtual machine Custom parameters for the template.
  13. 根据权利要求12所述的宿主机,其特征在于,所述预设脚本包括批处理脚本和开机启动脚本,The host machine according to claim 12, wherein the preset script comprises a batch script and a boot script.
    所述获取单元,还用于从所述云管理平台获取所述第二虚拟机的目标自定义参数;The obtaining unit is further configured to acquire a target custom parameter of the second virtual machine from the cloud management platform;
    所述处理单元,具体用于执行所述批处理脚本和所述开机启动脚本,以及根据所述获取单元获取的目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。The processing unit is configured to execute the batch script and the boot script, and modify the virtual machine image template on the second virtual machine according to the target custom parameter acquired by the acquiring unit. Define parameters.
  14. 根据权利要求13所述的宿主机,其特征在于,所述目标自定义参数包括域管理和网络配置、第二虚拟机的安全标识符SID、第二虚拟机的虚拟机名称以及第二虚拟机的管理员密码;其中,所述域管理包括退域和加域,所述网 络配置包括动态网络地址的配置和静态网络地址的配置;The host according to claim 13, wherein the target customization parameter comprises a domain management and network configuration, a security identifier SID of the second virtual machine, a virtual machine name of the second virtual machine, and a second virtual machine. Administrator password; wherein the domain management includes a domain and a domain, the network Network configuration includes configuration of dynamic network address and configuration of static network address;
    所述批处理脚本包括:激活第二虚拟机中的操作系统、对所述第二虚拟机进行退域以及设置动态主机配置协议DHCP获取网络;The batch processing script includes: activating an operating system in the second virtual machine, dequeating the second virtual machine, and setting a dynamic host configuration protocol DHCP acquisition network;
    所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码、修改所述第二虚拟机的SID、对所述第二虚拟机进行加域以及消所述第二虚拟机自动登录。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying an administrator password of the second virtual machine, modifying an SID of the second virtual machine, and The second virtual machine performs domain addition and cancels the second virtual machine automatic login.
  15. 根据权利要求14所述的宿主机,其特征在于,所述处理单元,具体用于:The host device according to claim 14, wherein the processing unit is specifically configured to:
    在所述第二虚拟机开机自动登录后,执行所述批处理脚本,以对所述第二虚拟机进行退域和设置DHCP获取以网络地址,以及触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;After the second virtual machine is powered on automatically, the batch script is executed to perform domain revocation and set DHCP acquisition with the network address, and trigger the cloud management platform to be the second The virtual machine configures the target custom parameter;
    执行所述开机启动脚本,以根据所述目标自定义参数修改所述第二虚拟机的虚拟机名称;Executing the boot startup script to modify a virtual machine name of the second virtual machine according to the target customization parameter;
    重启所述第二虚拟机后,执行所述开机启动脚本,以根据所述目标自定义参数对所述第二虚拟机进行加域、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的管理员密码,以及修改所述第二虚拟机的SID;After the second virtual machine is restarted, the booting script is executed to add a domain to the second virtual machine according to the target custom parameter, modify a static network address of the second virtual machine, and modify the second The administrator password of the virtual machine, and modifying the SID of the second virtual machine;
    重启所述第二虚拟机。Restart the second virtual machine.
  16. 根据权利要求12至15任一所述的宿主机,其特征在于,A host according to any one of claims 12 to 15, wherein:
    所述处理单元,还用于执行从所述云管理平台下载的封装脚本,以在第一虚拟机中重置第一虚拟机的管理员密码、关闭Windows更新、禁用用户账户控制UAC、关闭错误报告、禁用防火墙、退域和打开Windows核心内存转储功能,配置Windows开机自动登录和开机启动脚本注册表,根据XML应答文件运行Sysprep重新配置Windows系统,以及设置所述开机启动脚本,关闭第一虚拟机后将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。The processing unit is further configured to execute a package script downloaded from the cloud management platform to reset an administrator password of the first virtual machine, disable Windows update, disable user account control UAC, and close the error in the first virtual machine. Report, disable the firewall, decommission the domain and open the Windows core memory dump function, configure the Windows boot automatic login and boot script registry, run Sysprep according to the XML answer file to reconfigure the Windows system, and set the boot script, close the first After the virtual machine, the image file of the first virtual machine is encapsulated into the virtual machine image template.
  17. 根据权利要求12所述的宿主机,其特征在于,所述预设脚本包括开机启动脚本;The host machine according to claim 12, wherein the preset script comprises a boot script;
    所述获取单元,用于从云管理平台获取所述第二虚拟机的目标自定义参数; The acquiring unit is configured to acquire, by using a cloud management platform, a target custom parameter of the second virtual machine;
    所述处理单元,具体用于执行所述开机启动脚本,以及根据所述目标自定义参数在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。The processing unit is specifically configured to execute the boot startup script, and modify a custom parameter of the virtual machine image template on the second virtual machine according to the target custom parameter.
  18. 根据权利要求17所述的宿主机,其特征在于,所述目标自定义参数包括网络配置、第二虚拟机的虚拟机名称、第二虚拟机的超级用户名root对应的第二虚拟机的超级用户密码;其中,所述网络配置包括静态网络地址的配置;The host device according to claim 17, wherein the target custom parameter comprises a network configuration, a virtual machine name of the second virtual machine, and a second virtual machine corresponding to the super user name root of the second virtual machine. a user password; wherein the network configuration includes a configuration of a static network address;
    所述开机启动脚本包括:修改第二虚拟机的虚拟机名称、修改第二虚拟机的静态网络地址、修改所述第二虚拟机的超级用户密码、修改主机名配置文件和DNS域名解析。The booting startup script includes: modifying a virtual machine name of the second virtual machine, modifying a static network address of the second virtual machine, modifying a super user password of the second virtual machine, modifying a host name configuration file, and DNS domain name resolution.
  19. 根据权利要求18所述的宿主机,其特征在于,所述处理单元,具体用于:The host device according to claim 18, wherein the processing unit is specifically configured to:
    执行所述开机启动脚本,以触发所述云管理平台为所述第二虚拟机配置所述目标自定义参数;Executing the boot startup script to trigger the cloud management platform to configure the target custom parameter for the second virtual machine;
    根据所述目标自定义参数修改所述第二虚拟机的虚拟机名称、为所述第二虚拟机配置DNS域名解析、修改第二虚拟机的静态网络地址和修改所述第二虚拟机的超级用户密码;Modifying a virtual machine name of the second virtual machine according to the target customization parameter, configuring a DNS domain name resolution for the second virtual machine, modifying a static network address of the second virtual machine, and modifying the super virtual machine user password;
    重启所述第二虚拟机的网络服务。Restarting the network service of the second virtual machine.
  20. 根据权利要求17至19任一所述的宿主机,其特征在于,A host machine according to any one of claims 17 to 19, characterized in that
    所述处理单元,还用于执行从所述云管理平台下载的封装脚本,以删除网卡命名保持规则文件、设置动态主机配置协议DHCP以获取网络地址,在第一宿主机的第一虚拟机的镜像文件中设置所述开机启动脚本,并清理所述封装脚本,关闭所述第一虚拟机后,将所述第一虚拟机的镜像文件封装为所述虚拟机镜像模板。The processing unit is further configured to execute a package script downloaded from the cloud management platform, to delete a network card naming and maintaining rule file, and set a dynamic host configuration protocol DHCP to obtain a network address, where the first virtual machine of the first host machine The boot file is set in the image file, and the package script is cleared. After the first virtual machine is shut down, the image file of the first virtual machine is encapsulated into the virtual machine image template.
  21. 根据权利要求13或17所述的宿主机,其特征在于,所述宿主机还包括虚拟机监控器VMM,所述处理单元,还用于将所述虚拟机镜像模板挂载在计算节点代理CNA的Dom0上,以及将所述开机启动脚本和所述目标自定义参数发送给所述VMM,以使所述VMM将所述开机启动脚本和所述目标自定义参数注入到所述第二虚拟机的镜像文件中。 The host machine according to claim 13 or 17, wherein the host machine further includes a virtual machine monitor VMM, and the processing unit is further configured to mount the virtual machine image template on the computing node agent CNA. And sending the boot script and the target custom parameter to the VMM, so that the VMM injects the boot script and the target custom parameter into the second virtual machine In the image file.
  22. 一种部署虚拟机的系统,其特征在于,包括如权利要求12至21任一所述的宿主机以及虚拟化资源管理器;A system for deploying a virtual machine, comprising the host according to any one of claims 12 to 21 and a virtualization resource manager;
    所述虚拟化资源管理器,用于将虚拟机镜像模板克隆至所述宿主机。The virtualization resource manager is configured to clone a virtual machine image template to the host.
  23. 根据权利要求22所述的系统,其特征在于,所述虚拟化资源管理器在将所述虚拟机镜像模版克隆并导出至所述宿主机时,还需满足以下情况之一:The system according to claim 22, wherein the virtualized resource manager further needs to satisfy one of the following situations when the virtual machine image template is cloned and exported to the host:
    若所述第一虚拟机和所述第二虚拟机属于同一集群,所述虚拟化资源管理器具体用于将存储在所述同一集群的共享存储中的所述虚拟机镜像模板克隆并导出至所述宿主机;If the first virtual machine and the second virtual machine belong to the same cluster, the virtualized resource manager is specifically configured to clone and export the virtual machine image template stored in the shared storage of the same cluster to The host machine;
    若所述第一虚拟机和所述第二虚拟机属于同一虚拟化资源管理器,但不属于同一集群,则所述第一虚拟机和所述第二虚拟机位于不同的宿主机上,所述虚拟化资源管理器具体用于将所述第一宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二宿主机对应的共享存储,并将存储在所述第二宿主机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述第二宿主机;If the first virtual machine and the second virtual machine belong to the same virtualized resource manager but do not belong to the same cluster, the first virtual machine and the second virtual machine are located on different hosts. The virtualized resource manager is specifically configured to clone and export the virtual machine image template in the shared storage corresponding to the first host to the shared storage corresponding to the second host, and store the data in the first storage The virtual machine image template in the shared storage corresponding to the second host is cloned and exported to the second host;
    若所述第一虚拟机和所述第二虚拟机属于不同虚拟化资源管理器,则所述第一虚拟机和所述第二虚拟机位于不同的宿主机上,所述虚拟化资源管理器具体用于通过通用互联网文件系统CIFS协议共享NAS将所述第一虚拟机对应的共享存储中的所述虚拟机镜像模板克隆并导出至所述NAS,并将存储在所述NAS中的所述虚拟机镜像模板克隆并导出至所述第二宿主机。If the first virtual machine and the second virtual machine belong to different virtualization resource managers, the first virtual machine and the second virtual machine are located on different hosts, and the virtualized resource manager Specifically, the virtual machine image template in the shared storage corresponding to the first virtual machine is cloned and exported to the NAS by using a common Internet file system (CIFS) shared NAS, and the storage is stored in the NAS. The virtual machine image template is cloned and exported to the second host.
  24. 一种宿主机,其特征在于,包括接收器、处理器和存储器,其中,所述存储器用于存储程序代码,所述处理器用于调用所述存储器中的程序代码来执行以下操作:A host machine comprising a receiver, a processor and a memory, wherein the memory is for storing program code, and the processor is configured to call program code in the memory to perform the following operations:
    利用所述接收器获取虚拟机镜像模板,所述虚拟机镜像模板根据第一虚拟机封装的镜像文件得到,所述虚拟机镜像模板包括预设脚本;Obtaining, by the receiver, a virtual machine image template, where the virtual machine image template is obtained according to an image file of the first virtual machine package, where the virtual machine image template includes a preset script;
    将所述虚拟机镜像模板作为第二虚拟机的虚拟磁盘启动,执行所述预设脚本,以在所述第二虚拟机上修改所述虚拟机镜像模板的自定义参数。 The virtual machine image template is started as a virtual disk of the second virtual machine, and the preset script is executed to modify the custom parameter of the virtual machine image template on the second virtual machine.
PCT/CN2016/102161 2016-04-01 2016-10-14 Method for deploying virtual machines, host machine, and system WO2017166785A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610202864.0 2016-04-01
CN201610202864.0A CN107291525B (en) 2016-04-01 2016-04-01 Method, host machine and system for deploying virtual machine

Publications (1)

Publication Number Publication Date
WO2017166785A1 true WO2017166785A1 (en) 2017-10-05

Family

ID=59963381

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/102161 WO2017166785A1 (en) 2016-04-01 2016-10-14 Method for deploying virtual machines, host machine, and system

Country Status (2)

Country Link
CN (1) CN107291525B (en)
WO (1) WO2017166785A1 (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240716A (en) * 2018-09-10 2019-01-18 福建星瑞格软件有限公司 A kind of big data platform version management and iteratively faster dispositions method and system
CN110413293A (en) * 2019-07-23 2019-11-05 深圳忆联信息系统有限公司 The method and device that system deployment process modifies to standard mirror image
CN110531995A (en) * 2019-08-23 2019-12-03 济南浪潮数据技术有限公司 Manage dispositions method, device, equipment and the computer readable storage medium of platform
CN110750334A (en) * 2019-10-25 2020-02-04 北京计算机技术及应用研究所 Network target range rear-end storage system design method based on Ceph
CN111258719A (en) * 2020-01-19 2020-06-09 山东汇贸电子口岸有限公司 Method and system for rapidly deploying multi-node Ceph cluster under single-machine KVM virtualization
CN111459513A (en) * 2020-04-02 2020-07-28 西安远望谷物联网科技有限公司 Windows mirror image manufacturing system and method based on OpenStack platform
CN111813504A (en) * 2020-07-13 2020-10-23 北京金山云网络技术有限公司 Method and device for automatically configuring effective virtual machine and electronic equipment
CN112486631A (en) * 2020-12-04 2021-03-12 浪潮云信息技术股份公司 Method for constructing virtual machine mirror image
CN112783609A (en) * 2021-01-30 2021-05-11 浪潮云信息技术股份公司 Method for automatically resetting password for virtual machine on ESXI (electronic service organization) host
CN112882820A (en) * 2019-11-29 2021-06-01 北京百度网讯科技有限公司 Method and device for configuring resources
CN113076171A (en) * 2020-01-03 2021-07-06 阿里巴巴集团控股有限公司 Virtual machine installing method and device
CN113204363A (en) * 2021-05-27 2021-08-03 济南浪潮数据技术有限公司 Cloud management platform mirror image offline customization system
CN113342378A (en) * 2021-06-25 2021-09-03 山东浪潮通软信息科技有限公司 Mirror image generation method, device and medium based on file system update
CN114363334A (en) * 2021-12-30 2022-04-15 阿里巴巴(中国)有限公司 Network configuration method, device and equipment for cloud system and cloud desktop virtual machine
CN114465902A (en) * 2022-01-07 2022-05-10 苏州浪潮智能科技有限公司 Method, system, equipment and medium for cloud host multi-network card management bond
CN114661459A (en) * 2022-01-19 2022-06-24 浙江网商银行股份有限公司 Operation method, device and system of robot process automation RPA and electronic equipment
CN115357256A (en) * 2022-10-18 2022-11-18 安徽华云安科技有限公司 CDH cluster deployment method and system

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888695B (en) * 2017-11-23 2019-09-13 新华三云计算技术有限公司 The method and cloud platform equipment of cloud platform creation mirror image
CN108090333A (en) * 2017-12-29 2018-05-29 佛山市幻云科技有限公司 Apparatus control method, device, server and system based on virtual machine
CN110365508B (en) * 2018-04-10 2022-05-31 中国移动通信有限公司研究院 Method for instantiating virtual network function and network function virtualization orchestrator
CN108920253B (en) * 2018-06-20 2022-05-17 成都灵跃云创科技有限公司 Agent-free virtual machine monitoring system and monitoring method
CN108845865A (en) * 2018-06-28 2018-11-20 郑州云海信息技术有限公司 A kind of monitoring service dispositions method, system and storage medium
CN109308196B (en) * 2018-08-22 2020-04-14 腾讯科技(深圳)有限公司 Multi-model equipment multiplexing method and device and storage medium
CN109977640B (en) * 2019-02-21 2020-12-25 兴业数字金融服务(上海)股份有限公司 Method and device for recovering, keeping and using admin password
CN110275717B (en) * 2019-05-17 2024-03-22 平安科技(深圳)有限公司 Private image cloning method, private image cloning device, computer equipment and storage medium
CN110413374A (en) * 2019-06-28 2019-11-05 苏州浪潮智能科技有限公司 A kind of method and apparatus of the activation based on cloud platform
CN110377232A (en) * 2019-07-19 2019-10-25 苏州浪潮智能科技有限公司 A kind of method, apparatus and system for disposing distributed storage cluster
CN110471744B (en) * 2019-08-20 2021-11-30 北京首都在线科技股份有限公司 Password modification method, device, equipment and computer readable storage medium
CN110990117A (en) * 2019-11-22 2020-04-10 北京浪潮数据技术有限公司 Method, device and computer readable storage medium for deploying virtual machine
CN111459606A (en) * 2020-03-03 2020-07-28 山东汇贸电子口岸有限公司 Method for quickly creating virtual machine under virtualization and server
CN111506389A (en) * 2020-03-25 2020-08-07 新华三大数据技术有限公司 Virtual machine starting method and device
CN111754191A (en) * 2020-06-08 2020-10-09 中国建设银行股份有限公司 Automatic change method based on cloud platform and related equipment
CN111782222B (en) * 2020-06-30 2022-07-26 联想(北京)有限公司 Object deployment method and device
CN111857956B (en) * 2020-07-21 2024-03-12 上海云轴信息科技有限公司 Virtual machine starting method and equipment
CN112363671B (en) * 2020-10-23 2022-07-05 中国电子科技网络信息安全有限公司 Virtual machine template mirror image storage method based on fusion framework cloud platform
CN113504872B (en) * 2021-05-14 2023-11-03 济南浪潮数据技术有限公司 Method, system, equipment and medium for mounting virtual disk on cloud physical machine
CN113886008A (en) * 2021-09-19 2022-01-04 苏州浪潮智能科技有限公司 Virtual machine management method, system, device and medium
CN114327757B (en) * 2021-12-21 2023-03-24 北京永信至诚科技股份有限公司 Network target range tool delivery method, device, equipment and readable storage medium
CN114640597B (en) * 2022-02-24 2023-08-15 烽台科技(北京)有限公司 Network target range configuration migration method, device, computer equipment and medium
CN114448939B (en) * 2022-04-07 2022-07-05 广州市保伦电子有限公司 VirtualBox-based method for acquiring IP address of host machine and background server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6738977B1 (en) * 2000-05-31 2004-05-18 International Business Machines Corporation Class sharing between multiple virtual machines
CN102088367A (en) * 2010-12-10 2011-06-08 北京世纪互联工程技术服务有限公司 Method for quickly deploying in virtualization environment
CN102110009A (en) * 2009-12-28 2011-06-29 中国移动通信集团公司 Method for deploying application in virtual platform and virtual platform manager
CN104580519A (en) * 2015-01-29 2015-04-29 福建师范大学福清分校 Method for rapid deployment of openstack cloud computing platform

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5869099B2 (en) * 2011-03-30 2016-02-24 アマゾン・テクノロジーズ、インコーポレイテッド Framework and interface for offload device-based packet processing
US9571507B2 (en) * 2012-10-21 2017-02-14 Mcafee, Inc. Providing a virtual security appliance architecture to a virtual cloud infrastructure

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6738977B1 (en) * 2000-05-31 2004-05-18 International Business Machines Corporation Class sharing between multiple virtual machines
CN102110009A (en) * 2009-12-28 2011-06-29 中国移动通信集团公司 Method for deploying application in virtual platform and virtual platform manager
CN102088367A (en) * 2010-12-10 2011-06-08 北京世纪互联工程技术服务有限公司 Method for quickly deploying in virtualization environment
CN104580519A (en) * 2015-01-29 2015-04-29 福建师范大学福清分校 Method for rapid deployment of openstack cloud computing platform

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240716B (en) * 2018-09-10 2022-10-25 福建星瑞格软件有限公司 Big data platform version management and rapid iterative deployment method and system
CN109240716A (en) * 2018-09-10 2019-01-18 福建星瑞格软件有限公司 A kind of big data platform version management and iteratively faster dispositions method and system
CN110413293A (en) * 2019-07-23 2019-11-05 深圳忆联信息系统有限公司 The method and device that system deployment process modifies to standard mirror image
CN110531995A (en) * 2019-08-23 2019-12-03 济南浪潮数据技术有限公司 Manage dispositions method, device, equipment and the computer readable storage medium of platform
CN110531995B (en) * 2019-08-23 2022-06-17 济南浪潮数据技术有限公司 Management platform deployment method, device, equipment and computer readable storage medium
CN110750334A (en) * 2019-10-25 2020-02-04 北京计算机技术及应用研究所 Network target range rear-end storage system design method based on Ceph
CN110750334B (en) * 2019-10-25 2024-02-02 北京计算机技术及应用研究所 Ceph-based network target range rear end storage system design method
CN112882820A (en) * 2019-11-29 2021-06-01 北京百度网讯科技有限公司 Method and device for configuring resources
CN113076171A (en) * 2020-01-03 2021-07-06 阿里巴巴集团控股有限公司 Virtual machine installing method and device
CN113076171B (en) * 2020-01-03 2023-12-19 阿里巴巴集团控股有限公司 Virtual machine installation method and device
CN111258719A (en) * 2020-01-19 2020-06-09 山东汇贸电子口岸有限公司 Method and system for rapidly deploying multi-node Ceph cluster under single-machine KVM virtualization
CN111459513B (en) * 2020-04-02 2024-04-02 西安远望谷物联网科技有限公司 Windows mirror image manufacturing system and method based on OpenStack platform
CN111459513A (en) * 2020-04-02 2020-07-28 西安远望谷物联网科技有限公司 Windows mirror image manufacturing system and method based on OpenStack platform
CN111813504A (en) * 2020-07-13 2020-10-23 北京金山云网络技术有限公司 Method and device for automatically configuring effective virtual machine and electronic equipment
CN111813504B (en) * 2020-07-13 2024-01-19 北京金山云网络技术有限公司 Method and device for automatically configuring effective virtual machine and electronic equipment
CN112486631A (en) * 2020-12-04 2021-03-12 浪潮云信息技术股份公司 Method for constructing virtual machine mirror image
CN112486631B (en) * 2020-12-04 2023-03-24 浪潮云信息技术股份公司 Method for constructing virtual machine mirror image
CN112783609A (en) * 2021-01-30 2021-05-11 浪潮云信息技术股份公司 Method for automatically resetting password for virtual machine on ESXI (electronic service organization) host
CN113204363B (en) * 2021-05-27 2023-11-03 济南浪潮数据技术有限公司 Cloud management platform mirror image off-line customization system
CN113204363A (en) * 2021-05-27 2021-08-03 济南浪潮数据技术有限公司 Cloud management platform mirror image offline customization system
CN113342378A (en) * 2021-06-25 2021-09-03 山东浪潮通软信息科技有限公司 Mirror image generation method, device and medium based on file system update
CN114363334B (en) * 2021-12-30 2024-04-02 阿里巴巴(中国)有限公司 Cloud system, network configuration method, device and equipment of cloud desktop virtual machine
CN114363334A (en) * 2021-12-30 2022-04-15 阿里巴巴(中国)有限公司 Network configuration method, device and equipment for cloud system and cloud desktop virtual machine
CN114465902B (en) * 2022-01-07 2023-09-08 苏州浪潮智能科技有限公司 Method, system, equipment and medium for managing bond by cloud host multi-network card
CN114465902A (en) * 2022-01-07 2022-05-10 苏州浪潮智能科技有限公司 Method, system, equipment and medium for cloud host multi-network card management bond
CN114661459A (en) * 2022-01-19 2022-06-24 浙江网商银行股份有限公司 Operation method, device and system of robot process automation RPA and electronic equipment
CN115357256A (en) * 2022-10-18 2022-11-18 安徽华云安科技有限公司 CDH cluster deployment method and system

Also Published As

Publication number Publication date
CN107291525A (en) 2017-10-24
CN107291525B (en) 2021-06-01

Similar Documents

Publication Publication Date Title
WO2017166785A1 (en) Method for deploying virtual machines, host machine, and system
US11622010B2 (en) Virtualizing device management services on a multi-session platform
EP3647946B1 (en) Password reset method, apparatus and system for virtual machine
US9477507B2 (en) State customization of forked virtual machines
EP2823393B1 (en) Offline provisioning of virtual machines
EP3183649B1 (en) Application publishing using memory state sharing
JP6058628B2 (en) Multi-node application deployment system
US7941470B2 (en) Synchronization and customization of a clone computer
US9304793B2 (en) Master automation service
US9542174B2 (en) Deployment of software images with distinct configuration logic
US9858105B1 (en) Service for managing custom virtual machine images
KR101692733B1 (en) Method for managing virtual machine and device therefor
CN102567075A (en) Virtual machine context setting method in cloud computing environment
AU2013308873A1 (en) Integrated computing platform deployed in an existing computing environment
WO2017139476A1 (en) Managed virtual machine deployment
US11630777B2 (en) Provisioning virtual machines with a single identity and cache virtual disk
US11243781B2 (en) Provisioning services (PVS) cloud streaming with read cache file storing preboot data including a network driver
CN113918174A (en) Bare metal server deployment method, deployment controller and server cluster
US20230229482A1 (en) Autonomous cluster control plane in a virtualized computing system
AU2021202457B2 (en) Provisioning service (PVS) cloud streaming with read cache
Han OpenStack Based Packet Control Unit Cloudification
Fairén González et al. Heterogeneous distribution in ATLAS

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16896555

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16896555

Country of ref document: EP

Kind code of ref document: A1