Virtual machine creation method and device, equipment, storage medium and product
By matching and selecting suitable electronic devices to deploy virtual machines, the problems of low virtual machine deployment flexibility and low resource utilization are solved, and efficient resource utilization and performance improvement are achieved.
Patent Information
- Application Number
- CN202411044783.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-07-31
AI Technical Summary
In the prior art, virtual machines have low deployment flexibility and low resource utilization, and cannot effectively utilize electronic devices equipped with designated processors and other processors, resulting in waste of resources.
By obtaining the configuration requirements information of the virtual machine to be created and the configuration information of the candidate electronic devices, matching and selecting, selecting suitable target electronic devices to deploy the virtual machine, so that the deployment of the virtual machine is no longer limited to fixed models, and improving resource utilization Rate.
It realizes the flexibility of virtual machine deployment and the improvement of resource utilization, avoids resource waste, and maintains or improves application performance.
Smart Images

Figure CN119065784A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and product for creating a virtual machine. Background Art
[0002] With the development of computer technology, virtual machine technology has been widely used in various fields due to its advantages such as efficient resource utilization, excellent isolation and strong security. Among them, virtual machines can be created and deployed on electronic devices, simulating complete computer systems through software, and realizing multiple independent and completely isolated computer environments on the same electronic device. Through virtual machine technology, users can quickly respond to business needs and perform multi-tasking.
[0003] At present, users can select the desired configuration from the virtual machine configuration options provided by the cloud service provider according to their own needs, and then the cloud service provider can create a virtual machine according to the configuration selected by the user and deploy it on a suitable electronic device. When deploying a virtual machine, the cloud service provider usually deploys it on a preset fixed model of electronic device. For example, if the user specifies the central processing unit (CPU) configuration of the virtual machine, the cloud service provider usually only selects one from the servers equipped with the CPU for deployment. Although this method simplifies the deployment process, it results in low flexibility in virtual machine deployment and low resource utilization. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device, storage medium and product for creating a virtual machine, which can deploy a virtual machine configured with a specified processor by a user in an electronic device equipped with the specified processor and other processors, so that the deployment of the virtual machine is no longer selected from electronic devices of fixed models, and the deployment is more flexible, which can also improve resource utilization to a certain extent.
[0005] In a first aspect, an embodiment of the present application provides a method for creating a virtual machine, comprising:
[0006] Acquire configuration requirement information of a virtual machine to be created, and configuration information corresponding to a plurality of candidate electronic devices, wherein the configuration requirement information includes configuration information of a designated processor required for the virtual machine to be created, and the candidate electronic device is equipped with the designated processor and other processors;
[0007] Matching the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices respectively, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information;
[0008] According to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors, a target electronic device is selected from the candidate electronic device set, and a virtual machine is created in the target electronic device.
[0009] In a second aspect, an embodiment of the present application provides a device for creating a virtual machine, including:
[0010] an acquisition unit, configured to acquire configuration requirement information of a virtual machine to be created, and configuration information corresponding to a plurality of candidate electronic devices, wherein the configuration requirement information includes configuration information of a designated processor required for the virtual machine to be created, and the candidate electronic device is equipped with the designated processor and other processors;
[0011] A matching unit, configured to match the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information;
[0012] The selection unit is used to select a target electronic device from the candidate electronic device set according to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors, and to create a virtual machine in the target electronic device.
[0013] In a possible implementation, the matching unit is used to match the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices, specifically to:
[0014] Matching the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices;
[0015] If the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device among the multiple candidate electronic devices, the target candidate electronic device is added to the candidate electronic device set.
[0016] In a possible implementation, the matching unit is used to match the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices, specifically to:
[0017] Matching the model information of the designated processor in the configuration information with the model information of the designated processor in multiple configuration information, and matching the resource requirements corresponding to each component with the idle resources of the corresponding component in the multiple configuration information;
[0018] If the model information of the designated processor in the configuration information is the same as the model information of the designated processor in the configuration information corresponding to the target candidate electronic device, and the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component, then it is determined that the hardware specifications of each component match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device.
[0019] In a possible implementation manner, the device further includes:
[0020] A determination unit, configured to determine the reserved resource requirements corresponding to each component according to a preset resource reservation rule and the resource requirements corresponding to each component; and determine the sum of the resource requirements corresponding to each component according to the resource requirements corresponding to each component and the reserved resource requirements corresponding to each component;
[0021] The matching unit is further configured to match the sum of resource requirements corresponding to each component with the idle resources of the corresponding component in the plurality of configuration information;
[0022] The determination unit is further used to determine that the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component if the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the sum of the resource requirements corresponding to each component.
[0023] In a possible implementation, the acquisition unit is further configured to acquire configuration information of a virtual machine deployed in the target candidate electronic device;
[0024] The determination unit is further used to determine a first part of candidate electronic devices in the target candidate electronic devices that do not meet preset compatibility rules based on the configuration requirement information and the configuration information of the virtual machines deployed in the target candidate electronic devices, and remove the first part of candidate electronic devices from the candidate electronic device set.
[0025] In a possible implementation, the acquisition unit is further configured to run a reference benchmark test through each candidate electronic device in the candidate electronic device set, and acquire load information of each candidate electronic device running the reference benchmark test;
[0026] The determining unit is further configured to remove a second part of candidate electronic devices from the candidate electronic device set if there are second part of candidate electronic devices that do not meet a preset load condition in the load information corresponding to each candidate electronic device included in the candidate electronic device set.
[0027] In a possible implementation, the selection unit is used to select a target electronic device from the candidate electronic device set according to resource usage of a designated processor of each candidate electronic device in the candidate electronic device set and resource usage of other processors, specifically to:
[0028] Acquire a first idle resource of a designated processor of each candidate electronic device in the candidate electronic device set, and a second idle resource of other processors;
[0029] Determining, according to the configuration information and the first idle resources, remaining idle resources of a designated processor of each candidate electronic device in the set of candidate electronic devices;
[0030] The target electronic device is selected from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources.
[0031] In a possible implementation manner, the selection unit is configured to select the target electronic device from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources, specifically to:
[0032] Acquire business configuration information associated with the configuration requirement information;
[0033] The preset business rule is matched with the business configuration information, and the target electronic device is selected from the candidate electronic devices whose preset business rule matches the business configuration information in the order of the resource difference from small to large.
[0034] In a possible implementation manner, the device further includes:
[0035] A monitoring unit, configured to monitor the performance data of the virtual machine and obtain a load value corresponding to the virtual machine;
[0036] A processing unit is used to adjust the resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information if it is monitored that the load value is greater than a preset load threshold.
[0037] In a possible implementation manner, the processing unit is used to adjust the resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information, specifically to:
[0038] If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is met, determining the migration requirement information according to the load value and the configuration requirement information;
[0039] A designated electronic device is selected from electronic devices other than the target electronic device among a plurality of candidate electronic devices according to the migration requirement information, and the virtual machine is migrated from the target electronic device to the designated electronic device.
[0040] In a possible implementation, the processing unit is configured to select a designated electronic device from other electronic devices other than the target electronic device among a plurality of candidate electronic devices according to the migration requirement information, specifically to:
[0041] Matching the migration requirement information with the configuration information corresponding to the other electronic devices respectively, to obtain a set of migration electronic devices whose configuration information matches the migration requirement information;
[0042] The designated electronic device is selected from the set of migrating electronic devices according to resource usage of designated processors of each migrating electronic device in the set of migrating electronic devices and resource usage of other processors.
[0043] In a possible implementation manner, the processing unit is used to adjust the resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information, specifically to:
[0044] If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is not satisfied, then according to the correspondence between the load value and the reference resource information and the load value, determining the reference resource information corresponding to the load value, the reference resource information including reference added resources corresponding to one or more components;
[0045] Resources are added according to the references corresponding to the one or more components, and hot-add processing is performed on the resources of the virtual machine.
[0046] In a possible implementation, the acquisition unit is further configured to acquire, if there is no candidate electronic device whose configuration information matches the configuration requirement information among the multiple candidate electronic devices, the specified configuration information corresponding to multiple specified candidate electronic devices, the multiple specified candidate electronic devices being only equipped with the specified processor;
[0047] The matching unit is further configured to match the configuration requirement information with configuration information corresponding to a plurality of designated candidate electronic devices respectively, to obtain a set of designated candidate electronic devices whose designated configuration information matches the configuration requirement information;
[0048] The selection unit is further configured to select a target designated electronic device from the candidate electronic device set according to resource usage of a designated processor of each designated candidate electronic device in the designated candidate electronic device set, and create the virtual machine in the target designated electronic device.
[0049] In a third aspect, an embodiment of the present application provides an electronic device, which includes one or more processors; and a memory for storing one or more computer programs, so that when the one or more computer programs are executed by the one or more processors, the electronic device implements the method for creating a virtual machine of the first aspect mentioned above.
[0050] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the method for creating a virtual machine of the first aspect.
[0051] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, a method for creating a virtual machine as in the first aspect is implemented.
[0052] In the technical solutions provided in some embodiments of the present application, when deploying a virtual machine, the configuration requirement information of the virtual machine to be created can be obtained, and the configuration requirement information includes the configuration information of the specified processor, and the configuration information corresponding to multiple candidate electronic devices is obtained, and the multiple candidate electronic devices are electronic devices equipped with the specified processor and other processors. Then the configuration requirement information can be matched with the configuration information corresponding to the multiple candidate electronic devices, and a set of candidate electronic devices whose configuration information matches the configuration requirement information can be obtained. According to the resource usage of the specified processor of each candidate electronic device in the candidate electronic device set, and the resource usage of other processors, a target electronic device can be selected from the candidate electronic device set, and a virtual machine can be created in the target electronic device to deploy the virtual machine in an electronic device equipped with a specified processor and other processors. It can be seen from this that the virtual machine configured with a specified processor by the user can be deployed in an electronic device equipped with a specified processor and other processors. Compared with selecting in an electronic device of a fixed model equipped with only a specified processor, the deployment of the virtual machine is more flexible and is also conducive to improving the utilization of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0054] Figure 1 It is a schematic diagram of the architecture of a virtual machine creation system provided in an embodiment of the present application;
[0055] Figure 2 It is a flowchart of a method for creating a virtual machine provided in an embodiment of the present application;
[0056] Figure 3 This is an architecture diagram of a virtual machine deployment device for matching provided in an embodiment of the present application;
[0057] Figure 4 is a timing diagram of a performance evaluation provided by an embodiment of the present application;
[0058] Figure 5 It is a timing diagram of an adaptability decision provided in an embodiment of the present application;
[0059] Figure 6 It is a schematic diagram of the architecture of a computing resource adaptive discriminator provided in an embodiment of the present application;
[0060] Figure 7 is a timing diagram of selecting a target electronic device provided by an embodiment of the present application;
[0061] Figure 8 It is a timing diagram of creating a virtual machine in a target electronic device provided by an embodiment of the present application;
[0062] Fig. 9 This is another flowchart of a method for creating a virtual machine provided in an embodiment of the present application;
[0063] Fig.10 This is a timing diagram of adjusting resources of a virtual machine provided in an embodiment of the present application;
[0064] Fig.11 It is a schematic diagram of the architecture of a hybrid deployment adapter provided in an embodiment of the present application;
[0065] Fig.12 It is a structural schematic diagram of a virtual machine creation device provided in an embodiment of the present application;
[0066] Fig.13 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] It should be noted in advance that, in order to enable those skilled in the art to better understand the technical solutions proposed in the embodiments of the present application, the embodiments of the present application will be combined with one or more drawings to clearly and completely describe the implementation of the technical solutions proposed in the embodiments of the present application. In addition, the various drawings shown in the embodiments of the present application are only exemplary illustrations, and for example, the execution order of the various steps in the drawings can be adaptively adjusted according to the actual application scenario. In addition, in the embodiments of the present application, the block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or these functional entities can be implemented in one or more hardware modules or integrated circuits, or these functional entities can be implemented in different networks and / or processor devices and / or microcontroller devices.
[0068] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0069] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0070] At present, in the process of deploying virtual machines, it is found that: users can select the desired virtual machine hardware configuration on the virtual machine configuration platform provided by the cloud service provider according to their own needs, and then the cloud service provider can create a virtual machine according to the configuration selected by the user and deploy it on a suitable electronic device. For example, the user can select the configuration of the specified processor of the virtual machine, and then the cloud service provider can usually choose from electronic devices equipped with only the specified processor and deploy the virtual machine on the selected electronic device. Although this deployment method can simplify the deployment process, it may ignore the fact that electronic devices equipped with the specified processor and other processors can also meet the configuration requirements of the virtual machine. When the electronic device deployed with the specified processor and other processors has idle resources of the specified processor, it may cause waste of resources of such electronic devices, resulting in low flexibility in virtual machine deployment and low resource utilization.
[0071] Based on this, an embodiment of the present application provides a method for creating a virtual machine, which can determine whether a virtual machine with a configuration of a specified processor selected by a user can be deployed in an electronic device equipped with the specified processor and other processors. If it can be deployed, one can be selected from the deployable electronic devices for deployment, that is, a virtual machine is created, so that the deployment of virtual machines is no longer limited to the fixed models provided by the cloud service provider, such as models only equipped with specified processors. The deployment of virtual machines is more flexible, which is conducive to reducing resource waste, improving resource utilization, and can maintain or improve application performance to a certain extent.
[0072] Based on the above description, please refer to Figure 1 , Figure 1 Schematic diagram of the architecture of a virtual machine creation system provided in an embodiment of the present application. Figure 1 As shown, the virtual machine creation system includes a user terminal 101, a virtual machine deployment device 102, a candidate electronic device 103 and a database 104. The user terminal 101 can be directly or indirectly connected to the virtual machine deployment device 102 by wired or wireless means, and the virtual machine deployment device 102 can be directly or indirectly connected to the candidate electronic device 103 by wired or wireless means. There can be multiple candidate electronic devices 103, and the virtual machine deployment device 102 can be directly or indirectly connected to each candidate electronic device 103 by wired or wireless means, and the configuration information corresponding to the candidate electronic device is stored in the database 104. It should be noted that Figure 1 The number and form of the devices shown are for example only and do not constitute a limitation on the embodiments of the present application. In some embodiments, the candidate electronic device 103 and the virtual machine deployment device 102 may be the same electronic device.
[0073] Among them, the user terminal 101 can be an electronic device, specifically a terminal device, and the terminal device can include but is not limited to: smart phones (such as Android phones, IOS phones, etc.), tablet computers, portable personal computers, mobile Internet devices (Mobile Internet Devices, MID), intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable devices, etc., which are not limited in this embodiment of the present application. The virtual machine deployment device 102 and the candidate electronic device 103 can be independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms, which are not limited in this embodiment of the present application. The database 104 can be a cloud storage database or a locally stored database, which is not limited in this embodiment of the present application.
[0074] Among them, the user terminal 101 can be integrated with a virtual machine deployment platform, such as a platform provided by a cloud service provider for obtaining the configuration requirements of the virtual machine that the user wants to deploy, and the user can enter the configuration of the virtual machine he wants in the virtual machine deployment platform through the terminal device 101. The virtual machine deployment device 102 can access the data stored in the database 104, such as obtaining the configuration information of the candidate electronic device 103 stored in the database 104. The candidate electronic device 103 is an electronic device provided by the cloud service provider for deploying virtual machines. The number of candidate electronic devices 103 can be multiple, and the hardware specifications of each candidate electronic device 103 can be different, and can be used to deploy virtual machines with different hardware specifications specified by the user.
[0075] The general process of creating a virtual machine provided by this application is as follows:
[0076] The virtual machine deployment device 102 can obtain the configuration requirement information of the virtual machine to be created input by the user through the user terminal 101, and the configuration requirement information may include the configuration information of the specified processor. The virtual machine deployment device 102 can obtain the configuration information corresponding to multiple candidate electronic devices 103 in the database used to store the configuration information of the candidate electronic device 103, and the multiple candidate electronic devices 103 can be electronic devices equipped with the specified processor and other processors. Furthermore, the virtual machine deployment device 102 can match the configuration requirement information with the configuration information corresponding to the multiple candidate electronic devices 103, and obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information. Furthermore, the virtual machine deployment device 102 can select a target electronic device from the candidate electronic device set according to the resource usage of the specified processor of each candidate electronic device in the candidate electronic device set, and the resource usage of other processors, and create a virtual machine in the target electronic device.
[0077] In one implementation, the configuration requirement information and configuration information can be stored in the blockchain, which can prevent the configuration requirement information and configuration information from being tampered with. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. It is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block.
[0078] It can be understood that the virtual machine creation system described in the embodiment of the present application is for the purpose of more clearly illustrating the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0079] Based on the above virtual machine creation system, the present application embodiment provides a virtual machine creation method. The virtual machine creation method described in the present application embodiment can be executed by an electronic device, which can be Figure 1 The virtual machine deployment device 102 in the virtual machine creation system shown. Figure 2 , Figure 2 1 is a flow chart of a method for creating a virtual machine provided in an embodiment of the present application. The method for creating a virtual machine includes the following steps S201 to S203:
[0080] S201: Obtain configuration requirement information of a virtual machine to be created, and configuration information corresponding to a plurality of candidate electronic devices.
[0081] In the embodiment of the present application, the virtual machine to be created refers to a virtual machine that has not been created yet, and can be a virtual machine that the user plans to create to perform a certain task, such as a specific cloud computing task. A virtual machine is a software-simulated computer system that can run multiple operating systems and applications on a physical computer. One or more virtual machines can be created and run on a physical computer. The resources of the physical computer, such as processors, memory, storage, and networks, can be abstracted into multiple virtual resources, and each virtual machine can independently access and use these virtual resources, as if running on an independent physical computer. Among them, the configuration requirement information refers to the information of the hardware resources of the virtual machine that the user wants to create, and can include the configuration information of each component, and each component can be, for example, a processor, memory, disk, etc. Among them, the configuration requirement information may include the configuration information of a specified processor, and the specified processor may be, for example, a CPU, and the configuration information of the CPU may include the model and performance indicators of the CPU, such as the number of cores of the CPU, and may also include information such as the non-uniform memory access (NUMA) structure of the CPU.
[0082] Exemplarily, the configuration requirement information input by the user may be "AMD xx model 8 cores 64GB", where AMD xx model is the model information of the CPU, 8 cores means that the required number of CPU cores is 8, and 64G refers to the memory size. In another exemplary embodiment, the configuration requirement information input by the user may also be "Intel Xeon Gold 6248R CPU (18 cores), 128GB memory, 1TB storage and 10Gbps network bandwidth", where Intel Xeon Gold 6248R is the model information of the CPU, 18 cores means that the required number of CPU cores is 18, 128GB refers to the memory size, 1TB storage refers to the size of the disk space, and 10Gbps refers to the network bandwidth size.
[0083] Among them, the candidate electronic device can be an electronic device for creating and running a virtual machine, such as the above-mentioned physical computer, which can be a physical server, and the candidate electronic device may have been deployed with a virtual machine, or may not have been deployed with a virtual machine. The candidate electronic device can be called a host machine, a mother machine, etc. in the scenario for creating and running a virtual machine. When the electronic device for deploying a virtual machine is called a mother machine, the virtual machine can be called a virtual machine sub-machine, a sub-machine, a virtual machine configured with CPU resources can be called a CPU virtual machine, and a virtual machine configured with graphics processor (Graphics Processing Unit, GPU) resources can be called a GPU virtual machine. Deploying both CPU virtual machines and GPU virtual machines on electronic devices can be understood as a scenario of mixed deployment of CPU and GPU. The candidate electronic device can be a physical server with a virtualized environment deployed, and the virtual machine can use some or all of the resources of the physical server. The resources of the candidate electronic device (such as a physical server) can be resources sold by a cloud service provider, and the user can purchase the resources required for the virtual machine created according to the plan, and then the cloud service provider can deploy the virtual machine on a candidate electronic device that meets the user's needs, that is, select an electronic device from multiple candidate electronic devices to create a virtual machine, and run the virtual machine to perform the task that the user wants to perform.
[0084] It should be noted that multiple candidate electronic devices may all be electronic devices equipped with designated processors and other processors. The designated processor may be a CPU, and other processors may be, for example, a GPU, or other types of processors, which are not limited in this application. The configuration information corresponding to multiple candidate electronic devices may be the hardware information of each candidate electronic device, which may include, for example, processor configuration, memory configuration, storage configuration, and network configuration, and may also include other configurations, which are not limited in this application. Specifically, the processor configuration may include, for example, the model, quantity, and performance index of the CPU and GPU, and the performance index may be the number of cores. The processor configuration may also include the NUMA structure of the CPU, etc. The memory configuration may include memory size, speed, etc. The storage configuration may include the read and write speed of the disk, etc. The network configuration may include performance indicators of the network interface and the network, such as network bandwidth, etc.
[0085] It is understandable that after the virtual machine deployment device obtains the configuration requirement information including only the configuration information of the specified processor, that is, the user only needs the resources of the specified processor (such as CPU), the electronic device that meets the user's needs can be selected from the candidate electronic devices equipped with only CPU for deployment. This deployment method may ignore the existence of sufficient and idle CPU resources in the server equipped with CPU and other processors (such as GPU). This is because in the diversified cloud computing environment, the user's demand for computing resources is diverse, especially in the utilization of GPU and CPU resources. In the context of hardware diversification and personalized computing needs, different CPU architectures, GPU models and their NUMA topology structures make resource configuration and optimization more complicated. In order to perform high-intensity graphics processing and parallel computing tasks, some users may purchase more GPU resources for deploying virtual machines to perform related tasks, so that there may be idle CPU resources in the server and no virtual machines are deployed, resulting in waste of resources and low resource utilization. In addition, this inflexible deployment method may also affect the economic benefits of cloud service providers. Therefore, in an embodiment of the present application, the virtual machine deployment device can first determine whether it can be deployed in an electronic device equipped with a CPU and a GPU based on the configuration requirement information. If it can be deployed in an electronic device equipped with a CPU and a GPU, it can be configured in the electronic device equipped with a CPU and a GPU to avoid wasting resources.
[0086] In a possible implementation, the virtual machine deployment device can provide a platform for a user to input the desired configuration requirement information, and the user can input the configuration of the virtual machine to be created based on the platform, so that the virtual machine deployment device can obtain the configuration requirement information of the virtual machine to be created. The virtual machine deployment device can also obtain the configuration information of the candidate electronic device equipped with the specified processor and other processors from the database storing the configuration information of all candidate electronic devices. The process of the virtual machine deployment device obtaining the configuration information of all candidate electronic devices can be called the process of collecting configuration information. The database can be called a hardware specification database, which stores the configuration information of all candidate electronic devices, and the configuration information of all candidate electronic devices can be stored in the database after each candidate electronic device obtains its own configuration information. Exemplarily, each candidate electronic device can integrate (install) software for hardware detection, and can obtain its own configuration information by running the hardware test software, and further store the obtained configuration information in the database. The hardware test software can be, for example, HWiNFO and CPU-Z, or other software or tools, which are not limited in this application.
[0087] In some embodiments, the virtual machine deployment device can also obtain the configuration information of each candidate electronic device through software or tools integrated with hardware testing, and store it in a database so that it can be obtained after obtaining the configuration requirement information of the virtual machine to be created. The virtual machine deployment device can be an electronic device with the ability to remotely access each candidate electronic device and communicate with it remotely. Exemplarily, the virtual machine deployment device can run a specific script or program, can interact with each candidate electronic device using a remote management protocol, and call appropriate commands or tools to obtain the configuration information of each candidate electronic device, and then store the obtained configuration information in a database, that is, automatically collect the configuration information of each candidate electronic device.
[0088] In another embodiment, each candidate electronic device may also be integrated (installed) with software for hardware detection, such as HWiNFO and CPU-Z, and each candidate electronic device may obtain its own configuration information by running the software for hardware detection. Then, each candidate electronic device may send its own configuration information to the virtual machine deployment device, which receives and stores it in a database.
[0089] S202: Match the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information.
[0090] In the embodiment of the present application, the purpose of matching the configuration requirement information with the configuration information corresponding to the multiple candidate electronic devices is to determine whether there are one or more electronic devices among the multiple candidate electronic devices that can provide resources that meet the user's needs. In this way, it is determined whether the virtual machine can be deployed on an electronic device among the multiple candidate electronic devices. Among them, the candidate electronic device set is a set of one or more candidate electronic devices whose configuration information matches the configuration requirement information, and each candidate electronic device in the candidate electronic device set can provide resources that meet the user's needs.
[0091] In a possible implementation, in the process of matching the configuration requirement information with the configuration information corresponding to the multiple candidate electronic devices, the deployment device of the virtual machine can specifically match the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the multiple candidate electronic devices. For example, if the configuration requirement information includes the configuration information of the CPU, and the configuration information can be used to indicate the hardware specifications of the CPU, then the hardware specifications of the CPU can be matched with the hardware specifications of the CPU in the configuration information corresponding to the multiple candidate electronic devices. For another example, if the configuration requirement information includes the hardware specifications of the memory, then the hardware specifications of the memory can be matched with the hardware specifications of the memory in the configuration information corresponding to the multiple candidate electronic devices. And so on, until the matching of the hardware specifications of all components in the configuration requirement components is completed.
[0092] After the hardware specifications of each component are matched respectively, the virtual machine deployment device can determine whether the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the configuration information corresponding to each candidate electronic device among multiple candidate electronic devices. If it is determined that the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the configuration corresponding to the target candidate electronic device among multiple candidate electronic devices, that is, the hardware configuration of the target candidate electronic device can meet the hardware requirements of the virtual machine that the user wants to deploy, then the target candidate electronic device can be added to the candidate electronic device set, so that when there are multiple candidate electronic devices in the candidate electronic device set, an electronic device can be further screened out for deploying the virtual machine. Among them, the target candidate electronic device can be an electronic device among multiple candidate electronic devices, which is a candidate electronic device whose hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the corresponding configuration information. The number of the target candidate electronic devices can be one or more.
[0093] Specifically, in the process of matching the hardware specifications of each component respectively, the virtual machine deployment device can match the model information of the processor specified in the configuration information included in the configuration requirement information with the model information of the processor specified in multiple configuration information (configuration information corresponding to multiple candidate electronic devices respectively), and specifically can filter out candidate electronic devices that are the same as the model information of the processor specified in the configuration information included in the configuration requirement information. Exemplarily, taking the configuration requirement information as "Intel Xeon Gold 6248R CPU (18 cores), 128GB memory, 1TB storage and 10Gbps network bandwidth" as an example, the model information of the CPU is Intel Xeon Gold 6248R, which can include the manufacturer Intel and the specific model of the CPU, then the virtual machine deployment device can filter out candidate electronic devices that are the same as the Intel Xeon Gold 6248R from the model information of the CPU in multiple configuration information.
[0094] Further, the virtual machine deployment device can match the resource requirements corresponding to each component with the idle resources of the corresponding components in the multiple configuration information, and specifically can screen out the candidate electronic devices whose idle resources of each component meet the resource requirements corresponding to each component. Among them, the resource requirements refer to the requirements of the hardware resources required by the virtual machine, which can be the resource requirements corresponding to the specified processor (CPU), memory, disk and network respectively. Idle resources refer to the resources that the candidate electronic device can provide for deploying the virtual machine, which can be the idle resources corresponding to the specified processor (CPU), memory, disk and network respectively. Exemplarily, taking the configuration requirement information of "Intel Xeon Gold 6248R CPU (18 cores), 128GB memory, 1TB storage and 10Gbps network bandwidth" as an example, the resource requirements of each component can include the resource requirements of the CPU as 18 cores, the resource requirements of the memory as 128GB, the resource requirements of the disk as 1TB, and the resource requirements of the network as 10Gbps. For example, if the idle resources of the CPU of a candidate electronic device are only 10 cores, or the memory is only 100GB, it is determined that the idle resources of each component in the candidate electronic device cannot meet the resource requirements corresponding to each component in the configuration requirement information. It should be noted that only the CPU and memory are used as examples here. In reality, the idle resources of each component must meet the corresponding resource requirements of each component.
[0095] Furthermore, when the model information of the processor specified in the configuration requirement information determined by the virtual machine deployment device is the same as the model information of the processor specified in the configuration information corresponding to the target candidate electronic device, and the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component, the virtual machine deployment device determines that the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device. Thus, the virtual machine deployment device completes the matching of the hardware specifications and can add the matched target candidate electronic device to the candidate electronic device set.
[0096] In a possible implementation, considering that after a virtual machine is created in a certain electronic device, the user may perform certain operations through the virtual machine, which will affect other virtual machines in the electronic device, so some resources need to be reserved to deal with this situation. Therefore, the virtual machine deployment device can determine the reserved resource requirements corresponding to each component according to the preset resource reservation rules and the resource requirements corresponding to each component. Among them, the preset resource reservation rules can be resource reservation rules configured in advance by the cloud service provider, which are used to determine the reserved resource requirements, and can specifically include the reserved resource requirements corresponding to each component, and the reserved resource requirements are the number of resources that need to be reserved for each specific component. For example, the resource reservation rule can be that 20% of the resources need to be reserved, and the reserved resource requirements corresponding to each component can be calculated according to the resource requirements corresponding to each component, such as the resource requirement of the CPU is 10 cores, and the reserved resource requirement is 2 cores. For another example, the resource reservation requirement can be that a specified number of resources need to be reserved, such as the resource reservation requirement of the memory is 15GB.
[0097] Furthermore, the virtual machine deployment device can determine the sum of resource requirements corresponding to each component according to the resource requirements corresponding to each component and the reserved resource requirements corresponding to each component. Specifically, the resource requirements corresponding to each component and the reserved resource requirements corresponding to each component can be summed up, such as adding the above 10 cores and 2 cores to obtain a total resource requirement of 12 cores. The virtual machine deployment device can match the sum of resource requirements corresponding to each component with the idle resources of the corresponding components in multiple configuration information. Specifically, it can be determined whether there are multiple candidate electronic devices in the configuration information corresponding to the target candidate electronic device, and the idle resources of each component meet the sum of resource requirements corresponding to each component. For example, if the idle resources of the CPU of a candidate electronic device still have 30 cores, then the candidate electronic device is determined to be the target candidate electronic device, and the idle resources of each component in its corresponding configuration information meet the resource requirements corresponding to each component. It should be noted that only the CPU is used as an example here for explanation, and the idle resources of each component actually need to meet the sum of resource requirements corresponding to each component. Thus, the virtual machine deployment device completes conflict detection and can detect whether there are enough reserved resources.
[0098] Among them, the virtual machine deployment device can obtain the idle resources of each candidate electronic device by triggering the execution of relevant commands to each candidate electronic device or by running specific tools. For example, the virtual machine deployment device can view the total memory and available memory of the candidate electronic device by sending the free-m command or the cat / proc / meminfo command, or trigger the execution of the df-h command to view the free space of the disk, and can also view the CPU utilization through specific tools to estimate the number of idle cores. For another example, the virtual machine deployment device can determine the idle resources of the candidate electronic device based on the configuration information of each candidate electronic device and the resource information that has been allocated to the deployed virtual machine. The resource information of the deployed virtual machine can be stored in the database as the configuration information of the deployed virtual machine, and the virtual machine deployment device can obtain it from the database (such as the above-mentioned hardware specification database).
[0099] In one possible implementation, when considering deploying a virtual machine on an electronic device equipped with a CPU and a GPU, it may be necessary to consider whether the CPU virtual machine that the current user wants to deploy is compatible with the virtual machine already deployed on the electronic device, that is, to perform a compatibility check. Specifically, the virtual machine deployment device can obtain the configuration information of the virtual machine deployed in the target candidate electronic device after adding the target candidate electronic device to the candidate electronic device set. The configuration information of the deployed virtual machine may include resource information of the virtual machine, such as the specific number of resources allocated to the virtual machine. The configuration information of the deployed virtual machine may also include the version of the driver, the firmware version, the operating system, and other necessary software information, etc., and may also include other information, such as whether information about special components is included.
[0100] Furthermore, the virtual machine deployment device can determine the first part of the candidate electronic devices in the target candidate electronic devices that do not meet the preset compatibility rules based on the configuration requirement information and the configuration information of the virtual machines deployed in the target candidate electronic devices. Among them, the configuration requirement information also includes information about the driver, firmware version, operating system and other necessary software. The preset compatibility rules can include rules for determining whether the operating system, driver and other necessary software support the hardware specifications of the current candidate electronic device, and can also include rules for determining whether there is incompatibility between the virtual machine to be created, that is, the virtual machine to be created and the virtual machine already deployed on the target candidate electronic device.
[0101] Exemplarily, if the virtual machine deployment device determines that a driver included in the configuration requirement information, such as a driver for a network card, has a compatibility difference with the network hardware of the target candidate electronic device, then deploying the virtual machine on the candidate electronic device may cause network instability, packet loss or connection problems. Therefore, after the virtual machine deployment device performs a compatibility analysis based on the configuration information of the candidate electronic device, it can be determined that the target candidate electronic device does not meet the preset compatibility rules, and the target candidate electronic device is used as the first part of the candidate electronic devices. In another exemplary embodiment, if the virtual machine deployment device determines that the target candidate electronic device contains a specific component, such as a component related to the network rate, and the virtual machine to be deployed does not include the component, if the package does not contain this component, it may cause incompatibility, then deploying the virtual machine on the candidate electronic device may cause the network of the virtual machine to be interrupted at any time. Therefore, the virtual machine deployment device can determine that the target candidate electronic device does not meet the preset compatibility rules, and use the target candidate electronic device as the first part of the candidate electronic devices.
[0102] Furthermore, the virtual machine deployment device can remove the first part of candidate electronic devices from the candidate electronic device set. Removing the first part of candidate electronic devices from the candidate electronic device set means removing target candidate electronic devices that do not meet the preset compatibility rules from the candidate electronic device set, and the remaining target candidate electronic devices in the candidate electronic device set are all electronic devices that meet the preset compatibility rules. Thus, the virtual machine deployment device completes the application of the compatibility rules, and can more comprehensively check and ensure the long-term compatibility between the operating system, driver and other necessary software corresponding to the virtual machine to be deployed and the hardware configuration of the candidate electronic device, and ensure that the deployment of the virtual machine will not affect the operation of other virtual machines deployed in the electronic device.
[0103] Please also read Figure 3 , Figure 3 This is an architecture diagram of a virtual machine deployment device matching provided in an embodiment of the present application. Figure 3As shown, the virtual machine deployment device can obtain the configuration requirement information input by the user, and obtain the configuration information corresponding to multiple candidate electronic devices in the hardware specification database. Furthermore, the virtual machine deployment device can match the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices to obtain a matching result, such as obtaining the above-mentioned set of candidate electronic devices. Furthermore, the virtual machine deployment device can apply preset compatibility rules to perform a compatibility check and obtain a rule application result, such as screening out the first part of candidate electronic devices. The virtual machine deployment device can also determine whether multiple candidate electronic devices have sufficient reserved resources based on preset resource reservation rules and configuration requirement information to achieve conflict detection. Among them, the present application does not limit the execution order of the virtual machine deployment device to apply preset compatibility rules and determine whether there are sufficient reserved resources, which can be determined according to the specific implementation scenario and the order of the scripts (programs) configured by the cloud service provider.
[0104] In one possible implementation, after matching and compatibility verification, the virtual machine deployment device can perform performance evaluation on each candidate electronic device in the candidate electronic device set to perform load evaluation. Specifically, the virtual machine deployment device can simulate the deployment of the virtual machine to be deployed through each candidate electronic device in the candidate electronic device set, and fill up the virtual machine to test the load information of the candidate electronic device in this case. The virtual machine deployment device can run specific benchmark software through each candidate electronic device in the candidate electronic device set to simulate the load of deploying the virtual machine on the candidate electronic device through the reference benchmark test in the benchmark software for evaluating the computing power of the candidate electronic device, that is, the virtual machine deployment device obtains the load information of each candidate electronic device running the reference benchmark test.
[0105] Among them, the benchmark software may be, for example, Cinebench, 3DMark, PassMark, etc., which is not limited in this application. The reference benchmark test may be, for example, a CPU test item, a graphics test item, or a comprehensive test item. The load information may include CPU usage, memory usage, disk I / O, etc. The virtual machine deployment device may determine whether the load information corresponding to each candidate electronic device included in the candidate electronic device set meets the preset load condition, which may be a threshold value of a specific load indicator set for the load information, and the preset load condition may be pre-configured by the cloud service provider. For example, the CPU usage may be lower than xx, the available memory may be greater than xxGB, etc. If the virtual machine deployment device determines that there is a second part of candidate electronic devices that do not meet the preset load conditions in the load information corresponding to each candidate electronic device included in the candidate electronic device set, that is, the simulated load information is too high, which may affect the operation of the deployed virtual machine, then such candidate electronic device is determined to be the second part of the electronic device and is removed from the candidate electronic device set.
[0106] In some embodiments, the virtual machine deployment device simulates the deployment of the virtual machine to be deployed, and when the virtual machine is fully used, it can also be achieved by running performance evaluation tools on the candidate electronic device. These tools can simulate various types of network requests, database operations, etc., to simulate the load that may be generated when the virtual machine is deployed on the candidate electronic device. Among them, the performance evaluation tool can be, for example, LoadRunner, JMeter, etc., and this application does not limit this.
[0107] Please also read Figure 4 , Figure 4 is a timing diagram of a performance evaluation provided by an embodiment of the present application, such as Figure 4 As shown, first, the virtual machine deployment device can select benchmark software for simulating virtual machines being deployed on candidate electronic devices, such as Cinebench, 3DMark, PassMark, etc. These benchmark software can be used to simulate the load situation when the candidate electronic device under test is deployed and fully loaded. Then, the virtual machine deployment device can run the reference benchmark test provided by the benchmark software through each candidate electronic device in the candidate electronic device set, and obtain the load information. Then, the virtual machine deployment device can analyze the test results, that is, analyze the load information, and obtain the performance report of the candidate electronic device, such as high load in xx case, low load in xx case, and the load situation of each specific component. Further, the virtual machine deployment device can judge the load information corresponding to each candidate electronic device based on the preset load condition to determine the second part of the candidate electronic devices. Then, the virtual machine deployment device can perform resource matching, specifically matching with existing resources (candidate electronic devices in the candidate electronic device set), that is, removing the second part of the candidate electronic devices from the candidate electronic device set. Finally, the virtual machine deployment device can generate an evaluation result, that is, the virtual machine can be deployed in any candidate electronic device among the candidate electronic devices in the candidate electronic device set except the second part of the candidate electronic devices. Through this more accurate benchmark test, it can be ensured that the selection of candidate electronic devices and the resource allocation of the electronic devices specifically determined for deploying the virtual machines are more consistent with the actual workload of the virtual machines.
[0108] The virtual machine deployment device can determine whether to deploy the virtual machine on the candidate electronic device equipped with a CPU and a GPU based on the configuration information, configuration requirement information and the above evaluation results corresponding to the multiple candidate electronic devices, so as to determine whether the CPU virtual machine and the GPU virtual machine are suitable for mixed deployment on the same electronic device. Figure 5 , Figure 5 FIG. 1 is a timing diagram of an adaptability decision provided in an embodiment of the present application. Figure 5As shown, the virtual machine deployment device can obtain configuration requirement information and configuration information corresponding to multiple candidate electronic devices, and then can match hardware specifications, design algorithms for compatibility checks (application of compatibility rules), and performance evaluation. Among them, the matching of hardware specifications, the application of compatibility rules, and performance evaluation can be understood as the definition and application of preset logical rules to provide decision support for whether to deploy the virtual machine on an electronic device equipped with a CPU and a GPU in the future.
[0109] Furthermore, the virtual machine deployment device can make a hybrid deployment judgment. If the virtual machine deployment device determines that the candidate electronic device exists in the final set of candidate electronic devices, it determines that it is suitable for hybrid deployment, and then generates an adaptability report. The adaptability report may include the candidate electronic devices in the candidate electronic device set, as well as the above-mentioned hardware specification matching, compatibility rule application and performance evaluation results. Furthermore, the virtual machine deployment device can execute the decision, that is, execute the deployment of the virtual machine. After the virtual machine is deployed, the virtual machine can be monitored, such as monitoring performance data, and subsequent optimization. On the contrary, if the virtual machine deployment device determines that it is not suitable for hybrid deployment when it determines that there are no candidate electronic devices in the final set of candidate electronic devices, it will make improvement suggestions, such as outputting components with mismatched hardware specifications and corresponding resources, specific rules for compatibility mismatch, and performance evaluation results. Furthermore, the decision can be rejected and the deployment of the virtual machine on an electronic device equipped with a CPU and a GPU will not be executed.
[0110] It should be noted that the process of determining the set of candidate electronic devices based on the configuration information of the candidate electronic devices can be a script or program run by the virtual machine deployment device, which can be understood as a code-level implementation. The program can be called a computing resource adaptive discriminator, which can automatically evaluate whether the hardware environment of the candidate electronic device is suitable for the mixed deployment of CPU virtual machines and GPU virtual machines based on the configuration requirement information. Please refer to Figure 6 , Figure 6 Schematic diagram of the architecture of a computing resource adaptive discriminator provided in an embodiment of the present application. Figure 6 As shown, the computing resource adaptive discriminator is mainly used to perform three operations, among which:
[0111] The first part is the collection of configuration information, that is, obtaining the configuration information corresponding to the candidate electronic device, such as the CPU / GPU model, the performance indicators of each component, the NUMA topology of the processor, the memory size and memory speed, the read and write speed of the disk, and the performance parameters of the network, such as the network bandwidth, etc. The second part is the compatibility check, which can specifically include checking whether the software supports the hardware specifications of the candidate electronic device, such as whether the operating system, driver, firmware version and other necessary software support the hardware specifications of the candidate electronic device, and can also analyze the compatibility between virtual machines, such as whether there is incompatibility between the virtual machine and the virtual machine already deployed on the candidate electronic device. The third part is performance evaluation, which can simulate the load information of the virtual machine deployed on the candidate electronic device by running the benchmark software, and perform resource matching. The resource matching can also be called computing power demand matching, that is, whether the load information obtained by the performance evaluation of different candidate electronic devices meets the preset load rules, so as to finally obtain the adaptability decision, that is, determine the final set of candidate electronic devices, or it is not suitable for mixed deployment, there is no candidate electronic device set or the candidate electronic device set does not include any candidate electronic device.
[0112] S203: Select a target electronic device from the candidate electronic device set according to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors, and create a virtual machine in the target electronic device.
[0113] In an embodiment of the present application, the resource usage of the designated processor may be the number of allocated cores and the number of unallocated cores of the designated processor (CPU). Similarly, the resource usage of other processors (GPU) may refer to the number of allocated cores and the number of unallocated cores of other processors (GPU). The target electronic device is the electronic device on which the virtual machine is finally determined to be deployed, that is, the electronic device on which the virtual machine finally lands. Specifically, in the process of selecting the target electronic device from the set of candidate electronic devices, the virtual machine deployment device may specifically obtain the first idle resources of the designated processor of each candidate electronic device in the set of candidate electronic devices, and the second idle resources of other processors. Then, the virtual machine deployment device may determine the remaining idle resources of the designated processor of each candidate electronic device in the set of candidate electronic devices based on the configuration information and the first idle resources, and select the target electronic device from the set of candidate electronic devices based on the resource difference between the remaining idle resources and the second idle resources.
[0114] Among them, the first idle resource may refer to the number of cores of the CPU that are not allocated to other virtual machines, and the second idle resource may refer to the number of cores of the GPU that are not allocated to other virtual machines. The remaining idle resources refer to the number of remaining cores of the CPU after the deployment if the virtual machine is deployed in the candidate electronic device, and the remaining idle resources may be the difference between the first idle resources and the numerical value of the resource requirements of the CPU in the configuration information. The resource difference may refer to the difference in the number of cores between the remaining idle resources and the second idle resources. The virtual machine deployment device can select a target electronic device from the set of candidate electronic devices based on the resource difference. It should be noted that the target electronic device is selected here to select an optimal combination of CPU and GPU, and the selection based on the idle resources of the two is to determine whether the remaining resources of the CPU and GPU are convenient for the subsequent deployment of new virtual machines after the virtual machine is deployed in the candidate electronic device, so as to sell the remaining resources to other users to increase the economic benefits of the cloud service provider.
[0115] Specifically, the virtual machine deployment device can obtain the business configuration information associated with the configuration requirement information, and match the preset business rules with the business configuration information. Among them, the business configuration information can be configuration information related to the user's business, for example, the geographical information corresponding to the electronic device where the user requires the deployment of the virtual machine, that is, the city where the electronic device is located. For another example, whether the user is a customer with a specific identity of the cloud service provider, such as a VIP customer, etc. Matching the preset business rules with the business configuration information can be understood as packing to select the best candidate electronic device from the candidate electronic device set. In an embodiment of the present application, packing (packing scheduling) means that by setting multiple filters (filters), each filter can correspond to a preset business rule, and the business configuration information is filtered through multiple filters to obtain a candidate electronic device whose preset business rules match the business configuration information. Exemplarily, for example, the preset business rule of the first filter can be whether the geographical information of the candidate electronic device is Beijing, the preset business rule of the second filter can be whether the user is a user in the whitelist, and the preset business rule of the third filter can be whether there is a candidate electronic device reserved for the user. The preset business rules can be set in advance by the cloud service provider according to the screening logic, and this application does not limit this. Thus, the virtual machine deployment device can screen out candidate electronic devices whose preset business rules match the business configuration information.
[0116] Furthermore, the virtual machine deployment device can select a target electronic device from the candidate electronic devices that match the preset business rules and business configuration information in the order of resource difference from small to large. Among them, the resource difference is the numerical difference between the remaining idle resources of the designated processor of the candidate electronic device and the second idle resources of other processors, and the target electronic device is the electronic device that is finally determined to deploy the virtual machine. According to the order of resource difference from small to large, it can be understood that the more average the number of cores remaining in the CPU and GPU (the smaller the resource difference), the more conducive it may be to continue to deploy new virtual machines in the future, thereby improving the economic benefits of the cloud service provider. Therefore, the virtual machine deployment device can select an electronic device as the target electronic device from the candidate electronic device set based on the order of resource difference from small to large, and create a virtual machine in the target electronic device.
[0117] In some embodiments, the virtual machine deployment device can select a target electronic device from the candidate electronic device set according to a preset resource ratio condition and a resource difference from the candidate electronic devices whose preset business rules match the business configuration information. The preset resource ratio condition can be the best combination of resources required for the subsequent deployment of the virtual machine. The virtual machine deployment device can also sort the candidate electronic devices whose preset business rules match the business configuration information according to the remaining idle resources of the designated processor and the second idle resources of other processors, as well as a certain algorithm, so as to determine that the remaining resources can facilitate the subsequent further deployment of the virtual machine.
[0118] In some embodiments, the virtual machine deployment device may select, from the candidate electronic device set, a candidate electronic device whose preset business rules match the business configuration information as the target electronic device in the order of resource difference from small to large. In other words, the virtual machine deployment device may first make a judgment based on the resource difference, and then match the preset business rules with the business configuration information, or may first match the preset business rules with the business configuration information, and then make a judgment based on the resource difference, which is not limited in this application.
[0119] Please also read Figure 7 , Figure 7 is a timing diagram of selecting a target electronic device provided by an embodiment of the present application, such as Figure 7As shown, the process of selecting a target electronic device from a set of candidate electronic devices can be called a resource mapping process. The virtual machine deployment device can first obtain the business configuration information associated with the configuration requirement information of the virtual machine, and then take inventory of the resources of the candidate electronic devices, that is, obtain a set of candidate electronic devices. Further, the virtual machine deployment device can evaluate the specified processor and other processor combinations, for example, based on the resource difference between the remaining idle resources of the CPU and the second idle resources of the GPU, and select the optimal candidate electronic device in a box scheduling manner, that is, select the target electronic device. If the preset business rules are matched with the business configuration information, in the process of boxing and selecting the target electronic device, the preset business rules may include multiple rule filters, and the virtual machine deployment device can determine whether all business requirements (business configuration information) of the virtual machine to be created are met based on the matching results between the business configuration information and the multiple filters in the preset business rules. If so, the virtual machine deployment device can perform resource mapping.
[0120] Specifically, the virtual machine deployment device can map the resource requirements of each component of the virtual machine to be created to the resources of the corresponding components of the target electronic device, that is, determine the resources specifically allocated to the virtual machine to be created. For example, if the resource requirement of the designated processor of the virtual machine to be created is 10 cores, it can be mapped to the 6th to 16th cores of the idle resources of the designated processor of the target electronic device. Similarly, the virtual machine deployment device can make the same allocation of the idle resources of the memory and the idle resources of the storage (idle resources of the disk) based on the configuration requirement information until the resource mapping of each component is completed. The above-mentioned entire resource mapping process can be a resource mapping algorithm designed by the management personnel of the cloud service provider to map the resource requirements of the virtual machine to the physical hardware resources of the target electronic device. Furthermore, the virtual machine deployment device can create a virtual machine in the target electronic device, that is, produce a virtual machine.
[0121] In a possible implementation, the target electronic device may be integrated with a virtualization management platform, such as VMware vSphere, KVM, etc., to automatically execute the virtual machine creation and configuration process, and automate the configuration of various components, such as automating the configuration of the network and storage. After the virtual machine is created, the performance and connectivity of the virtual machine can also be tested through connectivity to ensure the performance and connectivity of the virtual machine. Please also refer to Figure 8 , Figure 8 is a timing diagram of creating a virtual machine in a target electronic device provided by an embodiment of the present application, such as Figure 8As shown, when the virtual machine deployment device starts the automated deployment, it can create a virtual machine through the virtual machine management platform based on the integrated virtualization management platform. The target electronic device can be integrated with virtualization management platforms such as VMware vSphere, KVM, etc. Taking VMware vSphere as an example, the virtualization management platform integrated in the target electronic device can create a virtual machine through the vSphere application programming interface (Application Programming Interface, API) based on the written script, and configure the mapped resources to the created virtual machine. The virtual machine deployment platform can also manage the virtualization environment through a graphical interface through a management console, such as vSphere Client, and create and configure virtual machines based on the graphical interface. Specifically, the hardware specifications of the virtual machine can be configured, such as CPU, memory, disk, and network.
[0122] For another example, taking the virtualization platform integrated in the target electronic device as KVM, the target electronic device is installed with software packages of libvirt and qemu-kvm, wherein libvirt is a library and daemon that provides a unified interface for virtualization technology, and qemu-kvm is a branch of QEMU, which refers to a user space component used to simulate hardware in user space and work with the KVM kernel module to achieve virtualization. The virtual machine deployment device can define an Extensible Markup Language (XML) file of the virtual machine, which describes the configuration of the virtual machine, configures the mapped resources to the created virtual machine, and the XML file can configure the hardware specifications of the virtual machine, which may specifically include CPU, memory, disk, and network, etc. The virtual machine deployment device can load the XML file to create a virtual machine through the virsh command line tool or through the virt-manager graphical interface tool.
[0123] Furthermore, the virtual machine deployment device can start the virtual machine and install the operating system. The virtual machine deployment device can connect to the virtual machine through a console or a remote management tool, and install the operating system according to the prompts of the operating system installation program. The startup of the virtual machine usually involves an image file based on the International Organization for Standardization (ISO) format, and installation by running the operating system installation program. The virtual machine deployment device can also trigger the installation of a driver suitable for the virtualization environment in the virtual machine to ensure that the virtual machine can fully utilize the hardware resources provided by the target electronic device. The virtual machine deployment device can also trigger the installation of related tools in the virtual machine, such as tools for managing virtual machines, so that the virtual machine can be monitored and managed from the outside.
[0124] Furthermore, the virtual machine deployment device can trigger a test of the performance and network connection capabilities of the virtual machine, such as evaluating the performance of the virtual machine through a performance test. The performance test can be specifically used to determine the performance of the virtual machine when processing different workloads to ensure that it meets the needs of the tasks to be performed by the user. The performance test can be a preset benchmark test, for example, it can include a CPU benchmark test, a memory performance test, a disk performance test, and a network throughput test, etc., to obtain a test result, which can include CPU usage, memory usage, disk read and write speed, and network latency / throughput, etc., and then the virtual machine deployment device can determine whether the performance test meets expectations based on relevant evaluation criteria, that is, determine whether the test passes. The virtual machine deployment device can test the connectivity of the virtual machine with the external network or other virtual machines by triggering commands such as ping to obtain test results, and can determine whether the connectivity test result passes based on relevant evaluation criteria.
[0125] Furthermore, the virtual machine deployment device can determine whether the virtual machine has passed the test based on the test results obtained from the performance test of the virtual machine and the connectivity test results obtained from the network connection capability test. If the virtual machine passes the test, the creation of the virtual machine is completed. On the contrary, if the virtual machine test fails, the modification is rolled back, that is, the configuration requirement information is re-matched with the configuration information corresponding to the multiple candidate electronic devices, so as to select an electronic device as the target electronic device for creating the virtual machine again, until a virtual machine that passes the test is created, and, if the virtual machine test fails, an error is reported and the current process of continuing to select candidate electronic devices is terminated.
[0126] In a possible implementation, after the virtual machine deployment device matches the configuration information corresponding to the multiple candidate electronic devices with the configuration requirement information, if there is no candidate electronic device whose configuration information matches the configuration requirement information, it can be understood that there is no candidate electronic device set, or there is a candidate electronic device set, but the set does not include any candidate electronic device, which means that it is not suitable to deploy the virtual machine on an electronic device equipped with a CPU and a GPU, that is, it is not suitable for the mixed deployment of CPU virtual machines and GPU virtual machines. The virtual machine deployment device can obtain the specified configuration information corresponding to the multiple specified candidate electronic devices, and the multiple specified candidate electronic devices are only equipped with a specified processor. Among them, the specified candidate electronic device is an electronic device equipped with only a CPU, in which a virtual machine can be deployed, or no virtual machine can be deployed. The specified configuration information may include the hardware information of each specified candidate electronic device, for example, it may include processor configuration, memory configuration, storage configuration and network configuration, and may also include other configurations, which are not limited in this application. Specifically, the processor configuration may include, for example, the model, quantity and performance index of the CPU, and the performance index may be the number of cores. The processor configuration may also include the NUMA structure of the CPU, etc. The memory configuration may include the memory size, speed, etc. The storage configuration may include the read and write speed of the disk, etc. Network configuration may include network interfaces and network performance indicators, such as network bandwidth.
[0127] It is understandable that the virtual machine deployment device can first screen whether a candidate electronic device can be selected from the pool of candidate electronic devices equipped with CPU and GPU for deploying the virtual machine. If no candidate electronic device can be screened, further screening can be performed from the pool of designated candidate electronic devices equipped only with CPU until a candidate designated electronic device that meets the requirements of the virtual machine to be created is selected. For cloud service providers, this approach allows users to flexibly choose virtual machine configurations according to their own needs, and they are no longer limited to the fixed models provided by cloud service providers. This flexibility is particularly important for users with special performance requirements, and they can customize resource configurations according to specific application scenarios to optimize performance and costs.
[0128] Specifically, the virtual machine deployment device can match the configuration requirement information with the configuration information corresponding to the multiple designated candidate electronic devices, and obtain a set of designated candidate electronic devices whose designated configuration information matches the configuration requirement information. Among them, matching the configuration requirement information with the configuration information corresponding to the multiple designated candidate electronic devices can specifically be matching hardware specifications, checking based on compatibility rules, and matching reserved resources (such as the above-mentioned conflict detection) to obtain a set of designated candidate electronic devices. The set of designated candidate electronic devices can include multiple designated candidate electronic devices, and the configuration information of each designated candidate electronic device matches the configuration requirement information.
[0129] Among them, the principle of matching the configuration requirement information with the configuration information corresponding to the multiple designated candidate electronic devices can be found in the specific description of matching the configuration requirement information with the configuration information corresponding to the multiple candidate electronic devices in step S202, which will not be repeated here. It should be noted that since the multiple designated candidate electronic devices are not equipped with GPUs, the preset compatibility rules may vary according to different electronic devices. They are all rules for checking whether the operating system, drivers and other necessary software support the hardware specifications of the current candidate electronic device. They may also include rules for determining whether there is incompatibility between the virtual machine to be created and the virtual machines already deployed on the designated candidate electronic device. The compatibility rules can be determined based on the hardware specifications of the specific electronic device and the deployed virtual machines.
[0130] Furthermore, after obtaining the designated candidate electronic device set, a reference benchmark test can also be run by each designated candidate electronic device in the designated candidate electronic device set to remove some designated candidate electronic devices from the designated candidate electronic device set according to the load information obtained by the test. In addition, the virtual machine deployment device can also select a target designated electronic device from the candidate electronic device set according to the resource usage of the designated processor of each designated candidate electronic device in the designated candidate electronic device set, and create a virtual machine in the target designated electronic device. Among them, the principles of running a reference benchmark test by each designated candidate electronic device in the designated candidate electronic device set, removing some designated candidate electronic devices from the designated candidate electronic devices according to the load information obtained by the test, and selecting a target designated electronic device from the designated candidate electronic device set according to the resource usage of the designated processor of each designated candidate electronic device, and building a virtual machine in the target designated electronic device can all be referred to the relevant descriptions in steps S202-step S203, which will not be repeated here.
[0131] It should be noted that the reference benchmark test run for a designated candidate electronic device equipped with only a designated processor (CPU) may be different from the specific test content of the reference benchmark test run for a candidate electronic device equipped with a designated processor (CPU) and other processors (GPU), which can be determined according to business needs and application scenarios. In addition, when selecting a designated candidate electronic device from a set of designated candidate electronic devices, the selection is based only on the resource usage of the CPU, such as the order of remaining free resources from large to small, and can also be based on other methods, which is not limited in this application. As a result, the virtual machine deployment device finally determines the electronic device on which the virtual machine is deployed and completes the deployment of the virtual machine.
[0132] In the technical solutions provided in some embodiments of the present application, when deploying a virtual machine, the configuration requirement information of the virtual machine to be created can be obtained, and the configuration requirement information includes the configuration information of the specified processor, and the configuration information corresponding to multiple candidate electronic devices is obtained, and the multiple candidate electronic devices are electronic devices equipped with the specified processor and other processors. Then the configuration requirement information can be matched with the configuration information corresponding to the multiple candidate electronic devices, and a set of candidate electronic devices whose configuration information matches the configuration requirement information can be obtained. According to the resource usage of the specified processor of each candidate electronic device in the candidate electronic device set, and the resource usage of other processors, a target electronic device can be selected from the candidate electronic device set, and a virtual machine can be created in the target electronic device to deploy the virtual machine in an electronic device equipped with a specified processor and other processors. It can be seen from this that the virtual machine configured with a specified processor by the user can be deployed in an electronic device equipped with a specified processor and other processors. Compared with selecting in an electronic device of a fixed model equipped with only a specified processor, the deployment of the virtual machine is more flexible and is also conducive to improving the utilization of resources.
[0133] Based on the above virtual machine creation system, the present application embodiment provides a virtual machine creation method. The virtual machine creation method described in the present application embodiment can be executed by an electronic device, which can be Figure 1 The virtual machine deployment device 102 in the virtual machine creation system shown. Fig. 9 , Fig. 9 1 is another flow chart of a method for creating a virtual machine provided in an embodiment of the present application. The method for creating a virtual machine includes the following steps S901-S902:
[0134] S901. Monitor the performance data of the virtual machine to obtain a load value corresponding to the virtual machine.
[0135] In an embodiment of the present application, the virtual machine deployment device can also monitor the performance data of the created virtual machine, and the performance data refers to the resource usage of each component of the virtual machine, which can be understood as a business load, such as CPU usage, memory usage, disk I / O, and network bandwidth. The load value can be the utilization rate of each component (various resources), or it can be a comprehensive score of the resource usage of the electronic device running the virtual machine, or it can be other numerical values used to indicate the load, and the present application does not limit this. Among them, the virtual machine deployment device can obtain the performance monitoring tool installed by the electronic device running the virtual machine, such as the built-in performance monitoring tool of VMware vSphere, and then the monitored data can be sent to the virtual machine deployment device. It can be understood that, on the one hand, monitoring the performance data of the virtual machine can determine the change of the business load of the virtual machine, so as to facilitate the subsequent adjustment of the resource allocation of the virtual machine. On the other hand, monitoring the performance data of the virtual machine can also indirectly find whether the electronic device running the virtual machine fails, so as to maintain the stability of the virtualized environment.
[0136] S902: If it is detected that the load value is greater than a preset load threshold, the resources of the virtual machine are adjusted according to the configuration information and the configuration information of the specific component in the configuration requirement information.
[0137] In an embodiment of the present application, the preset load threshold may refer to the cloud service provider's administrator setting a reasonable threshold for the performance indicators in the load value in advance according to business needs and the performance of the virtual machine. For example, the preset load threshold may include the threshold of the utilization rate of each component (various resources), such as 80% of the CPU utilization rate, etc. When the load value of the virtual machine exceeds the set threshold, that is, the load value is greater than the preset load threshold, the electronic device may trigger an alarm, notify the virtual machine deployment device, and further dynamically adjust the resource allocation of the virtual machine based on the decision of the virtual machine deployment device to cope with the changing workload. Among them, the configuration information is the configuration information of the specified processor (CPU), and the configuration information of the specific component in the configuration requirement information may refer to the configuration information of the memory. Adjusting the resources of the virtual machine can be divided into two ways, one is to migrate the virtual machine to other electronic devices with more idle resources, and the other is to add resources to the virtual machine. Therefore, it is necessary to first determine whether the virtual machine needs to be migrated to other electronic devices.
[0138] Specifically, in the process of adjusting the resources of the virtual machine, the virtual machine deployment device can first determine whether the preset migration conditions are met based on the configuration information and the configuration information of the specific components. The preset migration conditions refer to the conditions for judging whether the virtual machine needs to be migrated. In order to minimize business interruptions, that is, to minimize the interruption time of the tasks executed in the virtual machine, the resources of the virtual machine can be adjusted by online migration. The online migration method requires the electronic device currently running the virtual machine to establish a communication connection with the electronic device to which the virtual machine is to be migrated, and occupies the network bandwidth of the electronic device currently running the virtual machine. If the duration of affecting the network bandwidth is long, it may affect the operation of other virtual machines deployed in the electronic device currently running the virtual machine. Therefore, the preset migration condition can be to judge whether the online migration duration is greater than the duration threshold. If it is greater, the preset migration condition is not met. If it is less than, the preset migration condition is met.
[0139] Specifically, the virtual machine deployment device can estimate the duration required for migration based on the CPU configuration information and the memory configuration information. For example, when the number of CPU cores is small and the memory is also small, the amount of data required to be transmitted is small, and the duration required for online migration is shorter. Conversely, when the number of CPU cores is large and the memory is also large, the amount of data required to be transmitted is large, and the duration required for online migration is longer. Therefore, the virtual machine deployment device can estimate the duration required for online migration based on the relationship between the duration of previous online migrations, the number of CPU cores, and the memory size, and compare it with the duration threshold to determine whether the preset migration conditions are met.
[0140] In some embodiments, the virtual machine deployment device may also directly judge the number of CPU cores and memory size and the corresponding thresholds. In this case, there is no need to further estimate the duration required for online migration, because if the number of CPU cores and memory size are both greater than the corresponding thresholds, the estimated duration will definitely be greater than the duration threshold. For example, the virtual machine deployment device may determine whether the number of CPU cores is greater than a first threshold, and determine whether the memory size is greater than a second threshold. If either is greater than the corresponding threshold, it is determined that the preset migration condition is not met. On the contrary, if both are less than the corresponding thresholds, it is determined that the preset migration condition is met.
[0141] In one possible implementation, if it is determined that the preset migration conditions are met based on the configuration information and the configuration information of a specific component, the migration requirement information is determined based on the load value and the configuration requirement information. Among them, the migration requirement information refers to the new configuration requirement information of the virtual machine, which may include the configuration information of each component. The virtual machine deployment device may determine the migration requirement information based on the load value and the configuration requirement information, which means that the virtual machine deployment device evaluates the current resource demand based on the load value and the previous configuration requirement information. Specifically, it may be determined based on the components in the load value that exceed the preset load threshold and the quantitative indicators that exceed the load value, as well as the correspondence between the specific load value and the reference resource demand. Alternatively, a machine learning model may be deployed in the virtual machine deployment device, and the load value and the configuration requirement information may be input into the machine learning model, and the machine learning model predicts the migration requirement information. The migration requirement information may also be determined in other ways, which is not limited in this application.
[0142] After determining the migration requirement information, the virtual machine deployment device can select a designated electronic device from multiple candidate electronic devices other than the target electronic device according to the migration requirement information, and migrate the virtual machine from the target electronic device to the designated electronic device. Among them, the multiple candidate electronic devices can be electronic devices equipped with a CPU and a GPU, and the designated electronic device can be the electronic device to which the virtual machine is finally determined to be migrated. Specifically, in the process of determining the designated electronic device, the virtual machine deployment device can match the migration requirement information with the configuration information corresponding to the other electronic devices, respectively, to obtain a set of migration electronic devices whose configuration information matches the migration requirement information, and select the designated electronic device from the set of migration electronic devices according to the resource usage of the designated processors of each migration electronic device in the set of migration electronic devices, and the resource usage of other processors.
[0143] Among them, the specific implementation method of selecting the designated electronic device from other electronic devices other than the target electronic device among multiple candidate electronic devices can refer to the description of step S201-step S203, which will not be repeated here. It can be understood that compared with the process of screening the target electronic device for the first time, the candidate electronic devices screened this time are electronic devices other than the target electronic device. After screening out the designated electronic device, the virtual machine deployment device can trigger the electronic device currently running the virtual machine to check the preconditions, such as checking whether the preconditions required for migration are met, including network connectivity, storage access rights, etc. In addition, the synchronization method of data during the migration process can also be determined. Furthermore, after the electronic device currently running the virtual machine establishes a communication connection with the designated electronic device, the online migration of the virtual machine can be performed, and the memory and CPU status of the virtual machine can be synchronized to the designated electronic device in real time. After the virtual machine is hot migrated to the designated electronic device, the virtual machine deployment device can trigger the designated electronic device to monitor the performance data of the virtual machine. Among them, in the process of hot migrating the virtual machine to another electronic device, the faulty electronic device can be repaired, so that the fault repair is more efficient, and in the process of migration, the data of the virtual machine will also be backed up to ensure the high availability and data integrity of the virtualization environment.
[0144] In another possible implementation, if it is determined based on the configuration information and the configuration information of a specific component that the preset migration condition is not met, such as the migration duration is greater than the duration threshold, or the number of CPU cores and the memory size are greater than the set threshold, then it is determined that the preset migration condition is not met. The virtual machine deployment device can adjust the resources of the virtual machine by hot adding resources. The so-called hot add refers to adding computing, storage and network resources to the virtual machine when the virtual machine is powered on, such as adding CPU cores, memory, disk space, etc. Specifically, the virtual machine deployment device can determine the reference resource information corresponding to the monitored load value based on the correspondence between the load value and the reference resource information, as well as the monitored load value. Furthermore, the virtual machine deployment device can perform hot add processing on the resources of the virtual machine based on the reference add resources corresponding to one or more components included in the reference resource information.
[0145] The reference resource information may be a quantitative value of a hot-added resource for reference, and may include reference added resources corresponding to one or more components, that is, reference added resource values corresponding to one or more components, for example, added values corresponding to one or more components in CPU core, memory, and disk space, such as adding 10 CPU cores. Further, based on the reference added resources corresponding to one or more components, the virtual machine deployment device may add additional resources to the electronic device on which the virtual machine is currently running through the virtualization management platform. Thus, the adjustment process of the virtual machine's resources is completed.
[0146] In some embodiments, the virtual machine deployment device may also deploy a machine learning model that predicts reference resource information, and the virtual machine deployment device may input the load value and configuration requirement information into the machine learning model to obtain the reference resource information predicted by the machine learning model. The reference resource information may also be determined in other ways, which is not limited in this application.
[0147] In some embodiments, when it is monitored that the load of the virtual machine is lower than a set load threshold within a preset time period, the virtual machine can be migrated to an electronic device on which the virtual machine is deployed, or some resources can be released so that the idle resources can be used to deploy other virtual machines that require more resources, thereby helping to improve the economic benefits of the cloud service provider.
[0148] Please also read Fig.10 , Fig.10 is a timing diagram of adjusting the resources of a virtual machine provided by an embodiment of the present application, such as Fig.10 As shown, first, the virtual machine deployment device can monitor the performance data of the virtual machine, specifically, the load of the virtual machine can be monitored by the electronic device running the virtual machine to obtain the load value corresponding to the virtual machine. Then, it is determined whether the load value is greater than the preset load threshold. If it is greater, the resources of the virtual machine can be adjusted. Specifically, the virtual machine deployment device can determine whether the virtual machine needs to be migrated. For example, it can determine whether the configuration information of the CPU and the configuration information of the memory of the virtual machine meet the preset migration conditions to determine whether the virtual machine needs to be migrated. If it is less than, it is determined that the virtual machine does not need to be migrated.
[0149] Further, in the case where it is determined that the virtual machine does not need to be migrated, the resources of the virtual machine can be adjusted by hot adding resources. The virtual machine deployment device can first determine the specific resources to be hot added, such as determining the reference added resources corresponding to one or more components, and then hot adding resources, that is, adjusting the configuration of the virtual machine through the virtualization management platform so that the virtual machine continues to perform tasks based on the new configuration. Then the virtual machine deployment device can monitor the performance data of the virtual machine again through the electronic device running the virtual machine to verify the resource configuration, and specifically check whether the load value has been reduced to less than the preset load threshold. Finally, the virtual machine deployment device can check the configuration of the virtual machine through the electronic device running the virtual machine to determine whether the configuration is successful. If so, the virtual machine deployment device can monitor the performance data of the virtual machine again through the electronic device running the virtual machine, so as to adjust the resources of the virtual machine next time. If not, the change is rolled back, and the adjustment can be made by falling back to the step of hot adding resources of the virtual machine deployment device.
[0150] Furthermore, in the case where it is determined that the virtual machine needs to be migrated, the virtual machine deployment device can determine the migration requirement information of the virtual machine, which can be determined specifically based on the load value and configuration requirement information. And according to the migration requirement information, a designated electronic device is selected from multiple candidate electronic devices other than the target electronic device, that is, a target host is selected. Furthermore, the virtual machine deployment device can prepare for online migration through the electronic device currently running the virtual machine, such as determining network connectivity, etc. After the preparation is completed, the virtual machine can be migrated to the target host, that is, the designated electronic device. After the data and status synchronization is completed, the migration is completed, and the virtual machine deployment device can monitor the performance data of the virtual machine again through the electronic device running the virtual machine, so as to adjust the resources of the virtual machine next time.
[0151] Therefore, the virtual machine deployment device can dynamically adjust the resource allocation of the virtual machine according to the change of business load, realize the online migration of the virtual machine and the hot addition of resources, so that the configuration of the virtual machine is decoupled from the specific hardware resources, the adjustment of the virtual machine configuration is more flexible, and the virtual machine can adjust the resources without interrupting the service. In actual applications, it can respond quickly when the load is peak, increase the necessary computing resources, and release resources to save costs when the load is low, realizing the elastic expansion of resources, dynamically adjusting resource allocation according to the actual workload, and improving resource utilization. In a series of benchmark tests, compared with static resource allocation, the resource utilization rate is increased by about 20%, maintaining or improving application performance, which is conducive to improving the efficiency and accuracy of virtual machine deployment, and is also conducive to improving the utilization efficiency of resources and the flexibility of the system, providing users with more personalized and efficient cloud computing services. Compared with static resource allocation, application performance is maintained or improved at the same time.
[0152] It should be noted that the above process of selecting a target electronic device from a set of candidate electronic devices, creating a virtual machine in the target electronic device, and dynamically adjusting the resources of the virtual machine can be a script or program run by the virtual machine deployment device, which can be understood as a code-level implementation. The program can be called a hybrid deployment adapter, which can obtain the resource information required for deployment, and intelligently adjust the virtual machine configuration according to business needs and resource conditions to complete an efficient and flexible hybrid deployment (mixed deployment of CPU virtual machines and GPU virtual machines) process. Among them, the above-mentioned computing resource adaptive discriminator and hybrid deployment adapter can be two programs in the intelligent hybrid deployment system, and can also be understood as the implementation of the intelligent hybrid deployment technology as these two programs. Please refer to Fig.11 , Fig.11 Schematic diagram of a hybrid deployment adapter provided by an embodiment of the present application. Fig.11 As shown in the figure, the hybrid deployment adapter is mainly used to perform three operations, including:
[0153] The first part is resource mapping, which can specifically include virtual machine resource demand mapping, such as determining the target electronic device based on the business configuration information associated with the configuration demand information of the virtual machine, and determining the best combination of CPU and GPU based on the resource usage of the CPU and GPU of each candidate electronic device in the candidate electronic device set, and allocating resources such as CPU, memory, storage, and network to complete resource mapping. The second part is the part of automated deployment of virtual machines, which specifically starts to create virtual machines in target electronic devices. The creation and configuration of virtual machines can be automatically executed. The specific configuration may include hardware specification configuration, network and storage configuration, and further installation of operating systems, drivers and tools, so as to complete automated deployment. The third part is the part of dynamically adjusting virtual machine resources. The resources of the virtual machine can be adjusted according to the business load of the virtual machine. Specifically, the virtual machine can be migrated online to other electronic devices, or the resources of the virtual machine can be hot-added. Thus, the adjustment of the resources of the virtual machine is completed.
[0154] Therefore, the hybrid deployment adapter can intelligently adjust the virtual machine configuration according to the results of the computing resource adaptive discriminator and the load monitoring of the virtual machine, thereby achieving efficient and flexible CPU and GPU hybrid deployment. The hybrid deployment adapter can monitor the performance data of the virtual machine through the electronic device running the virtual machine, and can also monitor the status of the electronic device to timely discover and prevent potential problems. For example, if the electronic device fails, the virtual machine can be migrated online to other electronic devices to ensure that the creation and operation of the virtual machine will not have a negative impact on the performance of the host machine and other virtual machines on it, so as to improve system stability and performance.
[0155] In the technical solutions provided in some embodiments of the present application, when deploying a virtual machine, the configuration requirement information of the virtual machine to be created can be obtained, and the configuration requirement information includes the configuration information of the specified processor, and the configuration information corresponding to multiple candidate electronic devices is obtained, and the multiple candidate electronic devices are electronic devices equipped with the specified processor and other processors. Then the configuration requirement information can be matched with the configuration information corresponding to the multiple candidate electronic devices, and a set of candidate electronic devices whose configuration information matches the configuration requirement information can be obtained. According to the resource usage of the specified processor of each candidate electronic device in the candidate electronic device set, and the resource usage of other processors, a target electronic device can be selected from the candidate electronic device set, and a virtual machine can be created in the target electronic device to deploy the virtual machine in an electronic device equipped with a specified processor and other processors. It can be seen from this that the virtual machine configured with a specified processor by the user can be deployed in an electronic device equipped with a specified processor and other processors. Compared with selecting in an electronic device of a fixed model equipped with only a specified processor, the deployment of the virtual machine is more flexible and is also conducive to improving the utilization of resources.
[0156] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0157] See also Fig.12 , Fig.12 is a schematic diagram of a virtual machine creation device provided in an embodiment of the present application. The virtual machine creation device 120 can be used to execute Figure 2 and Fig. 9 The corresponding steps in the method for creating a virtual machine shown in FIG. The virtual machine creation device 120 includes the following units:
[0158] An acquisition unit 1201 is used to acquire configuration requirement information of a virtual machine to be created, and configuration information corresponding to a plurality of candidate electronic devices, wherein the configuration requirement information includes configuration information of a designated processor required for the virtual machine to be created, and the candidate electronic device is equipped with the designated processor and other processors;
[0159] A matching unit 1202, configured to match the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information;
[0160] The selection unit 1203 is used to select a target electronic device from the candidate electronic device set according to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors, and create a virtual machine in the target electronic device.
[0161] In a possible implementation, the matching unit 1202 is used to match the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices, specifically to:
[0162] Matching the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices;
[0163] If the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device among the multiple candidate electronic devices, the target candidate electronic device is added to the candidate electronic device set.
[0164] In a possible implementation, the matching unit 1202 is used to match the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices, specifically to:
[0165] Matching the model information of the designated processor in the configuration information with the model information of the designated processor in multiple configuration information, and matching the resource requirements corresponding to each component with the idle resources of the corresponding component in the multiple configuration information;
[0166] If the model information of the designated processor in the configuration information is the same as the model information of the designated processor in the configuration information corresponding to the target candidate electronic device, and the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component, then it is determined that the hardware specifications of each component match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device.
[0167] In a possible implementation, the device 120 further includes:
[0168] The determining unit 1204 is configured to determine the reserved resource requirements corresponding to each component according to a preset resource reservation rule and the resource requirements corresponding to each component; and determine the sum of the resource requirements corresponding to each component according to the resource requirements corresponding to each component and the reserved resource requirements corresponding to each component;
[0169] The matching unit 1202 is further configured to match the sum of resource requirements corresponding to each component with the idle resources of the corresponding component in the plurality of configuration information;
[0170] The determination unit 1204 is also used to determine that the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component if the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the sum of the resource requirements corresponding to each component.
[0171] In a possible implementation, the acquisition unit 1201 is further configured to acquire configuration information of a virtual machine deployed in the target candidate electronic device;
[0172] The determination unit 1204 is further used to determine a first part of candidate electronic devices in the target candidate electronic devices that do not meet preset compatibility rules based on the configuration requirement information and the configuration information of the virtual machines deployed in the target candidate electronic devices, and remove the first part of candidate electronic devices from the candidate electronic device set.
[0173] In a possible implementation, the acquisition unit 1201 is further configured to run a reference benchmark test through each candidate electronic device in the candidate electronic device set, and acquire load information of each candidate electronic device running the reference benchmark test;
[0174] The determining unit 1204 is further configured to remove a second part of candidate electronic devices from the candidate electronic device set if there are second part of candidate electronic devices that do not meet a preset load condition in the load information corresponding to each candidate electronic device included in the candidate electronic device set.
[0175] In a possible implementation, the selection unit 1203 is configured to select a target electronic device from the candidate electronic device set according to resource usage of a designated processor of each candidate electronic device in the candidate electronic device set and resource usage of other processors, and is specifically configured to:
[0176] Acquire a first idle resource of a designated processor of each candidate electronic device in the candidate electronic device set, and a second idle resource of other processors;
[0177] Determining, according to the configuration information and the first idle resources, remaining idle resources of a designated processor of each candidate electronic device in the set of candidate electronic devices;
[0178] The target electronic device is selected from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources.
[0179] In a possible implementation, the selection unit 1203 is configured to select the target electronic device from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources, and is specifically configured to:
[0180] Acquire business configuration information associated with the configuration requirement information;
[0181] The preset business rule is matched with the business configuration information, and the target electronic device is selected from the candidate electronic devices whose preset business rule matches the business configuration information in the order of the resource difference from small to large.
[0182] In a possible implementation, the device 120 further includes:
[0183] The monitoring unit 1205 is used to monitor the performance data of the virtual machine to obtain a load value corresponding to the virtual machine;
[0184] The processing unit 1206 is configured to adjust the resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information if it is detected that the load value is greater than a preset load threshold.
[0185] In a possible implementation, the processing unit 1206 is configured to adjust resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information, specifically to:
[0186] If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is met, determining the migration requirement information according to the load value and the configuration requirement information;
[0187] A designated electronic device is selected from electronic devices other than the target electronic device among a plurality of candidate electronic devices according to the migration requirement information, and the virtual machine is migrated from the target electronic device to the designated electronic device.
[0188] In a possible implementation, the processing unit 1206 is configured to select a designated electronic device from other electronic devices except the target electronic device among a plurality of candidate electronic devices according to the migration requirement information, specifically to:
[0189] Matching the migration requirement information with the configuration information corresponding to the other electronic devices respectively, to obtain a set of migration electronic devices whose configuration information matches the migration requirement information;
[0190] The designated electronic device is selected from the set of migrating electronic devices according to resource usage of designated processors of each migrating electronic device in the set of migrating electronic devices and resource usage of other processors.
[0191] In a possible implementation, the processing unit 1206 is configured to adjust resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information, specifically to:
[0192] If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is not satisfied, then according to the correspondence between the load value and the reference resource information and the load value, determining the reference resource information corresponding to the load value, the reference resource information including reference added resources corresponding to one or more components;
[0193] Resources are added according to the references corresponding to the one or more components, and hot-add processing is performed on the resources of the virtual machine.
[0194] In a possible implementation, the acquisition unit 1201 is further configured to acquire, if there is no candidate electronic device whose configuration information matches the configuration requirement information among the multiple candidate electronic devices, the specified configuration information corresponding to multiple specified candidate electronic devices, the multiple specified candidate electronic devices being only equipped with the specified processor;
[0195] The matching unit 1202 is further configured to match the configuration requirement information with configuration information corresponding to a plurality of designated candidate electronic devices, to obtain a set of designated candidate electronic devices whose designated configuration information matches the configuration requirement information;
[0196] The selection unit 1203 is further configured to select a target designated electronic device from the candidate electronic device set according to resource usage of a designated processor of each designated candidate electronic device in the designated candidate electronic device set, and create the virtual machine in the target designated electronic device.
[0197] According to one embodiment of the present application, Figure 2 and Fig. 9 The steps involved in the method shown may be performed by Fig.12 The creation of the virtual machine shown is performed by various units in the device. For example, Figure 2 Step S201 shown is composed of Fig.12 The acquisition unit 1201 shown in FIG. 1 is used to perform step S202. Fig.12 The matching unit 1202 shown in FIG. 1 is used to perform step S203. Fig.12 The selection unit 1203 shown is used for execution. For another example, Fig. 9 Step S901 shown is composed of Fig.12 The monitoring unit 1205 shown in FIG. 1 is used to perform step S902. Fig.12 The processing unit 1206 is shown to execute.
[0198] According to one embodiment of the present application, Fig.12 The various units in the virtual machine creation device 120 shown can be individually or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple functionally smaller units to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the virtual machine creation device 120 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units. According to another embodiment of the present application, it can be executed by running on a general computing device of a general-purpose computer including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM). Figure 2 and Fig. 9 A computer program (including program code) for each step involved in the corresponding method shown in Fig.12 The virtual machine creation device 120 shown in the figure and the virtual machine creation method of the embodiment of the present application are implemented. The computer program can be recorded on, for example, a computer readable storage medium and loaded into Figure 1 The virtual machine creation system is located in the virtual machine deployment device 102 and runs therein.
[0199] Based on the description of the above virtual machine creation method embodiment, the present application embodiment also discloses an electronic device, see Fig.13 , the electronic device 130 may include at least a processor 1301, an input device 1302, an output device 1303, and a memory 1304. The processor 1301, the input device 1302, the output device 1303, and the memory 1304 in the electronic device 130 may be connected via a bus or other means.
[0200] The above-mentioned memory 1304 is a memory device in the electronic device 130, which is used to store programs and data. It can be understood that the memory 1304 here can include both the built-in storage medium of the virtual machine creation device and the extended storage medium supported by the electronic device 130. The memory 1304 provides a storage space, which stores the operating system of the electronic device 130. In addition, computer programs (including program codes) are also stored in the storage space. It should be noted that the computer storage medium here can be a high-speed RAM memory; optionally, it can also be at least one computer storage medium away from the aforementioned processor. The aforementioned processor can be called a central processing unit (CPU), which is the core and control center of the virtual machine creation device and is used to run the computer program stored in the above-mentioned memory 1304.
[0201] In one implementation, the processor 1301 may load and execute a computer program stored in the memory 1304 to implement corresponding steps of the method in the above-mentioned virtual machine creation method embodiment; specifically, the processor 1301 loads and executes the computer program stored in the memory 1304, which is used to:
[0202] Acquire configuration requirement information of a virtual machine to be created, and configuration information corresponding to a plurality of candidate electronic devices, wherein the configuration requirement information includes configuration information of a designated processor required for the virtual machine to be created, and the candidate electronic device is equipped with the designated processor and other processors;
[0203] Matching the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices respectively, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information;
[0204] According to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors, a target electronic device is selected from the candidate electronic device set, and a virtual machine is created in the target electronic device.
[0205] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, which is used to match the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices, specifically:
[0206] Matching the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices;
[0207] If the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device among the multiple candidate electronic devices, the target candidate electronic device is added to the candidate electronic device set.
[0208] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, which is used to match the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices, specifically for:
[0209] Matching the model information of the designated processor in the configuration information with the model information of the designated processor in multiple configuration information, and matching the resource requirements corresponding to each component with the idle resources of the corresponding component in the multiple configuration information;
[0210] If the model information of the designated processor in the configuration information is the same as the model information of the designated processor in the configuration information corresponding to the target candidate electronic device, and the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component, then it is determined that the hardware specifications of each component match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device.
[0211] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is further configured to:
[0212] Determine the reserved resource requirements corresponding to each component according to the preset resource reservation rules and the resource requirements corresponding to each component;
[0213] Determine the sum of the resource requirements corresponding to the components according to the resource requirements corresponding to the components and the reserved resource requirements corresponding to the components;
[0214] Matching the sum of resource requirements corresponding to the components with the idle resources of the corresponding components in the plurality of configuration information;
[0215] If the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the sum of the resource requirements corresponding to the components, it is determined that the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to the components.
[0216] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is further configured to:
[0217] Acquire configuration information of a virtual machine deployed in the target candidate electronic device;
[0218] According to the configuration requirement information and the configuration information of the virtual machines deployed in the target candidate electronic devices, a first part of candidate electronic devices in the target candidate electronic devices that do not meet the preset compatibility rules are determined, and the first part of candidate electronic devices are removed from the candidate electronic device set.
[0219] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is further configured to:
[0220] Running a reference benchmark test on each candidate electronic device in the candidate electronic device set, and obtaining load information of each candidate electronic device running the reference benchmark test;
[0221] If there are a second part of candidate electronic devices that do not meet the preset load condition in the load information corresponding to each candidate electronic device included in the candidate electronic device set, the second part of candidate electronic devices are removed from the candidate electronic device set.
[0222] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, and is configured to select a target electronic device from the candidate electronic device set according to resource usage of a designated processor of each candidate electronic device in the candidate electronic device set and resource usage of other processors, and is specifically configured to:
[0223] Acquire a first idle resource of a designated processor of each candidate electronic device in the candidate electronic device set, and a second idle resource of other processors;
[0224] Determining, according to the configuration information and the first idle resources, remaining idle resources of a designated processor of each candidate electronic device in the set of candidate electronic devices;
[0225] The target electronic device is selected from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources.
[0226] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, configured to select the target electronic device from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources, specifically configured to:
[0227] Acquire business configuration information associated with the configuration requirement information;
[0228] The preset business rule is matched with the business configuration information, and the target electronic device is selected from the candidate electronic devices whose preset business rule matches the business configuration information in the order of the resource difference from small to large.
[0229] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is further configured to:
[0230] Monitoring the performance data of the virtual machine to obtain a load value corresponding to the virtual machine;
[0231] If it is monitored that the load value is greater than a preset load threshold, the resources of the virtual machine are adjusted according to the configuration information and the configuration information of the specific component in the configuration requirement information.
[0232] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, configured to adjust resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information, specifically configured to:
[0233] If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is met, determining the migration requirement information according to the load value and the configuration requirement information;
[0234] A designated electronic device is selected from electronic devices other than the target electronic device among a plurality of candidate electronic devices according to the migration requirement information, and the virtual machine is migrated from the target electronic device to the designated electronic device.
[0235] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, configured to select a designated electronic device from other electronic devices other than the target electronic device among a plurality of candidate electronic devices according to the migration requirement information, specifically configured to:
[0236] Matching the migration requirement information with the configuration information corresponding to the other electronic devices respectively, to obtain a set of migration electronic devices whose configuration information matches the migration requirement information;
[0237] The designated electronic device is selected from the set of migrating electronic devices according to resource usage of designated processors of each migrating electronic device in the set of migrating electronic devices and resource usage of other processors.
[0238] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, configured to adjust resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information, specifically configured to:
[0239] If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is not satisfied, then according to the correspondence between the load value and the reference resource information and the load value, determining the reference resource information corresponding to the load value, the reference resource information including reference added resources corresponding to one or more components;
[0240] Resources are added according to the references corresponding to the one or more components, and hot-add processing is performed on the resources of the virtual machine.
[0241] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is further configured to:
[0242] If there is no candidate electronic device whose configuration information matches the configuration requirement information among the multiple candidate electronic devices, obtaining the specified configuration information respectively corresponding to multiple specified candidate electronic devices, wherein the multiple specified candidate electronic devices are only equipped with the specified processor;
[0243] Matching the configuration requirement information with configuration information corresponding to a plurality of designated candidate electronic devices respectively, to obtain a set of designated candidate electronic devices whose designated configuration information matches the configuration requirement information;
[0244] According to the resource usage of the designated processor of each designated candidate electronic device in the designated candidate electronic device set, a target designated electronic device is selected from the candidate electronic device set, and the virtual machine is created in the target designated electronic device.
[0245] It should be understood that in the embodiment of the present application, the processor 1301 may be a central processing unit (CPU), and the processor 1301 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0246] In an embodiment of the present application, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the steps performed in all the above embodiments can be executed.
[0247] An embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a computer device, the methods in all the above embodiments are executed.
[0248] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0249] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
[0250] It is also particularly important to note that when the above embodiments of the present application are applied to specific products or technologies, if it is necessary to obtain user data, the user's permission or consent must be obtained, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
Claims
1. A method for creating a virtual machine, characterized in that: include: Acquire configuration requirement information of a virtual machine to be created, and configuration information corresponding to a plurality of candidate electronic devices, wherein the configuration requirement information includes configuration information of a designated processor required for the virtual machine to be created, and the candidate electronic device is equipped with the designated processor and other processors; Matching the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices respectively, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information; According to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors, a target electronic device is selected from the candidate electronic device set, and a virtual machine is created in the target electronic device.
2. The method according to claim 1, characterized in that The matching of the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices respectively includes: Matching the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices; If the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device among the multiple candidate electronic devices, the target candidate electronic device is added to the candidate electronic device set.
3. The method according to claim 2, characterized in that The matching of the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the plurality of candidate electronic devices respectively includes: Matching the model information of the designated processor in the configuration information with the model information of the designated processor in multiple configuration information, and matching the resource requirements corresponding to each component with the idle resources of the corresponding component in the multiple configuration information; If the model information of the designated processor in the configuration information is the same as the model information of the designated processor in the configuration information corresponding to the target candidate electronic device, and the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component, then it is determined that the hardware specifications of each component match the hardware specifications of the corresponding components in the configuration information corresponding to the target candidate electronic device.
4. The method according to claim 3, characterized in that The method further comprises: Determine the reserved resource requirements corresponding to each component according to the preset resource reservation rules and the resource requirements corresponding to each component; Determine the sum of the resource requirements corresponding to the components according to the resource requirements corresponding to the components and the reserved resource requirements corresponding to the components; Matching the sum of resource requirements corresponding to the components with the idle resources of the corresponding components in the plurality of configuration information; If the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the sum of the resource requirements corresponding to the components, it is determined that the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to the components.
5. The method according to claim 2, characterized in that: After adding the target candidate electronic device to the candidate electronic device set, the method further includes: Acquire configuration information of a virtual machine deployed in the target candidate electronic device; According to the configuration requirement information and the configuration information of the virtual machines deployed in the target candidate electronic devices, a first part of candidate electronic devices in the target candidate electronic devices that do not meet the preset compatibility rules are determined, and the first part of candidate electronic devices are removed from the candidate electronic device set.
6. The method according to claim 2, characterized in that After adding the target candidate electronic device to the candidate electronic device set, the method further includes: Running a reference benchmark test on each candidate electronic device in the candidate electronic device set, and obtaining load information of each candidate electronic device running the reference benchmark test; If there are a second part of candidate electronic devices that do not meet the preset load condition in the load information corresponding to each candidate electronic device included in the candidate electronic device set, the second part of candidate electronic devices are removed from the candidate electronic device set.
7. The method according to claim 1, characterized in that The selecting a target electronic device from the candidate electronic device set according to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors includes: Acquire a first idle resource of a designated processor of each candidate electronic device in the candidate electronic device set, and a second idle resource of other processors; Determining, according to the configuration information and the first idle resources, remaining idle resources of a designated processor of each candidate electronic device in the set of candidate electronic devices; The target electronic device is selected from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources.
8. The method according to claim 7, characterized in that The step of selecting the target electronic device from the set of candidate electronic devices according to the resource difference between the remaining idle resources and the second idle resources comprises: Acquire business configuration information associated with the configuration requirement information; The preset business rule is matched with the business configuration information, and the target electronic device is selected from the candidate electronic devices whose preset business rule matches the business configuration information in the order of the resource difference from small to large.
9. The method according to claim 1, characterized in that: After creating the virtual machine in the target electronic device, the method further includes: Monitoring the performance data of the virtual machine to obtain a load value corresponding to the virtual machine; If it is monitored that the load value is greater than a preset load threshold, the resources of the virtual machine are adjusted according to the configuration information and the configuration information of the specific component in the configuration requirement information.
10. The method according to claim 9, characterized in that The adjusting and processing of the resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information includes: If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is met, determining the migration requirement information according to the load value and the configuration requirement information; A designated electronic device is selected from electronic devices other than the target electronic device among a plurality of candidate electronic devices according to the migration requirement information, and the virtual machine is migrated from the target electronic device to the designated electronic device.
11. The method according to claim 10, characterized in that The step of selecting a designated electronic device from other electronic devices other than the target electronic device among a plurality of candidate electronic devices according to the migration requirement information includes: Matching the migration requirement information with the configuration information corresponding to the other electronic devices respectively, to obtain a set of migration electronic devices whose configuration information matches the migration requirement information; The designated electronic device is selected from the set of migrating electronic devices according to resource usage of designated processors of each migrating electronic device in the set of migrating electronic devices and resource usage of other processors.
12. The method according to claim 9, characterized in that The adjusting and processing of the resources of the virtual machine according to the configuration information and the configuration information of the specific component in the configuration requirement information includes: If it is determined according to the configuration information and the configuration information of the specific component that the preset migration condition is not satisfied, then according to the correspondence between the load value and the reference resource information and the load value, determining the reference resource information corresponding to the load value, the reference resource information including reference added resources corresponding to one or more components; Resources are added according to the references corresponding to the one or more components, and hot-add processing is performed on the resources of the virtual machine.
13. The method according to claim 1, characterized in that The method further comprises: If there is no candidate electronic device whose configuration information matches the configuration requirement information among the multiple candidate electronic devices, obtaining the specified configuration information respectively corresponding to multiple specified candidate electronic devices, wherein the multiple specified candidate electronic devices are only equipped with the specified processor; Matching the configuration requirement information with configuration information corresponding to a plurality of designated candidate electronic devices respectively, to obtain a set of designated candidate electronic devices whose designated configuration information matches the configuration requirement information; According to the resource usage of the designated processor of each designated candidate electronic device in the designated candidate electronic device set, a target designated electronic device is selected from the candidate electronic device set, and the virtual machine is created in the target designated electronic device.
14. A device for creating a virtual machine, characterized in that: include: an acquisition unit, configured to acquire configuration requirement information of a virtual machine to be created, and configuration information corresponding to a plurality of candidate electronic devices, wherein the configuration requirement information includes configuration information of a designated processor required for the virtual machine to be created, and the candidate electronic device is equipped with the designated processor and other processors; A matching unit, configured to match the configuration requirement information with configuration information corresponding to a plurality of candidate electronic devices, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information; The selection unit is used to select a target electronic device from the candidate electronic device set according to the resource usage of the designated processor of each candidate electronic device in the candidate electronic device set and the resource usage of other processors, and to create a virtual machine in the target electronic device.
15. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more computer programs, which, when executed by the one or more processors, enables the electronic device to implement the method for creating a virtual machine described in any one of claims 1-7 or 8-14.
16. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for creating a virtual machine according to any one of claims 1 to 13 is implemented.
17. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the method for creating a virtual machine according to any one of claims 1 to 13.
Citation Information
Patent Citations
Virtual machine management method and device, and storage medium
CN107038064A
Method and device for selecting host machine deployed by virtual machine
CN110928638A
Physical machine scheduling method and device
CN116126512A
Management computer, computer system, and instance management method
US20150236977A1
