[go: up one dir, main page]

CN113238835B - Virtual machine configuration method, device, server and system - Google Patents

Virtual machine configuration method, device, server and system Download PDF

Info

Publication number
CN113238835B
CN113238835B CN202110616754.XA CN202110616754A CN113238835B CN 113238835 B CN113238835 B CN 113238835B CN 202110616754 A CN202110616754 A CN 202110616754A CN 113238835 B CN113238835 B CN 113238835B
Authority
CN
China
Prior art keywords
configuration
virtual machine
information
server
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110616754.XA
Other languages
Chinese (zh)
Other versions
CN113238835A (en
Inventor
金叶
徐锐
沈松
王柯
朱威
武晓頔
马澍
王美玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202110616754.XA priority Critical patent/CN113238835B/en
Publication of CN113238835A publication Critical patent/CN113238835A/en
Application granted granted Critical
Publication of CN113238835B publication Critical patent/CN113238835B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a virtual machine configuration method, a device, a server and a system, wherein the method comprises the following steps: the method comprises the steps that a first server receives a configuration request sent by a terminal, configuration information corresponding to the configuration request is obtained from a configuration database in response to the configuration request, the configuration information is sent to a second server, so that the second server determines a virtual machine to be configured according to a network address carried in the configuration information, a configuration instruction is generated according to a pre-stored virtual machine management table, the configuration instruction and the configuration information are sent to the virtual machine to be configured, and the virtual machine to be configured responds to the configuration instruction to perform system configuration according to a pre-stored configuration script and the configuration information. According to the method and the system, the virtual machine to be configured is remotely controlled by the second server to perform system configuration according to the pre-stored configuration script and the pre-stored configuration information, so that the efficiency of configuring the virtual machine is improved, and the configuration time of the virtual machine is shortened.

Description

虚拟机配置方法、装置、服务器及系统Virtual machine configuration method, device, server and system

技术领域Technical field

本发明涉及计算机技术领域,尤其涉及一种虚拟机配置方法、装置、服务器及系统。The present invention relates to the field of computer technology, and in particular, to a virtual machine configuration method, device, server and system.

背景技术Background technique

随着云计算技术的不断发展,越来越多的项目通过创建启动和停止虚拟机使用云计算资源。面对大量的虚拟机创建需求和多种不同的虚拟机基础配置要求,亟需实现自动化创建和配置虚拟机,才能虚拟机快速交付和标准化交付的要求。With the continuous development of cloud computing technology, more and more projects use cloud computing resources by creating and starting and stopping virtual machines. Faced with a large number of virtual machine creation requirements and a variety of different virtual machine basic configuration requirements, it is urgent to realize automated creation and configuration of virtual machines to meet the requirements of rapid and standardized delivery of virtual machines.

现有技术中,虚拟机的自动化创建包括镜像模板的自动化创建、虚拟机镜像的自动化拉起及拉起文件的自动化配置、虚拟机内软件的自动化拉起及软件的初始化配置,并通过运维人员手动配置虚拟机的基础资源信息,例如用户信息、用户权限以及文件系统等,待配置基础资源信息成功后再填写工单进行虚拟机的交付。In the existing technology, the automatic creation of virtual machines includes automatic creation of image templates, automatic pull-up of virtual machine images and automatic configuration of pull-up files, automatic pull-up of software in virtual machines and initial configuration of software, and through operation and maintenance The personnel manually configure the basic resource information of the virtual machine, such as user information, user permissions, and file systems. After the basic resource information is successfully configured, a work order is filled in to deliver the virtual machine.

然而,人工手动配置虚拟机基础资源信息的效率较低,导致虚拟机的配置时间较长,影响虚拟机的交付进度。However, manually configuring the basic resource information of a virtual machine is inefficient, resulting in a longer configuration time for the virtual machine and affecting the delivery progress of the virtual machine.

发明内容Contents of the invention

本发明的目的在于提供一种虚拟机配置方法、装置、服务器及系统,以提高虚拟机的配置效率。The object of the present invention is to provide a virtual machine configuration method, device, server and system to improve the configuration efficiency of the virtual machine.

第一方面,本发明提供一种虚拟机配置方法,应用于第一服务器,包括:In a first aspect, the present invention provides a virtual machine configuration method, applied to a first server, including:

接收终端发送的配置请求,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;Receive a configuration request sent by the terminal, and obtain the configuration information corresponding to the configuration request from a configuration database in response to the configuration request. The configuration database stores a virtual machine table, an initialization user table, and an initialization file system information table;

将所述配置信息发送至第二服务器,以使所述第二服务器根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,使得所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。Send the configuration information to a second server, so that the second server determines the virtual machine to be configured according to the network address carried in the configuration information, generates a configuration instruction according to a pre-stored virtual machine management table, and sends the The configuration instruction and the configuration information are sent to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system configuration according to the pre-stored configuration script and the configuration information, and the configuration instruction includes the to-be-configured virtual machine. Administrative user information for the configured virtual machine.

在一种可能的设计中,在将所述配置信息发送至第二服务器之前,还包括:In a possible design, before sending the configuration information to the second server, it also includes:

根据负载均衡算法确定待连接的第二服务器,并将建立连接请求发送至所述待连接的第二服务器;Determine the second server to be connected according to the load balancing algorithm, and send the connection establishment request to the second server to be connected;

若在预设时间段内未接收到所述待连接的第二服务器返回的建立连接响应,则将所述建立连接请求发送至其他任一第二服务器,并在接收到所述第二服务器返回的建立连接响应之后,执行将所述配置信息发送至第二服务器的步骤。If the connection establishment response returned by the second server to be connected is not received within the preset time period, the connection establishment request is sent to any other second server, and after receiving the connection establishment response returned by the second server After the connection establishment response, the step of sending the configuration information to the second server is performed.

在一种可能的设计中,所述配置数据库为MySQL数据库,所述MySQL数据库为由第一服务器集群提供的主从同步数据库系统;In one possible design, the configuration database is a MySQL database, and the MySQL database is a master-slave synchronization database system provided by the first server cluster;

相应地,在所述从配置数据库中获取所述配置请求对应的配置信息之后,还包括:Correspondingly, after obtaining the configuration information corresponding to the configuration request from the configuration database, the method further includes:

将所述配置请求以及所述配置信息存储至所述主从同步数据库系统中。Store the configuration request and the configuration information in the master-slave synchronization database system.

在一种可能的设计中,在所述接收终端发送的配置请求之前,还包括:In a possible design, before receiving the configuration request sent by the terminal, it also includes:

接收终端发送的申请信息,根据所述申请信息确定配置需求参数,并将所述配置需求参数发送至终端,以使终端根据所述配置需求参数生成配置请求。Receive application information sent by the terminal, determine configuration requirement parameters based on the application information, and send the configuration requirement parameters to the terminal, so that the terminal generates a configuration request based on the configuration requirement parameters.

在一种可能的设计中,所述配置脚本用于配置连接虚拟机的账号密码、添加虚拟机用户和密码、添加虚拟机用户权限组、加载虚拟机硬盘信息、创建逻辑卷、配分文件系统以及保存操作日志中的至少一种。In one possible design, the configuration script is used to configure the account and password for connecting to the virtual machine, add a virtual machine user and password, add a virtual machine user permission group, load the virtual machine hard disk information, create a logical volume, allocate a file system, and Save at least one of the operation logs.

第二方面,本发明实施例提供一种虚拟机配置方法,应用于第二服务器,包括:In a second aspect, embodiments of the present invention provide a virtual machine configuration method, applied to the second server, including:

接收第一服务器发送的配置信息,所述配置信息为所述第一服务器根据终端发送的配置请求从配置数据库中获取的,其中所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;Receive configuration information sent by the first server. The configuration information is obtained by the first server from the configuration database according to the configuration request sent by the terminal, wherein the configuration database stores a virtual machine table, an initialization user table and an initialization file. System information table;

根据所述配置信息中携带的网络地址确定待配置的虚拟机,并根据预存的虚拟机管理表生成配置指令;Determine the virtual machine to be configured according to the network address carried in the configuration information, and generate configuration instructions according to the pre-stored virtual machine management table;

将所述配置指令以及所述配置信息发送至待配置的虚拟机,以使所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。The configuration instruction and the configuration information are sent to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system configuration according to the pre-stored configuration script and the configuration information, and the configuration The instruction contains the administrative user information of the virtual machine to be configured.

在一种可能的设计中,所述虚拟机配置方法还包括:In a possible design, the virtual machine configuration method further includes:

接收所述待配置的虚拟机发送的配置日志,所述配置日志是由所述待配置的虚拟机根据预存的配置脚本和所述配置信息进行系统配置时生成的,所述配置日志包括配置过程信息和配置结果;Receive a configuration log sent by the virtual machine to be configured. The configuration log is generated when the virtual machine to be configured performs system configuration according to the pre-stored configuration script and the configuration information. The configuration log includes the configuration process. Information and configuration results;

接收所述第一服务器发送的查询请求,响应于所述查询请求将所述配置日志发送至第一服务器,以使管理员调取第一服务器中存储的配置日志确认虚拟机的配置详情。Receive the query request sent by the first server, and send the configuration log to the first server in response to the query request, so that the administrator can retrieve the configuration log stored in the first server to confirm the configuration details of the virtual machine.

第三方面,本发明实施例提供一种虚拟机配置装置,包括:In a third aspect, an embodiment of the present invention provides a virtual machine configuration device, including:

获取模块,用于接收终端发送的配置请求,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;An acquisition module, configured to receive a configuration request sent by the terminal, and in response to the configuration request, obtain the configuration information corresponding to the configuration request from a configuration database. The configuration database stores a virtual machine table, an initialization user table, and an initialization file system. Information Sheet;

发送模块,用于将所述配置信息发送至第二服务器,以使所述第二服务器根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,使得所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。A sending module configured to send the configuration information to a second server, so that the second server determines the virtual machine to be configured according to the network address carried in the configuration information, and generates a configuration instruction according to a pre-stored virtual machine management table. and send the configuration instruction and the configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system configuration according to the pre-stored configuration script and the configuration information, the The configuration instruction contains the management user information of the virtual machine to be configured.

第四方面,本发明实施例提供一种虚拟机配置装置,包括:In a fourth aspect, embodiments of the present invention provide a virtual machine configuration device, including:

接收模块,用于接收第一服务器发送的配置信息,所述配置信息为所述第一服务器根据终端发送的配置请求从配置数据库中获取的,其中所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;A receiving module, configured to receive configuration information sent by the first server. The configuration information is obtained by the first server from a configuration database according to the configuration request sent by the terminal, wherein the configuration database stores virtual machine tables, initialization User table and initialized file system information table;

确定模块,用于根据所述配置信息中携带的网络地址确定待配置的虚拟机,并根据预存的虚拟机管理表生成配置指令;A determination module, configured to determine the virtual machine to be configured based on the network address carried in the configuration information, and generate configuration instructions based on the pre-stored virtual machine management table;

发送模块,用于将所述配置指令以及所述配置信息发送至待配置的虚拟机,以使所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。A sending module, configured to send the configuration instruction and the configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system processing according to the pre-stored configuration script and the configuration information. Configuration, the configuration instructions include the management user information of the virtual machine to be configured.

第五方面,本发明实施例提供一种虚拟机配置系统,包括至少一台终端、至少两台第一服务器、至少两台第二服务器以及N台虚拟机,其中N为正整数:In a fifth aspect, embodiments of the present invention provide a virtual machine configuration system, including at least one terminal, at least two first servers, at least two second servers, and N virtual machines, where N is a positive integer:

所述终端,用于根据客户端接收用户的配置请求;The terminal is used to receive the user's configuration request according to the client;

所述第一服务器,用于接收终端发送的配置请求,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,并将所述配置信息发送至第二服务器,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;The first server is configured to receive the configuration request sent by the terminal, obtain the configuration information corresponding to the configuration request from the configuration database in response to the configuration request, and send the configuration information to the second server. The database stores virtual machine tables, initialized user tables, and initialized file system information tables;

所述第二服务器,用于根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,其中所述配置指令中包含待配置的虚拟机的管理用户信息;The second server is configured to determine the virtual machine to be configured according to the network address carried in the configuration information, generate a configuration instruction according to a pre-stored virtual machine management table, and send the configuration instruction and the configuration information to the virtual machine to be configured. The configured virtual machine, wherein the configuration instruction includes the management user information of the virtual machine to be configured;

所述待配置的虚拟机,用于响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置。The virtual machine to be configured is configured to perform system configuration according to the pre-stored configuration script and the configuration information in response to the configuration instruction.

第六方面,本发明实施例提供一种服务器,包括存储器和至少一个处理器;所述存储器用于存储计算机执行指令;至少一个处理器,用于执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行实现如第一方面以及第一方面的各种可能的设计所述虚拟机配置方法。In a sixth aspect, embodiments of the present invention provide a server, including a memory and at least one processor; the memory is used to store computer execution instructions; and at least one processor is used to execute the computer execution instructions stored in the memory, so that the The at least one processor executes the virtual machine configuration method implementing the first aspect and various possible designs of the first aspect.

第七方面,本发明实施例提供一种服务器,包括存储器和至少一个处理器;所述存储器用于存储计算机执行指令;至少一个处理器,用于执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行实现如第二方面以及第二方面的各种可能的设计所述虚拟机配置方法。In a seventh aspect, embodiments of the present invention provide a server, including a memory and at least one processor; the memory is used to store computer execution instructions; and at least one processor is used to execute the computer execution instructions stored in the memory, so that the The at least one processor executes the virtual machine configuration method implementing the second aspect and various possible designs of the second aspect.

第八方面,本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如第一方面以及第一方面的各种可能的设计所述虚拟机配置方法、或第二方面以及第二方面的各种可能的设计所述虚拟机配置方法。In an eighth aspect, embodiments of the present invention provide a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executable instructions, the first aspect and the first aspect are implemented. Various possible designs of the virtual machine configuration method of the aspect, or various possible designs of the virtual machine configuration method of the second aspect and the second aspect.

第九方面,本发明实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时,实现如第一方面以及第一方面的各种可能的设计所述虚拟机配置方法、或第二方面以及第二方面的各种可能的设计所述虚拟机配置方法。In a ninth aspect, embodiments of the present invention provide a computer program product, including a computer program. When the computer program is executed by a processor, the virtual machine configuration method of the first aspect and various possible designs of the first aspect are implemented. , or the second aspect and various possible designs of the virtual machine configuration method of the second aspect.

本发明实施例提供的一种虚拟机配置方法、装置、服务器及系统,通过设置第一服务器从配置数据库中获取配置请求对应的配置信息,并将配置信息发送至第二服务器,使得第二服务器根据预存的虚拟机管理表生成配置指令,并根据配置指令调用待配置的虚拟机中预存的配置脚本,使得待配置的虚拟机根据配置信息以及配置脚本进行系统配置,实现了自动化配置用户权限以及文件系统的目的,提高了配置虚拟机的效率,缩短了虚拟机的配置时间。A virtual machine configuration method, device, server and system provided by embodiments of the present invention set the first server to obtain the configuration information corresponding to the configuration request from the configuration database and send the configuration information to the second server, so that the second server Generate configuration instructions based on the pre-stored virtual machine management table, and call the pre-stored configuration script in the virtual machine to be configured according to the configuration instructions, so that the virtual machine to be configured performs system configuration based on the configuration information and configuration scripts, realizing automated configuration of user permissions and The purpose of the file system is to improve the efficiency of configuring virtual machines and shorten the configuration time of virtual machines.

附图说明Description of the drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description serve to explain the principles of the invention.

图1为本发明实施例提供的虚拟机配置系统结构示意图;Figure 1 is a schematic structural diagram of a virtual machine configuration system provided by an embodiment of the present invention;

图2为本发明实施例提供的虚拟机配置方法流程图一;Figure 2 is a flow chart 1 of a virtual machine configuration method provided by an embodiment of the present invention;

图3为本发明实施例提供的虚拟机配置方法流程图二;Figure 3 is a flow chart 2 of a virtual machine configuration method provided by an embodiment of the present invention;

图4为本发明实施例提供的虚拟机配置方法流程图三;Figure 4 is a flow chart 3 of a virtual machine configuration method provided by an embodiment of the present invention;

图5为本发明实施例提供的虚拟机配置方法流程图四;Figure 5 is a flow chart 4 of a virtual machine configuration method provided by an embodiment of the present invention;

图6为本发明实施例提供的虚拟机配置装置的结构示意图一;Figure 6 is a schematic structural diagram of a virtual machine configuration device provided by an embodiment of the present invention;

图7为本发明实施例提供的虚拟机配置装置的结构示意图二;Figure 7 is a schematic structural diagram 2 of a virtual machine configuration device provided by an embodiment of the present invention;

图8为本发明实施例提供的服务器的硬件结构示意图一;Figure 8 is a schematic diagram 1 of the hardware structure of a server provided by an embodiment of the present invention;

图9为本发明实施例提供的服务器的硬件结构示意图二。Figure 9 is a schematic diagram 2 of the hardware structure of a server provided by an embodiment of the present invention.

具体实施方式Detailed ways

通过上述附图,已示出本发明明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本发明构思的范围,而是通过参考特定实施例为本领域技术人员说明本发明的概念。Specific embodiments of the present invention have been shown in the above-mentioned drawings and will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concept in any way, but rather to illustrate the concept of the present invention to those skilled in the art with reference to specific embodiments.

虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。在实体计算机中能够完成的工作在虚拟机中都能够实现。在计算机中创建虚拟机时,需要将实体机的部分硬盘和内存容量作为虚拟机的硬盘和内存容量。每个虚拟机都有独立的芯片、硬盘和操作系统,可以像使用实体机一样对虚拟机进行操作。A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. Everything that can be done on a physical computer can be done on a virtual machine. When creating a virtual machine on a computer, you need to use part of the hard disk and memory capacity of the physical machine as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent chip, hard disk and operating system, and can be operated on the virtual machine just like a physical machine.

目前,启动和停止虚拟机是使用云计算资源的必不可少的步骤。客户可以拷贝一个预先配置好的虚拟机镜像,或者他们可以按照需求装配一个自定义的虚拟机镜像以完成在云中部署虚拟机。具体的,虚拟机的自动化创建包括镜像模板的自动化创建、虚拟机镜像的自动化拉起及拉起文件的自动化配置、虚拟机内软件的自动化拉起及软件的初始化配置,并通过运维人员手动配置虚拟机的基础资源信息,例如用户信息、用户权限以及文件系统等,待配置基础资源信息成功后再填写工单进行虚拟机的交付。然而,现有技术中人工手动配置虚拟机基础资源信息的效率较低,导致虚拟机交付时间较长,影响虚拟机的交付进度。Currently, starting and stopping virtual machines are essential steps for using cloud computing resources. Customers can copy a pre-configured virtual machine image, or they can assemble a custom virtual machine image on demand to complete the deployment of virtual machines in the cloud. Specifically, the automatic creation of virtual machines includes automatic creation of image templates, automatic pull-up of virtual machine images and automatic configuration of pull-up files, automatic pull-up of software in virtual machines and initial configuration of software, and manual operation and maintenance personnel. Configure the basic resource information of the virtual machine, such as user information, user permissions, and file systems. After the basic resource information is successfully configured, fill out a work order to deliver the virtual machine. However, the efficiency of manually configuring basic resource information of a virtual machine in the existing technology is low, resulting in a long delivery time of the virtual machine and affecting the delivery progress of the virtual machine.

为了解决上述技术问题,本发明实施例利用跳转机调用待配置的虚拟机中预存的配置脚本,使得待配置的虚拟机根据配置信息以及配置脚本进行系统配置,实现了自动化配置用户权限以及文件系统的目的,提高了配置虚拟机的效率,缩短了虚拟机的配置时间。In order to solve the above technical problems, the embodiment of the present invention uses a jump machine to call the pre-stored configuration script in the virtual machine to be configured, so that the virtual machine to be configured performs system configuration according to the configuration information and configuration script, and realizes the automatic configuration of user permissions and files. The purpose of the system is to improve the efficiency of configuring virtual machines and shorten the configuration time of virtual machines.

图1为本发明实施例提供的虚拟机配置系统结构示意图。如图1所示,在本发明实施例中,大米质量检测系统包括多台终端10、第一服务器20、第二服务器30以及多台虚拟机40。其中,每台终端10分别与每台第一服务器20建立连接,每台第一服务器20分别与每台第二服务器30建立连接,以及每台第二服务器30分别与每台虚拟机40建立连接。其中,虚拟机配置系统中至少包含两台第一服务器20以及至少两台第二服务器30。终端10用于通过虚拟机配置的客户端接收用户的配置请求,并根据第一服务器20和第二服务器30实现对待配置的虚拟机的自动化配置。第一服务器20用于接收终端发送的配置请求,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,并将所述配置信息发送至第二服务器,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;第二服务器30用于根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,其中所述配置指令中包含待配置的虚拟机的管理用户信息。其中,每台虚拟机40是在云数据库中,第一服务器20按照创建虚拟机的需求通过第二服务器30装配多个自定义的虚拟机镜像,以实现在云中部署多台虚拟机的目的。在创建虚拟机的过程中,第一服务器20为每台虚拟机40配置了网络地址和虚拟机信息,在每个第二服务器30中存储了虚拟机管理表,虚拟机管理表包含了所有虚拟机40的网络地址和虚拟机信息,其中虚拟机信息包含创建虚拟机的超级管理员的账户信息,具体包括超级管理员标识和密码。在创建虚拟机完成之后,待配置的虚拟机40响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置。Figure 1 is a schematic structural diagram of a virtual machine configuration system provided by an embodiment of the present invention. As shown in Figure 1, in this embodiment of the present invention, the rice quality inspection system includes multiple terminals 10, a first server 20, a second server 30, and multiple virtual machines 40. Among them, each terminal 10 establishes a connection with each first server 20 respectively, each first server 20 establishes a connection with each second server 30 respectively, and each second server 30 establishes a connection with each virtual machine 40 respectively. . The virtual machine configuration system includes at least two first servers 20 and at least two second servers 30 . The terminal 10 is configured to receive the user's configuration request through a virtual machine configuration client, and implement automatic configuration of the virtual machine to be configured according to the first server 20 and the second server 30 . The first server 20 is configured to receive the configuration request sent by the terminal, obtain the configuration information corresponding to the configuration request from the configuration database in response to the configuration request, and send the configuration information to the second server. A virtual machine table, an initialization user table and an initialization file system information table are stored; the second server 30 is used to determine the virtual machine to be configured according to the network address carried in the configuration information, and generate configuration instructions according to the pre-stored virtual machine management table, The configuration instruction and the configuration information are sent to the virtual machine to be configured, where the configuration instruction includes management user information of the virtual machine to be configured. Each virtual machine 40 is in a cloud database, and the first server 20 assembles multiple customized virtual machine images through the second server 30 according to the requirements for creating virtual machines to achieve the purpose of deploying multiple virtual machines in the cloud. . During the process of creating a virtual machine, the first server 20 configures a network address and virtual machine information for each virtual machine 40, and stores a virtual machine management table in each second server 30. The virtual machine management table contains all virtual machines. The network address and virtual machine information of the machine 40, where the virtual machine information includes the account information of the super administrator who created the virtual machine, specifically including the super administrator ID and password. After the creation of the virtual machine is completed, the virtual machine 40 to be configured performs system configuration according to the pre-stored configuration script and the configuration information in response to the configuration instruction.

图2为本发明实施例提供的虚拟机配置方法流程图一。其中,本实施例的执行主体可以为第一服务器。如图2所示,虚拟机配置方法包括以下步骤:Figure 2 is a flowchart 1 of a virtual machine configuration method provided by an embodiment of the present invention. The execution subject of this embodiment may be the first server. As shown in Figure 2, the virtual machine configuration method includes the following steps:

S201:接收终端发送的配置请求,响应于配置请求从配置数据库中获取配置请求对应的配置信息,配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表。S201: Receive the configuration request sent by the terminal, and obtain the configuration information corresponding to the configuration request from the configuration database in response to the configuration request. The configuration database stores a virtual machine table, an initialization user table, and an initialization file system information table.

在本发明实施例中,用户可以在终端上的配置虚拟机的客户端提交配置虚拟机的申请。具体的,在终端上提供用于配置虚拟机的OA系统,用户通过登录OA系统提交配置虚拟机的需求,管理员登录OA系统,确认用户提交的配置工单。终端根据管理员确认后的配置工单生成配置请求,并将配置请求发送至第一服务器,其中配置请求中包含了虚拟机的文件系统配置参数、用户信息以及用户权限信息。In this embodiment of the present invention, the user can submit an application for configuring the virtual machine on the client for configuring the virtual machine on the terminal. Specifically, an OA system for configuring virtual machines is provided on the terminal. Users submit requirements for configuring virtual machines by logging into the OA system. The administrator logs into the OA system and confirms the configuration work order submitted by the user. The terminal generates a configuration request based on the configuration work order confirmed by the administrator, and sends the configuration request to the first server. The configuration request includes the virtual machine's file system configuration parameters, user information, and user permission information.

在本发明实施例中,第一服务器中预存有配置数据库,其中,配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表。第一服务器从配置数据库中获取与配置请求对应的配置信息,即根据配置请求中包含的虚拟机的文件系统配置参数、用户信息以及用户权限信息,从虚拟机表、初始化用户表以及初始化文件系统信息表查找到对应的配置信息,第一服务器根据所有已创建的虚拟机的网络地址为用户分配待配置的虚拟机,配置信息还包含待配置的虚拟机的网络地址。In this embodiment of the present invention, a configuration database is pre-stored in the first server, where a virtual machine table, an initialization user table and an initialization file system information table are stored in the configuration database. The first server obtains the configuration information corresponding to the configuration request from the configuration database, that is, based on the file system configuration parameters, user information and user permission information of the virtual machine included in the configuration request, it obtains the configuration information from the virtual machine table, initialization user table and initialization file system. Corresponding configuration information is found in the information table, and the first server allocates virtual machines to be configured to the user based on the network addresses of all created virtual machines. The configuration information also includes the network addresses of the virtual machines to be configured.

S202:将配置信息发送至第二服务器,以使第二服务器根据配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将配置指令以及配置信息发送至待配置的虚拟机,使得待配置的虚拟机响应于配置指令根据预存的配置脚本和配置信息进行系统配置,配置指令中包含待配置的虚拟机的管理用户信息。S202: Send the configuration information to the second server, so that the second server determines the virtual machine to be configured according to the network address carried in the configuration information, generates a configuration instruction according to the pre-stored virtual machine management table, and sends the configuration instruction and configuration information. to the virtual machine to be configured, causing the virtual machine to be configured to perform system configuration according to the pre-stored configuration script and configuration information in response to the configuration instruction, where the configuration instruction includes management user information of the virtual machine to be configured.

在本发明实施例中,第一服务器将配置信息发送至第二服务器,第二服务器根据配置信息中携带的网络地址与待配置的虚拟机建立连接。第二服务器根据预存的虚拟机管理表生成配置指令,并将配置指令以及配置信息发送至待配置的虚拟机,使得待配置的虚拟机响应于配置指令根据预存的配置脚本和配置信息进行系统配置。具体的,第二服务器将配置信息发送至待配置的虚拟机中。在第二服务器和待配置的虚拟机中都安装了用于实现远程执行脚本的expect软件。第二服务器根据预存的虚拟机管理表确定待配置的虚拟机的超级管理员的账户信息,以管理员的身份通过expect软件登录到虚拟机中,远程连接待配置的虚拟机根据预存的配置脚本和配置信息进行系统配置,具体的,第二服务器连接待配置的虚拟机将配置信息传递到配置脚本中,通过登录管理员账户对待配置的虚拟机的基础配置资源进行配置。配置脚本可根据不同的虚拟机系统进行修改和调整,匹配不同虚拟机系统的配置要求。In this embodiment of the present invention, the first server sends the configuration information to the second server, and the second server establishes a connection with the virtual machine to be configured according to the network address carried in the configuration information. The second server generates configuration instructions according to the pre-stored virtual machine management table, and sends the configuration instructions and configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instructions and performs system configuration according to the pre-stored configuration script and configuration information. . Specifically, the second server sends the configuration information to the virtual machine to be configured. The expect software for remote execution of scripts is installed on both the second server and the virtual machine to be configured. The second server determines the account information of the super administrator of the virtual machine to be configured based on the pre-stored virtual machine management table, logs in to the virtual machine as an administrator through the expect software, and remotely connects to the virtual machine to be configured according to the pre-stored configuration script. Configure the system with the configuration information. Specifically, the second server connects to the virtual machine to be configured, passes the configuration information to the configuration script, and configures the basic configuration resources of the virtual machine to be configured by logging in to the administrator account. The configuration script can be modified and adjusted according to different virtual machine systems to match the configuration requirements of different virtual machine systems.

示例性的,预存的配置脚本为预先封装好的用于实现对虚拟机进行系统资源配置的shell脚本。具体的,配置脚本用于配置连接虚拟机的账号密码、添加虚拟机用户和密码、添加虚拟机用户权限组、加载虚拟机硬盘信息、创建逻辑卷、配分文件系统以及保存操作日志中的至少一种。具体的,虚拟机根据配置脚本进行配置的具体操作包括:虚拟机根据配置信息判定是否创建文件系统,若没有创建文件系统的需求,只有创建初始用户的需求,则直接生成配置脚本。若配置信息中包含硬盘的配置需求,则扫描系统硬盘信息,加载新添加的硬盘,并通过正则规则筛选出空闲的硬盘,再依次创建物理卷、创建或扩容用户卷组、创建逻辑卷、格式化卷。根据配置信息中的用户信息创建用户和组、初始化用户密码、创建目录、挂载文件系统、配置目录权限等。For example, the pre-stored configuration script is a pre-packaged shell script used to configure system resources of the virtual machine. Specifically, the configuration script is used to configure the account and password for connecting to the virtual machine, add virtual machine users and passwords, add virtual machine user permission groups, load virtual machine hard disk information, create logical volumes, allocate file systems, and save at least one of the operation logs. kind. Specifically, the specific operations of configuring the virtual machine according to the configuration script include: the virtual machine determines whether to create a file system based on the configuration information. If there is no need to create a file system and only the need to create an initial user, the configuration script is directly generated. If the configuration information contains the configuration requirements of the hard disk, the system hard disk information is scanned, the newly added hard disk is loaded, and the idle hard disks are filtered out through regular rules, and then the physical volume is created, the user volume group is created or expanded, the logical volume is created, and the format is Volume. Create users and groups, initialize user passwords, create directories, mount file systems, configure directory permissions, etc. based on the user information in the configuration information.

示例性的,在本发明实施例中,为了保证连接的第二服务器能够提供远程配置虚拟机的功能,在将配置信息发送至第二服务器之前,第一服务器根据负载均衡算法确定待连接的第二服务器,并将建立连接请求发送至待连接的第二服务器;若在预设时间段内未接收到待连接的第二服务器返回的建立连接响应,则将建立连接请求发送至其他任一第二服务器,并在接收到第二服务器返回的建立连接响应之后,执行将配置信息发送至第二服务器的步骤。For example, in this embodiment of the present invention, in order to ensure that the connected second server can provide the function of remotely configuring the virtual machine, before sending the configuration information to the second server, the first server determines the third server to be connected based on the load balancing algorithm. The second server and the connection establishment request are sent to the second server to be connected; if the connection establishment response returned by the second server to be connected is not received within the preset time period, the connection establishment request is sent to any other third server. The second server, and after receiving the connection establishment response returned by the second server, performs the step of sending the configuration information to the second server.

在本发明实施例中,采用多跳机制,即设置多个第二服务器,提高了配置系统的安全性。第一服务器根据负载均衡算法确定待连接的第二服务器,当待连接的第二服务器出现故障时,还可连接其他的第二服务器,不会影响虚拟机的远程配置过程。并且,通过设置多台跳板机服务器,控制不同用户具备不同的访问权限,只让少数的管理员可以访问到新创建的虚拟机,其他用户都不可以操作,减少认证授权的过程和安全泄漏的问题发生。In the embodiment of the present invention, a multi-hop mechanism is adopted, that is, multiple second servers are set up, which improves the security of the configuration system. The first server determines the second server to be connected based on the load balancing algorithm. When the second server to be connected fails, it can also connect to other second servers without affecting the remote configuration process of the virtual machine. Moreover, by setting up multiple springboard servers, different users are controlled to have different access rights, so that only a few administrators can access the newly created virtual machines, and other users cannot operate them, reducing the authentication and authorization process and the risk of security leaks. Problem occurs.

从上述实施例可知,通过设置第一服务器从配置数据库中获取配置请求对应的配置信息,并将配置信息发送至第二服务器,使得第二服务器根据预存的虚拟机管理表生成配置指令,并根据配置指令调用待配置的虚拟机中预存的配置脚本,使得待配置的虚拟机根据配置信息以及配置脚本进行系统配置,实现了自动化配置用户权限以及文件系统的目的,提高了配置虚拟机的效率,缩短了虚拟机的配置时间。As can be seen from the above embodiments, the first server is configured to obtain the configuration information corresponding to the configuration request from the configuration database, and sends the configuration information to the second server, so that the second server generates configuration instructions according to the pre-stored virtual machine management table, and The configuration instruction calls the pre-stored configuration script in the virtual machine to be configured, so that the virtual machine to be configured performs system configuration according to the configuration information and configuration script, realizes the purpose of automatically configuring user permissions and file systems, and improves the efficiency of configuring the virtual machine. Reduces virtual machine configuration time.

在一种可能的实现方式中,在接收终端发送的配置请求之前,第一服务器接收终端发送的申请信息,根据申请信息确定配置需求参数,并将配置需求参数发送至终端,以使终端根据配置需求参数生成配置请求。In a possible implementation, before receiving the configuration request sent by the terminal, the first server receives the application information sent by the terminal, determines the configuration requirement parameters based on the application information, and sends the configuration requirement parameters to the terminal, so that the terminal Requirement parameters generate configuration requests.

在本发明实施例中,用户也有可能填写的申请信息中可能包含错误的虚拟机基础配置信息,第一服务器判定申请信息是否为已配置过的,若为已配置过的,则根据之前业务系统的配置、用户申请时的参数信息两个维度推荐与用户提交的申请信息对应的配置需求参数。若之前没有配置过,则根据用户的申请信息确定推匹配的配置需求参数。并根据预设配置规则对配置需求参数的合法性进行审核,示例性的,预设配置规则包括校验数据的合法性、判断分配的空间是否超过了最大值、用户名称是否规范以及密码是否符合强密码的规则等。将符合要求的配置需求参数发送至终端,以使终端根据配置需求参数生成配置请求。In this embodiment of the present invention, the application information filled in by the user may contain incorrect virtual machine basic configuration information. The first server determines whether the application information has been configured. If so, the application information is configured according to the previous business system. Configuration requirements parameters corresponding to the application information submitted by the user are recommended from two dimensions: configuration and parameter information when the user applies. If it has not been configured before, the configuration requirement parameters for push matching are determined based on the user's application information. And review the legality of the configuration requirement parameters according to the preset configuration rules. For example, the preset configuration rules include verifying the legality of the data, determining whether the allocated space exceeds the maximum value, whether the user name is standardized, and whether the password complies with Rules for strong passwords, etc. Send the configuration requirement parameters that meet the requirements to the terminal, so that the terminal generates a configuration request based on the configuration requirement parameters.

在一种可能的实现方式中,配置数据库为MySQL数据库,MySQL数据库为由第一服务器集群提供的主从同步数据库系统。通过将配置数据库配置为主从同步数据库系统,在配置数据库出现问题时,保证第一服务器能够成功从配置数据库中获取配置请求对应的配置信息,提高自动化配置虚拟机的成功率。示例性的,在从配置数据库中获取配置请求对应的配置信息之后,第一服务器将配置请求以及配置信息存储至主从同步数据库系统中。In a possible implementation manner, the configuration database is a MySQL database, and the MySQL database is a master-slave synchronization database system provided by the first server cluster. By configuring the configuration database as a master-slave synchronization database system, when a problem occurs in the configuration database, it is ensured that the first server can successfully obtain the configuration information corresponding to the configuration request from the configuration database, thereby improving the success rate of automated virtual machine configuration. Exemplarily, after obtaining the configuration information corresponding to the configuration request from the configuration database, the first server stores the configuration request and the configuration information in the master-slave synchronization database system.

图3为本发明实施例提供的虚拟机配置方法流程图二。其中,本实施例的执行主体可以为第二服务器。如图3所示,虚拟机配置方法包括以下步骤:Figure 3 is a second flow chart of a virtual machine configuration method provided by an embodiment of the present invention. The execution subject of this embodiment may be the second server. As shown in Figure 3, the virtual machine configuration method includes the following steps:

S301:接收第一服务器发送的配置信息,配置信息为第一服务器根据终端发送的配置请求从配置数据库中获取的,其中配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表。S301: Receive configuration information sent by the first server. The configuration information is obtained by the first server from the configuration database according to the configuration request sent by the terminal. The configuration database stores a virtual machine table, an initialization user table, and an initialization file system information table.

S302:根据配置信息中携带的网络地址确定待配置的虚拟机,并根据预存的虚拟机管理表生成配置指令。S302: Determine the virtual machine to be configured according to the network address carried in the configuration information, and generate a configuration instruction according to the pre-stored virtual machine management table.

S303:将配置指令以及配置信息发送至待配置的虚拟机,以使待配置的虚拟机响应于配置指令根据预存的配置脚本和配置信息进行系统配置,配置指令中包含待配置的虚拟机的管理用户信息。S303: Send the configuration instruction and configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system configuration according to the pre-stored configuration script and configuration information. The configuration instruction includes management of the virtual machine to be configured. User Info.

在本发明实施例中,S301至S303实现的方法与图2实施例中S201至S202执行的方法和实现的效果相同,在此不再赘述。In the embodiment of the present invention, the method implemented in S301 to S303 has the same effect as the method implemented in S201 to S202 in the embodiment of FIG. 2 and will not be described again here.

图4为本发明实施例提供的虚拟机配置方法流程图三。如图4所示,在图3所示的实施例的基础上,本发明实施例提供的虚拟机配置方法还包括以下步骤:Figure 4 is a flow chart 3 of a virtual machine configuration method provided by an embodiment of the present invention. As shown in Figure 4, based on the embodiment shown in Figure 3, the virtual machine configuration method provided by the embodiment of the present invention also includes the following steps:

S401:接收待配置的虚拟机发送的配置日志,配置日志是由待配置的虚拟机根据预存的配置脚本和配置信息进行系统配置时生成的,配置日志包括配置过程信息和配置结果。S401: Receive the configuration log sent by the virtual machine to be configured. The configuration log is generated when the virtual machine to be configured performs system configuration based on the pre-stored configuration script and configuration information. The configuration log includes configuration process information and configuration results.

在本发明实施例中,待配置的虚拟机在执行配置脚本进行基础资源配置的过程中,会详细记录脚本执行的过程,并生成配置日志,用于记录虚拟机的配置过程信息和配置结果。具体的,在配置脚本shell脚本中设置了反馈机制,如果在配置过程中出现错误,则中断配置过程并输出和记录错误配置信息,错误信息不仅包含执行命令的反馈错误,也包含自定义的错误信息,便于后续检索和定位问题。配置结束后,待配置的虚拟机会将配置日志发送至第二服务器。示例性的,在执行脚本的过程中,超级管理员的账户信息以参数的形式代入,不会记录在配置日志中,确保用户信息的安全。In this embodiment of the present invention, when the virtual machine to be configured executes the configuration script to configure basic resources, the script execution process will be recorded in detail and a configuration log will be generated to record the configuration process information and configuration results of the virtual machine. Specifically, a feedback mechanism is set up in the configuration script shell script. If an error occurs during the configuration process, the configuration process is interrupted and the error configuration information is output and recorded. The error information not only includes feedback errors from the execution command, but also includes customized errors. Information to facilitate subsequent retrieval and problem location. After the configuration is completed, the virtual machine to be configured will send the configuration log to the second server. For example, during the execution of the script, the super administrator's account information is substituted in the form of parameters and will not be recorded in the configuration log, ensuring the security of user information.

S402:接收第一服务器发送的查询请求,响应于查询请求将配置日志发送至第一服务器,以使管理员调取第一服务器中存储的配置日志确认虚拟机的配置详情。S402: Receive the query request sent by the first server, and send the configuration log to the first server in response to the query request, so that the administrator can retrieve the configuration log stored in the first server to confirm the configuration details of the virtual machine.

在本发明实施例中,管理员查看虚拟机的配置详情时,通过终端向第一服务器发送查询请求,第一服务器将查询请求转发至第二服务器。第二服务器将配置日志返回至第一服务器,管理员调取第一服务器中存储的配置日志展示日志信息,管理员通过查看配置过程信息和配置结果确认虚拟机的配置详情。In this embodiment of the present invention, when the administrator checks the configuration details of the virtual machine, the administrator sends a query request to the first server through the terminal, and the first server forwards the query request to the second server. The second server returns the configuration log to the first server. The administrator retrieves the configuration log stored in the first server to display the log information. The administrator confirms the configuration details of the virtual machine by viewing the configuration process information and configuration results.

从上述实施例可知,通过设置配置脚本在配置虚拟机的基础资源过程中,通过记录配置过程信息和配置结果生成配置日志,并将配置日志上传至第二服务器中。配置操作记录都会保存到跳板机服务器中,当出现配置故障时,可以通过配置日志快速的确定故障原因,便于管理员确认虚拟机的配置详情,使得虚拟机的远程配置过程具有可溯源性。As can be seen from the above embodiments, in the process of configuring the basic resources of the virtual machine by setting the configuration script, a configuration log is generated by recording the configuration process information and configuration results, and the configuration log is uploaded to the second server. Configuration operation records will be saved to the springboard server. When a configuration failure occurs, the cause of the failure can be quickly determined through the configuration log, allowing administrators to confirm the configuration details of the virtual machine, making the remote configuration process of the virtual machine traceable.

图5为本发明实施例提供的虚拟机配置方法流程图四。如图5所示,本发明实施例提供的虚拟机配置方法包括以下步骤:Figure 5 is a flow chart 4 of a virtual machine configuration method provided by an embodiment of the present invention. As shown in Figure 5, the virtual machine configuration method provided by this embodiment of the present invention includes the following steps:

S501:终端根据客户端接收用户的配置请求,并将配置请求发送至第一服务器。S501: The terminal receives the user's configuration request according to the client, and sends the configuration request to the first server.

S502:第一服务器响应于配置请求从配置数据库中获取配置请求对应的配置信息,并将配置信息发送至第二服务器,配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表。S502: In response to the configuration request, the first server obtains the configuration information corresponding to the configuration request from the configuration database, and sends the configuration information to the second server. The configuration database stores a virtual machine table, an initialization user table, and an initialization file system information table.

S503:第二服务器根据配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将配置指令以及配置信息发送至待配置的虚拟机,其中配置指令中包含待配置的虚拟机的管理用户信息。S503: The second server determines the virtual machine to be configured according to the network address carried in the configuration information, generates a configuration instruction according to the pre-stored virtual machine management table, and sends the configuration instruction and configuration information to the virtual machine to be configured, where the configuration instruction Contains administrative user information for the virtual machine to be configured.

S504:待配置的虚拟机响应于配置指令根据预存的配置脚本和配置信息进行系统配置。S504: The virtual machine to be configured performs system configuration according to the pre-stored configuration script and configuration information in response to the configuration instruction.

在本发明实施例中,S501至S504实现的方法与图2实施例中S201至S202执行的方法和实现的效果相同,在此不再赘述。In the embodiment of the present invention, the method implemented in S501 to S504 has the same effect as the method implemented in S201 to S202 in the embodiment of FIG. 2 and will not be described again here.

图6为本发明实施例提供的虚拟机配置装置的结构示意图一。如图6所示,该虚拟机配置装置60包括:获取模块601,用于接收终端发送的配置请求,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;发送模块602,用于将所述配置信息发送至第二服务器,以使所述第二服务器根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,使得所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。Figure 6 is a schematic structural diagram of a virtual machine configuration device provided by an embodiment of the present invention. As shown in Figure 6, the virtual machine configuration device 60 includes: an acquisition module 601, configured to receive a configuration request sent by a terminal, and obtain the configuration information corresponding to the configuration request from the configuration database in response to the configuration request. A virtual machine table, an initialization user table, and an initialization file system information table are stored in the database; the sending module 602 is used to send the configuration information to the second server, so that the second server can adjust the configuration information according to the configuration information carried in the configuration information. The network address determines the virtual machine to be configured, generates a configuration instruction according to the pre-stored virtual machine management table, and sends the configuration instruction and the configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the The configuration instruction performs system configuration according to the pre-stored configuration script and the configuration information, and the configuration instruction includes management user information of the virtual machine to be configured.

在本实施例中,该虚拟机配置装置60可以采用上述实施例所述的方法,其技术方案及其技术效果相类似,此处不在赘述。In this embodiment, the virtual machine configuration device 60 can adopt the method described in the above embodiment. The technical solutions and technical effects thereof are similar and will not be described again here.

在一种可能的实现方式中,虚拟机配置装置60还包括:确定模块,用于根据负载均衡算法确定待连接的第二服务器,并将建立连接请求发送至所述待连接的第二服务器;若在预设时间段内未接收到所述待连接的第二服务器返回的建立连接响应,则将所述建立连接请求发送至其他任一第二服务器,并在接收到所述第二服务器返回的建立连接响应之后,执行将所述配置信息发送至第二服务器的步骤。该确定模块可以采用上述实施例所述的方法,其技术方案及其技术效果相类似,此处不在赘述。In a possible implementation, the virtual machine configuration device 60 further includes: a determining module, configured to determine a second server to be connected according to a load balancing algorithm, and send a connection establishment request to the second server to be connected; If the connection establishment response returned by the second server to be connected is not received within the preset time period, the connection establishment request is sent to any other second server, and after receiving the connection establishment response returned by the second server After the connection establishment response, the step of sending the configuration information to the second server is performed. The determination module may adopt the method described in the above embodiment, and its technical solutions and technical effects are similar and will not be described again here.

在一种可能的实现方式中,虚拟机配置装置60还包括:接收模块,用于接收终端发送的申请信息,根据所述申请信息确定配置需求参数,并将所述配置需求参数发送至终端,以使终端根据所述配置需求参数生成配置请求。该接收模块可以采用上述实施例所述的方法,其技术方案及其技术效果相类似,此处不在赘述。In a possible implementation, the virtual machine configuration device 60 further includes: a receiving module, configured to receive application information sent by the terminal, determine configuration requirement parameters based on the application information, and send the configuration requirement parameters to the terminal, So that the terminal generates a configuration request according to the configuration requirement parameters. The receiving module can adopt the method described in the above embodiment, and its technical solutions and technical effects are similar and will not be described again here.

图7为本发明实施例提供的虚拟机配置装置的结构示意图二。如图7所示,该虚拟机配置装置70包括:接收模块701,用于接收第一服务器发送的配置信息,所述配置信息为所述第一服务器根据终端发送的配置请求从配置数据库中获取的,其中所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;确定模块702,用于根据所述配置信息中携带的网络地址确定待配置的虚拟机,并根据预存的虚拟机管理表生成配置指令;发送模块703,用于将所述配置指令以及所述配置信息发送至待配置的虚拟机,以使所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。Figure 7 is a schematic second structural diagram of a virtual machine configuration device provided by an embodiment of the present invention. As shown in Figure 7, the virtual machine configuration device 70 includes: a receiving module 701, configured to receive configuration information sent by the first server. The configuration information is obtained by the first server from the configuration database according to the configuration request sent by the terminal. , wherein the configuration database stores a virtual machine table, an initialization user table and an initialization file system information table; the determination module 702 is used to determine the virtual machine to be configured according to the network address carried in the configuration information, and determine the virtual machine to be configured according to the pre-stored The virtual machine management table generates a configuration instruction; the sending module 703 is used to send the configuration instruction and the configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction according to the pre-stored The configuration script and the configuration information are used to configure the system, and the configuration instructions include the management user information of the virtual machine to be configured.

在本实施例中,该虚拟机配置装置70可以采用上述实施例所述的方法,其技术方案及其技术效果相类似,此处不在赘述。In this embodiment, the virtual machine configuration device 70 can adopt the method described in the above embodiment. The technical solutions and technical effects thereof are similar and will not be described again here.

在一种可能的实现方式中,虚拟机配置装置70还包括:生成模块,用于接收所述待配置的虚拟机发送的配置日志,所述配置日志是由所述待配置的虚拟机根据预存的配置脚本和所述配置信息进行系统配置时生成的,所述配置日志包括配置过程信息和配置结果;接收所述第一服务器发送的查询请求,响应于所述查询请求将所述配置日志发送至第一服务器,以使管理员调取第一服务器中存储的配置日志确认虚拟机的配置详情。该生成模块可以采用上述实施例所述的方法,其技术方案及其技术效果相类似,此处不在赘述。In a possible implementation, the virtual machine configuration device 70 further includes: a generation module configured to receive a configuration log sent by the virtual machine to be configured, where the configuration log is generated by the virtual machine to be configured according to a pre-stored The configuration script and the configuration information are generated when the system is configured, and the configuration log includes configuration process information and configuration results; receiving the query request sent by the first server, and sending the configuration log in response to the query request to the first server, so that the administrator can retrieve the configuration log stored in the first server to confirm the configuration details of the virtual machine. The generation module can adopt the method described in the above embodiment, and its technical solutions and technical effects are similar and will not be described again here.

图8为本发明实施例提供的服务器的硬件结构示意图一。如图8所示,本实施例的服务器包括:处理器801以及存储器802;其中Figure 8 is a schematic diagram 1 of the hardware structure of a server provided by an embodiment of the present invention. As shown in Figure 8, the server in this embodiment includes: a processor 801 and a memory 802; where

存储器802,用于存储计算机执行指令;Memory 802, used to store computer execution instructions;

处理器801,用于执行存储器存储的计算机执行指令,以实现上述实施例中第一服务器所执行的各个步骤。具体可以参见前述方法实施例中的相关描述。The processor 801 is configured to execute computer execution instructions stored in the memory to implement various steps performed by the first server in the above embodiment. For details, please refer to the relevant descriptions in the foregoing method embodiments.

可选地,存储器802既可以是独立的,也可以跟处理器801集成在一起。Optionally, the memory 802 can be independent or integrated with the processor 801 .

当存储器802独立设置时,该服务器还包括总线803,用于连接所述存储器802和处理器801。When the memory 802 is provided independently, the server also includes a bus 803 for connecting the memory 802 and the processor 801 .

图9为本发明实施例提供的服务器的硬件结构示意图二。如图9所示,本实施例的服务器包括:处理器901以及存储器902;其中Figure 9 is a schematic diagram 2 of the hardware structure of a server provided by an embodiment of the present invention. As shown in Figure 9, the server in this embodiment includes: a processor 901 and a memory 902; where

存储器902,用于存储计算机执行指令;Memory 902, used to store computer execution instructions;

处理器901,用于执行存储器存储的计算机执行指令,以实现上述实施例中第二服务器所执行的各个步骤。具体可以参见前述方法实施例中的相关描述。The processor 901 is configured to execute computer execution instructions stored in the memory to implement various steps performed by the second server in the above embodiment. For details, please refer to the relevant descriptions in the foregoing method embodiments.

可选地,存储器902既可以是独立的,也可以跟处理器901集成在一起。Optionally, the memory 902 can be independent or integrated with the processor 901 .

当存储器902独立设置时,该服务器还包括总线903,用于连接所述存储器902和处理器901。When the memory 902 is provided independently, the server also includes a bus 903 for connecting the memory 902 and the processor 901 .

本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上述实施例所述的虚拟机配置方法。Embodiments of the present invention also provide a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executable instructions, the virtual machine configuration as described in the above embodiments is implemented. method.

本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上图3和图4所述的虚拟机配置方法。Embodiments of the present invention also provide a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executable instructions, the virtualization as described in Figures 3 and 4 above is realized. Machine configuration method.

本发明实施例还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时,实现如上述实施例所述的虚拟机配置方法。An embodiment of the present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the virtual machine configuration method as described in the above embodiment is implemented.

本发明实施例还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时,实现如上图3和图4所述的虚拟机配置方法。An embodiment of the present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the virtual machine configuration method as described in Figures 3 and 4 is implemented.

在本发明所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, for example, multiple modules may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or modules, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to implement the solution of this embodiment.

另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个单元中。上述模块成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional module in various embodiments of the present invention can be integrated into a processing unit, or each module can exist physically alone, or two or more modules can be integrated into one unit. The units formed by the above modules can be implemented in the form of hardware or in the form of hardware plus software functional units.

上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的部分步骤。The above-mentioned integrated modules implemented in the form of software function modules can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute some steps of the methods described in various embodiments of the present application.

应理解,上述处理器可以是中央处理单元(Central Processing Unit,简称CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合发明所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。It should be understood that the above-mentioned processor can be a central processing unit (Central Processing Unit, referred to as CPU), or other general-purpose processor, digital signal processor (Digital Signal Processor, referred to as DSP), or application specific integrated circuit (Application Specific Integrated Circuit, (referred to as ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the invention can be directly embodied and executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

存储器可能包含高速RAM存储器,也可能还包括非易失性存储NVM,例如至少一个磁盘存储器,还可以为U盘、移动硬盘、只读存储器、磁盘或光盘等。The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, which may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.

总线可以是工业标准体系结构(Industry Standard Architecture,简称ISA)总线、外部设备互连(Peripheral Component Interconnect,简称PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,简称EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

上述存储介质可以是由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。存储介质可以是通用或专用计算机能够存取的任何可用介质。The above storage medium can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Except programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. Storage media can be any available media that can be accessed by a general purpose or special purpose computer.

一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于专用集成电路(Application Specific Integrated Circuits,简称ASIC)中。当然,处理器和存储介质也可以作为分立组件存在于电子设备或主控设备中。An exemplary storage medium is coupled to the processor such that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium may be located in Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may also exist as discrete components in an electronic device or a host control device.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Persons of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps including the above-mentioned method embodiments are executed; and the aforementioned storage media include: ROM, RAM, magnetic disks, optical disks and other media that can store program codes.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features can be equivalently replaced; and these modifications or substitutions do not deviate from the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention. scope.

Claims (13)

1.一种虚拟机配置方法,其特征在于,应用于第一服务器,包括:1. A virtual machine configuration method, characterized in that, applied to the first server, comprising: 接收终端发送的配置请求,其中,配置请求中包含虚拟机的文件系统配置参数、用户信息以及用户权限信息;Receive a configuration request sent by the terminal, where the configuration request contains the file system configuration parameters, user information and user permission information of the virtual machine; 响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;其中,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,包括:根据配置请求中包含的虚拟机的文件系统配置参数、用户信息以及用户权限信息,从虚拟机表、初始化用户表以及初始化文件系统信息表查找到对应的配置信息,根据所有已创建的虚拟机的网络地址为用户分配待配置的虚拟机,其中,配置信息包含待配置的虚拟机的网络地址;In response to the configuration request, the configuration information corresponding to the configuration request is obtained from a configuration database. The configuration database stores a virtual machine table, an initialization user table, and an initialization file system information table; wherein, in response to the configuration request, the configuration information corresponding to the configuration request is obtained from a configuration database. Obtaining the configuration information corresponding to the configuration request from the configuration database includes: according to the file system configuration parameters, user information and user permission information of the virtual machine included in the configuration request, from the virtual machine table, initialization user table and initialization file system information table Find the corresponding configuration information, and allocate virtual machines to be configured to users based on the network addresses of all created virtual machines, where the configuration information includes the network addresses of the virtual machines to be configured; 将所述配置信息发送至第二服务器,以使所述第二服务器根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,使得所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。Send the configuration information to a second server, so that the second server determines the virtual machine to be configured according to the network address carried in the configuration information, generates a configuration instruction according to a pre-stored virtual machine management table, and sends the The configuration instruction and the configuration information are sent to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system configuration according to the pre-stored configuration script and the configuration information, and the configuration instruction includes the to-be-configured virtual machine. Administrative user information for the configured virtual machine. 2.根据权利要求1所述的方法,其特征在于,在将所述配置信息发送至第二服务器之前,还包括:2. The method according to claim 1, characterized in that, before sending the configuration information to the second server, it further includes: 根据负载均衡算法确定待连接的第二服务器,并将建立连接请求发送至所述待连接的第二服务器;Determine the second server to be connected according to the load balancing algorithm, and send the connection establishment request to the second server to be connected; 若在预设时间段内未接收到所述待连接的第二服务器返回的建立连接响应,则将所述建立连接请求发送至其他任一第二服务器,并在接收到所述第二服务器返回的建立连接响应之后,执行将所述配置信息发送至第二服务器的步骤。If the connection establishment response returned by the second server to be connected is not received within the preset time period, the connection establishment request is sent to any other second server, and after receiving the connection establishment response returned by the second server After the connection establishment response, the step of sending the configuration information to the second server is performed. 3.根据权利要求1所述的方法,其特征在于,所述配置数据库为MySQL数据库,所述MySQL数据库为由第一服务器集群提供的主从同步数据库系统;3. The method according to claim 1, characterized in that the configuration database is a MySQL database, and the MySQL database is a master-slave synchronization database system provided by the first server cluster; 相应地,在所述从配置数据库中获取所述配置请求对应的配置信息之后,还包括:Correspondingly, after obtaining the configuration information corresponding to the configuration request from the configuration database, the method further includes: 将所述配置请求以及所述配置信息存储至所述主从同步数据库系统中。Store the configuration request and the configuration information in the master-slave synchronization database system. 4.根据权利要求1所述的方法,其特征在于,在所述接收终端发送的配置请求之前,还包括:4. The method according to claim 1, characterized in that, before receiving the configuration request sent by the terminal, it further includes: 接收终端发送的申请信息,根据所述申请信息确定配置需求参数,并将所述配置需求参数发送至终端,以使终端根据所述配置需求参数生成配置请求。Receive application information sent by the terminal, determine configuration requirement parameters based on the application information, and send the configuration requirement parameters to the terminal, so that the terminal generates a configuration request based on the configuration requirement parameters. 5.根据权利要求1至4任一项所述的方法,其特征在于,所述配置脚本用于配置连接虚拟机的账号密码、添加虚拟机用户和密码、添加虚拟机用户权限组、加载虚拟机硬盘信息、创建逻辑卷、配分文件系统以及保存操作日志中的至少一种。5. The method according to any one of claims 1 to 4, characterized in that the configuration script is used to configure the account password for connecting to the virtual machine, add the virtual machine user and password, add the virtual machine user permission group, load the virtual machine At least one of the following: machine hard disk information, creating logical volumes, allocating file systems, and saving operation logs. 6.一种虚拟机配置方法,其特征在于,应用于第二服务器,包括:6. A virtual machine configuration method, characterized in that it is applied to the second server and includes: 接收第一服务器发送的配置信息,所述配置信息为所述第一服务器根据终端发送的配置请求从配置数据库中获取的,其中所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;其中,配置请求中包含虚拟机的文件系统配置参数、用户信息以及用户权限信息;其中,所述第一服务器根据终端发送的配置请求从配置数据库中获取配置信息,包括:根据配置请求中包含的虚拟机的文件系统配置参数、用户信息以及用户权限信息,从虚拟机表、初始化用户表以及初始化文件系统信息表查找到对应的配置信息,根据所有已创建的虚拟机的网络地址为用户分配待配置的虚拟机,其中,配置信息包含待配置的虚拟机的网络地址;Receive configuration information sent by the first server. The configuration information is obtained by the first server from the configuration database according to the configuration request sent by the terminal, wherein the configuration database stores a virtual machine table, an initialization user table and an initialization file. System information table; wherein the configuration request includes the file system configuration parameters, user information and user permission information of the virtual machine; wherein the first server obtains configuration information from the configuration database according to the configuration request sent by the terminal, including: according to the configuration The file system configuration parameters, user information and user permission information of the virtual machine included in the request are found from the virtual machine table, initialization user table and initialization file system information table. Based on the network addresses of all created virtual machines Allocate a virtual machine to be configured to the user, where the configuration information includes the network address of the virtual machine to be configured; 根据所述配置信息中携带的网络地址确定待配置的虚拟机,并根据预存的虚拟机管理表生成配置指令;Determine the virtual machine to be configured according to the network address carried in the configuration information, and generate configuration instructions according to the pre-stored virtual machine management table; 将所述配置指令以及所述配置信息发送至待配置的虚拟机,以使所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。The configuration instruction and the configuration information are sent to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system configuration according to the pre-stored configuration script and the configuration information, and the configuration The instruction contains the administrative user information of the virtual machine to be configured. 7.根据权利要求6所述的方法,其特征在于,还包括:7. The method of claim 6, further comprising: 接收所述待配置的虚拟机发送的配置日志,所述配置日志是由所述待配置的虚拟机根据预存的配置脚本和所述配置信息进行系统配置时生成的,所述配置日志包括配置过程信息和配置结果;Receive a configuration log sent by the virtual machine to be configured. The configuration log is generated when the virtual machine to be configured performs system configuration according to the pre-stored configuration script and the configuration information. The configuration log includes the configuration process. Information and configuration results; 接收所述第一服务器发送的查询请求,响应于所述查询请求将所述配置日志发送至第一服务器,以使管理员调取第一服务器中存储的配置日志确认虚拟机的配置详情。Receive the query request sent by the first server, and send the configuration log to the first server in response to the query request, so that the administrator can retrieve the configuration log stored in the first server to confirm the configuration details of the virtual machine. 8.一种虚拟机配置装置,其特征在于,包括:8. A virtual machine configuration device, characterized in that it includes: 获取模块,用于接收终端发送的配置请求,其中,配置请求中包含虚拟机的文件系统配置参数、用户信息以及用户权限信息;响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;其中,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,包括:根据配置请求中包含的虚拟机的文件系统配置参数、用户信息以及用户权限信息,从虚拟机表、初始化用户表以及初始化文件系统信息表查找到对应的配置信息,根据所有已创建的虚拟机的网络地址为用户分配待配置的虚拟机,其中,配置信息包含待配置的虚拟机的网络地址;The acquisition module is configured to receive a configuration request sent by the terminal, where the configuration request includes the file system configuration parameters, user information and user permission information of the virtual machine; in response to the configuration request, obtain the configuration request corresponding to the configuration database from the configuration database. Configuration information, the configuration database stores a virtual machine table, an initialization user table, and an initialization file system information table; wherein, in response to the configuration request, obtaining the configuration information corresponding to the configuration request from the configuration database includes: according to the configuration The file system configuration parameters, user information and user permission information of the virtual machine included in the request are found from the virtual machine table, initialization user table and initialization file system information table. Based on the network addresses of all created virtual machines Allocate a virtual machine to be configured to the user, where the configuration information includes the network address of the virtual machine to be configured; 发送模块,用于将所述配置信息发送至第二服务器,以使所述第二服务器根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,使得所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。A sending module configured to send the configuration information to a second server, so that the second server determines the virtual machine to be configured according to the network address carried in the configuration information, and generates a configuration instruction according to a pre-stored virtual machine management table. and send the configuration instruction and the configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system configuration according to the pre-stored configuration script and the configuration information, the The configuration instruction contains the management user information of the virtual machine to be configured. 9.一种虚拟机配置装置,其特征在于,包括:9. A virtual machine configuration device, characterized by comprising: 接收模块,用于接收第一服务器发送的配置信息,所述配置信息为所述第一服务器根据终端发送的配置请求从配置数据库中获取的,其中所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;其中,配置请求中包含虚拟机的文件系统配置参数、用户信息以及用户权限信息;其中,所述第一服务器根据终端发送的配置请求从配置数据库中获取配置信息,包括:根据配置请求中包含的虚拟机的文件系统配置参数、用户信息以及用户权限信息,从虚拟机表、初始化用户表以及初始化文件系统信息表查找到对应的配置信息,根据所有已创建的虚拟机的网络地址为用户分配待配置的虚拟机,其中,配置信息包含待配置的虚拟机的网络地址;A receiving module, configured to receive configuration information sent by the first server. The configuration information is obtained by the first server from a configuration database according to the configuration request sent by the terminal, wherein the configuration database stores virtual machine tables, initialization The user table and the initialized file system information table; wherein the configuration request contains the file system configuration parameters, user information and user permission information of the virtual machine; wherein the first server obtains the configuration information from the configuration database according to the configuration request sent by the terminal , including: according to the file system configuration parameters, user information and user permission information of the virtual machine included in the configuration request, find the corresponding configuration information from the virtual machine table, initialization user table and initialization file system information table, and based on all created The network address of the virtual machine allocates the virtual machine to be configured to the user, where the configuration information includes the network address of the virtual machine to be configured; 确定模块,用于根据所述配置信息中携带的网络地址确定待配置的虚拟机,并根据预存的虚拟机管理表生成配置指令;A determination module, configured to determine the virtual machine to be configured based on the network address carried in the configuration information, and generate configuration instructions based on the pre-stored virtual machine management table; 发送模块,用于将所述配置指令以及所述配置信息发送至待配置的虚拟机,以使所述待配置的虚拟机响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置,所述配置指令中包含待配置的虚拟机的管理用户信息。A sending module, configured to send the configuration instruction and the configuration information to the virtual machine to be configured, so that the virtual machine to be configured responds to the configuration instruction and performs system processing according to the pre-stored configuration script and the configuration information. Configuration, the configuration instructions include the management user information of the virtual machine to be configured. 10.一种虚拟机配置系统,其特征在于,包括至少一台终端、至少两台第一服务器、至少两台第二服务器以及N台虚拟机,其中N为正整数:10. A virtual machine configuration system, characterized in that it includes at least one terminal, at least two first servers, at least two second servers, and N virtual machines, where N is a positive integer: 所述终端,用于根据客户端接收用户的配置请求;The terminal is used to receive the user's configuration request according to the client; 所述第一服务器,用于接收终端发送的配置请求,响应于所述配置请求从配置数据库中获取所述配置请求对应的配置信息,并将所述配置信息发送至第二服务器,所述配置数据库中存储有虚拟机表、初始化用户表以及初始化文件系统信息表;The first server is configured to receive the configuration request sent by the terminal, obtain the configuration information corresponding to the configuration request from the configuration database in response to the configuration request, and send the configuration information to the second server. The database stores virtual machine tables, initialized user tables, and initialized file system information tables; 所述第二服务器,用于根据所述配置信息中携带的网络地址确定待配置的虚拟机,根据预存的虚拟机管理表生成配置指令,并将所述配置指令以及所述配置信息发送至待配置的虚拟机,其中所述配置指令中包含待配置的虚拟机的管理用户信息;The second server is configured to determine the virtual machine to be configured according to the network address carried in the configuration information, generate a configuration instruction according to a pre-stored virtual machine management table, and send the configuration instruction and the configuration information to the virtual machine to be configured. The configured virtual machine, wherein the configuration instruction includes the management user information of the virtual machine to be configured; 所述待配置的虚拟机,用于响应于所述配置指令根据预存的配置脚本和所述配置信息进行系统配置。The virtual machine to be configured is configured to perform system configuration according to the pre-stored configuration script and the configuration information in response to the configuration instruction. 11.一种服务器,其特征在于,包括存储器和至少一个处理器;11. A server, characterized in that it includes a memory and at least one processor; 所述存储器用于存储计算机执行指令;The memory is used to store computer execution instructions; 至少一个处理器,用于执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如权利要求1至5任一项所述的虚拟机配置方法。At least one processor, configured to execute computer execution instructions stored in the memory, so that the at least one processor executes the virtual machine configuration method according to any one of claims 1 to 5. 12.一种服务器,其特征在于,包括存储器和至少一个处理器;12. A server, characterized by comprising a memory and at least one processor; 所述存储器用于存储计算机执行指令;The memory is used to store computer execution instructions; 至少一个处理器,用于执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如权利要求6或7所述的虚拟机配置方法。At least one processor, configured to execute computer execution instructions stored in the memory, so that the at least one processor executes the virtual machine configuration method according to claim 6 or 7. 13.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1至5任一项、或6至7任一项所述的虚拟机配置方法。13. A computer-readable storage medium, characterized in that computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executable instructions, the implementation of any one of claims 1 to 5, Or the virtual machine configuration method described in any one of 6 to 7.
CN202110616754.XA 2021-06-02 2021-06-02 Virtual machine configuration method, device, server and system Active CN113238835B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110616754.XA CN113238835B (en) 2021-06-02 2021-06-02 Virtual machine configuration method, device, server and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110616754.XA CN113238835B (en) 2021-06-02 2021-06-02 Virtual machine configuration method, device, server and system

Publications (2)

Publication Number Publication Date
CN113238835A CN113238835A (en) 2021-08-10
CN113238835B true CN113238835B (en) 2023-10-31

Family

ID=77136448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110616754.XA Active CN113238835B (en) 2021-06-02 2021-06-02 Virtual machine configuration method, device, server and system

Country Status (1)

Country Link
CN (1) CN113238835B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301771B (en) * 2021-12-23 2024-03-12 中国农业银行股份有限公司 Virtual machine configuration method and device and electronic equipment
CN115835305B (en) * 2022-11-09 2025-07-11 中国联合网络通信集团有限公司 UPF deployment method, device, equipment and medium
CN117215730B (en) * 2023-11-08 2024-02-23 北京火山引擎科技有限公司 Data transmission method, device, equipment and storage medium
CN117591248B (en) * 2024-01-18 2024-05-03 杭州筋斗腾云科技有限公司 Terminal system processing method based on containerized virtual machine and electronic equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110009A (en) * 2009-12-28 2011-06-29 中国移动通信集团公司 Method for deploying application in virtual platform and virtual platform manager
CN102932408A (en) * 2012-09-21 2013-02-13 中国电信股份有限公司云计算分公司 Management method and platform of server cluster
CN103297514A (en) * 2013-05-06 2013-09-11 北京启创卓越科技有限公司 Virtual machine management platform and virtual machine management method based on cloud infrastructure
CN104579887A (en) * 2013-10-16 2015-04-29 宇宙互联有限公司 Cloud gateway, cloud gateway creation and configuration system and method
CN104636189A (en) * 2015-02-25 2015-05-20 哈尔滨工业大学 Xen-based virtual machine deployment system and Xen-based virtual machine deployment method
CN106095526A (en) * 2016-06-06 2016-11-09 腾讯科技(深圳)有限公司 Virtual Server Cluster and the dispositions method of server, device and system
CN108089910A (en) * 2016-11-23 2018-05-29 北京国双科技有限公司 The method and apparatus for configuring virtual machine IP address
CN108287750A (en) * 2012-09-12 2018-07-17 格林伊登美国控股有限责任公司 System and method for the dynamic elasticity for providing liaison centre's resource
US10365935B1 (en) * 2008-09-23 2019-07-30 Open Invention Network Llc Automated system and method to customize and install virtual machine configurations for hosting in a hosting environment
CN110995705A (en) * 2019-12-03 2020-04-10 广州西麦科技股份有限公司 Method for remotely and safely accessing virtual machine
CN111104200A (en) * 2019-12-11 2020-05-05 秒针信息技术有限公司 Virtual machine management method, device, storage medium and server
CN112162825A (en) * 2020-10-12 2021-01-01 北京首都在线科技股份有限公司 Equipment configuration method, device, equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10365935B1 (en) * 2008-09-23 2019-07-30 Open Invention Network Llc Automated system and method to customize and install virtual machine configurations for hosting in a hosting environment
CN102110009A (en) * 2009-12-28 2011-06-29 中国移动通信集团公司 Method for deploying application in virtual platform and virtual platform manager
CN108287750A (en) * 2012-09-12 2018-07-17 格林伊登美国控股有限责任公司 System and method for the dynamic elasticity for providing liaison centre's resource
CN102932408A (en) * 2012-09-21 2013-02-13 中国电信股份有限公司云计算分公司 Management method and platform of server cluster
CN103297514A (en) * 2013-05-06 2013-09-11 北京启创卓越科技有限公司 Virtual machine management platform and virtual machine management method based on cloud infrastructure
CN104579887A (en) * 2013-10-16 2015-04-29 宇宙互联有限公司 Cloud gateway, cloud gateway creation and configuration system and method
CN104636189A (en) * 2015-02-25 2015-05-20 哈尔滨工业大学 Xen-based virtual machine deployment system and Xen-based virtual machine deployment method
CN106095526A (en) * 2016-06-06 2016-11-09 腾讯科技(深圳)有限公司 Virtual Server Cluster and the dispositions method of server, device and system
CN108089910A (en) * 2016-11-23 2018-05-29 北京国双科技有限公司 The method and apparatus for configuring virtual machine IP address
CN110995705A (en) * 2019-12-03 2020-04-10 广州西麦科技股份有限公司 Method for remotely and safely accessing virtual machine
CN111104200A (en) * 2019-12-11 2020-05-05 秒针信息技术有限公司 Virtual machine management method, device, storage medium and server
CN112162825A (en) * 2020-10-12 2021-01-01 北京首都在线科技股份有限公司 Equipment configuration method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于软件路由器的网络环境自动构建技术研究;张云;张云;I139-76 *

Also Published As

Publication number Publication date
CN113238835A (en) 2021-08-10

Similar Documents

Publication Publication Date Title
CN113238835B (en) Virtual machine configuration method, device, server and system
US11243792B2 (en) Image file conversion method and apparatus
US11886886B2 (en) System and method for runtime synchronization and authentication of pre-boot device drivers for a rescue operating system
WO2017067404A1 (en) Method of creating mirror file in logical volume, method of initiating virtual machine, and server
WO2018173164A1 (en) Data processing system
CN112306380B (en) A storage management method, device and computer storage medium
CN117591016A (en) Encrypted volume migration method, encrypted volume migration device, computer equipment and storage medium
CN107463404A (en) Increase the method and system of configuration file in a kind of system to virtual machine file
WO2021254280A1 (en) Disk mounting method and device, storage medium, and electronic device
CN111629044B (en) Cloud disk-based Windows operating system data roaming network structure and method thereof
WO2021135326A1 (en) Data backup method, apparatus and device, and medium
CN110515540B (en) Method and device for topology hard disk
WO2024165064A1 (en) Cloud phone hot starting method and cloud phone management platform
CN103713952A (en) Virtual disk distributed-memory method based on UFS (Universal Flash Storage)
KR101554554B1 (en) Method for driving verture machine and and system thereof
CN107861761B (en) A method and system for starting a physical host
CN113703676B (en) Method, device, equipment and medium for invoking hyperactive volumes
CN114675926A (en) Virtual machine attribute changing method and device, storage medium and electronic device
CN103870748A (en) Method and device for safety processing of virtual machine
WO2023092430A1 (en) Virtual machine initialization method and apparatus, terminal device, and storage medium
CN112463034A (en) Storage deployment method, device, electronic equipment and medium
CN113572849B (en) File access system and method
CN116302007B (en) Disk array firmware upgrade method, device, equipment, medium and disk array card
CN117972670A (en) Cloud container mirror image building method and device
US20250244984A1 (en) Automated deployment of resources using validated templates

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant