Method, apparatus, device, storage medium and product for creating a virtual machine
By matching user needs with electronic devices of various processor configurations in a cloud computing environment, flexible deployment and resource optimization of virtual machines are achieved, solving the problem of virtual machine deployment being limited to fixed machine models and improving resource utilization and economic efficiency.
Patent Information
- Application Number
- CN202411044783.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-07-31
AI Technical Summary
In existing technologies, virtual machine deployment is limited to fixed machine types, resulting in low flexibility and low resource utilization. This is especially true in cloud computing environments with diverse user needs, leading to resource waste and reduced economic benefits.
By matching user configuration requirements with the configuration information of multiple candidate electronic devices, virtual machines are deployed using specified processors and other processors. Flexible virtual machine deployment and resource optimization are achieved by utilizing a computing resource adaptive discriminator and a hybrid deployment adapter.
It improves the flexibility and resource utilization of virtual machine deployment, reduces resource waste, enhances the economic benefits of cloud service providers, and dynamically adjusts resource allocation to improve resource utilization and application performance when the load changes.
Smart Images

Figure CN119065784B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, apparatus, device, storage medium, and product for creating a virtual machine. Background Art
[0002] With the development of computer technology, virtual machine technology has gradually been widely used in various fields due to its advantages such as efficient resource utilization, excellent isolation, and strong security. Among them, a virtual machine can be created and deployed on an electronic device, and a complete computer system is simulated through software to implement multiple independent and completely isolated computer environments on the same electronic device. Through virtual machine technology, users can quickly respond to business requirements and perform multitasking.
[0003] Currently, users can select the desired configuration from the virtual machine configuration options provided by cloud service providers according to their own needs. Then, the cloud service providers can create a virtual machine according to the selected configuration by the users and deploy it on a suitable electronic device. When deploying a virtual machine, cloud service providers usually deploy it on an electronic device of a preset fixed model. For example, if a user specifies the configuration of the central processing unit (CPU) 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 and low resource utilization of virtual machine deployment. Summary of the Invention
[0004] Embodiments of this 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 a fixed model, the deployment is more flexible, and to a certain extent, the resource utilization rate can also be improved.
[0005] In a first aspect, embodiments of this application provide a method for creating a virtual machine, including:
[0006] Obtaining configuration requirement information of a virtual machine to be created, and configuration information respectively corresponding to multiple candidate electronic devices, where the configuration requirement information includes configuration information of a specified processor required by the virtual machine to be created, and the candidate electronic devices are equipped with the specified processor and other processors;
[0007] Matching the configuration requirement information with the configuration information respectively corresponding to the multiple candidate electronic devices to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information;
[0008] Select a target electronic device from the set of candidate electronic devices according to the resource usage of the specified processors of each candidate electronic device in the set of candidate electronic devices and the resource usage of other processors, and create a virtual machine in the target electronic device.
[0009] In a second aspect, an embodiment of the present application provides a virtual machine creation device, including:
[0010] An acquisition unit, configured to acquire configuration requirement information for a virtual machine to be created, and configuration information corresponding to multiple candidate electronic devices respectively, where the configuration requirement information includes configuration information of a specified processor required for the virtual machine to be created, and the candidate electronic devices are equipped with the specified processor and other processors;
[0011] A matching unit, configured to match the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively, to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information;
[0012] A selection unit, configured to select a target electronic device from the set of candidate electronic devices according to the resource usage of the specified processors of each candidate electronic device in the set of candidate electronic devices and the resource usage of other processors, and create a virtual machine in the target electronic device.
[0013] In a possible implementation manner, the matching unit, when matching the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively, is specifically configured to:
[0014] 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 multiple candidate electronic devices respectively;
[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 a target candidate electronic device among the multiple candidate electronic devices, add the target candidate electronic device to the set of candidate electronic devices.
[0016] In a possible implementation manner, the matching unit, when 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 multiple candidate electronic devices respectively, is specifically configured to:
[0017] Match the model information of the specified processor in the configuration information with the model information of the specified processor in the multiple configuration information, and match the resource requirements corresponding to each component with the idle resources of the corresponding components in the multiple configuration information;
[0018] If the model information of the specified processor in the configuration information is the same as the model information of the specified 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, 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, the apparatus 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; determine the total 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 total resource requirements corresponding to each component with the idle resources of the corresponding components in the multiple configuration information;
[0022] The determination unit is further configured to, if the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the total resource requirements corresponding to each component, 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.
[0023] In a possible implementation, the obtaining unit is further configured to obtain the configuration information of the virtual machines deployed in the target candidate electronic device;
[0024] The determination unit is further configured to determine, according to the configuration requirement information and the configuration information of the virtual machines deployed in the target candidate electronic device, a first part of candidate electronic devices that do not meet the preset compatibility rule in the target candidate electronic device, and remove the first part of candidate electronic devices from the candidate electronic device set.
[0025] In a possible implementation, the obtaining unit is further configured to run a reference benchmark test on each candidate electronic device in the candidate electronic device set, and obtain the load information of each candidate electronic device running the reference benchmark test;
[0026] The determination unit is further configured to, 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, remove the second part of candidate electronic devices from the candidate electronic device set.
[0027] In a possible implementation, the selection unit is configured to select a target electronic device from the candidate electronic device set according to the resource usage of the specified processors of each candidate electronic device in the candidate electronic device set and the resource usage of other processors. Specifically, it is configured to:
[0028] Obtain the first idle resources of the specified processors of each candidate electronic device in the candidate electronic device set and the second idle resources of other processors;
[0029] Determine the remaining idle resources of the specified processors of each candidate electronic device in the candidate electronic device set according to the configuration information and the first idle resources;
[0030] Select the target electronic device from the candidate electronic device set according to the resource difference between the remaining idle resources and the second idle resources.
[0031] In a possible implementation, the selection unit is configured to select the target electronic device from the candidate electronic device set according to the resource difference between the remaining idle resources and the second idle resources. Specifically, it is configured to:
[0032] Obtain service configuration information associated with the configuration requirement information;
[0033] Match the preset service rules with the service configuration information, and select the target electronic device from the candidate electronic device set in ascending order of the resource difference from the candidate electronic devices that match the preset service rules and the service configuration information.
[0034] In a possible implementation, the device further includes:
[0035] A monitoring unit configured to monitor the performance data of the virtual machine to obtain the load value corresponding to the virtual machine;
[0036] A processing unit configured to, if it is monitored that the load value is greater than a preset load threshold, adjust the resources of the virtual machine according to the configuration information and the configuration information of specific components in the configuration requirement information.
[0037] In a possible implementation, the processing unit is configured to adjust the resources of the virtual machine according to the configuration information and the configuration information of specific components in the configuration requirement information. Specifically, it is configured to:
[0038] If it is determined that a preset migration condition is satisfied according to the configuration information and the configuration information of the specific components, determine migration requirement information according to the load value and the configuration requirement information;
[0039] Select a specified electronic device from other electronic devices except the target electronic device among multiple candidate electronic devices according to the migration requirement information, and migrate the virtual machine from the target electronic device to the specified electronic device.
[0040] In a possible implementation manner, the processing unit is configured to select a specified electronic device from other electronic devices except the target electronic device among multiple candidate electronic devices according to the migration requirement information, and specifically:
[0041] Match the migration requirement information with the configuration information corresponding to each of the other electronic devices to obtain a set of migration electronic devices whose configuration information matches the migration requirement information;
[0042] Select the specified electronic device from the set of migration electronic devices according to the resource usage of the specified processor of each migration electronic device in the set of migration electronic devices and the resource usage of other processors.
[0043] In a possible implementation manner, the processing unit is configured to adjust the resources of the virtual machine according to the configuration information and the configuration information of specific components in the configuration requirement information, and specifically:
[0044] If it is determined that the preset migration condition is not satisfied according to the configuration information and the configuration information of the specific components, then determine the reference resource information corresponding to the load value according to the correspondence between the load value and the reference resource information, and the reference resource information includes the reference added resources corresponding to one or more components;
[0045] Perform a hot-add process on the resources of the virtual machine according to the reference added resources corresponding to the one or more components.
[0046] In a possible implementation manner, the obtaining unit is further configured to, if there is no candidate electronic device among multiple candidate electronic devices whose configuration information matches the configuration requirement information, obtain the specified configuration information corresponding to multiple specified candidate electronic devices, and the multiple specified candidate electronic devices are only equipped with the specified processor;
[0047] The matching unit is further configured to match the configuration requirement information with the configuration information corresponding to multiple specified candidate electronic devices respectively to obtain a set of specified candidate electronic devices whose specified configuration information matches the configuration requirement information;
[0048] The selection unit is further configured to select a target specified electronic device from the candidate electronic device set according to the resource usage of the specified processors of the specified candidate electronic devices in the specified candidate electronic device set, and create the virtual machine in the target specified electronic device.
[0049] In a third aspect, an embodiment of the present application provides an electronic device, which includes one or more processors; a memory for storing one or more computer programs, and 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 in the first aspect described 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 instructions are run on a computer, the computer executes the method for creating a virtual machine in the first aspect described above.
[0051] In a fifth aspect, an embodiment of the present application provides a computer program product, where the computer program product includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the method for creating a virtual machine in the first aspect is implemented.
[0052] In the technical solution provided by some embodiments of the present application, when deploying a virtual machine, configuration requirement information of the virtual machine to be created can be obtained, and the configuration requirement information includes configuration information of a specified processor, and configuration information corresponding to multiple candidate electronic devices can be obtained. The multiple candidate electronic devices are electronic devices equipped with a specified processor and other processors. Furthermore, the configuration requirement information can be matched with the configuration information corresponding to the multiple candidate electronic devices respectively to obtain a candidate electronic device set in which the configuration information matches the configuration requirement information. According to the resource usage of the specified processors of the candidate electronic devices 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, so as to deploy the virtual machine in an electronic device equipped with a specified processor and other processors. It can be seen that a virtual machine configured with a specified processor by a user can be deployed in an electronic device equipped with a specified processor and other processors. Compared with selecting from 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 beneficial to improving the resource utilization rate. Description of the Drawings
[0053] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0054] Figure 1 It is a schematic structural diagram of a virtual machine creation system provided by an embodiment of the present application;
[0055] Figure 2 It is a schematic flowchart of a virtual machine creation method provided by an embodiment of the present application;
[0056] Figure 3 It is a schematic diagram of the architecture for matching a virtual machine deployment device provided by an embodiment of the present application;
[0057] Figure 4 It is a schematic timing diagram of performance evaluation provided by an embodiment of the present application;
[0058] Figure 5 It is a schematic timing diagram of adaptability decision-making provided by an embodiment of the present application;
[0059] Figure 6 It is a schematic structural diagram of a computing resource adaptive discriminator provided by an embodiment of the present application;
[0060] Figure 7 It is a schematic timing diagram of selecting a target electronic device provided by an embodiment of the present application;
[0061] Figure 8 It is a schematic timing diagram of creating a virtual machine in a target electronic device provided by an embodiment of the present application;
[0062] Figure 9 It is another schematic flowchart of a virtual machine creation method provided by an embodiment of the present application;
[0063] Figure 10 It is a schematic timing diagram of adjusting the resources of a virtual machine provided by an embodiment of the present application;
[0064] Figure 11 It is a schematic structural diagram of a hybrid deployment adapter provided by an embodiment of the present application;
[0065] Figure 12 It is a schematic structural diagram of a virtual machine creation device provided by an embodiment of the present application;
[0066] Figure 13 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[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 describe the implementation manners of the technical solutions proposed in the embodiments of the present application clearly and completely in combination with one or more attached drawings. Moreover, each of the attached drawings shown in the embodiments of the present application is only for exemplary illustration. For example, the execution order of each step in the attached 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 each attached drawing are only functional entities, and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in the form of software, or, implemented in one or more hardware modules or integrated circuits, or 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 with a predetermined function or a part of a computer program, which 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 a processing circuit or a memory), or a combination thereof. Similarly, one 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 a part of the overall module or unit that includes the function of the module or unit.
[0069] It should be noted that: "a plurality of" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0070] Currently, in the process of deploying virtual machines, it is found that: users can, according to their own needs, select the desired virtual machine hardware configuration on the virtual machine configuration platform provided by cloud service providers. Then, the cloud service providers can create virtual machines according to the selected configuration and deploy them on suitable electronic devices. For example, users can select the configuration of a specified processor of the virtual machine. Then, the cloud service providers can usually select from electronic devices equipped only with 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 that electronic devices equipped with the specified processor and other processors can also meet the configuration requirements of the virtual machine. In the case where there is idle specified processor resources in the electronic devices equipped with the specified processor and other processors, it may cause waste of resources of such electronic devices, resulting in low flexibility and low resource utilization rate in virtual machine deployment.
[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 of the deployable electronic devices can be selected for deployment, that is, to create a virtual machine, so that the deployment of the virtual machine is no longer limited to the fixed models provided by cloud service providers, such as models only equipped with the specified processor. The deployment of the virtual machine is more flexible, which is conducive to reducing resource waste and improving resource utilization rate, and can maintain or improve application performance to a certain extent.
[0072] Based on the above description, please refer to Figure 1 , Figure 1 which is a schematic architecture diagram of a virtual machine creation system provided by an embodiment of the present application. As Figure 1 shown, the virtual machine creation system includes a user terminal 101, a virtual machine deployment device 102, candidate electronic devices 103, and a database 104. Among them, the user terminal 101 can be directly or indirectly connected to the virtual machine deployment device 102 in a wired or wireless manner. The virtual machine deployment device 102 can be directly or indirectly connected to the candidate electronic devices 103 in a wired or wireless manner. Among them, the number of candidate electronic devices 103 can be multiple, and the virtual machine deployment device 102 can be directly or indirectly connected to each candidate electronic device 103 in a wired or wireless manner. The configuration information corresponding to the candidate electronic devices is stored in the database 104. It should be noted that Figure 1 the number and form of the devices shown are for illustration 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 can be the same electronic device.
[0073] Among them, the user terminal 101 can be an electronic device, specifically a terminal device, which may include but is not limited to: smart phones (such as Android phones, IOS phones, etc.), tablet computers, portable personal computers, Mobile Internet Devices (MIDs), intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, wearable devices, etc. The embodiments of the present application do not make any limitations in this regard. The virtual machine deployment device 102 and the candidate electronic device 103 can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The embodiments of the present application do not make any limitations in this regard. The database 104 can be a cloud-stored database or a locally stored database. The embodiments of the present application do not make any limitations in this regard.
[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. The user can input the configuration of the virtual machine they want 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 a 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 the virtual machine creation solution provided by the present 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 can include the configuration information of the specified processor. The virtual machine deployment device 102 can obtain the configuration information corresponding to each of the multiple candidate electronic devices 103 in the database for storing the configuration information of the candidate electronic devices 103. 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 each of the multiple candidate electronic devices 103 to 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 set of candidate electronic devices according to the resource usage of the specified processor and the resource usage of other processors in each candidate electronic device in the set of candidate electronic devices, and create a virtual machine in the target electronic device.
[0077] In one implementation, the above-mentioned configuration requirement information and configuration information can both be stored in the blockchain, which can prevent the configuration requirement information and configuration information from being tampered with. Among them, the blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. In essence, it is a decentralized database, a string of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, 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 embodiments of the present application is for more clearly explaining the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0079] Based on the above virtual machine creation system, the embodiments of the present application provide a method for creating a virtual machine. The method for creating a virtual machine described in the embodiments of the present application can be executed by an electronic device, and the electronic device can be Figure 1 the virtual machine deployment device 102 in the virtual machine creation system shown. Please refer to Figure 2 , Figure 2 is a flowchart of a method for creating a virtual machine provided by the embodiments of the present application. The method for creating a virtual machine includes the following steps S201 to step S203:
[0080] S201. Obtain the configuration requirement information of the virtual machine to be created, and the configuration information corresponding to each of the multiple candidate electronic devices.
[0081] In an embodiment of the present application, a virtual machine to be created refers to a virtual machine that has not been created yet, and it can be a virtual machine planned by a user to execute 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 the processor, memory, storage, and network, can be abstracted into multiple virtual resources, and each virtual machine can independently access and use these virtual resources as if it were 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 it can include the configuration information of each component. Each component can be, for example, a processor, memory, disk, etc. Among them, the configuration requirement information can include the configuration information of a specified processor. The specified processor can be, for example, a CPU. The configuration information of the CPU can include the model and performance indicators of the CPU. The performance indicators such as the number of cores of the CPU can 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 can be "AMD xx model, 8 cores, 64GB", where AMD xx model is the model information of the CPU, 8 cores means the required number of CPU cores is 8, and 64G means the memory size. Another exemplarily, the configuration requirement information input by the user can 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 the required number of CPU cores is 18, 128GB means the memory size, 1TB storage means the size of the disk space, and 10Gbps means the size of the network bandwidth.
[0083] Among them, the candidate electronic device can be an electronic device for creating and running virtual machines, such as the above-mentioned physical computer, which can be a physical server. There may already be virtual machines deployed on the candidate electronic device, or there may be no virtual machines deployed. In the scenario of creating and running virtual machines, the candidate electronic device can be called a host machine, a mother machine, etc. When the electronic device for deploying virtual machines 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 Processing Unit (GPU) resources can be called a GPU virtual machine. Deploying both a CPU virtual machine and a GPU virtual machine on an electronic device can be understood as a scenario of hybrid deployment of CPU and GPU. The candidate electronic device can be a physical server with a virtualization environment deployed, and the virtual machine can use some or all of the resources of this physical server. The resources of this candidate electronic device (such as a physical server) can be the resources sold by a cloud service provider. Users can purchase according to the resources required for the virtual machines created by the plan. Then, the cloud service provider can deploy the virtual machines 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 this virtual machine to execute the tasks that the user wants to execute.
[0084] It should be noted that multiple candidate electronic devices can all be electronic devices equipped with a specified processor and other processors. The specified processor can be a CPU, and other processors can be, for example, GPUs, or other types of processors, which are not limited in this application. The configuration information corresponding to multiple candidate electronic devices can be the hardware information of each candidate electronic device. For example, it can include processor configuration, memory configuration, storage configuration, and network configuration, and can also include other configurations, which are not limited in this application. Specifically, the processor configuration can include, for example, the model, quantity, and performance metrics of the CPU and GPU. The performance metric can be the number of cores. The processor configuration can also include the NUMA structure of the CPU, etc. The memory configuration can include the memory size, speed, etc. The storage configuration can include the read and write speeds of the disks, etc. The network configuration can include network interfaces and performance metrics of the network, such as network bandwidth, etc.
[0085] It can be understood that after the virtual machine deployment device obtains the configuration requirement information that only includes the configuration information of the specified processor, that is, the user only needs the resources of the specified processor (such as CPU), it can select an electronic device that meets the user's needs from the candidate electronic devices equipped only with CPU for deployment. This deployment method may ignore the sufficient and idle CPU resources in the server equipped with CPU and other processors (such as GPU). This is because in a diversified cloud computing environment, the user's demand for computing resources shows diversity, especially in the utilization of GPU and CPU resources. Against the background of hardware diversification and personalized computing requirements, different CPU architectures, GPU models, and their NUMA topologies make resource configuration and optimization more complex. Some users may purchase more GPU resources for deploying virtual machines to execute related tasks in order to perform high-intensity graphics processing and parallel computing tasks. As a result, there may be idle CPU resources in the server that do not deploy any virtual machines, causing waste of resources, low resource utilization, and this inflexible deployment method may also affect the economic benefits of cloud service providers. Therefore, in the embodiment of the present application, the virtual machine deployment device can first determine whether it can be deployed in an electronic device equipped with CPU and GPU according to the configuration requirement information. If it can, it can be configured in the electronic device equipped with CPU and GPU to avoid wasting resources.
[0086] In a possible implementation manner, the virtual machine deployment device can provide a platform for the user to input the desired configuration requirement information. The user can input the configuration of the virtual machine to be created based on this 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 devices 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. This database can be called a hardware specification database, which stores the configuration information of all candidate electronic devices. 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 respectively obtain its own configuration information by integrating (installing) software for hardware detection, and further store the obtained configuration information in the database by running the software for hardware testing. The software for hardware testing can be, for example, HWiNFO and CPU-Z, or other software or tools. The present application does not make any limitations in this regard.
[0087] In some embodiments, the virtual machine deployment device can also obtain the configuration information of each candidate electronic device separately through software or tools integrating hardware testing, and store it in a database for obtaining 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, be able to 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 the database, that is, automatically collect the configuration information of each candidate electronic device.
[0088] In another embodiment, each candidate electronic device can also be integrated (installed) with software for hardware detection, such as HWiNFO and CPU-Z, etc. Each candidate electronic device can obtain its own configuration information by running the software for hardware detection. Then each candidate electronic device can send its own configuration information to the virtual machine deployment device, and the virtual machine deployment device receives and stores it in the database.
[0089] S202. Match the above configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively to obtain a set of candidate electronic devices whose configuration information matches the above configuration requirement information.
[0090] In the embodiments of the present application, the purpose of matching the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively is to determine whether there is one or more electronic devices among the multiple candidate electronic devices that can provide resources meeting user requirements. Thus, it is determined whether the virtual machine can be deployed on the electronic devices among the multiple candidate electronic devices. Among them, the set of candidate electronic devices 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 set of candidate electronic devices can provide resources meeting user requirements.
[0091] In a possible implementation, during the process of matching the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices, specifically, the hardware specifications of each component in the configuration requirement information can be respectively matched with the hardware specifications of the corresponding components in the configuration information corresponding to multiple candidate electronic devices. For example, the configuration requirement information includes the configuration information of the CPU, and this 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 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 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 respectively matched, 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 as to further screen out an electronic device for deploying the virtual machine when there are multiple candidate electronic devices in the candidate electronic device set. 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 multiple.
[0093] Specifically, during the process of matching the hardware specifications of each component respectively, the virtual machine deployment device can match the model information of the specified processor in the configuration information included in the configuration requirement information with the model information of the specified processor in multiple pieces of configuration information (the configuration information corresponding to multiple candidate electronic devices). Specifically, it can filter out the candidate electronic devices whose model information of the specified processor in the configuration information included in the configuration requirement information is the same. 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 the candidate electronic devices with the same Intel Xeon Gold 6248R from the model information of the CPU in multiple pieces of configuration information.
[0094] Furthermore, the virtual machine deployment device can match the resource requirements corresponding to each component with the idle resources of the corresponding component in multiple pieces of configuration information. Specifically, it can filter out the candidate electronic devices whose idle resources of each component can meet the resource requirements corresponding to each component. Among them, the resource requirement refers to the requirement for 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. The idle resource refers 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 as "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 that the resource requirement of the CPU is 18 cores, the resource requirement of the memory is 128GB, the resource requirement of the disk is 1TB, and the resource requirement of the network is 10Gbps. For example, if the idle resource of the CPU of a certain candidate electronic device is only 10 cores, or the memory is only 100GB, it is determined that the idle resources of each component in this 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 taken as examples for explanation here. In fact, the idle resources of all components are required to meet the resource requirements corresponding to each component.
[0095] Furthermore, in the virtual machine deployment device, when the model information of the processor specified in the determined configuration requirement information 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 obtained target candidate electronic device to the candidate electronic device set.
[0096] In a possible implementation, considering that after creating a virtual machine in a certain electronic device, users may perform certain operations through the virtual machine, which may affect other virtual machines in the electronic device. Therefore, it is necessary to reserve some resources to handle this situation. Thus, 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 the resource reservation rules pre-configured by the cloud service provider for determining the reserved resource requirements, and can specifically include the reserved resource requirements corresponding to each component. The reserved resource requirements are the specific resource quantities that each component needs to reserve. For example, the resource reservation rule can be to reserve 20% of the resources, and the reserved resource requirements corresponding to each component can be calculated according to the resource requirements corresponding to each component. For example, if the resource requirement of the CPU is 10 cores, then the reserved resource requirement is 2 cores. Another example is that the reserved resource requirement can be to reserve a specified quantity of resources, such as the reserved resource requirement of the memory is 15GB.
[0097] Furthermore, the virtual machine deployment device can determine the total 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, it can be obtained by summing the resource requirements corresponding to each component and the reserved resource requirements corresponding to each component. For example, adding the above 10 cores and 2 cores, the total resource requirement is 12 cores. The virtual machine deployment device can match the total resource requirements corresponding to each component with the idle resources of the corresponding components in multiple configuration information. Specifically, it can determine whether there is a target candidate electronic device in the corresponding configuration information of multiple candidate electronic devices, and the idle resources of each component meet the total resource requirements corresponding to each component. For example, if the idle resource of the CPU of a certain candidate electronic device is still 30 cores, then it is determined that this candidate electronic device is 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 in fact, the idle resources of each component need to meet the total resource requirements corresponding to each component. Thus, the virtual machine deployment device completes the conflict detection and can detect whether there are sufficient 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 or running specific tools for each candidate electronic device. 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, can also trigger the execution of the df - h command to view the free disk space, and can also view the CPU utilization rate through a specific tool 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 according to the configuration information of each candidate electronic device and the resource information of the virtual machines that have been deployed. The resource information of the deployed virtual machines can be stored in the database as the configuration information of the deployed virtual machines, and the virtual machine deployment device can obtain it from the database (such as the above - mentioned hardware specification database).
[0099] In a possible implementation manner, 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 machines that have already been deployed on the electronic device, that is, perform a compatibility check. Specifically, after adding the target candidate electronic device to the candidate electronic device set, the virtual machine deployment device can obtain the configuration information of the virtual machines that have been deployed in the target candidate electronic device. The configuration information of the deployed virtual machine can include the resource information of the virtual machine, such as the specific quantity of the resources allocated to the virtual machine. The configuration information of the deployed virtual machine can also include information such as the version of the driver, the firmware version, the operating system, and the information of other necessary software, and can also include other information, such as whether it includes information about special components.
[0100] Furthermore, the virtual machine deployment device can determine the first - part candidate electronic devices that do not meet the preset compatibility rules in the target candidate electronic device according to the configuration requirement information and the configuration information of the virtual machines that have been deployed in the target candidate electronic device. Among them, the configuration requirement information also includes information such as the driver, the firmware version, the operating system, and the information of other necessary software. The preset compatibility rules can be rules including judging whether the operating system, the driver, and other necessary software support the hardware specifications of the current candidate electronic device, and can also include rules for judging whether there is incompatibility between the virtual machine to be created, that is, the virtual machine to be created and the virtual machines that have already been deployed on the target candidate electronic device.
[0101] Exemplarily, if the virtual machine deployment device determines that there is a compatibility difference between a certain driver included in the configuration requirement information, such as the driver of the network card, and 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 performing compatibility analysis based on the configuration information of the candidate electronic device, the virtual machine deployment device can determine that the target candidate electronic device does not meet the preset compatibility rules, and regard the target candidate electronic device as the first part of the candidate electronic devices. Another exemplarily, if the virtual machine deployment device determines that the target candidate electronic device includes a certain specific component, such as a component related to network rate, and the virtual machine to be deployed does not include this component, and not including this component 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 regard 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 the candidate electronic devices from the candidate electronic device set. Removing the first part of the candidate electronic devices from the candidate electronic device set means removing the target candidate electronic devices that do not meet the preset compatibility rules from the candidate electronic device set. The remaining target candidate electronic device set in the candidate electronic device set are all electronic devices that meet the preset compatibility rules. Thus, the virtual machine deployment device has completed the application of the compatibility rules, 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 deploying the virtual machine will not affect the operation of other virtual machines already deployed in the electronic device.
[0103] Please refer to Figure 3 , Figure 3 which is an architecture diagram for matching provided by an embodiment of the present application. As 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. Further, the virtual machine deployment device can match the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively to obtain a matching result, such as obtaining the above-mentioned candidate electronic device set. Further, the virtual machine deployment device can perform a compatibility check by applying a preset compatibility rule to obtain a rule application result, such as screening out the first part of the candidate electronic devices. The virtual machine deployment device can also determine whether there are sufficient reserved resources for multiple candidate electronic devices according to the preset resource reservation rule and the configuration requirement information to achieve conflict detection. Among them, this application does not limit the execution order of the virtual machine deployment device to execute the preset compatibility rule and determine whether there are sufficient reserved resources, which can be specifically determined according to the specific implementation scenario and the order of the script (program) configured by the cloud service provider.
[0104] In a possible implementation manner, after the virtual machine deployment device performs matching and compatibility verification, it can perform a performance evaluation on each candidate electronic device in the candidate electronic device set to perform a 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 a specific benchmark test 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 for evaluating the computing power of the candidate electronic device in the benchmark test software, 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 test software can be, for example, Cinebench, 3DMark, PassMark, etc., and this application does not limit this. The reference benchmark test can be, for example, a CPU test item, a graphics test item, or a comprehensive test item, etc. The load information can include CPU usage, memory usage, disk I / O, etc. The virtual machine deployment device can determine whether the load information corresponding to each candidate electronic device included in the candidate electronic device set meets the preset load condition. The preset load condition can be a threshold of a specific load index set for the load information, and the preset load condition can be pre-configured by the cloud service provider. For example, it can be that the CPU usage rate is lower than xx and the available memory is greater than xx GB, etc. If the virtual machine deployment device determines that there are second part of candidate electronic devices among the load information corresponding to each candidate electronic device included in the candidate electronic device set that do not meet the preset load condition, that is, the simulated load information is too high, which may affect the operation of the already deployed virtual machine, then determine such candidate electronic devices as the second part of electronic devices and remove them from the candidate electronic device set.
[0106] In some embodiments, when the virtual machine deployment device simulates the deployment of the virtual machine to be deployed and fills up the virtual machine, it can also be achieved by running performance evaluation tools on candidate electronic devices. 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 tools can be, for example, LoadRunner, JMeter, etc., and the present application does not limit this.
[0107] Please refer to Figure 4 , Figure 4 which is a timing schematic diagram of performance evaluation provided by an embodiment of the present application. As Figure 4 shown, first, the virtual machine deployment device can select benchmark test software for simulating the deployment of the virtual machine on the candidate electronic device, such as Cinebench, 3DMark, PassMark, etc. These benchmark test software can be used to test the load situation when the candidate electronic device for testing simulates the deployment and fills up the virtual machine. Furthermore, the virtual machine deployment device can run the reference benchmark tests provided by the benchmark test software through each candidate electronic device in the candidate electronic device set and obtain load information. Furthermore, the virtual machine deployment device can analyze the test results, that is, analyze the load information, to obtain the performance report of the candidate electronic device, such as high load in xx situation, low load in xx situation, and the specific load situation of each component, etc. Further, the virtual machine deployment device can judge the load information corresponding to each candidate electronic device based on a preset load condition to determine the second part of the candidate electronic devices. Then, the virtual machine deployment device can perform resource matching, specifically, it can match with the existing resources (candidate electronic devices in the candidate electronic device set), that is, remove 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 on any one of 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 ensure the selection of candidate electronic devices and make the resource allocation for specifically determining the electronic device for deploying the virtual machine more in line with the actual workload of the virtual machine.
[0108] Among them, the virtual machine deployment device can judge whether to deploy the virtual machine on the candidate electronic device equipped with a CPU and a GPU based on the obtained configuration information, configuration requirement information corresponding to multiple candidate electronic devices respectively, and the above evaluation result, so as to judge whether the CPU virtual machine and the GPU virtual machine are suitable for hybrid deployment on the same electronic device. Please refer to Figure 5 , Figure 5 which is a timing schematic diagram of adaptability decision provided by an embodiment of the present application. As Figure 5As shown, the virtual machine deployment device can obtain configuration requirement information and the configuration information corresponding to multiple candidate electronic devices, and then can perform hardware specification matching, design algorithms for compatibility checking (application of compatibility rules), and performance evaluation. Among them, the hardware specification matching, the application of compatibility rules, and the performance evaluation can be understood as the definition and application of preset logic 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 perform hybrid deployment judgment. If the virtual machine deployment device determines that hybrid deployment is suitable when there are candidate electronic devices in the finally obtained candidate electronic device set, it generates an adaptability report. The adaptability report can include the candidate electronic devices in the candidate electronic device set, as well as the results of the above-mentioned hardware specification matching, compatibility rule application, and performance evaluation. Furthermore, the virtual machine deployment device can execute a 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 can be carried out. On the contrary, if the virtual machine deployment device determines that hybrid deployment is not suitable when there are no candidate electronic devices in the finally obtained candidate electronic device set, it proposes improvement suggestions, such as outputting the components with mismatched hardware specifications and the corresponding resources, the specific rules of incompatibility in compatibility, and the performance evaluation results. Furthermore, the decision can be rejected, and the deployment of the virtual machine on the electronic device equipped with a CPU and a GPU is not executed.
[0110] It should be noted that the process of determining the candidate electronic device set based on the configuration information of the candidate electronic devices can be a script or a program run by the virtual machine deployment device, which can be understood as an implementation at the code level. This 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 hybrid deployment of CPU virtual machines and GPU virtual machines based on the configuration requirement information. Please refer to Figure 6 , Figure 6 which is a schematic diagram of the architecture of a computing resource adaptive discriminator provided by an embodiment of the present application. As Figure 6 shown, the computing resource adaptive discriminator is mainly used to perform three parts of operations, among which:
[0111] The first part is the collection of configuration information, that is, obtaining the configuration information corresponding to the candidate electronic devices, such as the CPU / GPU models, the performance indicators of each component, the NUMA topology structure of the processor, the memory size and memory speed, the read / write speed of the disk, and the performance parameters of the network, such as network bandwidth. The second part is the compatibility check, which can specifically include checking whether the software supports the hardware specifications of the candidate electronic devices, such as whether the operating system, driver, firmware version, and other necessary software support the hardware specifications of the candidate electronic devices. It can also include the compatibility analysis between virtual machines, such as whether there is incompatibility between the virtual machine and the virtual machines already deployed on the candidate electronic devices. The third part is the performance evaluation. The load information of the virtual machine deployed on the candidate electronic device can be simulated by running benchmark test software, and resource matching can be performed. This resource matching can also be called computing power requirement matching, that is, according to whether the load information obtained through performance evaluation of different candidate electronic devices meets the preset load rules, so as to finally obtain an adaptability decision, that is, to determine the final set of candidate electronic devices, or it is not suitable for hybrid deployment, there is no set of candidate electronic devices or the set of candidate electronic devices does not include any candidate electronic devices.
[0112] S203. According to the resource usage of the designated processors of each candidate electronic device in the above candidate electronic device set, and the resource usage of other processors, select a target electronic device from the above candidate electronic device set, and create a virtual machine in the above target electronic device.
[0113] In the 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 (GPUs) may be the number of allocated cores and the number of unallocated cores of other processors (GPUs). The target electronic device is the electronic device finally determined to deploy the virtual machine, that is, the electronic device where the virtual machine finally resides. Specifically, during the process of the virtual machine deployment device selecting the target electronic device from the candidate electronic device set, it can specifically obtain the first idle resources of the designated processors of each candidate electronic device in the candidate electronic device set, and the second idle resources of other processors. Furthermore, the virtual machine deployment device can determine the remaining idle resources of the designated processors of each candidate electronic device in the candidate electronic device set according to the configuration information and the first idle resources, and select the target electronic device from the candidate electronic device set according to 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 CPU cores not allocated to other virtual machines, and the second idle resource may refer to the number of GPU cores not allocated to other virtual machines. The remaining idle resource refers to the remaining number of CPU cores after the virtual machine is deployed if it is deployed in the candidate electronic device. The remaining idle resource can be the numerical difference between the first idle resource and the CPU resource requirement in the configuration information. The resource difference may refer to the numerical difference in the number of cores between the remaining idle resource and the second idle resource. The virtual machine deployment device can select a target electronic device from the candidate electronic device set based on the resource difference. It should be noted that the purpose of selecting the target electronic device here is to select an optimal combination of CPU and GPU. Selecting based on the idle resources of both is to determine whether the remaining resources of the CPU and GPU are convenient for 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 improve the economic benefits of the cloud service provider.
[0115] Specifically, the virtual machine deployment device can obtain the service configuration information associated with the configuration requirement information and match the preset service rules with the service configuration information. Among them, the service configuration information may be the configuration information related to the user's service. For example, the geographical information of the electronic device where the user requests to deploy the virtual machine, that is, the city where the electronic device is located. Another example is whether the user is a customer with a specific identity of the cloud service provider, such as a VIP customer, etc. Matching the preset service rules and the service configuration information can be understood as packing to select the optimal candidate electronic device from the candidate electronic device set. In the embodiment of the present application, packing (packing scheduling) means that multiple filters can be set, and each filter can correspond to a preset service rule respectively. The service configuration information is filtered through multiple filters to obtain the candidate electronic device that matches the preset service rule and the service configuration information. Exemplarily, for example, the preset service rule of the first filter may be whether the geographical information of the candidate electronic device is Beijing, the preset service rule of the second filter may be whether the user is a user in the whitelist, and the preset service rule of the third filter may be whether there is a candidate electronic device reserved for the user. The preset service rules can be set by the cloud service provider in advance according to the screening logic, and the present application does not limit this. Thus, the virtual machine deployment device can screen out the candidate electronic device that matches the preset service rule and the service configuration information.
[0116] Furthermore, the virtual machine deployment device can select a target electronic device from the candidate electronic devices matched by the preset service rules and service configuration information in ascending order of the resource difference. The resource difference is the numerical difference between the remaining idle resources of the specified processor of the candidate electronic device and the second idle resources of other processors. The target electronic device is the electronic device finally determined to deploy the virtual machine. Selecting in ascending order of the resource difference can be understood as the more average the remaining number of cores of the CPU and GPU (the smaller the resource difference), the more conducive it may be to continue deploying new virtual machines subsequently, thereby improving the economic benefits of cloud service providers. Therefore, the virtual machine deployment device can select an electronic device from the candidate electronic device set as the target electronic device based on the ascending order of the resource difference, 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 devices matched by the preset service rules and service configuration information according to the preset resource ratio condition and resource difference. The preset resource ratio condition can be the best combination of resources required for subsequent virtual machine deployment. The virtual machine deployment device can also sort the candidate electronic devices matched by the preset service rules and service configuration information according to the remaining idle resources of the specified processor, the second idle resources of other processors, and a certain algorithm, so as to determine that the remaining resources are convenient for subsequent further virtual machine deployment.
[0118] In some embodiments, the virtual machine deployment device can select the candidate electronic device matched by the preset service rules and service configuration information from the candidate electronic device set as the target electronic device in ascending order of the resource difference. That is to say, the virtual machine deployment device can first make a judgment based on the resource difference and then perform the matching of the preset service rules and service configuration information, or it can first perform the matching of the preset service rules and service configuration information and then make a judgment based on the resource difference. This application does not make any limitations on this.
[0119] Please refer to Figure 7 , Figure 7 which is a timing schematic diagram of selecting a target electronic device provided by an embodiment of this application. As Figure 7As shown, the process of selecting a target electronic device from a set of candidate electronic devices can be referred to as the process of resource mapping. The virtual machine deployment device can first obtain the service configuration information associated with the configuration requirement information of the virtual machine, and then inventory the resources of the candidate electronic devices, that is, obtain the set of candidate electronic devices. Further, the virtual machine deployment device can evaluate combinations of a specified processor and other processors, for example, evaluate 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 packing and scheduling manner, that is, select the target electronic device. For example, when matching a preset service rule with the service configuration information, in the process of selecting the target electronic device by packing, the preset service rule can include multiple rule filters. The virtual machine deployment device can determine whether all service requirements (service configuration information) of the virtual machine to be created are met based on the matching results between the service configuration information and the multiple filters in the preset service rule. If so, the virtual machine deployment device can perform resource mapping.
[0120] Specifically, the virtual machine deployment device can specifically 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 specified processor of the virtual machine to be created is 10 cores, it can be mapped to the 6th - 16th cores of the idle resources of the specified processor of the target electronic device. Similarly, the virtual machine deployment device can perform the same allocation for the idle resources of memory and the idle resources of storage (the idle resources of the disk) based on the configuration requirement information until the resource mapping of each component is completed. The above entire resource mapping process can be a resource mapping algorithm designed for 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. Further, 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 manner, a virtualization management platform such as VMware vSphere, KVM, etc. can be integrated in the target electronic device to automatically execute the process of creating and configuring the virtual machine and automate the configuration of each component, such as automating the configuration of network and storage. After creating the virtual machine, 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 refer to Figure 8 , Figure 8 is a timing schematic 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 starting the automated deployment, the virtual machine deployment device can create virtual machines through the virtual machine management platform based on the integrated virtualization management platform. The target electronic device can integrate virtualization management platforms such as VMware vSphere and KVM. Taking the virtualization management platform integrated in the target electronic device as VMware vSphere as an example, the virtual machine deployment device can create virtual machines based on the written script through the vSphere Application Programming Interface (API) and configure the mapped resources to the created virtual machines. The virtual machine deployment platform can also manage the virtualization environment through the management console, such as vSphere Client, create and configure virtual machines through the graphical interface, and specifically configure the hardware specifications of the virtual machines, such as CPU, memory, disk, and network.
[0122] For another example, taking the virtualization platform integrated in the target electronic device as KVM as an example, software packages of libvirt and qemu-kvm are installed on the target electronic device. Among them, 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 the 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 for the virtual machine. This XML file describes the configuration of the virtual machine, and the mapped resources are configured to the created virtual machine. This XML file can configure the hardware specifications of the virtual machine, specifically including CPU, memory, disk, and network, etc. The virtual machine deployment device can load this 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 the console or 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 in the International Organization for Standardization (ISO) format and installation through running the operating system installation program. The virtual machine deployment device can also trigger the installation of drivers suitable for the virtualization environment in the virtual machine to ensure that the virtual machine can make full use of the hardware resources provided by the target electronic device. The virtual machine deployment device can also trigger the installation of relevant tools in the virtual machine, such as tools for managing the virtual machine, so as to monitor and manage the virtual machine from the outside.
[0124] Furthermore, the virtual machine deployment device can trigger tests on the performance and network connection capabilities of the virtual machine. For example, the performance of the virtual machine can be evaluated through performance tests, which can be specifically used to determine the performance of the virtual machine when processing different workloads to ensure that it meets the requirements of the tasks to be executed by the user. The performance test can be a preset benchmark test, such as including CPU benchmark tests, memory performance tests, disk performance tests, and network throughput tests, etc., so as to obtain test results. The test results can include CPU usage, memory usage, disk read / write speed, and network latency / throughput, etc. Furthermore, the virtual machine deployment device can determine whether the performance test meets the expectations based on relevant evaluation criteria, that is, determine whether the test passes. The virtual machine deployment device can test the connectivity between the virtual machine and the external network or other virtual machines by triggering commands such as ping, obtain the test results, and can determine whether the connectivity test results pass based on relevant evaluation criteria.
[0125] Furthermore, the virtual machine deployment device can determine whether the virtual machine passes 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 fails the test, it will roll back the modification, that is, roll back to re-match the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively to select another electronic device as the target electronic device for creating the virtual machine until a virtual machine that passes the test is created. And, if the virtual machine fails the test, an error will be reported and the current process of continuing to select candidate electronic devices will be terminated.
[0126] In a possible implementation, after the virtual machine deployment device matches the configuration information corresponding to 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 this set does not include any candidate electronic devices, 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 hybrid deployment of CPU virtual machines and GPU virtual machines. The virtual machine deployment device can obtain the specified configuration information corresponding to multiple specified candidate electronic devices, and these multiple specified candidate electronic devices are only equipped with specified processors. Among them, the specified candidate electronic device is an electronic device only equipped with a CPU, on which a virtual machine can be deployed or no virtual machine can be deployed. The specified configuration information can include the hardware information of each specified candidate electronic device. For example, it can include processor configuration, memory configuration, storage configuration, and network configuration, and can also include other configurations, which are not limited in this application. Specifically, the processor configuration can include, for example, the model, quantity, and performance metrics of the CPU. The performance metric can be the number of cores. The processor configuration can also include the NUMA structure of the CPU, etc. The memory configuration can include the memory size, speed, etc. The storage configuration can include the read and write speed of the disk, etc. The network configuration can include the network interface and the performance metrics of the network, such as network bandwidth, etc.
[0127] It can be understood that the virtual machine deployment device can first screen in the pool of candidate electronic devices equipped with a CPU and a GPU to see if a candidate electronic device can be selected for deploying the virtual machine. If no candidate electronic device can be screened out, it can further screen in the pool of specified candidate electronic devices only equipped with a CPU until a candidate specified electronic device that meets the requirements of the virtual machine to be created is selected. For cloud service providers, this method enables users to flexibly select virtual machine configurations according to their own needs and is no longer restricted by the fixed models provided by cloud service providers. This flexibility is particularly important for users with special performance requirements, who can customize resource configurations according to specific application scenarios, thereby optimizing performance and costs.
[0128] Specifically, the virtual machine deployment device can match the configuration requirement information with the configuration information corresponding to multiple specified candidate electronic devices respectively to obtain a set of specified candidate electronic devices whose specified configuration information matches the configuration requirement information. Among them, matching the configuration requirement information with the configuration information corresponding to multiple specified candidate electronic devices respectively can specifically be to perform hardware specification matching, check based on compatibility rules, and perform reserved resource matching (such as the above conflict detection) to obtain a set of specified candidate electronic devices. The set of specified candidate electronic devices can include multiple specified candidate electronic devices, and the configuration information of each specified candidate electronic device matches the configuration requirement information.
[0129] Among them, for the principle of matching the configuration requirement information with the configuration information corresponding to multiple specified candidate electronic devices respectively, reference can be made to the specific description of matching the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively in step S202, which will not be elaborated here. It should be noted that since the GPU is not equipped in multiple specified candidate electronic devices, the preset compatibility rules may vary according to different electronic devices, and all are rules for checking whether the operating system, driver, and other necessary software support the hardware specifications of the current candidate electronic device. It may also include rules for judging whether there is an incompatibility between the virtual machine to be created and the virtual machines already deployed on the specified candidate electronic device. The compatibility rules can be determined according to the hardware specifications of the specific electronic device and the deployed virtual machines.
[0130] Furthermore, after obtaining the specified candidate electronic device set, reference benchmark tests can be run on each specified candidate electronic device in the specified candidate electronic device set to remove some specified candidate electronic devices from the specified candidate electronic device set according to the load information obtained from the tests. In addition, the virtual machine deployment device can also select a target specified electronic device from the candidate electronic device set according to the resource usage of the specified processors of each specified candidate electronic device in the specified candidate electronic device set, and create a virtual machine in the target specified electronic device. Among them, for the principle of running reference benchmark tests on each specified candidate electronic device in the specified candidate electronic device set, removing some specified candidate electronic devices from the specified candidate electronic devices according to the load information obtained from the tests, and selecting a target specified electronic device from the specified candidate electronic device set according to the resource usage of the specified processors of each specified candidate electronic device, and constructing a virtual machine in the target specified electronic device, reference can be made to the relevant descriptions in steps S202 - S203, which will not be elaborated here.
[0131] It should be noted that the specific test content of the reference benchmark test run on the specified candidate electronic device equipped only with the specified processor (CPU) may be different from that of the candidate electronic device equipped with the specified processor (CPU) and other processors (GPU), which can be specifically determined according to business requirements and application scenarios. And when selecting a specified candidate electronic device from the specified candidate electronic device set, it can be selected only based on the resource usage of the CPU, such as in the order of the remaining free resources from large to small, or it can also be selected based on other methods, which are not limited in this application. Thus, the virtual machine deployment device finally determines the electronic device for deploying the virtual machine and completes the deployment of the virtual machine.
[0132] In the technical solutions provided by 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. The configuration requirement information includes the configuration information of a specified processor, and the configuration information corresponding to multiple candidate electronic devices is obtained. The multiple candidate electronic devices are electronic devices equipped with the specified processor and other processors. Furthermore, the configuration requirement information can be matched with the configuration information corresponding to the multiple 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 specified processor and the resource usage of other processors of each candidate electronic device in the set of candidate electronic devices, a target electronic device can be selected from the set of candidate electronic devices, and a virtual machine can be created in the target electronic device to deploy the virtual machine in an electronic device equipped with the specified processor and other processors. Thus, it can be seen that a virtual machine configured with a specified processor by a user can be deployed in an electronic device equipped with the specified processor and other processors. Compared with selecting from an electronic device of a fixed model equipped only with the specified processor, the deployment of the virtual machine is more flexible and is also conducive to improving the utilization rate of resources.
[0133] Based on the above virtual machine creation system, an embodiment of the present application provides a method for creating a virtual machine. The method for creating a virtual machine described in the embodiment of the present application can be executed by an electronic device, and the electronic device can be Figure 1 the virtual machine deployment device 102 in the virtual machine creation system shown. Please refer to Figure 9 , Figure 9 is another flowchart of a method for creating a virtual machine provided by an embodiment of the present application. The method for creating a virtual machine includes the following steps S901 - step S902:
[0134] S901. Monitor the performance data of the virtual machine to obtain the load value corresponding to the virtual machine.
[0135] In the embodiment of the present application, the virtual machine deployment device can also monitor the performance data of the created virtual machine. The performance data refers to the resource usage of each component of the virtual machine, which can be understood as the business load. For example, it can be the CPU usage rate, memory usage, disk I / O, and network bandwidth, etc. The load value can be the usage rate of each component (various resources), or the comprehensive score of the resource usage of the electronic device running the virtual machine, or other numerical values used to indicate the load. The present application does not limit this. Among them, the virtual machine deployment device can obtain the performance monitoring tool installed on the electronic device running the virtual machine, such as the performance monitoring tool built in VMware vSphere, and then can send the monitored data 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 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 discover whether the electronic device running the virtual machine has a fault, so as to maintain the stability of the virtualization environment.
[0136] S902. If it is monitored that the above load value is greater than the preset load threshold, the resources of the above virtual machine are adjusted according to the configuration information of the specific component in the above configuration information and the above configuration requirement information.
[0137] In the embodiment of the present application, the preset load threshold can refer to the threshold reasonably set by the administrator of the cloud service provider for the performance indicators in the load value according to the business requirements and the performance of the virtual machine. For example, the preset load threshold can include the threshold of the usage rate of each component (various resources), such as the CPU usage rate being 80% 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 can 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 can refer to the configuration information of the memory. The adjustment process of the resources of the virtual machine can be divided into two methods. 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 judge whether the virtual machine needs to be migrated to other electronic devices.
[0138] Specifically, during the process of adjusting the resources of a virtual machine, the virtual machine deployment device can first determine whether the preset migration conditions are met according to the configuration information and the configuration information of specific components. The preset migration conditions refer to the conditions for judging whether it is necessary to migrate the virtual machine. To minimize service interruption, that is, to minimize the interruption time of the tasks executed in the virtual machine, an online migration method can be adopted to adjust the resources of the virtual machine. The online migration method requires establishing a communication connection between the electronic device currently running the virtual machine and the electronic device to which the virtual machine is to be migrated, and occupying the network bandwidth of the electronic device currently running the virtual machine. If the duration of affecting the network bandwidth is relatively 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 conditions are not met. If it is less, the preset migration conditions are met.
[0139] Specifically, the virtual machine deployment device can estimate the duration required for migration based on the configuration information of the CPU and the configuration information of the memory. For example, when the number of CPU cores is small and the memory is also small, the amount of data to be transmitted is small, and the duration required for online migration is short. On the contrary, when the number of CPU cores is large and the memory is also large, the amount of data to be transmitted is large, and the duration required for online migration is long. Therefore, the virtual machine deployment device can estimate the duration required for online migration according to 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 can also directly judge the number of CPU cores and the memory size against the corresponding thresholds. In this case, there is no need to further estimate the duration required for online migration because if both the number of CPU cores and the memory size are greater than their corresponding thresholds, the estimated duration will definitely be greater than the duration threshold. For example, the virtual machine deployment device can judge whether the number of CPU cores is greater than the first threshold and whether the memory size is greater than the second threshold. If either is greater than its corresponding threshold, it is determined that the preset migration conditions are not met. On the contrary, if both are less than their corresponding thresholds, it is judged that the preset migration conditions are met.
[0141] In a possible implementation, if it is determined that a preset migration condition is met according to the configuration information and the configuration information of a specific component, the migration requirement information is determined according to the load value and the configuration requirement information. 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 can determine the migration requirement information according to the load value and the configuration requirement information, which means that the virtual machine deployment device evaluates the current resource requirements according to the load value and the previous configuration requirement information. Specifically, it can be determined according to the components in the load value that exceed the preset load threshold and the exceeded quantitative indicators, as well as the corresponding relationship between the specific load value and the reference resource requirements. It can also be that a machine learning model is deployed in the virtual machine deployment device, and the load value and the configuration requirement information can be input into the machine learning model, and the machine learning model predicts the migration requirement information. It can also be determined by other methods, and the present application does not limit this.
[0142] After determining the migration requirement information, the virtual machine deployment device can select a specified electronic device from other electronic devices except the target electronic device among multiple candidate electronic devices according to the migration requirement information, and migrate the virtual machine from the target electronic device to the specified electronic device. Among them, the multiple candidate electronic devices can be electronic devices equipped with a CPU and a GPU, and the specified electronic device can be the electronic device finally determined to migrate the virtual machine to. Specifically, in the process of determining the specified electronic device, the virtual machine deployment device can match the migration requirement information with the configuration information corresponding to other electronic devices respectively to obtain a set of migration electronic devices whose configuration information matches the migration requirement information, and select the specified electronic device from the set of migration electronic devices according to the resource usage of the specified processor and the resource usage of other processors in the set of migration electronic devices.
[0143] Among them, the specific implementation of selecting the specified electronic device from other electronic devices except the target electronic device among multiple candidate electronic devices can refer to the description of steps S201 - S203, which will not be elaborated here. It can be understood that, compared with the process of screening the target electronic device for the first time, the candidate electronic devices for this screening are the electronic devices except the target electronic device. After the specified electronic device is screened out, the virtual machine deployment device can trigger the electronic device running the virtual machine currently to check the preconditions, such as whether the preconditions required for migration are met, including network connectivity, storage access permissions, etc. And it can also determine the data synchronization method during the migration process, etc. Furthermore, after the electronic device running the virtual machine currently establishes a communication connection with the specified electronic device, online migration of the virtual machine can be performed. Specifically, the memory and CPU status of the virtual machine can be synchronized to the specified electronic device in real time. After the virtual machine is hot - migrated to the specified electronic device, the virtual machine deployment device can trigger the specified electronic device to monitor the performance data of the virtual machine. Among them, during the process of hot - migrating the virtual machine to another electronic device, the faulty electronic device can be repaired, making the fault repair more efficient. And during the migration process, data backup of the virtual machine will also be performed to ensure the high availability and data integrity of the virtualization environment.
[0144] In another possible implementation, if it is determined that the preset migration conditions are not met according to the configuration information and the configuration information of specific components, 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 thresholds, then it is determined that the preset migration conditions are not met. The virtual machine deployment device can adjust the resources of the virtual machine by means of hot - adding resources. The so - called hot - adding means 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 according to the corresponding relationship between the load value and the reference resource information, and the monitored load value. Furthermore, the virtual machine deployment device can perform hot - adding processing on the resources of the virtual machine according to the reference added resources corresponding to one or more components included in the reference resource information.
[0145] Among them, the reference resource information can be the quantization value of the hot - added resources for reference, and can include the reference added resources corresponding to one or more components, that is, the resource numerical values to be added respectively corresponding to one or more components. For example, the added numerical values corresponding to one or more components among CPU cores, memory, and disk space, such as adding 10 CPU cores. Furthermore, according to the reference added resources corresponding to one or more components, the virtual machine deployment device can, through the virtualization management platform, add additional resources to the virtual machine on the electronic device where the virtual machine is currently running. Thus, the adjustment processing of the resources of the virtual machine is completed.
[0146] In some embodiments, the virtual machine deployment device may also be deployed with a machine learning model for predicting reference resource information. 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. It may also be determined in other ways, and the present application does not limit this.
[0147] In some embodiments, when it is monitored that the load of the virtual machine is lower than the set load threshold within a preset time period, the virtual machine may be migrated to an electronic device on which the virtual machine is deployed, or some resources may be released to use the idle resources to deploy other virtual machines that require more resources, which is beneficial to improving the economic benefits of cloud service providers.
[0148] Please refer to Figure 10 , Figure 10 which is a timing schematic diagram for adjusting the resources of a virtual machine provided by an embodiment of the present application. As Figure 10 shown, first, the virtual machine deployment device may monitor the performance data of the virtual machine. Specifically, the load of the virtual machine may be monitored through 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 may be adjusted. Specifically, the virtual machine deployment device may determine whether it is necessary to migrate the virtual machine. For example, it may be determined whether it is necessary to migrate the virtual machine by judging whether the configuration information of the CPU and memory of the virtual machine meets the preset migration conditions. If it is less, it is determined that there is no need to migrate the virtual machine.
[0149] Further, in the case where it is determined that there is no need to migrate the virtual machine, the resources of the virtual machine may be adjusted by the method of hot adding resources. The virtual machine deployment device may 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 add the resources, that is, adjust the configuration of the virtual machine through the virtualization management platform so that the virtual machine continues to execute tasks based on the new configuration. Then the virtual machine deployment device may monitor the performance data of the virtual machine again through the electronic device running the virtual machine to verify the resource configuration. Specifically, it may be checked whether the load value has been reduced to less than the preset load threshold. Finally, the virtual machine deployment device may view 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 may monitor the performance data of the virtual machine again through the electronic device running the virtual machine to facilitate the next adjustment of the resources of the virtual machine. If not, the change may be rolled back, and the adjustment may be rolled back to the step where the virtual machine deployment device hot adds resources.
[0150] Furthermore, when 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 according to the load value and the configuration requirement information. Then, according to the migration requirement information, the virtual machine deployment device can select a specified electronic device from other electronic devices except the target electronic device among multiple candidate electronic devices, that is, select the target host. 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 specified electronic device. After the data and status synchronization are completed, the migration is completed. 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 for the next time.
[0151] Thus, the virtual machine deployment device can dynamically adjust the resource allocation of the virtual machine according to the change of the business load, realize the online migration and resource hot addition of the virtual machine, decouple the configuration of the virtual machine from the specific hardware resources, make the adjustment of the virtual machine configuration more flexible, and also enable the virtual machine to adjust resources without interrupting the service. In practical applications, it can quickly respond during the load peak, add necessary computing resources, and release resources during the load trough to save costs, realizing the elastic scaling of resources, dynamically adjusting resource allocation according to the actual workload, which can improve resource utilization. In a series of benchmark tests, compared with static resource allocation, the resource utilization is increased by about 20%, the application performance is maintained or improved, which is beneficial to improving the efficiency and accuracy of virtual machine deployment, and is also beneficial 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, the application performance is also maintained or improved.
[0152] It should be noted that the process of selecting the target electronic device from the candidate electronic device set, creating a virtual machine in the target electronic device, and dynamically adjusting the resources of the virtual machine can be a script or a program run by the virtual machine deployment device, which can be understood as an implementation at the code level. This 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 the business requirements and resource status to complete an efficient and flexible hybrid deployment (hybrid deployment of CPU virtual machines and GPU virtual machines). Among them, the above-mentioned computing resource adaptive discriminator and hybrid deployment adapter can be two programs in the intelligent hybrid deployment system, or it can be understood that the implementation of the intelligent hybrid deployment technology is these two programs. Please refer to Figure 11 , Figure 11 is a schematic diagram of the architecture of a hybrid deployment adapter provided by an embodiment of the present application. As Figure 11 shown, the hybrid deployment adapter is mainly used to execute three parts of operations, among which:
[0153] The first part is resource mapping, which can specifically include virtual machine resource requirement mapping. For example, based on the service configuration information associated with the configuration requirement information of the virtual machine, the target electronic device is determined. And based on the resource usage of the CPU and GPU of each candidate electronic device in the candidate electronic device set, the optimal combination of the CPU and GPU is determined, and resources such as CPU, memory, storage, and network are allocated to complete the resource mapping. The second part is the part for automatically deploying virtual machines. Specifically, it starts to create a virtual machine in the target electronic device. The creation and configuration of the virtual machine can be automatically executed. The specific configuration can include hardware specification configuration, network and storage configuration, and further install the operating system, drivers, and tools to complete the automatic deployment. The third part is the part for dynamically adjusting the resources of the virtual machine. 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 process of the resources of the virtual machine is completed.
[0154] Thus, 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, so as to achieve 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, or monitor the status of the electronic device to timely discover and prevent potential problems. 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 the system stability and performance.
[0155] In the technical solutions provided in some embodiments of the present application, when deploying a virtual machine, configuration requirement information of the virtual machine to be created can be obtained. The configuration requirement information includes configuration information of a specified processor, and configuration information corresponding to multiple candidate electronic devices is obtained. The multiple candidate electronic devices are electronic devices equipped with the specified processor and other processors. Furthermore, the configuration requirement information can be matched with the configuration information corresponding to the multiple 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 specified processor and the resource usage of other processors of each candidate electronic device in the set of candidate electronic devices, a target electronic device can be selected from the set of candidate electronic devices, and a virtual machine can be created in the target electronic device to deploy the virtual machine in an electronic device equipped with the specified processor and other processors. Thus, it can be seen that a virtual machine configured by a user with a specified processor can be deployed in an electronic device equipped with the specified processor and other processors. Compared with selecting from an electronic device of a fixed model equipped only with the specified processor, the deployment of the virtual machine is more flexible and is also beneficial to improving the utilization rate of resources.
[0156] The method of the embodiments of the present application is elaborated in detail above. To facilitate better implementation of the above solutions of the embodiments of the present application, correspondingly, an apparatus of the embodiments of the present application is provided below.
[0157] Please refer to Figure 12 , Figure 12 which is a schematic structural diagram of an apparatus for creating a virtual machine provided by an embodiment of the present application. The apparatus 120 for creating a virtual machine can be used to execute Figure 2 and Figure 9 the corresponding steps in the method for creating a virtual machine shown. The apparatus 120 for creating a virtual machine includes the following units:
[0158] An obtaining unit 1201, configured to obtain configuration requirement information of a virtual machine to be created, and configuration information corresponding to multiple candidate electronic devices respectively. The configuration requirement information includes configuration information of a specified processor required for the virtual machine to be created, and the candidate electronic devices are equipped with the specified processor and other processors;
[0159] A matching unit 1202, configured to match the configuration requirement information with the configuration information corresponding to the multiple candidate electronic devices respectively to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information;
[0160] A selecting unit 1203, configured to select a target electronic device from the set of candidate electronic devices according to the resource usage of the specified processor and the resource usage of other processors of each candidate electronic device in the set of candidate electronic devices, and create a virtual machine in the target electronic device.
[0161] In a possible implementation, the matching unit 1202 is configured to match the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices, specifically:
[0162] Match the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding component in the configuration information corresponding to multiple candidate electronic devices;
[0163] If the hardware specifications of each component in the configuration requirement information match the hardware specifications of the corresponding component in the configuration information corresponding to the target candidate electronic device among the multiple candidate electronic devices, add the target candidate electronic device to the candidate electronic device set.
[0164] In a possible implementation, the matching unit 1202 is configured to match the hardware specifications of each component in the configuration requirement information with the hardware specifications of the corresponding component in the configuration information corresponding to multiple candidate electronic devices, specifically:
[0165] Match the model information of the specified processor in the configuration information with the model information of the specified processor in multiple configuration information, and match 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 specified processor in the configuration information is the same as the model information of the specified 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, determine that the hardware specifications of each component match the hardware specifications of the corresponding component in the configuration information corresponding to the target candidate electronic device.
[0167] In a possible implementation, the apparatus 120 further includes:
[0168] A determination unit 1204, 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; determine the total 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 total resource requirements corresponding to each component with the idle resources of the corresponding component in the multiple configuration information;
[0170] The determining unit 1204 is further configured 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 total sum of the resource requirements corresponding to each component.
[0171] In a possible implementation manner, the obtaining unit 1201 is further configured to obtain the configuration information of the virtual machines deployed in the target candidate electronic device;
[0172] The determining unit 1204 is further configured to determine a first part of candidate electronic devices that do not meet the preset compatibility rules 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 device, and remove the first part of candidate electronic devices from the candidate electronic device set.
[0173] In a possible implementation manner, the obtaining unit 1201 is further configured to run a reference benchmark test on each candidate electronic device in the candidate electronic device set, and obtain the 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 that do not meet the preset load conditions from the candidate electronic device set if there are second part of candidate electronic devices in the load information corresponding to each candidate electronic device included in the candidate electronic device set.
[0175] In a possible implementation manner, the selecting unit 1203 is configured 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, specifically:
[0176] Obtain the first idle resource of the designated processor of each candidate electronic device in the candidate electronic device set and the second idle resource of other processors;
[0177] Determine the remaining idle resources of the designated processor of each candidate electronic device in the candidate electronic device set according to the configuration information and the first idle resource;
[0178] Select the target electronic device from the candidate electronic device set 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 specifically configured to:
[0180] Obtain service configuration information associated with the configuration requirement information;
[0181] Match the preset service rules with the service configuration information, and select the target electronic device from the set of candidate electronic devices in ascending order of the resource difference from the candidate electronic devices that match the preset service rules and the service configuration information.
[0182] In a possible implementation, the apparatus 120 further includes:
[0183] A monitoring unit 1205, configured to monitor the performance data of the virtual machine to obtain a load value corresponding to the virtual machine;
[0184] A processing unit 1206, configured to, if it is monitored that the load value is greater than a preset load threshold, adjust and process the resources of the virtual machine according to the configuration information and the configuration information of specific components in the configuration requirement information.
[0185] In a possible implementation, the processing unit 1206 is configured to adjust and process the resources of the virtual machine according to the configuration information and the configuration information of specific components in the configuration requirement information, and specifically configured to:
[0186] If it is determined that a preset migration condition is satisfied according to the configuration information and the configuration information of the specific components, determine migration requirement information according to the load value and the configuration requirement information;
[0187] Select a specified electronic device from other electronic devices other than the target electronic device from multiple candidate electronic devices according to the migration requirement information, and migrate the virtual machine from the target electronic device to the specified electronic device.
[0188] In a possible implementation, the processing unit 1206 is configured to select a specified electronic device from other electronic devices other than the target electronic device from multiple candidate electronic devices according to the migration requirement information, and specifically configured to:
[0189] 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;
[0190] Select the specified electronic device from the set of migration electronic devices according to the resource usage of the specified processors of each migration electronic device in the set of migration electronic devices and the resource usage of other processors.
[0191] In a possible implementation, the processing unit 1206 is configured to adjust the resources of the virtual machine according to the configuration information and the configuration information of specific components in the configuration requirement information. Specifically, it is configured to:
[0192] If it is determined according to the configuration information and the configuration information of the specific components that the preset migration condition is not satisfied, then determine the reference resource information corresponding to the load value according to the correspondence between the load value and the reference resource information, and the load value, where the reference resource information includes the reference added resources corresponding to one or more components;
[0193] Perform hot addition processing on the resources of the virtual machine according to the reference added resources corresponding to the one or more components.
[0194] In a possible implementation, the obtaining unit 1201 is further configured to, if there is no candidate electronic device among the multiple candidate electronic devices whose configuration information matches the configuration requirement information, obtain the specified configuration information corresponding to each of the multiple specified candidate electronic devices, where the multiple specified candidate electronic devices are only equipped with the specified processors;
[0195] The matching unit 1202 is further configured to match the configuration requirement information with the configuration information corresponding to each of the multiple specified candidate electronic devices to obtain a set of specified candidate electronic devices whose specified configuration information matches the configuration requirement information;
[0196] The selection unit 1203 is further configured to select a target specified electronic device from the set of candidate electronic devices according to the resource usage of the specified processors of each specified candidate electronic device in the set of specified candidate electronic devices, and create the virtual machine in the target specified electronic device.
[0197] According to an embodiment of the present application, Figure 2 and Figure 9 The steps involved in the method shown can be executed by each unit in the virtual machine creation device shown. For example, Figure 12 The step S201 shown is executed by the obtaining unit 1201 shown, the step S202 is executed by the matching unit 1202 shown, and the step S203 is executed by the selection unit 1203 shown. For another example, Figure 2 The step S901 shown is executed by Figure 12 The obtaining unit 1201 shown, the step S202 is executed by Figure 12 The matching unit 1202 shown, the step S203 is executed by Figure 12 The selection unit 1203 shown. For another example, Figure 9 The step S901 shown is executed byFigure 12 executed by the monitoring unit 1205 shown, and step S902 is executed by Figure 12 the processing unit 1206 shown.
[0198] According to an embodiment of the present application, Figure 12 each unit in the virtual machine creation device 120 shown can be separately or all combined into one or several other units to form, or a certain (some) unit can also be further split into multiple smaller units in terms of function 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 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 assisted by other units and can be implemented by the cooperation of multiple units. According to another embodiment of the present application, it can be achieved by running a computer program (including program code) capable of executing the respective steps involved in the corresponding methods shown in Figure 2 and Figure 9 on a general computing device of a general computer including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), etc., to construct the virtual machine creation device 120 shown in Figure 12 and to implement the virtual machine creation method of the embodiments of the present application. The computer program can be recorded on, for example, a computer-readable storage medium and loaded into Figure 1 the virtual machine deployment device 102 of the virtual machine creation system shown and run therein.
[0199] Based on the description of the embodiments of the above virtual machine creation method, the embodiments of the present application also disclose an electronic device. Please refer to Figure 13 , the electronic device 130 may at least include a processor 1301, an input device 1302, an output device 1303, and a memory 1304. Among them, the processor 1301, the input device 1302, the output device 1303, and the memory 1304 in the electronic device 130 can be connected through 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, of course, the extended storage medium supported by the electronic device 130. The memory 1304 provides a storage space, and the operating system of the electronic device 130 is stored in this storage space. Moreover, computer programs (including program codes) are also stored in this 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 programs stored in the memory 1304.
[0201] In one implementation, the processor 1301 can load and execute the computer programs stored in the memory 1304 to implement the corresponding steps of the method in the above-mentioned method embodiments for creating a virtual machine; specifically, the processor 1301 loads and executes the computer programs stored in the memory 1304 for:
[0202] Obtain the configuration requirement information of the virtual machine to be created, as well as the configuration information corresponding to multiple candidate electronic devices respectively. The configuration requirement information includes the configuration information of the specified processor required for the virtual machine to be created, and the candidate electronic devices are equipped with the specified processor and other processors;
[0203] Match the configuration requirement information with the configuration information corresponding to multiple 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 specified processors and the resource usage of other processors of each candidate electronic device in the set of candidate electronic devices, select a target electronic device from the set of candidate electronic devices and create a virtual machine in the target electronic device.
[0205] In one possible implementation, the processor 1301 loads and executes the computer programs stored in the memory 1304 for matching the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively, specifically for:
[0206] 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 multiple candidate electronic devices respectively;
[0207] If the hardware specifications of the components in the configuration requirement information match the hardware specifications of the corresponding components in the configuration information of the target candidate electronic device among the multiple candidate electronic devices, add the target candidate electronic device to the candidate electronic device set.
[0208] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is used to match the hardware specifications of the components in the configuration requirement information with the hardware specifications of the corresponding components in the configuration information corresponding to the multiple candidate electronic devices respectively. Specifically, it is used for:
[0209] Match the model information of the specified processor in the configuration information with the model information of the specified processor in the multiple configuration information, and match the resource requirements corresponding to each component with the idle resources of the corresponding components in the multiple configuration information;
[0210] If the model information of the specified processor in the configuration information is the same as the model information of the specified processor in the configuration information corresponding to the target candidate electronic device, and the idle resources of the components in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component, it is determined that the hardware specifications of the components 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 also used for:
[0212] Determine the reserved resource requirements corresponding to each component according to the preset resource reservation rule and the resource requirements corresponding to each component;
[0213] Determine the total resource requirements corresponding to each component according to the resource requirements corresponding to each component and the reserved resource requirements corresponding to each component;
[0214] Match the total resource requirements corresponding to each component with the idle resources of the corresponding components in the multiple configuration information;
[0215] If the idle resources of the components in the configuration information corresponding to the target candidate electronic device meet the total resource requirements corresponding to each component, it is determined that the idle resources of the components in the configuration information corresponding to the target candidate electronic device meet the resource requirements corresponding to each component.
[0216] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is also used for:
[0217] Obtain the configuration information of the virtual machines deployed in the target candidate electronic devices;
[0218] According to the configuration requirement information and the configuration information of the virtual machines deployed in the target candidate electronic devices, determine the first part of candidate electronic devices in the target candidate electronic devices that do not meet the preset compatibility rules, and remove the first part of candidate electronic devices 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] Run a reference benchmark test through each candidate electronic device in the candidate electronic device set, and obtain the load information of each candidate electronic device running the reference benchmark test;
[0221] If there are second part of candidate electronic devices in the load information corresponding to each candidate electronic device included in the candidate electronic device set that do not meet the preset load conditions, remove the second part of candidate electronic devices from the candidate electronic device set.
[0222] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is used to select a target electronic device from the candidate electronic device set according to the resource usage of the specified processor and the resource usage of other processors in each candidate electronic device in the candidate electronic device set. Specifically, it is used to:
[0223] Obtain the first idle resources of the specified processors of each candidate electronic device in the candidate electronic device set, and the second idle resources of other processors;
[0224] According to the configuration information and the first idle resources, determine the remaining idle resources of the specified processors of each candidate electronic device in the candidate electronic device set;
[0225] Select the target electronic device from the candidate electronic device set 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 the computer program stored in the memory 1304, and is used to select the target electronic device from the candidate electronic device set according to the resource difference between the remaining idle resources and the second idle resources. Specifically, it is used to:
[0227] Obtain the service configuration information associated with the configuration requirement information;
[0228] Match the preset business rules with the business configuration information, and select the target electronic device from the candidate electronic devices where the preset business rules match the business configuration information in ascending order of the resource difference from the candidate electronic device set.
[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] Monitor the performance data of the virtual machine to obtain the load value corresponding to the virtual machine;
[0231] If it is monitored that the load value is greater than the preset load threshold, adjust the resources of the virtual machine according to the configuration information of the specific components in the configuration information and the configuration requirement information.
[0232] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is configured to adjust the resources of the virtual machine according to the configuration information of the specific components in the configuration information and the configuration requirement information. Specifically, it is configured to:
[0233] If it is determined that the preset migration condition is satisfied according to the configuration information and the configuration information of the specific components, determine the migration requirement information according to the load value and the configuration requirement information;
[0234] Select a specified electronic device from the other electronic devices except the target electronic device among the multiple candidate electronic devices according to the migration requirement information, and migrate the virtual machine from the target electronic device to the specified electronic device.
[0235] In a possible implementation, the processor 1301 loads and executes the computer program stored in the memory 1304, and is configured to select a specified electronic device from the other electronic devices except the target electronic device among the multiple candidate electronic devices according to the migration requirement information. Specifically, it is configured to:
[0236] 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;
[0237] Select the specified electronic device from the set of migration electronic devices according to the resource usage of the specified processors of the migration electronic devices in the set of migration electronic devices and the resource usage of other processors.
[0238] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, and is used to adjust the resources of the virtual machine according to the configuration information and the configuration information of specific components in the configuration requirement information. Specifically, it is used for:
[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, determine the reference resource information corresponding to the load value, where the reference resource information includes reference added resources corresponding to one or more components;
[0240] Perform hot addition processing on the resources of the virtual machine according to the reference added resources corresponding to the one or more components.
[0241] In a possible implementation, the processor 1301 loads and executes a computer program stored in the memory 1304, and is further used for:
[0242] If there is no candidate electronic device whose configuration information matches the configuration requirement information among multiple candidate electronic devices, then obtain the specified configuration information corresponding to each of the multiple specified candidate electronic devices, where the multiple specified candidate electronic devices are only equipped with the specified processor;
[0243] Match the configuration requirement information with the configuration information corresponding to each of the multiple specified candidate electronic devices to obtain a set of specified candidate electronic devices whose specified configuration information matches the configuration requirement information;
[0244] Select a target specified electronic device from the set of candidate electronic devices according to the resource usage of the specified processors of the specified candidate electronic devices in the set of specified candidate electronic devices, and create the virtual machine in the target specified electronic device.
[0245] It should be understood that in the embodiments of the present application, the so-called processor 1301 may be a central processing unit (CPU), and this processor 1301 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.
[0246] In an embodiment of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the steps executed in all the embodiments can be executed.
[0247] The embodiment of the present application further provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions. The computer instructions are 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 of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The above program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the above storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.
[0249] The above-disclosed is only a preferred embodiment of the present invention. Of course, the scope of the rights of the present invention cannot be limited by this. Those of ordinary skill in the art can understand all or part of the processes of the above embodiments, and the equivalent changes made according to the claims of the present invention still fall within the scope covered by the invention.
[0250] In addition, it should be particularly noted 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 permission or consent of the user needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
Claims
1. A method for creating a virtual machine, characterized in that, Including: Obtaining configuration requirement information of a virtual machine to be created, and configuration information corresponding to multiple candidate electronic devices respectively, where the configuration requirement information includes configuration information of a specified processor required for the virtual machine to be created, and the candidate electronic devices are equipped with the specified processor and other processors; Matching the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information; Selecting a target electronic device from the set of candidate electronic devices according to the resource usage of the specified processors and the resource usage of other processors in each candidate electronic device in the set of candidate electronic devices, and creating a virtual machine in the target electronic device; If the set of candidate electronic devices does not include any candidate electronic devices, selecting a target specified electronic device from multiple specified candidate electronic devices equipped only with the specified processor, and creating the virtual machine in the target specified electronic device; Among them, the step of selecting a target electronic device from the set of candidate electronic devices according to the resource usage of the specified processors and the resource usage of other processors in each candidate electronic device in the set of candidate electronic devices includes: obtaining the first idle resources of the specified processors of each candidate electronic device in the set of candidate electronic devices, and the second idle resources of other processors; determining the remaining idle resources of the specified processors of each candidate electronic device in the set of candidate electronic devices according to the configuration information and the first idle resources; and 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.
2. The method according to claim 1, characterized in that, The step of matching the configuration requirement information with the configuration information corresponding to multiple 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 multiple candidate electronic devices respectively; 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 multiple candidate electronic devices, adding the target candidate electronic device to the set of candidate electronic devices.
3. The method according to claim 2, wherein The step of 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 multiple candidate electronic devices respectively includes: Matching the model information of the specified processor in the configuration information with the model information of the specified processor in multiple configuration information, and matching the resource requirements corresponding to each component with the idle resources of the corresponding components in the multiple configuration information. If the model information of the specified processor in the configuration information is the same as the model information of the specified 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, 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, wherein The method further includes: 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 total resource requirements corresponding to each component according to the resource requirements corresponding to each component and the reserved resource requirements corresponding to each component; Match the total resource requirements corresponding to each component with the idle resources of the corresponding components in the multiple configuration information; If the idle resources of each component in the configuration information corresponding to the target candidate electronic device meet the total resource requirements corresponding to each component, 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 each component.
5. The method according to claim 2, wherein After adding the target candidate electronic device to the candidate electronic device set, the method further includes: Obtain the configuration information of the virtual machines already deployed in the target candidate electronic device; Determine the first part of candidate electronic devices in the target candidate electronic device that do not meet the preset compatibility rules according to the configuration requirement information and the configuration information of the virtual machines already deployed in the target candidate electronic device, and remove the first part of candidate electronic devices 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: Run a reference benchmark test through each candidate electronic device in the candidate electronic device set, and obtain the load information of each candidate electronic device running the reference benchmark test; If there are a second part of candidate electronic devices in the load information corresponding to each candidate electronic device included in the candidate electronic device set that do not meet the preset load conditions, remove the second part of candidate electronic devices from the candidate electronic device set.
7. The method according to claim 1, wherein The selecting the target electronic device from the candidate electronic device set according to the resource difference between the remaining idle resources and the second idle resources includes: Obtain the service configuration information associated with the configuration requirement information; Match the preset service rules with the service configuration information, and select the target electronic device from the candidate electronic devices that match the preset service rules and the service configuration information in ascending order of the resource difference from the candidate electronic device set.
8. The method according to claim 1, wherein After creating a virtual machine in the target electronic device, the method further includes: Monitor the performance data of the virtual machine to obtain the load value corresponding to the virtual machine; If it is monitored that the load value is greater than the preset load threshold, adjust the resources of the virtual machine according to the configuration information and the configuration information of the specific components in the configuration requirement information.
9. The method according to claim 8, characterized in that Adjusting the resources of the virtual machine according to the configuration information of specific components in the configuration information and the configuration requirement information includes: If it is determined according to the configuration information and the configuration information of the specific component that a preset migration condition is met, then determine the migration requirement information according to the load value and the configuration requirement information; Select a specified electronic device from other electronic devices except the target electronic device among multiple candidate electronic devices according to the migration requirement information, and migrate the virtual machine from the target electronic device to the specified electronic device.
10. The method according to claim 9, wherein Selecting a specified electronic device from other electronic devices except the target electronic device among multiple candidate electronic devices according to the migration requirement information includes: 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; Select the specified electronic device from the set of migration electronic devices according to the resource usage of the specified processors of each migration electronic device in the set of migration electronic devices and the resource usage of other processors.
11. The method according to claim 8, wherein Adjusting the resources of the virtual machine according to the configuration information of specific components in the configuration information and 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 met, then determine the reference resource information corresponding to the load value according to the corresponding relationship between the load value and the reference resource information, and the load value, where the reference resource information includes reference added resources corresponding to one or more components; Perform hot addition processing on the resources of the virtual machine according to the reference added resources corresponding to the one or more components.
12. The method according to claim 1, wherein Selecting a target specified electronic device from multiple specified candidate electronic devices equipped only with the specified processor and creating the virtual machine in the target specified electronic device includes: Obtain the specified configuration information corresponding to each of the multiple specified candidate electronic devices; Match the configuration requirement information with the specified configuration information corresponding to each of the multiple specified candidate electronic devices to obtain a set of specified candidate electronic devices whose specified configuration information matches the configuration requirement information; Select a target specified electronic device from the set of candidate electronic devices according to the resource usage of the specified processors of each specified candidate electronic device in the set of specified candidate electronic devices, and create the virtual machine in the target specified electronic device.
13. A creation device for a virtual machine, characterized in that, Includes: An acquisition unit for acquiring the configuration requirement information of the virtual machine to be created and the configuration information corresponding to multiple candidate electronic devices respectively, where the configuration requirement information includes the configuration information of the specified processor required for the virtual machine to be created, and the candidate electronic devices are equipped with the specified processor and other processors; A matching unit for matching the configuration requirement information with the configuration information corresponding to multiple candidate electronic devices respectively to obtain a set of candidate electronic devices whose configuration information matches the configuration requirement information; A selection unit, configured to select a target electronic device from the set of candidate electronic devices according to the resource usage of the specified processors of each candidate electronic device in the set of candidate electronic devices and the resource usage of other processors, and create a virtual machine in the target electronic device; if the set of candidate electronic devices does not include any candidate electronic devices, select a target specified electronic device from multiple specified candidate electronic devices equipped only with the specified processor, and create the virtual machine in the target specified electronic device; Specifically, the selection unit is configured to: obtain the first idle resources of the specified processors of each candidate electronic device in the set of candidate electronic devices and the second idle resources of other processors; determine the remaining idle resources of the specified processors of each candidate electronic device in the set of candidate electronic devices according to the configuration information and the first idle resources; 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.
14. An electronic device, characterized in that, Comprising: One or more processors; A memory for storing one or more computer programs, which when executed by the one or more processors, cause the electronic device to implement the method for creating a virtual machine according to any one of claims 1-12.
15. A computer-readable medium having a computer program stored thereon, characterized in that, The computer program, when executed by a processor, implements the method for creating a virtual machine according to any one of claims 1-12.
16. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium. The processor of the 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-12.
Citation Information
Patent Citations
Physical machine scheduling method and device
CN116126512A