Charging method and device of virtual machine and computing equipment
By considering the fluctuation of virtual machine resource usage in cloud computing, and deploying virtual machine instances with similar fluctuations on the same server to share resources, the problem of high operating costs of virtual machines in cloud computing is solved and resource efficiency is achieved Utilization and cost reduction.
Patent Information
- Application Number
- CN202311054778.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-06-05
- Filing Date
- 2023-08-21
- Publication Date
- 2024-12-06
AI Technical Summary
In the cloud computing market, cloud manufacturers face challenges in maintaining profitability while reducing costs. The charging model of existing virtual machines fails to effectively consider the impact of the fluctuations in resource usage on costs, resulting in higher operating costs.
A method of billing for virtual machines is proposed. By comprehensively considering the size and fluctuation of the resource usage of virtual machines in each billing cycle, dynamic pricing, the greater the fluctuation of resource usage, the higher the charge, the smaller the fluctuation, the more charge it is. Low and deploys virtual machine instances of similar fluctuations on the same server to share buffer resources.
It achieves more extreme resource efficiency utilization and fewer operating costs, reduces the operating costs of cloud service providers and increases market share.
Smart Images

Figure CN119094255A_ABST
Abstract
Description
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on June 5, 2023, with application number 202310657999.6 and invention name “Scheduling method and system for virtual machine instances”, all contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of cloud computing, and more specifically, to a billing method, apparatus and computing device for a virtual machine. Background Art
[0003] "The race to zero price" is a phrase often mentioned by cloud vendors, meaning that cloud computing services are getting closer and closer to "free". Cloud vendors compete for market share by lowering prices. This price war has existed for many years, but as the cloud computing market continues to develop and competition intensifies, price wars have become more and more fierce, and prices are getting closer and closer to zero. Price wars between competitors usually lead to a continuous decline in prices, making cloud computing a more affordable option. However, this will also put pressure on the cloud computing market because vendors need to maintain their profitability while lowering prices. In this competition, vendors will continue to strive to reduce costs while providing better services and more value-added features to gain more market share.
[0004] Mainstream cloud vendors usually have two charging models for virtual machines: "annual and monthly packages" and "pay as you go". Among them, annual and monthly packages prepay resources for a certain period of time to obtain higher discounts and use these resources for a certain period of time. During the payment period, regardless of the actual amount of resources used by the user, they need to pay according to the price set at the time of purchase. Pay as you go is based on the actual amount of resources used by the user during use, and usually a settlement is made every hour on the hour, and a new settlement period begins after the settlement is completed. For the existing charging model for virtual machines, even if a more flexible payment method such as pay as you go is adopted, the costs that cloud vendors have to pay are different.
[0005] Therefore, how to reduce the operating costs of cloud vendors to gain more market share has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present application provides a virtual machine billing method, apparatus, and computing device, which can reduce the operating costs of cloud vendors to gain more market share.
[0007] In a first aspect, a billing method for a virtual machine is provided. The method is applied to a cloud management platform, the cloud management platform is used to manage an infrastructure for providing cloud services, the infrastructure includes at least one cloud data center, each of the cloud data center is provided with at least one server, each of the servers runs a virtual machine instance, the method includes: the cloud management platform receives configuration information of the virtual machine instance sent by a tenant, the configuration information includes the size of the virtual machine instance selected by the tenant and the type of the virtual machine instance, the type of the virtual machine instance is a first virtual machine instance, and the first virtual machine instance is billed according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage; the cloud management platform selects a first server from the at least one server according to the size of the virtual machine instance selected by the tenant, and deploys the first virtual machine instance on the first server; the cloud management platform sends login information of the first virtual machine instance to a client of the tenant, the login information is used for the tenant to log in and use the first virtual machine instance; the cloud management platform bills the first virtual machine instance according to the type of the virtual machine instance selected by the tenant, which is the first virtual machine instance.
[0008] In the above technical solution, the virtual machine is dynamically priced by comprehensively considering the resource usage and fluctuation degree of the virtual machine in each billing cycle. The greater the fluctuation degree of resource usage, the higher the charge, and the smaller the fluctuation degree of resource usage, the lower the charge, thereby bringing more extreme resource efficiency utilization and less operating costs to the cloud service provider.
[0009] In combination with the first aspect, in certain implementations of the first aspect, the cloud management platform determines a charging price corresponding to the actual resource usage of the first virtual machine instance; the cloud management platform multiplies the charging price corresponding to the actual resource usage of the first virtual machine instance by a price coefficient to obtain the charging price of the first virtual machine instance, the price coefficient is positively correlated with the degree of fluctuation of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
[0010] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: the cloud management platform receives a creation request for the first virtual machine instance, and the creation request is used to create the first virtual machine instance; the cloud management platform creates the first virtual machine instance on the first server based on the creation request for the first virtual machine instance, and a second virtual machine instance is deployed on the first server, and a difference between a predicted value of the fluctuation degree of actual resource usage of the second virtual machine instance in the first scheduling period and a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period satisfies a preset threshold.
[0011] In the above technical solution, virtual machine instances with similar fluctuations in actual resource usage can be deployed on the same server, and these virtual machine instances can share the buffer resources reserved by the server, which can further reduce the operating costs of the cloud service provider.
[0012] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: the cloud management platform receives a migration request for the first virtual machine instance, the migration request is used to migrate the first virtual machine instance from a second server to the first server, the second server is one of the at least one server, and the first virtual machine instance is running on the second server; the cloud management platform migrates the first virtual machine instance from the second server to the first server.
[0013] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: the cloud management platform determines a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in a first scheduling period based on a historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in a second scheduling period, and the second scheduling period is a period before the first scheduling period.
[0014] In a second aspect, a billing method for a virtual machine is provided, the method being applied to a cloud management platform, the cloud management platform being used to manage an infrastructure for providing cloud services, the infrastructure comprising at least one cloud data center, each of the cloud data center being provided with at least one server, each of the servers running a virtual machine instance, the method comprising: the cloud management platform receiving configuration information of a virtual machine instance sent by a tenant, the configuration information being used to modify the type of a second virtual machine instance running on a first server to a first virtual machine instance, the first server being one of the at least one server, the first virtual machine instance being billed according to actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage; the cloud management platform modifying the type of the second virtual machine instance running on the first server to the first virtual machine instance according to the configuration information; the cloud management platform sending login information of the first virtual machine instance to a client of the tenant, the login information being used for the tenant to log in and use the first virtual machine instance; the cloud management platform billing the first virtual machine instance according to the type of the virtual machine instance selected by the tenant as the first virtual machine instance according to actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage.
[0015] In the above technical solution, tenants can also be supported to modify the type of created virtual machine instances to virtual machine instances that are charged based on the actual resource usage of the virtual machine instances and the degree of fluctuation of the actual resource usage. In this way, the greater the fluctuation of resource usage, the higher the charge, and the smaller the fluctuation of resource usage, the lower the charge, thereby bringing more extreme resource efficiency utilization and less operating costs to cloud service providers.
[0016] In combination with the second aspect, in certain implementations of the second aspect, the degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
[0017] In combination with the second aspect, in certain implementations of the second aspect, the cloud management platform determines the charging price corresponding to the actual resource usage of the first virtual machine instance; the cloud management platform multiplies the charging price corresponding to the actual resource usage of the first virtual machine instance by a price coefficient to obtain the charging price of the first virtual machine instance, and the price coefficient is positively correlated with the degree of fluctuation of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
[0018] In combination with the second aspect, in certain implementations of the second aspect, the method also includes: the cloud management platform receives a creation request for the first virtual machine instance, and the creation request is used to create the first virtual machine instance; the cloud management platform creates the first virtual machine instance on the first server based on the creation request for the first virtual machine instance, and a second virtual machine instance is deployed on the first server, and a difference between a predicted value of the fluctuation degree of actual resource usage of the second virtual machine instance in the first scheduling period and a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period satisfies a preset threshold.
[0019] In the above technical solution, virtual machine instances with similar fluctuations in actual resource usage can be deployed on the same server, and these virtual machine instances can share the buffer resources reserved by the server, which can further reduce the operating costs of the cloud service provider.
[0020] In combination with the second aspect, in certain implementations of the second aspect, the method also includes: the cloud management platform receives a migration request for the first virtual machine instance, the migration request is used to migrate the first virtual machine instance from the second server to the first server, the second server is one of the at least one server, and the first virtual machine instance is running on the second server; the cloud management platform migrates the first virtual machine instance from the second server to the first server.
[0021] In combination with the second aspect, in certain implementations of the second aspect, the method also includes: the cloud management platform determines a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period based on the historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in the second scheduling period, and the second scheduling period is the period before the first scheduling period.
[0022] In a third aspect, a billing device for a virtual machine is provided, which is applied to a cloud management platform, and the cloud management platform is used to manage the infrastructure for providing cloud services, the infrastructure includes at least one cloud data center, each of which is provided with at least one server, and each of which runs a virtual machine instance, and the device includes: a receiving module, a configuration module, a sending module, and a billing module. Among them, the receiving module is used to receive the configuration information of the virtual machine instance sent by the tenant, the configuration information includes the size of the virtual machine instance selected by the tenant and the type of the virtual machine instance, the type of the virtual machine instance is a first virtual machine instance, and the first virtual machine instance is billed according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage; the configuration module is used to select a first server from the at least one server according to the size of the virtual machine instance selected by the tenant, and deploy the first virtual machine instance on the first server; the sending module is used to send the login information of the first virtual machine instance to the client of the tenant, and the login information is used for the tenant to log in and use the first virtual machine instance; the billing module is used to bill the first virtual machine instance according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage according to the type of the virtual machine instance selected by the tenant is the first virtual machine instance.
[0023] In combination with the third aspect, in certain implementations of the third aspect, the degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
[0024] In combination with the third aspect, in certain implementations of the third aspect, the billing module is specifically used to: determine the charging price corresponding to the actual resource usage of the first virtual machine instance; multiply the charging price corresponding to the actual resource usage of the first virtual machine instance by a price coefficient to obtain the charging price of the first virtual machine instance, the price coefficient is positively correlated with the degree of fluctuation of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
[0025] In combination with the third aspect, in certain implementations of the third aspect, the receiving module is also used to receive a creation request for the first virtual machine instance, and the creation request is used to create the first virtual machine instance; the configuration module is specifically used to create the first virtual machine instance on the first server according to the creation request of the first virtual machine instance, and a second virtual machine instance is deployed on the first server, and a difference between a predicted value of the fluctuation degree of actual resource usage of the second virtual machine instance in the first scheduling period and a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period satisfies a preset threshold.
[0026] In combination with the third aspect, in certain implementations of the third aspect, the receiving module is also used to receive a migration request for the first virtual machine instance, the migration request is used to migrate the first virtual machine instance from the second server to the first server, the second server is one of the at least one server, and the first virtual machine instance is running on the second server; the configuration module is specifically used to migrate the first virtual machine instance from the second server to the first server.
[0027] In combination with the third aspect, in certain implementations of the third aspect, the device also includes: a determination module for determining a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in a first scheduling period based on a historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in a second scheduling period, and the second scheduling period is a period before the first scheduling period.
[0028] In a fourth aspect, a billing device for a virtual machine is provided, which is applied to a cloud management platform, and the cloud management platform is used to manage the infrastructure for providing cloud services, the infrastructure includes at least one cloud data center, each of which is provided with at least one server, and each of which runs a virtual machine instance, and the device includes: a receiving module, a configuration module, a sending module, and a billing module. Among them, the receiving module is used to receive the configuration information of the virtual machine instance sent by the tenant, and the configuration information is used to modify the type of the second virtual machine instance running on the first server to the first virtual machine instance, the first server is one of the at least one server, and the first virtual machine instance is billed according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage; the configuration module is used to modify the type of the second virtual machine instance running on the first server to the first virtual machine instance according to the configuration information; the sending module is used to send the login information of the first virtual machine instance to the client of the tenant, and the login information is used for the tenant to log in and use the first virtual machine instance; the billing module is used to bill the first virtual machine instance according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage according to the type of the virtual machine instance selected by the tenant as the first virtual machine instance.
[0029] In combination with the fourth aspect, in certain implementations of the fourth aspect, the degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
[0030] In combination with the fourth aspect, in certain implementations of the fourth aspect, the billing module is specifically used to: determine the charging price corresponding to the actual resource usage of the first virtual machine instance; multiply the charging price corresponding to the actual resource usage of the first virtual machine instance by a price coefficient to obtain the charging price of the first virtual machine instance, the price coefficient is positively correlated with the degree of fluctuation of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
[0031] In combination with the fourth aspect, in certain implementations of the fourth aspect, the receiving module is also used to receive a creation request for the first virtual machine instance, and the creation request is used to create the first virtual machine instance; the configuration module is specifically used to create the first virtual machine instance on the first server according to the creation request of the first virtual machine instance, and a second virtual machine instance is deployed on the first server, and the difference between the predicted value of the fluctuation degree of actual resource usage of the second virtual machine instance in the first scheduling period and the predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period meets a preset threshold.
[0032] In combination with the fourth aspect, in certain implementations of the fourth aspect, the receiving module is further used to receive a migration request for the first virtual machine instance, the migration request being used to migrate the first virtual machine instance from the second server to the first server, the second server being one of the at least one server, and the first virtual machine instance running on the second server; the configuration module is specifically used to migrate the first virtual machine instance from the second server to the first server.
[0033] In combination with the fourth aspect, in certain implementations of the fourth aspect, the device also includes: a determination module, used to determine a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period based on a historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in the second scheduling period, and the second scheduling period is a period before the first scheduling period.
[0034] In a fifth aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.
[0035] Optionally, the processor may be a general-purpose processor, which may be implemented by hardware or software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated in the processor or located outside the processor and exist independently.
[0036] In a sixth aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method in the second aspect or any possible implementation of the second aspect.
[0037] Optionally, the processor may be a general-purpose processor, which may be implemented by hardware or software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated in the processor or located outside the processor and exist independently.
[0038] In a seventh aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method in the first aspect and any one of the implementations of the first aspect.
[0039] In an eighth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method in the second aspect and any one of the implementations of the second aspect.
[0040] In a ninth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method in the first aspect and any one of the implementations of the first aspect.
[0041] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and hard drive.
[0042] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium.
[0043] In a tenth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method in the second aspect and any one of the implementations of the second aspect.
[0044] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and hard drive.
[0045] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1It is a basic architecture diagram of a server running a virtual machine applicable to an embodiment of the present application.
[0047] Figure 2 It is a schematic diagram of CPU virtualization applicable to an embodiment of the present application.
[0048] Figure 3 It is a schematic diagram of another CPU virtualization applicable to an embodiment of the present application.
[0049] Figure 4 It is a schematic diagram of memory virtualization applicable to an embodiment of the present application.
[0050] Figure 5 It is a schematic diagram of an architecture combining a virtual machine and a cloud scenario applicable to an embodiment of the present application.
[0051] Figure 6 It is a schematic flow chart of a virtual machine billing method provided in an embodiment of the present application.
[0052] Figure 7 It is a schematic diagram of a pricing strategy for a virtual machine provided in an embodiment of the present application.
[0053] Figure 8 It is a schematic diagram of the influence of the over-resolution ratio of a host machine where a virtual machine is located on a price coefficient provided in an embodiment of the present application.
[0054] Fig. 9 It is a schematic diagram provided in an embodiment of the present application for charging a virtual machine deployed on a host machine according to the over-resolution ratio of the host machine.
[0055] Fig.10 It is a schematic flowchart of another virtual machine billing method provided in an embodiment of the present application.
[0056] Fig.11 It is a robust probability map provided in an embodiment of the present application.
[0057] Fig.12 This is a schematic diagram provided by an embodiment of the present application of placing virtual machines with similar resource usage fluctuations on a host.
[0058] Fig.13 This is a schematic diagram provided in an embodiment of the present application in which virtual machines with similar resource usage fluctuation levels are not placed on one host.
[0059] Fig.14 It is a schematic flowchart of a method for creating a virtual machine instance on a server provided in an embodiment of the present application.
[0060] Fig.15It is a schematic flowchart of a method for migrating a virtual machine instance provided in an embodiment of the present application.
[0061] Fig.16 It is a schematic block diagram of a billing device 1600 for a virtual machine provided in an embodiment of the present application.
[0062] Fig.17 It is a schematic diagram of the architecture of a computing device 1700 provided in an embodiment of the present application.
[0063] Fig.18 It is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of the present application.
[0064] Fig.19 It is a schematic diagram of the connection between computing devices 1700A and 1700B via a network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0066] The present application will present various aspects, embodiments or features around a system including multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all devices, components, modules, etc. discussed in conjunction with the figures. In addition, combinations of these schemes may also be used.
[0067] In addition, in the embodiments of the present application, words such as "exemplary" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present concepts in a concrete way.
[0068] In the embodiments of the present application, "corresponding (corresponding, relevant)" and "corresponding (corresponding)" can sometimes be used interchangeably. It should be pointed out that when the distinction between them is not emphasized, the meanings they intend to express are consistent.
[0069] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0070] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0071] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0072] A virtual machine (VM) is a complete computer system that runs in a completely isolated environment and has complete hardware system functions, simulated by software. Any work that can be done in a server can be done in a virtual machine. When creating a virtual machine in a server, part of the hard disk and memory capacity of the physical machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent hard disk and operating system, and the user of the virtual machine can operate the virtual machine just like using a server.
[0073] Figure 1 1 is a basic architecture diagram of a server running a virtual machine applied to an embodiment of the present application. Figure 1 As shown, the server includes a hardware layer and a software layer. The hardware layer is a conventional configuration of the server, wherein PCI devices may be, for example, network cards, GPUs, offload cards, and other devices that can be inserted into PCI / PCIe slots of the server. The software layer includes an operating system installed and running on the server (relative to the operating system of the virtual machine, it can be called a host operating system). A virtual machine manager VMM (also called a Hypervisor) is provided in the host operating system. The role of the virtual machine manager is to realize computing virtualization, network virtualization, and storage virtualization of the virtual machine, and is responsible for managing the virtual machine.
[0074] Computing virtualization refers to providing part of the server's processor and memory to the virtual machine, network virtualization refers to providing part of the network card's functions (such as bandwidth) to the virtual machine, and storage virtualization refers to providing part of the disk to the virtual machine. The virtual machine manager can also achieve logical isolation between different virtual machines and manage virtual machines, such as creating virtual machines, simulating virtual hardware for virtual machines according to the hardware layer (hardware simulation function), deleting virtual machines, forwarding and / or processing network messages between all virtual machines running on the server (such as virtual machine 1 and virtual machine 2) or forwarding network messages between the virtual machines on the server and the external network (virtual switching function), processing I / O generated by virtual machines, etc. The operating environments (such as virtual machine applications, operating systems, and virtual hardware) in different virtual machines are completely isolated. For virtual machines 1 and 2 to communicate, network messages must be forwarded by the virtual manager. Tenants can log in to the virtual machine remotely and operate the virtual machine to install, set up, and uninstall applications in the virtual machine operating system environment.
[0075] The following is a detailed description of the relevant technologies of computing virtualization.
[0076] 1. Processor (CPU) virtualization
[0077] Generally, a server running a virtual machine is provided with multiple physical CPUs, wherein the physical CPU is Figure 1 The processors in the hardware layer shown are VCPUs. Figure 1 The virtual processor in the software layer shown in the figure. The virtual machine cannot perceive the physical CPU. The computing unit of the virtual machine is presented through the VCPU. The virtual machine can only perceive the VCPU presented to the virtual machine by the virtual machine manager. Figure 2 As shown, the server is configured with 4 physical CPUs 0, each physical CPU includes 4 CPU cores, and the number of hyperthreads of each CPU core = 2. The total number of vCPUs that the virtual machine manager can provide to the virtual machine = the total number of hyperthreads = the number of physical CPUs (also called the number of sockets) x the number of CPU cores of each physical CPU x the number of hyperthreads supported by each CPU core = 32.
[0078] like Figure 3 As shown, one hyperthread can be provided to a virtual machine as one VCPU. In other implementations, one hyperthread can also be provided to a virtual machine as multiple VCPUs in a time-sharing manner (i.e., CPU overselling in cloud computing), depending on the CPU quality of service (QoS) of the virtual machine.
[0079] It should be understood that QoS refers to allocating specific resource quotas to virtual machines in a virtualized environment to ensure the performance and reliability of virtual machines, thereby meeting specific business needs. Virtual machine QoS can be applied to multiple resources, such as CPU time, memory, disk bandwidth, and network bandwidth. By allocating specific resource quotas and priorities to virtual machines, it can be ensured that important virtual machines obtain sufficient resources to meet their performance requirements without being affected by other virtual machines. When the demand of a virtual machine on a host in a certain resource dimension (such as CPU) at a certain moment is greater than the total amount of resources that the host can provide, QoS is likely to degrade. Therefore, one of the important ways to ensure QoS is to ensure that at any moment, the sum of the virtual machine's demand for host resources cannot be greater than the total amount of resources that the host can actually provide.
[0080] 2. Memory Virtualization
[0081] The purpose of memory virtualization technology is to provide virtual machines with a continuous physical memory space starting from address 0, effectively isolating and scheduling memory resources between virtual machines. Memory virtualization technology mainly involves the conversion of guest virtual address (GVA) -> guest physical address (GPA) -> host virtual address (GVA) -> host physical address (HPA).
[0082] In virtualization technology, multiple virtual machines are often running on a physical host, and each virtual machine thinks that it has exclusive memory space of the physical host. Therefore, the virtual machine uses the guest physical address (GPA) to represent the memory space owned by the virtual machine, where the memory space is considered to be continuous by the virtual machine (that is, it can be understood that the virtual machine thinks that it has a complete physical memory bar).
[0083] GVA is the address formed by mapping the GPA by the operating system of the virtual machine. The operating system of the virtual machine provides the GVA to the process or application software set on the operating system of the virtual machine. The operating system of the virtual machine records the mapping relationship from GVA to GPA. The conversion from GVA to GPA is implemented by the page table of the operating system of the virtual machine.
[0084] HPA is the actual physical memory address, and HVA is the address formed by the host machine's operating system mapping HPA. The host machine's operating system provides HVA to the process on the operating system (such as a virtual machine) for use. The host machine's operating system records the mapping relationship from HVA to HPA. The conversion from HVA to HPA is implemented by the page table of the host machine's operating system.
[0085] exist Figure 4 In the example, virtual machine 1 and virtual machine 2 are set in the same server (hereinafter referred to as the host machine), and the virtual machine manager of the host machine sets the GPA address range of virtual machine 1 to 0-5GB, which corresponds to the HPA address range of 1.5GB-4.5GB and 6.5GB-8.5GB on the physical memory. In addition, the virtual machine manager of the host machine sets the GPA address range of virtual machine 2 to 0-4GB, which corresponds to the HPA address range of 9GB-11GB and 13GB-15GB on the physical memory. Therefore, virtual machine 1 exclusively uses the GPA address range of 0-5GB, and virtual machine 2 exclusively uses the GPA address range of 0-4GB. The GPA address range of 0-5GB and the GPA address range of 0-4GB can both correspond to different HPA address ranges on the physical memory, thereby realizing the isolation of virtual machine memory. Among them, the GPA address range is related to the virtual machine specifications described above. For example, if the tenant sets the virtual machine specification with a memory size of 5G in virtual machine 1, the virtual machine manager needs to create a virtual machine 1 with a GPA of 0-5G.
[0086] Figure 5 This is a schematic diagram of the architecture that combines virtual machines and cloud scenarios. Figure 5 As shown, the cloud scenario may include: a cloud management platform, the Internet, and a client.
[0087] like Figure 5 As shown, the cloud management platform is used to manage the infrastructure that provides multiple cloud services. The infrastructure includes multiple cloud data centers, each of which includes multiple servers, and each server includes cloud service resources to provide corresponding cloud services to tenants.
[0088] The cloud management platform can be located in a cloud data center, which can provide an access interface (such as an interface or an application program interface (API)). Tenants can operate the client remote access access interface to register a cloud account and password on the cloud management platform, and log in to the cloud management platform. After the cloud management platform successfully authenticates the cloud account and password, the tenant can further pay to select and purchase a virtual machine with specific specifications (processor, memory, disk) on the cloud management platform. After the payment is successful, the cloud management platform provides the remote login account and password of the purchased virtual machine, and the client can remotely log in to the virtual machine, install and run the tenant's application in the virtual machine. Therefore, tenants can create, manage, log in and operate virtual machines in the cloud data center through the cloud management platform.
[0089] It should be understood that tenants of cloud services can be individuals, enterprises, schools, hospitals, administrative agencies, etc.
[0090] The functions of the cloud management platform include but are not limited to user console, computing management service, network management service, storage management service, authentication service, and image management service. The user console provides an interface or API to interact with tenants. The computing management service is used to manage servers running virtual machines and containers and bare metal servers. The network management service is used to manage network services (such as gateways, firewalls, etc.). The storage management service is used to manage storage services (such as data bucket services). The authentication service is used to manage tenants' accounts and passwords. The image management service is used to manage virtual machine images. Tenants can use the client to log in to the cloud management platform through the Internet to manage the rented cloud services.
[0091] like Figure 5 As shown in the figure, the cloud management platform client function is running in the server of the data center. It mainly receives the control plane commands sent by the cloud management platform, creates virtual machines on the server according to the control plane control commands, and manages the virtual machines throughout their life cycle. Therefore, tenants can create, manage, log in and operate virtual machines in the cloud data center through the cloud management platform. Among them, virtual machines can also be called cloud servers (elastic compute services, ECS) and elastic instances (different cloud service providers have different names).
[0092] exist Figure 5 In the architecture shown, a data center is equipped with multiple servers, which can be used to run virtual machines of different specifications. Virtual machine specifications are divided into: general computing type, memory optimization type, ultra-large memory type, etc., and each type has specific specifications. After the tenant selects the virtual machine specification, the cloud management platform selects a server that supports the specification in the data center, determines that there are enough idle hardware resources on the server, and then creates a virtual machine with the specification on the server.
[0093] In some cases, servers can be grouped together, and each server group supports one type of virtual machine. For example, one server group supports "general computing enhanced" virtual machines, one server group supports "extra large memory" virtual machines, and one server group supports "GPU accelerated" virtual machines. When the tenant selects "general computing enhanced" and selects "x6.large.2", the cloud management platform selects a server group that supports "general computing enhanced" and selects a server with idle hardware resources in the server group that can provide "x6.large.2 specifications" and creates a virtual machine on the server.
[0094] "The race to zero price" is a phrase often mentioned by cloud vendors, meaning that cloud computing services are getting closer and closer to "free". Cloud vendors compete for market share by lowering prices. This price war has existed for many years, but as the cloud computing market continues to develop and competition intensifies, price wars have become more and more fierce, and prices are getting closer and closer to zero. Price wars between competitors usually lead to a continuous decline in prices, making cloud computing a more affordable option. However, this will also put pressure on the cloud computing market because vendors need to maintain their profitability while lowering prices. In this competition, vendors will continue to strive to reduce costs while providing better services and more value-added features to gain more market share.
[0095] In the existing virtual machine product matrix of mainstream cloud vendors, Amazon AWS's EC2, Microsoft Azure, Google Cloud Compute Engine, Alibaba Cloud ECS and Huawei Cloud ECS services all provide a variety of virtual machines, including general-purpose, computing, shared, memory, storage, network, etc., and a variety of virtual machines meet the needs of users for a variety of job types. For example, if the user's job requirements are CPU-oriented high-performance computing applications, such as batch jobs, distributed analysis and high-performance computing, you can purchase a computing virtual machine. For another example, if the user's application is memory-oriented, such as in-memory databases, memory caches and large-scale analysis, you can purchase a memory virtual machine.
[0096] Correspondingly, mainstream cloud vendors usually have three charging models for virtual machines: "annual and monthly packages", "pay as you go" and "preemptible instances". Among them, annual and monthly packages prepay resources for a certain period of time to obtain higher discounts and use these resources for a certain period of time. During the payment period, regardless of the actual amount of resources used by the user, they need to pay according to the price set at the time of purchase. Pay as you go is based on the actual amount of resources used by the user during use, and usually a settlement is made every hour on the hour, and a new settlement period begins after the settlement is completed. The "preemptible instance" billing method is essentially a pay as you go method, but there is a certain discount on the pay as you go price, and its price changes in real time with the market supply and demand relationship, that is, the market price creates its floating price.
[0097] As for the existing charging model of virtual machines, on the one hand, the virtual machines provided by cloud vendors to customers have fixed specifications. The "annual and monthly" charging model has high requirements for users, requiring users to have high prior knowledge requirements and be able to more accurately evaluate the amount of resources required for their business applications. On the other hand, even if a more flexible payment method such as pay-as-you-go is adopted, the cost to be paid by cloud vendors is different. In the first case, the total number of vCPUs actually used by a virtual machine in a billing cycle is 1.5 cores, and the resource usage of the virtual machine changes relatively steadily over time. At this time, the cloud vendor can meet the needs of the virtual machine with 2u host resources. In the second case, assuming that the resource usage of the virtual machine over a period of time is the same as the first case, but the resource usage of the virtual machine fluctuates greatly over time, due to the instability of its usage, the cloud vendor needs to reserve more space on the host to cope with its fluctuations, so it needs to pay a higher cost than the first case.
[0098] Therefore, from the perspective of cloud service providers, not only the resource usage of virtual machines will affect their costs, but also the fluctuation of virtual machine usage will affect the price they have to pay to meet the demand for virtual machines. However, the current mainstream cloud vendors only consider the actual resource usage of virtual machines in their charging model for virtual machines, while ignoring the impact of resource usage fluctuations on costs.
[0099] In view of this, an embodiment of the present application provides a billing method for virtual machines. This billing method not only pays for virtual machines on a pay-as-you-go basis, but also takes into account the fluctuation of the resource usage of the virtual machines, so that cloud vendors can further reduce costs while providing better services and more value-added functions to gain more market share.
[0100] Figure 6 is a schematic flow chart of a virtual machine billing method provided in an embodiment of the present application. Figure 6As shown, the method may include steps 610-640, and steps 610-640 are described in detail below.
[0101] It should be understood that Figure 6 The method shown can be applied to a cloud management platform, which is used to manage the infrastructure that provides cloud services. The infrastructure includes at least one cloud data center, each cloud data center is equipped with at least one server, and each server runs a virtual machine instance. For details, see Figure 5 The description in will not be repeated here.
[0102] Step 610: The cloud management platform receives the configuration information of the virtual machine instance sent by the tenant.
[0103] As an example, a tenant can Figure 5 The client shown sends the configuration information of the virtual machine instance to the cloud management platform, and the configuration information includes the specification size of the virtual machine instance selected by the tenant and the type of the virtual machine instance. The type of the virtual machine instance is a first virtual machine instance, and the first virtual machine instance is billed according to the actual resource usage of the first virtual machine instance and the fluctuation degree of the actual resource usage.
[0104] It should be understood that the size of the virtual machine instance selected by the tenant may include but is not limited to: the processor size, memory size, disk size, etc. For example, assuming that the size of the virtual machine instance selected by the tenant is a 4u8g virtual machine, 4u8g means that the virtual machine is a 4vcpu-8G memory virtual machine.
[0105] It should also be understood that there are many ways to characterize the degree of fluctuation of resource usage, which are not specifically limited in the embodiments of the present application. Several possible implementations are described below.
[0106] In one implementation, the variance of resource usage of the first virtual machine in a billing cycle is used to describe the degree of fluctuation in resource usage. It should be understood that the variance is the average of the sum of squares of the differences between a set of data and its average value. The larger the variance of resource usage, the greater the fluctuation.
[0107] In another implementation, the fluctuation degree of resource usage is described by the range of resource usage of the first virtual machine in a billing cycle. It should be understood that the range is the difference between the maximum and minimum values of a set of data. The larger the range of resource usage, the greater the fluctuation.
[0108] In another implementation, the fluctuation degree of resource usage is described by the coefficient of variation (CV) of resource usage of the first virtual machine in a billing cycle. It should be understood that the CV coefficient is the ratio of the standard deviation to the mean, usually expressed as a percentage. The larger the CV coefficient of resource usage, the greater the fluctuation.
[0109] In another implementation, the degree of fluctuation in resource usage is described by the over-allocation ratio of the host machine where the first virtual machine is located. The so-called over-allocation ratio is the proportion of the host resources that are oversold. For example, if the host is 100u, and the total specification usage of the virtual machines deployed on it is 120u, the over-allocation ratio is 120 / 100=1.2. If the over-allocation ratio is higher, there are more virtual machines on the host machine where it is located, which means that the cloud vendor pays a smaller price to meet user requests, and the price coefficient brought by fluctuations is lower. If the over-allocation ratio is lower, there are fewer virtual machines on the host machine where it is located, which means that the cloud vendor pays a greater price to meet user requests, and the price coefficient brought by fluctuations is higher.
[0110] Step 620: The cloud management platform selects a first server from the at least one server according to the size of the virtual machine instance selected by the tenant, and deploys the first virtual machine instance on the first server.
[0111] As an example, after the tenant selects the first virtual machine specification, the cloud management platform can select a server that supports the specification in the data center, determine that the server has sufficient idle hardware resources, and then create the first virtual machine with the specification on the server. Specifically, when the cloud management platform confirms that a virtual machine is to be created on a server, it sends a virtual machine creation command to the cloud management platform client on the server, and the cloud management platform client creates the virtual machine on the server after receiving the command.
[0112] Step 630: The cloud management platform sends the login information of the first virtual machine instance to the client of the tenant, and the login information is used by the tenant to log in and use the first virtual machine instance.
[0113] As an example, after the tenant creates the first virtual machine on the cloud management platform, the cloud management platform sends the login information of the first virtual machine instance to the client of the tenant. For example, the cloud management platform provides the tenant with the account and password for logging into the first virtual machine and provides a connection portal. After the tenant clicks the connection portal and enters the account and password, he can log in to the first virtual machine and configure and run the tenant's own application on the first virtual machine.
[0114] Step 640: The cloud management platform selects the first virtual machine instance as the type of the virtual machine instance selected by the tenant, and charges the first virtual machine instance according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage.
[0115] In an embodiment of the present application, in order to bring more extreme resource efficiency utilization and less operating costs to the cloud service provider, a pricing strategy for the first virtual machine is formulated. This pricing strategy dynamically prices the virtual machine by comprehensively considering the resource usage and fluctuation degree of the first virtual machine in each billing cycle. For users with stable behavior, it can achieve better cost-effectiveness.
[0116] For example, Figure 7 The pricing strategy shown is that for the first virtual machine whose resource usage fluctuates greatly during the billing cycle, the user of the first virtual machine is given a smaller discount and the charge is relatively high, but not higher than the pay-as-you-go price of the first virtual machine instance. When the resource usage of the first virtual machine fluctuates less during the billing cycle, it means that the usage behavior of the first virtual machine is very stable. The cloud service provider will reward these users of the first virtual machine and can give them a greater discount and charge relatively low, which can be lower than the pay-as-you-go price of the first virtual machine instance, so that these users can enjoy a more extreme product cost performance.
[0117] In a possible implementation, a price coefficient can be determined according to the above pricing strategy, and the price coefficient is multiplied by the pay-as-you-go price of the first virtual machine instance to obtain the final charge price of the first virtual machine instance. As an example, the price coefficient is positively correlated with the fluctuation degree of the actual resource usage of the first virtual machine, and the range of the price coefficient is 0-1. Therefore, if the fluctuation degree of the actual resource usage of the first virtual machine is greater, the price coefficient is greater, and conversely, if the fluctuation degree of the actual resource usage of the first virtual machine is smaller, the price coefficient is lower.
[0118] For example, Figure 8 As shown, according to the real-time over-allocation ratio of the host machine in each scheduling period, it is aggregated to the nearest price level. For example, the T0-T1 scheduling interval is charged according to the price coefficient of X times over-allocation, the T1-T2 scheduling interval is charged according to the price coefficient of 1.5X times, the T2-T3 scheduling interval is charged according to the price coefficient of 1.5X times, and the T3-T4 scheduling interval is charged according to the price coefficient of X times over-allocation.
[0119] For example, Fig. 9 This is a schematic diagram of charging based on the host machine's over-allocation ratio. Fig. 9The total charge is 2XX+2YY, where XX is the pay-as-you-go price of the virtual machine instance multiplied by the price coefficient of X times the over-allocation, and YY is the pay-as-you-go price of the virtual machine instance multiplied by the price coefficient of 1.5X times the over-allocation, where the price coefficient of X times the over-allocation is greater than the price coefficient of 1.5X times the over-allocation.
[0120] In the above technical solution, the virtual machine is dynamically priced by comprehensively considering the resource usage and fluctuation degree of the first virtual machine in each billing cycle. The greater the fluctuation degree of resource usage, the higher the charge, and the smaller the fluctuation degree of resource usage, the lower the charge, thereby bringing more extreme resource efficiency utilization and less operating costs to the cloud service provider.
[0121] Fig.10 FIG. 1 is a schematic flow chart of another virtual machine billing method provided in an embodiment of the present application. Fig.10 As shown, the method may include steps 1010-1040, and steps 1010-1040 are described in detail below.
[0122] It should be understood that Fig.10 The method shown can be applied to a cloud management platform, which is used to manage the infrastructure that provides cloud services. The infrastructure includes at least one cloud data center, each cloud data center is equipped with at least one server, and each server runs a virtual machine instance. For details, see Figure 5 The description in will not be repeated here.
[0123] Step 1010: The cloud management platform receives configuration information of the virtual machine instance sent by the tenant.
[0124] As an example, the above configuration information is used to change the type of the second virtual machine instance running on the first server to a first virtual machine instance, where the first server is one of at least one server in the cloud data center, and the first virtual machine instance is billed according to the actual resource usage of the first virtual machine instance and the fluctuation degree of the actual resource usage.
[0125] Step 1020: The cloud management platform changes the type of the second virtual machine instance running on the first server to the first virtual machine instance based on the configuration information.
[0126] Step 1030: The cloud management platform sends the login information of the first virtual machine instance to the client of the tenant, and the login information is used by the tenant to log in and use the first virtual machine instance.
[0127] Step 1030 is similar to step 630. Please refer to the description in step 630 for details, which will not be repeated here.
[0128] Step 1040: The cloud management platform selects the first virtual machine instance as the type of the virtual machine instance selected by the tenant, and charges the first virtual machine instance according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage.
[0129] Step 1040 is similar to step 640. Please refer to the description in step 640 for details, which will not be repeated here.
[0130] In the above technical solution, tenants can also be supported to modify the type of created virtual machine instances to virtual machine instances that are charged based on the actual resource usage of the virtual machine instances and the degree of fluctuation of the actual resource usage. In this way, the greater the fluctuation of resource usage, the higher the charge, and the smaller the fluctuation of resource usage, the lower the charge, thereby bringing more extreme resource efficiency utilization and less operating costs to cloud service providers.
[0131] In addition, the resource utilization rate of data centers worldwide (mainly CPU resources) is less than 15%. The reason behind this is that users do not fully use the resources of virtual machines after purchasing them. For example, for a 4u8g virtual machine, the total vCPU of the virtual machine is 4 cores, but in the actual use of the user, only 0.5 cores may be used at a certain moment, so the actual amount of resources used is far less than the amount of resources purchased. For a host, there are several virtual machines deployed on it, and the usage of each virtual machine is likely to be less than the amount of resources purchased (or called specification usage), which results in a large waste of host resources and increases the cost of cloud service providers.
[0132] It should be understood that the utilization of the CPU resources of virtual machines and hosts is used here for explanation. In a virtualized environment, the CPU resources of a host can be shared by multiple virtual machines. Virtual machines can be allocated different numbers of CPU cores and processor time slices to fully utilize CPU resources on the host. For example, if a virtual machine is waiting for an I / O operation to complete, it can give up using CPU resources so that other virtual machines can use the CPU. This flexibility can improve CPU utilization, thereby improving the overall performance and resource utilization of the host. In the CPU dimension, the resource utilization of the host refers to the ratio between the sum of the CPU resources used by all virtual machines on the host and the available CPU resources on the host. The CPU utilization of a virtual machine refers to the ratio between the CPU time used by the virtual machine and its total CPU time. The utilization of the host is closely related to the utilization of the virtual machines on it. A large number of experiments have shown that the utilization of the host at a certain moment can be equivalent to the superposition of the resource overhead of the host management plane and the utilization of the virtual machines on it at that moment.
[0133] On the one hand, there is an increasingly fierce price war for the sale of cloud resources, and on the other hand, a large number of resources are idle and wasted, which has prompted cloud vendors to adopt more optimized scheduling solutions to reuse idle resources. However, resource reuse also comes with the cost of QoS degradation, because after resource reuse, the actual resource demand of the virtual machines carried on the host at a certain moment may exceed the total resource volume of the host. Therefore, in the process of resource reuse, it is necessary to set a reasonable "Buffer" buffer resource on the host to cope with the real usage demand of the constantly fluctuating virtual machines. If the "Buffer" buffer resource is set too small, the risk of QoS degradation will increase, and if the "Buffer" buffer resource is set too large, it will lead to resource waste. The setting of the "Buffer" buffer resource is not only related to the usage characteristics of the virtual machine, but also to the scheduling plan of the virtual machine on the host.
[0134] The mainstream scheduling scheme is based on the "packing" method, which regards each host as a "box" and each virtual machine as an item. The CPU (e.g. 4u) and memory (e.g. 8g) requirements of the virtual machine are the length and width of the item, and the total CPU resources (e.g. 100u) and memory resources (e.g. 300g) of the host are the length and width of the box. The virtual machine scheduling problem is transformed into a vector-bin-packing problem in a class of combinatorial optimization problems. The requirement is that the sum of the lengths and widths of all items in each box cannot exceed the length and width of the box itself. Through the deployment and migration of virtual machines between hosts, the goal is to achieve the lowest fragmentation rate for each host, that is, to fully allocate the resources of the host to the virtual machine and reduce the waste of resources in various resource dimensions of the host.
[0135] The traditional fixed bin allocation adopted by the above scheduling method has a lot of resource waste. Specifically, although the "bin allocation" based on fixed resource specifications has allocated more than 85% of the host's resources, that is, sold to virtual machine requests, only about 15% of the resources are actually used. Therefore, there is a huge gap between the host's "allocation rate" and the actual "utilization rate", which is a waste of resources.
[0136] In view of this, the embodiment of the present application also provides a method for scheduling virtual machines on a host. In order to give full play to the effect of virtual machines in shifting peaks and filling valleys in resource usage, reduce the amount of buffer resources on each host, and achieve a higher level of reuse of host resources, the embodiment of the present application adopts a robust optimization-based method for virtual machine scheduling, co-locates virtual machines with similar fluctuations on a host, and virtual machines on the same host share host resources. Therefore, there is no need to set up buffer resources separately for each virtual machine, but a unified buffer resource can be reserved on the host for all virtual machines to share. In this way, limited host resources can meet more virtual machine requests (or equivalently, fewer hosts can meet the same number of virtual machine requests) to achieve the ultimate utilization of data center host resources, so that cloud service providers can gain cost and efficiency advantages in the fierce market competition.
[0137] It should be understood that the core of the above scheduling optimization is to reserve a suitable proportion of buffer resources for each host. On the one hand, the buffer resources cannot be too small, which will increase the risk of QoS degradation. On the other hand, the buffer resources cannot be too large, which will lead to excessive waste of resources. Since the actual usage of each virtual machine fluctuates over time, the essential challenge of setting reasonable buffer resources is how to scientifically evaluate the superposition of fluctuations, that is, to evaluate the maximum value of the resources consumed by the virtual machine on the host at any time in the next scheduling cycle.
[0138] The theoretical direction on which the embodiments of the present application are based is robust optimization for uncertainty optimization. This theory considers the resource usage of each virtual machine ( where i represents a virtual machine and I represents a set of virtual machines) is described by an interval value, i.e. u i =[uc i -ur i ,uc i +ur i ], where uc i Indicates nominal usage (NU), ur i Indicates the radius usage (RU). Translated to the virtual machine scheduling scenario, uc i It can be understood as the basic resource consumption of the virtual machine. iIt can be understood as the fluctuating resource consumption of the virtual machine. When a virtual machine is placed on a host, its basic resource consumption must be deducted on the host, but its fluctuating resource consumption does not necessarily need to be deducted on the host. Robust optimization theory concludes through mathematical deduction that for N uncertainties, the probability of reaching the fluctuation peak at the same time is very low. The theory believes that if Γ uncertain variables reach their peak values at the same time, the upper bound of the probability of constraint violation in the actual production environment of the obtained effective solution (Pr(N,Γ)) can be obtained by the following formula:
[0139]
[0140] Let's take a practical example to explain this in detail: suppose there are 50 virtual machines on a host, and the usage of each virtual machine is represented by an interval. Convert the above formula into a statistical chart, such as Fig.11 As shown in the figure, when the decision maker believes that at most Γ = 15 virtual machines will reach their peak usage at the same time, the upper limit of the probability of QoS degradation in the feasible scheduling scheme found at this time in the real cloud environment is 2.46%, which is already a low probability. When Γ = 25, the upper limit of the probability is further reduced to 0.02%. Therefore, the revelation of robust optimization to cloud service providers is that they do not need to be too conservative in protecting the fluctuation of each virtual machine. Instead, they only need to protect the fluctuation usage of the Γ virtual machines with the largest fluctuations based on the acceptable probability of QoS degradation. The remaining virtual machines only need to deduct their basic usage on the host.
[0141] Further applying the above concept to the scheduling process of virtual machines, in order to achieve more resource reuse, it is necessary to deploy virtual machines with similar fluctuation usage (RU) on one host as much as possible to better play the role of peak-filling. More specifically, allowing virtual machines with large fluctuations to share buffers can make better use of the buffer.
[0142] For example, let's take a specific example to describe. Suppose there are 10 virtual machines, 5 of which need to be assigned to one host, and the other 5 to another host. Since their nominal usage needs to be deducted on the host, no matter which scheduling strategy is used, it is consistent. For their fluctuating usage, which are 1, 2, ..., 10, respectively, the optimal allocation method is to allocate the 5 with the largest fluctuations to one host, and the 5 with the smallest fluctuations to another host. Assume that when N = 5, Γ = 2, that is, the usage of the buffer is determined by the fluctuation usage of the two largest VMs among the 5 VMs.
[0143] Fig.12The allocation method is the optimal method (i.e., placing the ones with the largest fluctuations together). Five VMs with fluctuation usage of 10, 9, ..., 6 are deployed on one host. The amount of buffer resources that need to be reserved on the host is 10+9=19, and the 19 buffer resources are shared by the five VMs deployed on the host. Five VMs with fluctuation usage of 5, 4, ..., 1 are deployed on another host. The amount of buffer resources that need to be reserved on the host is 5+4=9, and the 9 buffer resources are shared by the five VMs deployed on the host. The amount of buffer resources that need to be reserved on the two hosts is 119+9=28.
[0144] Fig.13 For the other type of allocation (i.e., not placing the devices with the largest fluctuations together), the amount of buffer resources that need to be reserved on one host is 10+8=18, and the amount of buffer resources that need to be reserved on the other host is 9+7=16. The amount of buffer resources that need to be reserved on both hosts is 18+16=34. Fig.12 The VM allocation method shown is Fig.13 The VM allocation method shown results in the consumption of an additional 6 cores of host resources, which results in increased costs and reduced resource utilization efficiency. Fig.12 In the VM allocation method shown, VMs with similar fluctuation levels among multiple VMs are deployed on one host, which can reduce the operating costs of the cloud service provider and improve the utilization rate of host resources.
[0145] It can be seen that in the VM scheduling strategy, co-locating virtual machines with similar volatility levels can give full play to the "pooling" effect of resources, that is, by sharing the buffer through virtual machines, the efficiency of resource reuse can be improved.
[0146] The scheduling of the above VMs includes but is not limited to: initial placement of VMs and secondary scheduling of VMs. The primary scheduling system focuses on selecting the most suitable host for the VM at the beginning of its creation. The secondary scheduling system implements the rearrangement of the VMs on the host through hot migration of the VMs. The core idea of the primary and secondary scheduling systems is to aggregate VMs with similar fluctuations to improve the utilization efficiency of host resources.
[0147] The following are combined Figure 14-15 , the method of initial placement of VM and the method of secondary scheduling of VM are described in detail. It should be understood that Figure 14-15 The examples are only intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to Figure 14-15The specific numerical values or specific scenarios shown in the examples. Figure 14-15 The examples given are obviously susceptible to various equivalent modifications or changes, and such modifications and changes also fall within the scope of the embodiments of the present application.
[0148] Fig.14 1 is a schematic flow chart of a method for creating a virtual machine instance on a server provided in an embodiment of the present application. Fig.14 As shown, the method may include steps 1410-1430, and steps 1410-1430 are described in detail below.
[0149] Step 1410: The cloud management platform receives a request to create the virtual machine instance.
[0150] As an example, the cloud management platform may receive a request for creating a virtual machine instance sent by a tenant through a client, where the request is used to create the virtual machine instance on a server in a cloud data center.
[0151] It should be understood that the virtual machine instance to be created can be an ordinary virtual machine instance that is charged according to actual resource usage, or it can also be a first virtual machine instance that is charged according to actual resource usage and the degree of fluctuation of actual resource usage. The embodiments of the present application do not make specific limitations on this.
[0152] Step 1420: The cloud management platform determines the basic resource usage of the virtual machine instance to be created and the predicted value of the fluctuation degree of the basic resource usage.
[0153] As an example, the cloud management platform can predict the basic resource usage of the virtual machine instance to be created and the degree of fluctuation of the basic resource usage. For the description of the degree of fluctuation of the basic resource usage, please refer to the above description, which will not be repeated here.
[0154] In a possible implementation, the cloud management platform can use an intelligent profiler to profile the basic resource usage and the degree of fluctuation of the basic resource usage of the virtual machine instance to be created, and obtain the predicted value of the basic resource usage and the degree of fluctuation of the basic resource usage of the virtual machine instance to be created. In one example, the intelligent profiler can use a cold start profile algorithm to profile the basic resource usage and the degree of fluctuation of the basic resource usage of the virtual machine instance to be created.
[0155] It should be noted that the embodiment of the present application does not specifically limit the cold start profiling algorithm adopted by the intelligent profiling device. The cold start profiling algorithm may be, for example, gradient-boosted decision trees (DBDT).
[0156] Step 1430: The cloud management platform selects a server that matches the fluctuation level of the virtual machine instance to be created based on the fluctuation level of the basic resource usage of the virtual machine instances already created on each server in the server group, and deploys the virtual machine instance to be created on the matching server.
[0157] In an embodiment of the present application, if a VM is created on each server in the server group, then based on the fluctuation degree of the basic resource usage of the created virtual machine instances, a virtual machine instance with a fluctuation degree similar to that of the virtual machine instance to be created or that meets the threshold condition can be determined from the created virtual machine instances, and the server where the virtual machine instance is located can be determined as a server machine that matches the virtual machine instance to be created, and the virtual machine instance to be created can be deployed on the matching server.
[0158] In a possible implementation, each server has a label of "fluctuation range of virtual machine instance", which is composed of the maximum and minimum values of the fluctuation degree of the virtual machine instance deployed on the server. In the embodiment of the present application, if the fluctuation degree of the virtual machine instance to be created is within the label of "fluctuation range of virtual machine instance", the server can be determined to be the server that matches the virtual machine instance to be created.
[0159] It should be understood that the basic resource usage and the degree of fluctuation of the basic resource usage of the virtual machine instance deployed on the server will change over time. Therefore, in the embodiment of the present application, the cloud management platform can regularly update the label of "VM fluctuation range" on each server so as to more accurately find the server that matches the virtual machine instance to be created. Specifically, each server is installed with a cloud management platform client, which detects the usage of the hardware resources of the server in real time and reports it to the cloud management platform.
[0160] In some embodiments, if the hotspot constraint is not violated after the virtual machine instance is deployed on a matching server, the server is selected to deploy the virtual machine instance, otherwise the next server is tried.
[0161] Fig.15 is a schematic flow chart of a method for migrating a virtual machine instance provided in an embodiment of the present application. Fig.15 As shown, the method may include steps 1510-1540, and steps 1510-1540 are described in detail below.
[0162] It should be understood that the virtual machine instances that have been deployed on the server are rescheduled, and the virtual machine instances are migrated from the original host (server) to a more suitable new host through hot migration to achieve specific scheduling goals. Since the resource usage characteristics of virtual machine instances change over time, the system needs to regularly rearrange the virtual machine instances on the server to achieve the goal of co-location of virtual machine instances with similar fluctuations. Its scheduling logic and Fig.14 The method of allocating servers to instances for the first time is similar to that shown in FIG. 1 , but the main difference is that the virtual machine instances faced by the initial server allocation are newly arrived virtual machine instances, so there is no accumulation of historical resource usage data, and the intelligent profiler is required to perform cold start prediction of the future resource usage of the virtual machine instances. However, the virtual machine instances have accumulated historical data during the migration process, and the intelligent profiler can accurately predict the future resource usage of the virtual machine instances by learning from the historical data.
[0163] Step 1510: The cloud management platform receives a migration request for the virtual machine instance, where the migration request is used to migrate the virtual machine instance from the second server to the first server.
[0164] It should be understood that the virtual machine instance to be migrated can be an ordinary virtual machine instance that is charged according to actual resource usage, or it can also be a first virtual machine instance that is charged according to actual resource usage and the degree of fluctuation of actual resource usage. The embodiments of the present application do not make specific limitations on this.
[0165] To ensure the tenant experience, the migration of virtual machine instances must ensure that the tenants of the virtual machine are unaware of the migration process, so it is also called online migration or hot migration of virtual machine instances.
[0166] Step 1520: The cloud management platform obtains historical data on resource usage of all virtual machine instances on the second server in the previous scheduling cycle.
[0167] As an example, the cloud management platform can obtain the historical resource usage data of all virtual machine instances on the second server in the last scheduling cycle. The historical resource usage data includes but is not limited to: the basic resource usage of the virtual machine instances in the last scheduling cycle, and the fluctuation degree of the basic resource usage.
[0168] Step 1530: Determine the predicted value of the basic resource usage and the fluctuation degree of the basic resource usage of the virtual machine instance in the next scheduling cycle based on the acquired historical data of resource usage of the virtual machine instance in the previous scheduling cycle.
[0169] In an embodiment of the present application, the cloud management platform can predict the basic resource usage and the degree of fluctuation of the basic resource usage of the virtual machine instance in the next scheduling cycle based on the historical data of resource usage of the virtual machine instance in the previous scheduling cycle.
[0170] In a possible implementation, the cloud management platform can obtain the basic resource usage and the predicted value of the basic resource usage of the virtual machine instance in the next scheduling cycle through the learning of historical data by the intelligent profiler. In one example, the intelligent profiler can perform moving average on the historical data and take the maximum and minimum values of the usage to obtain the basic resource usage and the predicted value of the basic resource usage of the virtual machine instance in the next scheduling cycle.
[0171] Step 1540: Regroup and migrate the created virtual machine instances through a secondary scheduling migration algorithm, so that the fluctuation degree of the virtual machines on each server after migration is as close as possible.
[0172] As an example, hot migration is used to achieve migration of virtual machines on the server, and the virtual machines are rearranged on the server, so that the fluctuation levels of the virtual machine instances on each server after the rearrangement are as close as possible (the difference in fluctuation levels meets a preset threshold).
[0173] For example, suppose that virtual machine 1 of server 1 needs to be migrated to server 2. The cloud management platform confirms that virtual machine 1 of server 1 needs to be migrated to server 2, and the cloud management platform notifies the cloud management platform client of server 2 to create virtual machine 1'. The specifications of virtual machine 1' are the same as those of virtual machine 1, and virtual machine 1' is not started yet.
[0174] After the migration starts, the virtual machine 1 of server 1 is still running, and the virtual machine 1' has not yet started. The cloud management platform client of the server sends all the memory page data corresponding to the virtual machine 1 to the memory space corresponding to the virtual machine 1' in server 2 in the first round of the cycle (see Figure 4 HPA in the pre-copy process), and in each subsequent cycle, the dirty pages written by virtual machine 1 in the previous pre-copy process are sent. When the time is right (for example, virtual machine 1 does not generate dirty pages in a cycle, or the generated dirty pages are less than a certain threshold), the pre-copy cycle ends and enters the shutdown copy phase. Virtual machine 1 is suspended and no memory is updated. The storage resources and network resources of virtual machine 1 (storage resources and network resources are distributed settings and can be mounted to other virtual machines) are connected to virtual machine 1', virtual machine 1' is started, and the virtual machine 1 logged in by the tenant is directly replaced by virtual machine 1'. Therefore, the tenant is unaware of the above virtual machine migration process.
[0175] Optionally, the embodiment of the present application may also adjust the server that does not meet the resource capacity constraint, and move the portion of the resource limit that exceeds the limit out of some virtual machine instances to the nearest server that has sufficient space to accommodate it.
[0176] In the above technical solutions, whether it is the scheduling scheme for the initial allocation of VM or the scheduling scheme for the secondary scheduling of VM, the scheduling method is based on a robust optimization approach, which can co-locate virtual machine instances with similar fluctuations on a server, so as to maximize the pooling response of the instance resource sharing buffer and utilize the peak-filling effect of the virtual machine instance resource utilization, thereby bringing more extreme resource efficiency utilization and less operating costs to the cloud service provider.
[0177] Combination of the above Figures 1 to 15 , describes in detail the method provided by the embodiment of the present application, and will be combined with Figure 16-Figure 19 , describes in detail the embodiment of the device of the present application. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous method embodiment.
[0178] Fig.16 It is a schematic block diagram of a billing device 1600 for a virtual machine provided in an embodiment of the present application. The device 1600 can be implemented by software, hardware, or a combination of the two. The device 1600 provided in an embodiment of the present application can implement the process of the billing method for the virtual machine shown in the embodiment of the present application. The device 1600 is applied to a cloud management platform, and the cloud management platform is used to manage the infrastructure for providing cloud services. The infrastructure includes at least one cloud data center, each of which is provided with at least one server, and each server runs a virtual machine instance. The device 1600 includes: a receiving module 1610, a configuration module 1620, a sending module 1630, and a billing module 1640.
[0179] In one implementation, the receiving module 1610 is used to receive configuration information of a virtual machine instance sent by a tenant, the configuration information including the size of the virtual machine instance selected by the tenant and the type of the virtual machine instance, the type of the virtual machine instance being a first virtual machine instance, and the first virtual machine instance being charged according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage; the configuration module 1620 is used to select a first server from the at least one server according to the size of the virtual machine instance selected by the tenant, and deploy the first virtual machine instance on the first server; the sending module 1630 is used to send login information of the first virtual machine instance to the client of the tenant, the login information being used for the tenant to log in and use the first virtual machine instance; the billing module 1640 is used to bill the first virtual machine instance according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage according to the type of the virtual machine instance selected by the tenant being the first virtual machine instance.
[0180] In another implementation, the receiving module 1610 is used to receive configuration information of a virtual machine instance sent by a tenant, the configuration information being used to modify the type of a second virtual machine instance running on a first server to a first virtual machine instance, the first server being one of the at least one server, and the first virtual machine instance being charged according to actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage; the configuration module 1620 is used to modify the type of the second virtual machine instance running on the first server to the first virtual machine instance based on the configuration information; the sending module 1630 is used to send login information of the first virtual machine instance to the client of the tenant, the login information being used for the tenant to log in and use the first virtual machine instance; the billing module 1640 is used to bill the first virtual machine instance according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage based on the type of the virtual machine instance selected by the tenant being the first virtual machine instance.
[0181] Optionally, the degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
[0182] Optionally, the billing module 1640 is specifically used to: determine the charging price corresponding to the actual resource usage of the first virtual machine instance; multiply the charging price corresponding to the actual resource usage of the first virtual machine instance by a price coefficient to obtain the charging price of the first virtual machine instance, the price coefficient is positively correlated with the degree of fluctuation of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
[0183] Optionally, the receiving module 1610 is also used to receive a creation request for the first virtual machine instance, which is used to create the first virtual machine instance; the configuration module 1620 is specifically used to create the first virtual machine instance on the first server according to the creation request for the first virtual machine instance, and a second virtual machine instance is deployed on the first server, and a difference between a predicted value of the fluctuation degree of actual resource usage of the second virtual machine instance in the first scheduling period and a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period satisfies a preset threshold.
[0184] Optionally, the receiving module 1610 is also used to receive a migration request for the first virtual machine instance, and the migration request is used to migrate the first virtual machine instance from the second server to the first server, where the second server is one of the at least one server and the first virtual machine instance is running on the second server; the configuration module 1620 is specifically used to migrate the first virtual machine instance from the second server to the first server.
[0185] Optionally, the device 1600 also includes: a determination module, used to determine a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period based on a historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in the second scheduling period, and the second scheduling period is a period before the first scheduling period.
[0186] The device 1600 here can be embodied in the form of a functional module. The term "module" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0187] For example, a "module" can be a software program, a hardware circuit, or a combination of the two that implements the above functions. Exemplarily, the implementation of the receiving module 1610 is described below by taking the receiving module 1610 as an example. Similarly, the implementation of other modules, such as the configuration module 1620, the sending module 1630, and the billing module 1640, can refer to the implementation of the receiving module 1610.
[0188] The receiving module 1610 is taken as an example of a software functional unit, and the receiving module 1610 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the acquisition module 1110 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0189] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0190] The receiving module 1610 is taken as an example of a hardware functional unit, and the receiving module 1610 may include at least one computing device, such as a server, etc. Alternatively, the acquisition module 1110 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0191] The multiple computing devices included in the receiving module 1610 can be distributed in the same region or in different regions. The multiple computing devices included in the receiving module 1610 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the receiving module 1610 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0192] Therefore, the modules of each example described in the embodiments of the present application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0193] It should be noted that: when the device provided in the above embodiment executes the above method, only the division of the above functional modules is used as an example. In actual application, the above function allocation can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For example, the receiving module 1610 can be used to execute any step in the above method, the configuration module 1620 can be used to execute any step in the above method, the sending module 1630 can be used to execute any step in the above method, the billing module 1640 can be used to execute any step in the above method, and the determination module can be used to execute any step in the above method. The steps that the configuration module 1620, the sending module 1630, the billing module 1640, and the determination module are responsible for implementing can be specified as needed. The configuration module 1620, the sending module 1630, the billing module 1640, and the determination module respectively implement different steps in the above method to realize all the functions of the above device.
[0194] In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments above, which will not be repeated here.
[0195] The method provided in the embodiment of the present application can be performed by a computing device, which can also be referred to as a computer system. It includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a processing unit, a memory and a memory control unit, and then the function and structure of the hardware are described in detail. The operating system is any one or more computer operating systems that implement business processing through a process, for example, a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer includes applications such as a browser, an address book, a word processing software, and an instant messaging software. In addition, optionally, the computer system is a handheld device such as a smart phone, or a terminal device such as a personal computer, and the present application is not particularly limited, as long as the method provided by the embodiment of the present application can be used. The execution subject of the method provided in the embodiment of the present application can be a computing device, or a functional module in a computing device that can call a program and execute a program.
[0196] Combine the following Fig.17 , a computing device provided in an embodiment of the present application is described in detail.
[0197] Fig.17 1 is a schematic diagram of the architecture of a computing device 1700 provided in an embodiment of the present application. The computing device 1700 may be a server or a computer or other device with computing capabilities. Fig.17 The computing device 1700 shown includes at least one processor 1710 and a memory 1720 .
[0198] It should be understood that the present application does not limit the number of processors and memories in the computing device 1700.
[0199] The processor 1710 executes the instructions in the memory 1720, so that the computing device 1700 implements the method provided by the present application. Alternatively, the processor 1710 executes the instructions in the memory 1720, so that the computing device 1700 implements the functional modules provided by the present application, thereby implementing the method provided by the present application.
[0200] Optionally, the computing device 1700 further includes a communication interface 1730. The communication interface 1730 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1700 and other devices or a communication network.
[0201] Optionally, the computing device 1700 further includes a system bus 1740, wherein the processor 1710, the memory 1720 and the communication interface 1730 are respectively connected to the system bus 1740. The processor 1710 can access the memory 1720 through the system bus 1740. For example, the processor 1710 can read and write data or execute code in the memory 1720 through the system bus 1740. The system bus 1740 is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus 1740 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.17 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0202] In a possible implementation, the function of the processor 1710 is mainly to interpret the instructions (or codes) of the computer program and process the data in the computer software. The instructions of the computer program and the data in the computer software can be stored in the memory 1720 or the cache 1716.
[0203] Optionally, the processor 1710 may be an integrated circuit chip with signal processing capabilities. As an example and not limitation, the processor 1710 is a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Among them, the general-purpose processor is a microprocessor, etc. For example, the processor 1710 is a central processing unit (CPU).
[0204] Optionally, each processor 1710 includes at least one processing unit 1712 and a memory control unit 1714 .
[0205] Optionally, the processing unit 1712 is also called a core or kernel, which is the most important component of the processor. The processing unit 1712 is manufactured from single crystal silicon using a certain production process, and all calculations, command acceptance, command storage, and data processing of the processor are performed by the core. The processing units run program instructions independently and use the ability of parallel computing to speed up the running speed of the program. Various processing units have a fixed logical structure. For example, the processing unit includes logical units such as a first-level cache, a second-level cache, an execution unit, an instruction-level unit, and a bus interface.
[0206] In an implementation example, the memory control unit 1714 is used to control data interaction between the memory 1720 and the processing unit 1712. Specifically, the memory control unit 1714 receives a memory access request from the processing unit 1712, and controls access to the memory based on the memory access request. As an example and not a limitation, the memory control unit is a device such as a memory management unit (MMU).
[0207] In one implementation example, each memory control unit 1714 addresses the memory 1720 through the system bus. And an arbiter ( Fig.17 ), which is responsible for handling and coordinating competing accesses of multiple processing units 1712.
[0208] In an implementation example, the processing unit 1712 and the memory control unit 1714 are connected to each other through connection lines inside the chip, such as address lines, so as to achieve communication between the processing unit 1712 and the memory control unit 1714.
[0209] Optionally, each processor 1710 also includes a cache 1716, wherein the cache is a buffer for data exchange (called cache). When the processing unit 1712 wants to read data, it will first search for the required data from the cache. If it is found, it will be executed directly. If it is not found, it will be searched from the memory. Since the running speed of the cache is much faster than the memory, the role of the cache is to help the processing unit 1712 run faster.
[0210] The memory 1720 can provide a running space for the processes in the computing device 1700. For example, the computer program (specifically, the code of the program) used to generate the process is stored in the memory 1720. After the computer program is executed by the processor to generate the process, the processor allocates a corresponding storage space for the process in the memory 1720. Furthermore, the above storage space further includes a text segment, an initialized data segment, a bit initialized data segment, a stack segment, a heap segment, etc. The memory 1720 stores the data generated during the running of the process in the storage space corresponding to the above process, such as intermediate data, process data, etc.
[0211] Optionally, the storage is also called memory, and its function is to temporarily store the operation data in the processor 1710 and the data exchanged with the external storage such as the hard disk. As long as the computer is running, the processor 1710 will transfer the data to be calculated to the memory for calculation, and when the calculation is completed, the processing unit 1712 will transmit the result.
[0212] As an example and not limitation, memory 1720 is a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory is a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory is a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DRRAM). It should be noted that the memory 1720 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0213] The structure of the computing device 1700 listed above is only an example, and the present application is not limited thereto. The computing device 1700 of the embodiment of the present application includes various hardware in the computer system in the prior art. For example, the computing device 1700 also includes other memories besides the memory 1720, such as disk storage, etc. Those skilled in the art should understand that the computing device 1700 may also include other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the above-mentioned computing device 1700 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the above-mentioned computing device 1700 may also include only the devices necessary to implement the embodiment of the present application, and does not necessarily include Fig.17 All devices shown in .
[0214] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0215] like Fig.18 As shown, the computing device cluster includes at least one computing device 1700. The memory 1720 in one or more computing devices 1700 in the computing device cluster may store the same instructions for executing the above method.
[0216] In some possible implementations, the memory 1720 in one or more computing devices 1700 in the computing device cluster may also store some instructions for executing the above method. In other words, the combination of one or more computing devices 17700 can jointly execute the instructions of the above method.
[0217] It should be noted that the memory 1720 in different computing devices 1700 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the above-mentioned apparatus. That is, the instructions stored in the memory 1720 in different computing devices 1700 may implement the functions of one or more modules in the above-mentioned apparatus.
[0218] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.19 A possible implementation is shown. Fig.19 As shown, two computing devices 1700A and 1700B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.
[0219] It should be understood that Fig.19The functionality of the computing device 1700A shown in FIG. 17 may also be implemented by multiple computing devices 1700. Similarly, the functionality of the computing device 1700B may also be implemented by multiple computing devices 1700.
[0220] In this embodiment, a computer program product including instructions is also provided, and the computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on a computing device, the computing device is caused to execute the method provided above, or the computing device is caused to implement the function of the apparatus provided above.
[0221] In this embodiment, a computer-readable storage medium is also provided. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions. When the instructions in the computer-readable storage medium are executed on a computing device, the computing device executes the method provided above.
[0222] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0223] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0224] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0225] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0226] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0227] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0228] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0229] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A billing method for a virtual machine, It is characterized in that The method is applied to a cloud management platform, the cloud management platform is used to manage the infrastructure for providing cloud services, the infrastructure includes at least one cloud data center, each of the cloud data center is provided with at least one server, each of the servers runs a virtual machine instance, the method includes: The cloud management platform receives configuration information of a virtual machine instance sent by a tenant, wherein the configuration information includes a specification size of the virtual machine instance selected by the tenant and a type of the virtual machine instance, wherein the type of the virtual machine instance is a first virtual machine instance, and the first virtual machine instance is charged according to actual resource usage of the first virtual machine instance and a degree of fluctuation of the actual resource usage; The cloud management platform selects a first server from the at least one server according to the size of the virtual machine instance selected by the tenant, and deploys the first virtual machine instance on the first server; The cloud management platform sends login information of the first virtual machine instance to the client of the tenant, where the login information is used by the tenant to log in and use the first virtual machine instance; The cloud management platform selects the first virtual machine instance according to the type of the virtual machine instance selected by the tenant, and charges the first virtual machine instance according to actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage.
2. The method according to claim 1, It is characterized in that The degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
3. The method according to claim 1 or 2, It is characterized in that The cloud management platform charges the first virtual machine instance according to actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage, including: The cloud management platform determines a charging price corresponding to the actual resource usage of the first virtual machine instance; The cloud management platform multiplies the charging price corresponding to the actual resource usage of the first virtual machine instance by a price coefficient to obtain the charging price of the first virtual machine instance. The price coefficient is positively correlated with the degree of fluctuation of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: The cloud management platform receives a creation request for the first virtual machine instance, where the creation request is used to create the first virtual machine instance; The cloud management platform deploys the first virtual machine instance on the first server, including: The cloud management platform creates the first virtual machine instance on the first server based on the creation request of the first virtual machine instance. A second virtual machine instance is deployed on the first server, and a difference between a predicted value of a fluctuation degree of actual resource usage of the second virtual machine instance in a first scheduling period and a predicted value of a fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period satisfies a preset threshold.
5. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: The cloud management platform receives a migration request for the first virtual machine instance, where the migration request is used to migrate the first virtual machine instance from a second server to the first server, where the second server is one of the at least one server, and the first virtual machine instance is running on the second server; The cloud management platform deploys the first virtual machine instance on the first server, including: The cloud management platform migrates the first virtual machine instance from the second server to the first server.
6. The method according to claim 5, It is characterized in that The method further comprises: The cloud management platform determines a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period based on a historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in the second scheduling period, where the second scheduling period is a period before the first scheduling period.
7. A billing method for a virtual machine, It is characterized in that The method is applied to a cloud management platform, the cloud management platform is used to manage the infrastructure for providing cloud services, the infrastructure includes at least one cloud data center, each of the cloud data center is provided with at least one server, each of the servers runs a virtual machine instance, the method includes: The cloud management platform receives configuration information of a virtual machine instance sent by a tenant, the configuration information being used to modify a type of a second virtual machine instance running on a first server to a first virtual machine instance, the first server being one of the at least one server, and the first virtual machine instance being charged according to actual resource usage of the first virtual machine instance and a degree of fluctuation of the actual resource usage; The cloud management platform changes the type of the second virtual machine instance running on the first server to the first virtual machine instance according to the configuration information; The cloud management platform sends login information of the first virtual machine instance to the client of the tenant, where the login information is used by the tenant to log in and use the first virtual machine instance; The cloud management platform selects the first virtual machine instance according to the type of the virtual machine instance selected by the tenant, and charges the first virtual machine instance according to actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage.
8. The method according to claim 7, It is characterized in that The degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
9. The method according to claim 7 or 8, It is characterized in that The cloud management platform charges the first virtual machine instance according to actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage, including: The cloud management platform determines a charging price corresponding to the actual resource usage of the first virtual machine instance; The cloud management platform multiplies the charging price corresponding to the actual resource usage of the first virtual machine instance by a price coefficient to obtain the charging price of the first virtual machine instance. The price coefficient is positively correlated with the degree of fluctuation of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
10. The method according to any one of claims 7 to 9, It is characterized in that The method further comprises: The cloud management platform receives a creation request for the first virtual machine instance, where the creation request is used to create the first virtual machine instance; The cloud management platform creates the first virtual machine instance on the first server based on the creation request of the first virtual machine instance. A second virtual machine instance is deployed on the first server, and a difference between a predicted value of a fluctuation degree of actual resource usage of the second virtual machine instance in a first scheduling period and a predicted value of a fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period satisfies a preset threshold.
11. The method according to any one of claims 7 to 9, It is characterized in that The method further comprises: The cloud management platform receives a migration request for the first virtual machine instance, where the migration request is used to migrate the first virtual machine instance from a second server to the first server, where the second server is one of the at least one server, and the first virtual machine instance is running on the second server; The cloud management platform migrates the first virtual machine instance from the second server to the first server.
12. The method according to claim 11, It is characterized in that The method further comprises: The cloud management platform determines a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period based on a historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in the second scheduling period, where the second scheduling period is a period before the first scheduling period.
13. A charging device for a virtual machine, It is characterized in that The device is applied to a cloud management platform, the cloud management platform is used to manage the infrastructure for providing cloud services, the infrastructure includes at least one cloud data center, each of the cloud data center is provided with at least one server, each of the servers runs a virtual machine instance, the device includes: A receiving module, configured to receive configuration information of a virtual machine instance sent by a tenant, wherein the configuration information includes a specification size of the virtual machine instance selected by the tenant and a type of the virtual machine instance, wherein the type of the virtual machine instance is a first virtual machine instance, and the first virtual machine instance is charged according to actual resource usage of the first virtual machine instance and a degree of fluctuation of the actual resource usage; a configuration module, configured to select a first server from the at least one server according to the size of the virtual machine instance selected by the tenant, and deploy the first virtual machine instance on the first server; A sending module, configured to send login information of the first virtual machine instance to a client of the tenant, wherein the login information is used by the tenant to log in and use the first virtual machine instance; A billing module is used to bill the first virtual machine instance according to the type of the virtual machine instance selected by the tenant, which is the first virtual machine instance, according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage.
14. The device according to claim 13, It is characterized in that The degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
15. The device according to claim 13 or 14, It is characterized in that The billing module is specifically used for: Determining a charging price corresponding to actual resource usage of the first virtual machine instance; The charging price corresponding to the actual resource usage of the first virtual machine instance is multiplied by the price coefficient to obtain the charging price of the first virtual machine instance. The price coefficient is positively correlated with the fluctuation degree of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
16. The device according to any one of claims 13 to 15, It is characterized in that The receiving module is further configured to receive a creation request for the first virtual machine instance, where the creation request is used to create the first virtual machine instance; The configuration module is specifically used to create the first virtual machine instance on the first server according to the creation request of the first virtual machine instance, and a second virtual machine instance is deployed on the first server, and the difference between the predicted value of the fluctuation degree of actual resource usage of the second virtual machine instance in the first scheduling period and the predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period meets a preset threshold.
17. The device according to any one of claims 13 to 15, It is characterized in that The receiving module is further configured to receive a migration request of the first virtual machine instance, wherein the migration request is used to migrate the first virtual machine instance from a second server to the first server, where the second server is one of the at least one server and the first virtual machine instance is running on the second server; The configuration module is specifically configured to migrate the first virtual machine instance from the second server to the first server.
18. The device according to claim 17, It is characterized in that The device also includes: A determination module is used to determine a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period based on the historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in the second scheduling period, and the second scheduling period is the period before the first scheduling period.
19. A billing device for a virtual machine, It is characterized in that The device is applied to a cloud management platform, the cloud management platform is used to manage the infrastructure for providing cloud services, the infrastructure includes at least one cloud data center, each of the cloud data center is provided with at least one server, each of the servers runs a virtual machine instance, the device includes: a receiving module, configured to receive configuration information of a virtual machine instance sent by a tenant, wherein the configuration information is used to modify the type of a second virtual machine instance running on a first server to a first virtual machine instance, wherein the first server is one of the at least one server, and the first virtual machine instance is charged according to actual resource usage of the first virtual machine instance and a degree of fluctuation of the actual resource usage; a configuration module, configured to modify the type of the second virtual machine instance running on the first server to the first virtual machine instance according to the configuration information; A sending module, configured to send login information of the first virtual machine instance to a client of the tenant, wherein the login information is used by the tenant to log in and use the first virtual machine instance; A billing module is used to bill the first virtual machine instance according to the type of the virtual machine instance selected by the tenant, which is the first virtual machine instance, according to the actual resource usage of the first virtual machine instance and the degree of fluctuation of the actual resource usage.
20. The device according to claim 19, It is characterized in that The degree of fluctuation of the actual resource usage is represented by at least one of the following information: the variance of the actual resource usage, the range of the actual resource usage, the coefficient of variation CV of the actual resource usage, and the over-allocation ratio of the first server.
21. The device according to claim 19 or 20, It is characterized in that The billing module is specifically used for: Determining a charging price corresponding to actual resource usage of the first virtual machine instance; The charging price corresponding to the actual resource usage of the first virtual machine instance is multiplied by the price coefficient to obtain the charging price of the first virtual machine instance. The price coefficient is positively correlated with the fluctuation degree of the actual resource usage, and the price coefficient is a positive number greater than 0 and less than or equal to 1.
22. The device according to any one of claims 19 to 21, It is characterized in that The receiving module is further configured to receive a creation request for the first virtual machine instance, where the creation request is used to create the first virtual machine instance; The configuration module is specifically used to create the first virtual machine instance on the first server according to the creation request of the first virtual machine instance, and a second virtual machine instance is deployed on the first server, and the difference between the predicted value of the fluctuation degree of actual resource usage of the second virtual machine instance in the first scheduling period and the predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period meets a preset threshold.
23. The device according to any one of claims 19 to 21, It is characterized in that The receiving module is further configured to receive a migration request of the first virtual machine instance, wherein the migration request is used to migrate the first virtual machine instance from a second server to the first server, where the second server is one of the at least one server and the first virtual machine instance is running on the second server; The configuration module is specifically configured to migrate the first virtual machine instance from the second server to the first server.
24. The device according to claim 23, It is characterized in that The device also includes: A determination module is used to determine a predicted value of the fluctuation degree of actual resource usage of the first virtual machine instance in the first scheduling period based on the historical value of the fluctuation degree of actual resource usage of the first virtual machine instance in the second scheduling period, and the second scheduling period is the period before the first scheduling period.
25. A computing device cluster, It is characterized in that comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 6, or executes the method according to any one of claims 7 to 12.
26. A computer program product comprising instructions, It is characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 6, or executes the method according to any one of claims 7 to 12.
27. A computer-readable storage medium, It is characterized in that The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 6, or executes the method according to any one of claims 7 to 12.
Citation Information
Cited By
Virtual machine migration method, device and system
CN114691287A
Data processing method and apparatus, chip, and cluster
WO2026145389A1
