Method, System, Device, Server, and Storage Medium for Creating a Virtual Machine

By controlling the transmission speed of mirrored data is less than the available bandwidth of the target storage cluster during the virtual machine creation process in the cloud platform, the problem of network bandwidth fullness during the virtual machine creation is solved, and the service quality and stability of the cloud platform are improved.

CN112084010BActive Publication Date: 2025-06-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010981932.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-17
Publication Date
2025-06-10
Estimated Expiration
2040-09-17

AI Technical Summary

Technical Problem

In a cloud platform, the process of transmitting mirrored data to the storage cluster when virtual machines are created can easily fill the network bandwidth, resulting in a decline in service quality.

Method used

By receiving a virtual machine creation request, the mirrored data is obtained and transmitted to the target storage cluster at a first transmission speed, ensuring that the transmission speed is less than the available bandwidth of the target storage cluster.

Benefits of technology

This avoids mirror data transmission to fill the network bandwidth, improves network fluency, and thus improves the service quality and stability of the cloud platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112084010B_ABST
    Figure CN112084010B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a method, system, device, server, and storage medium for creating a virtual machine. The method includes: receiving a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier, obtaining mirror data from a first target storage cluster corresponding to the first storage cluster identifier, and transmitting the mirror data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that when the second target storage cluster receives the mirror data, it creates a virtual machine according to the mirror data, and the first transmission speed is less than the available bandwidth of the second target storage cluster. This method can enable there to be remaining bandwidth in the network between the mirror management component and the second target storage cluster for other components to use, thereby avoiding filling up the network bandwidth during the transmission process of the mirror data, improving network fluency, and further improving the service quality of the cloud platform and maintaining the stability of the cloud platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud technologies, and more specifically, to a method, system, device, server, and storage medium for creating a virtual machine. Background Art

[0002] In a cloud platform, in order to provide computing power, it is generally necessary to create a virtual machine. When creating a virtual machine, it is necessary to create a storage cluster with an operating system, that is, it is necessary to transfer image data to the storage cluster. However, when transferring the image data to the storage cluster, it is easy to cause a decline in the service quality of the cloud platform. Summary of the Invention

[0003] In view of the above problems, this application proposes a method, system, device, server, and storage medium for creating a virtual machine to improve the above problems.

[0004] In a first aspect, this application provides a method for creating a virtual machine, the method including:

[0005] Receiving a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier;

[0006] Obtaining image data from a first target storage cluster corresponding to the first storage cluster identifier;

[0007] Transmitting the image data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that when the second target storage cluster receives the image data, it creates a virtual machine according to the image data, where the first transmission speed is less than the available bandwidth of the second target storage cluster.

[0008] In a second aspect, this application provides a method for creating a virtual machine, which is applied to a virtual machine creation system. The virtual machine creation system includes a first target storage cluster, an image management component, and a second target storage cluster. The method includes:

[0009] The image management component receives a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier;

[0010] The image management component obtains image data from a first target storage cluster corresponding to the first storage cluster identifier;

[0011] The image management component transmits the image data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, where the first transmission speed is less than the available bandwidth of the second target storage cluster;

[0012] When the second target storage cluster receives the mirror data, it creates a virtual machine according to the mirror data.

[0013] In a third aspect, the present application provides a virtual machine creation system, and the method includes:

[0014] A first target storage cluster for storing a plurality of mirror shards;

[0015] A mirror management component for receiving a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier; obtaining mirror data from the first target storage cluster corresponding to the first storage cluster identifier; and transmitting the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, where the first transmission speed is less than the available bandwidth of the second target storage cluster;

[0016] A second target storage cluster for creating a virtual machine according to the mirror data when receiving the mirror data.

[0017] In a fourth aspect, the present application provides a virtual machine creation device, and the method includes:

[0018] A receiving module for receiving a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier;

[0019] An obtaining module for obtaining mirror data from the first target storage cluster corresponding to the first storage cluster identifier;

[0020] A transmission module for transmitting the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that the second target storage cluster creates a virtual machine according to the mirror data when receiving the mirror data, where the first transmission speed is less than the available bandwidth of the second target storage cluster.

[0021] In a fifth aspect, the present application provides a server, including a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.

[0022] In a sixth aspect, the present application provides a computer-readable storage medium, where program code is stored in the computer-readable storage medium, and when the program code is run by a processor, the above method is executed.

[0023] A method, system, device, server, and storage medium for creating a virtual machine provided by this application. After receiving a virtual machine creation request including a first storage cluster identifier and a second storage cluster identifier, first obtain mirror data from a first target storage cluster corresponding to the first storage cluster identifier, and then transmit the mirror data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that the second target storage cluster creates a virtual machine according to the received mirror data. Since the first transmission speed for transmitting the mirror data to the second target storage cluster is less than the available bandwidth of the second target cluster, in this way, there is still remaining bandwidth in the network between the mirror management component and the second target storage cluster that can be used by other components, thereby avoiding occupying the network bandwidth during the transmission process of the mirror data, improving network fluency, and further improving the service quality of the cloud platform and maintaining the stability of the cloud platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0025] Figure 1 The flowchart of a method for creating a virtual machine proposed in an embodiment of this application is shown;

[0026] Figure 2 The structural schematic diagram of the system architecture of a cloud platform in the embodiments of this application is shown;

[0027] Figure 3 The flowchart of a method for creating a virtual machine proposed in another embodiment of this application is shown;

[0028] Figure 4 The schematic diagram of a mirror data transmission process in the embodiments of this application is shown;

[0029] Figure 5 The flowchart of a method for creating a virtual machine proposed in another embodiment of this application is shown;

[0030] Figure 6 The storage schematic diagram of mirror data in the ceph cluster in the embodiments of this application is shown;

[0031] Figure 7 The schematic diagram of the relationship between mirror shards and basic mirror blocks in the embodiments of this application is shown;

[0032] Figure 8 The functional schematic diagram of the rate limiting component in the embodiments of this application is shown;

[0033] Figure 9 Shows a schematic diagram of the working process of the mirror management component in the embodiments of the present application;

[0034] Figure 10 Shows a schematic diagram of the mirror data transmission process in the embodiments of the present application;

[0035] Figure 11 Shows the present application Figure 5 A flowchart in an implementation manner of S34 shown;

[0036] Figure 12 Shows a working flowchart of a current limiting component in the embodiments of the present application;

[0037] Figure 13 Shows a flowchart of a method for creating a virtual machine proposed in another embodiment of the present application;

[0038] Figure 14 Shows a schematic diagram of the interaction process within a system for creating a virtual machine proposed in the embodiments of the present application;

[0039] Figure 15 Shows a structural block diagram of a device for creating a virtual machine proposed in the embodiments of the present application;

[0040] Figure 16 Shows a structural block diagram of a device for creating a virtual machine proposed in another embodiment of the present application;

[0041] Figure 17 Shows a structural block diagram of a server for executing the method for creating a virtual machine according to the embodiments of the present application;

[0042] Figure 18 Shows a storage unit for storing or carrying program codes for implementing the method for creating a virtual machine according to the embodiments of the present application. Detailed implementation manners

[0043] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present application.

[0044] For the convenience of understanding, the terms involved in the embodiments of the present application are explained below.

[0045] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.

[0046] Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computing devices, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides resources is called the "cloud". The resources in the "cloud" seem to be infinitely expandable to users, and can be obtained at any time, used on demand, expanded at any time, and paid according to usage.

[0047] As a basic capability provider of cloud computing, a cloud computing resource pool (abbreviated as cloud platform, generally called IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to select and use. The cloud computing resource pool mainly includes: computing devices (virtual machines containing operating systems), storage devices, and network devices.

[0048] According to logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. The SaaS layer can also be directly deployed on the IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is various business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.

[0049] OpenStack: OpenStack is an open-source Iaas management platform.

[0050] Image management component (Glance component): A component in Openstack used to manage virtual machine images, with functions such as creating and uploading images, deleting images, and editing basic image information, and supporting multiple virtual machine image formats.

[0051] Virtual machine management component (Nova component): A component in Openstack used to manage virtual machines.

[0052] Block storage management component (Cinder component): A component in Openstack used to manage block storage.

[0053] Ceph: It is a distributed storage system / cluster that provides three types of storage: block, object, and file.

[0054] Ipsan: A storage cluster that provides block device services through the Transmission Control Protocol (TCP) / Internet Protocol (IP).

[0055] In a cloud platform, such as a private cloud platform, a public cloud platform, or a hybrid cloud platform, Openstack can be used as the basic platform to provide basic IaaS capabilities, including computing, storage, and network resources. Among them, computing refers to virtual machines, and storage generally refers to the system disk and data disk of virtual machines. An image refers to the template of the virtual machine system disk, which stores the operating system required when the virtual machine starts. When a virtual machine is created, a system disk with an operating system needs to be created, and the image data, as well as the data disk and system disk of the virtual machine, are stored in the storage cluster. Therefore, it is necessary to transfer the image data to the storage cluster where the system disk is located.

[0056] However, the inventor found in the research that for some servers, after the image management component is called to obtain the image data, during the process of transferring the image data to the storage cluster where the system disk is located, the transfer process of the image data will occupy the network bandwidth, resulting in network congestion, and thus reducing the service quality of the cloud platform.

[0057] Therefore, the inventor proposed the creation method, system, component, server, and storage medium of the virtual machine provided in this application. In this method, after obtaining multiple image shards, the multiple image shards are transferred to the second target storage cluster corresponding to the second storage cluster identifier at a first transfer speed, where the first transfer speed is less than the available bandwidth of the second target storage cluster, so that the transfer speed of the multiple image shards to the second target cluster can be limited, avoiding the transfer process of the image data from occupying the network bandwidth, improving network fluency, and thus improving the service quality of the cloud platform and maintaining the stability of the cloud platform.

[0058] The following will specifically describe the embodiments of this application with reference to the drawings.

[0059] Please refer to Figure 1 , Figure 1 The flowchart of a method for creating a virtual machine proposed in an embodiment of this application is shown. This method can be applied to the image management component in the cloud platform. This method includes:

[0060] Step S11: Receive a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier.

[0061] Please refer toFigure 2 In a cloud platform implemented using OpenStack as the underlying platform, the cloud platform can be a private cloud platform, a public cloud platform, or a hybrid cloud platform. The system architecture of the cloud platform includes a business layer 101, a gateway layer 102, a basic cloud layer 103, and a storage layer 104.

[0062] The business layer 101 interfaces with terminals and provides an operable interface for various users, which can specifically include a self-service platform, an operation and maintenance platform, a management platform, etc. The self-service platform provides a user interface for resource application, the management platform is used to manage the entire platform's resource usage, and the operation and maintenance platform provides an interface for administrators to perform operations such as migrating host machines. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.

[0063] The gateway layer 102 includes a database, a platform resource interface, an IP system, and role-based access control (RBAC). Among them, the IP system is used to manage network resources such as IP, and RBAC is used for authentication.

[0064] The basic cloud layer 103: includes components that provide services through the open-source OpenStack. The services can be IaaS services, and the components can be an image management component, a virtual machine management component, a block storage management component, etc. Among them, the virtual machine management component is used to manage the life cycle of virtual machines, the image management component is used to manage the life cycle of images, and the block storage management component is used to manage the life cycle of volumes.

[0065] It should be noted that each component that provides services through OpenStack can be located on one server or on different servers. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and this application does not limit this.

[0066] The storage layer 104: includes one or more storage clusters, and the storage clusters are used to store image data and the data disks and system disks of virtual machines. Among them, the type of storage cluster can be Ceph, Ipsan. For example, Figure 1Multiple storage clusters are shown. Among them, the virtual machine management component is docked with one set of storage clusters, the block storage management component is docked with two sets of storage clusters to use block storage, and the image management component is docked with one set of storage clusters to store image data separately.

[0067] In this embodiment, an operator who needs to create a virtual machine can use a terminal docked with the service layer to initiate a virtual machine creation request through an operable interface provided by the service layer. In this way, the image management component in the cloud platform can receive the virtual machine creation request.

[0068] As a way, when initiating a virtual machine creation request, the operator can actively set a first storage cluster identifier and a second storage cluster identifier. The first storage cluster identifier represents the source storage cluster where the image data is saved, and the second storage cluster identifier represents the destination storage cluster for image data transmission, that is, the storage cluster where the system disk of the virtual machine to be created is located.

[0069] As another way, when initiating a virtual machine creation request, the operator may not actively set the first storage cluster identifier and the second storage cluster identifier, but the image management component automatically confirms the first storage cluster identifier and the second storage cluster identifier according to the existing configuration file.

[0070] Specifically, the image management component internally stores a configuration file. The configuration file can configure the selection strategy for the first storage cluster identifier and the second storage cluster identifier. In this way, after receiving the virtual machine creation request, the image management component can automatically obtain the first storage cluster identifier and the second storage cluster identifier from the selection strategy configured in the configuration file. Among them, the configuration file can be set and saved by the operator at a certain specific usage stage. As a way, the configuration file can be configured by the operator during the creation stage of the image management component. The configuration file can configure the selection strategy for the first storage cluster identifier and the second storage cluster identifier. For example, the selection strategy can be that when the memory usage rate of the source storage cluster is less than the preset memory usage rate, the storage cluster identifier corresponding to the source storage cluster with a higher serial number is preferentially selected as the first storage cluster identifier; when the memory usage rate of the destination storage cluster is less than the preset memory usage rate, the storage cluster identifier corresponding to the destination storage cluster with a higher serial number is preferentially selected as the second storage cluster identifier. The selection strategy can also be to directly select the storage cluster identifier corresponding to the source storage cluster with the lowest memory occupancy rate as the first storage cluster identifier, and directly select the storage cluster identifier corresponding to the destination storage cluster with the lowest memory occupancy rate as the second storage cluster identifier.

[0071] Of course, in some ways, there may be other feasible ways for the image management component to automatically confirm the first storage cluster identifier and the second storage cluster identifier according to the existing configuration, which will not be elaborated here one by one.

[0072] Step S12: Obtain mirror data from the first target storage cluster corresponding to the first storage cluster identifier.

[0073] It can be understood that when the operator initiates a virtual machine creation request, the operator can actively set the first storage cluster identifier and the second storage cluster identifier, or the operator may not actively set the first storage cluster identifier and the second storage cluster identifier. Regardless of which method is adopted, after the mirror management component receives the virtual machine creation request, it can determine the first storage cluster identifier and the second storage cluster identifier, and then obtain the mirror data from the first target storage cluster corresponding to the first storage cluster identifier.

[0074] Step S13: Transmit the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that when the second target storage cluster receives the mirror data, it creates a virtual machine according to the mirror data. Wherein, the first transmission speed is less than the available bandwidth of the second target storage cluster.

[0075] Wherein, the first transmission speed refers to the speed used to transmit the mirror data obtained by the mirror management component to the second target storage cluster. In some ways, the first transmission speed can be set by the operator according to the available bandwidth of the second target cluster. The available bandwidth of the second target cluster refers to the maximum allowable bandwidth of the network between the mirror management component and the second target storage cluster, which is jointly used by other components and cloud management platform services between the mirror management component and the second target storage cluster. As needed, the first transmission speed can be set to be less than the available bandwidth of the second target cluster. For example, the first transmission speed can be 80M / S, indicating that the total amount of mirror data that the mirror management component can transmit per second is 80M, and the available bandwidth of the second target cluster can be 100M / S. It can be understood that the first transmission speed is less than the available bandwidth of the second target cluster. In this way, there is still remaining bandwidth in the network between the mirror management component and the second target storage cluster for other components to use, thereby avoiding filling up the network bandwidth during the transmission process of the mirror data, improving network fluency, and further improving the service quality of the cloud platform and maintaining the stability of the cloud platform.

[0076] After the mirror management component transmits the mirror data to the second target storage cluster, the second target storage cluster can receive the mirror data and create a virtual machine according to the received mirror data.

[0077] The method for creating a virtual machine provided in this embodiment first obtains mirror data from the first target storage cluster corresponding to the first storage cluster identifier after receiving a virtual machine creation request including the first storage cluster identifier and the second storage cluster identifier, and then transmits the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at the first transmission speed, so that the second target storage cluster creates a virtual machine according to the received mirror data. Since the first transmission speed for transmitting the mirror data to the second target storage cluster is less than the available bandwidth of the second target cluster, there is still remaining bandwidth in the network between the mirror management component and the second target storage cluster for other components to use, thus avoiding the network bandwidth being fully occupied during the transmission process of the mirror data, improving network fluency, further improving the service quality of the cloud platform, and maintaining the stability of the cloud platform.

[0078] Please refer to Figure 3 , Figure 3 which is a flowchart of a method for creating a virtual machine proposed in an embodiment of this application. The virtual machine creation request further includes a virtual machine startup method, and the method includes:

[0079] Step S21, receive a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier, a second storage cluster identifier, and a virtual machine startup method.

[0080] Step S22, obtain mirror data from the first target storage cluster corresponding to the first storage cluster identifier.

[0081] Step S23, determine an intermediate component for transmitting the mirror data according to the virtual machine startup method.

[0082] Step S24, transmit the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at the first transmission speed through the intermediate component.

[0083] It should be noted that the virtual machine startup method can also be actively set when an operator initiates a virtual machine creation request, or determined according to a configuration file stored inside the mirror management component, and the configuration file can configure a selection policy for the virtual machine startup method.

[0084] In some ways, the virtual machine startup method can include two types: mirror startup and volume startup. Among them, when the virtual machine uses mirror startup, the virtual machine management component of Openstack is responsible for creating the system disk of the virtual machine. Correspondingly, the determined intermediate component for transmitting the mirror data is the virtual machine management component. When the virtual machine uses volume startup, the block storage management component of Openstack is responsible for creating the system disk of the virtual machine. Correspondingly, the determined intermediate component for transmitting the mirror data is the block storage management component. Please refer to Figure 4 , in Figure 4Among them, the storage layer includes 4 sets of storage clusters. Among them, the mirror management component docks with one storage cluster (Storage Cluster 1) to store mirror data separately. The block storage management component docks with two storage clusters (Storage Cluster 2 and 3) to use block storage. The virtual machine management component docks with one storage cluster (Storage Cluster 4). Therefore, when a virtual machine starts with an image, the virtual machine management component calls the mirror management component to obtain mirror data from Storage Cluster 1. After the mirror management component obtains the mirror data from Storage Cluster 1, it transmits the obtained mirror data to the virtual machine management component, and the virtual machine management component then forwards the mirror data to Storage Cluster 4; when a virtual machine starts with a volume, the block storage management component calls the mirror management component to obtain mirror data from Storage Cluster 1. After the mirror management component obtains the mirror data from Storage Cluster 1, it transmits the obtained mirror data to the block storage management component, and the block storage management component then forwards the mirror data to Storage Cluster 2 or Storage Cluster 3.

[0085] Continue to refer to Figure 4 , in some ways, a storage network is used between the mirror management component and the docked Storage Cluster 1. A storage network is used between the block storage management component and the docked Storage Cluster 2 and Storage Cluster 3 respectively. A storage network is used between the virtual machine management component and the docked Storage Cluster 4. A management network is used between the mirror management component and the connected block storage management component. A management network is used between the mirror management component and the connected virtual machine management component. Among them, the management network refers to the network used by the Openstack service. For example, the IPs that provide services for the mirror management component, the block storage management component, and the virtual machine management component. The storage network refers to the network for data communication with the storage cluster.

[0086] Considering that the mirror management component, the block storage management component, and the virtual machine management component are the components that actually provide cloud platform services, and these components are connected by a management network. Therefore, the bandwidth of the management network during mirror data transmission is the key to affecting the quality of cloud platform services. Therefore, in some ways, the transmission speed of the storage network can be not restricted, but only the transmission speed of the management network is restricted. At this time, the first transmission speed can refer to the speed of transmitting mirror data in the management network, that is, the sum of the mirror data transmission speeds between the mirror management component and the block storage management component, and between the mirror management component and the virtual machine management component. Therefore, it is necessary to ensure that the first transmission speed is less than the maximum available bandwidth of the management network.

[0087] Please refer to Figure 5 , Figure 5 is a flowchart of a method for creating a virtual machine provided by another embodiment of the present application. Among them, the mirror data includes multiple mirror shards. The method includes:

[0088] Step S31: Receive a virtual machine creation request, which includes a first storage cluster identifier and a second storage cluster identifier.

[0089] Step S32: Obtain multiple mirror shards from the first target storage cluster corresponding to the first storage cluster identifier.

[0090] Among them, the mirror data includes multiple mirror shards. That is to say, when the mirror management component obtains the mirror data, it obtains it in the form of mirror shards. The mirror management component can obtain one mirror shard from the corresponding storage cluster each time. Since block devices are stored as basic mirror blocks of a fixed size at the bottom layer of the storage cluster, in some ways, a basic mirror block can be regarded as a mirror shard. Exemplarily, as Figure 6 shown, in the Ceph storage cluster, the rbd (Rados Block Device) block device is stored as a basic mirror block 601 of 4M size in the rbd image volume. Thus, when the mirror management component obtains the mirror data from the first target storage cluster corresponding to the first storage cluster identifier, it can obtain one basic mirror block 601 from the first target storage cluster each time, and finally obtain multiple basic mirror blocks 601 by looping.

[0091] In some ways, in order to reduce the number of times the mirror management component loops to obtain mirror shards from the docked storage cluster, it can be set that each mirror shard includes a first number of basic mirror blocks. Exemplarily, as Figure 7 shown, the first number can be set to 2. In this way, each mirror shard 60 includes two basic mirror blocks 601 of 4M size. Thus, when the mirror management component obtains the mirror shard 60 from the docked storage cluster each time, it can obtain two basic mirror blocks 601 each time. Therefore, when the number of basic mirror blocks 601 included in the mirror data is the same, the number of times the mirror management component loops to obtain the mirror shard 60 can be reduced, and the process of the mirror management component obtaining the mirror data can be simplified. It should be noted that the first number can also be set to positive integers such as 1, 3, 4, etc.

[0092] Step S33: Obtain at least one to-be-transferred mirror shard from the multiple mirror shards.

[0093] Step S34: For the to-be-transferred mirror shard, obtain a corresponding shard permission. Among them, the generation speed of the shard permission is determined according to the ratio of the first transmission speed and the size of the mirror shard.

[0094] Step S35: After obtaining the shard permission, transfer the corresponding to-be-transferred mirror shard to the second target storage cluster corresponding to the second storage cluster identifier.

[0095] Among them, the shard permission refers to the permission for the mirror shard to be transmitted to the second target cluster. That is to say, only the mirror shard that obtains the shard permission can be transmitted to the second target storage cluster by the mirror management component. Moreover, the shard permission is generated by the shard permission generator at the generation speed of the shard permission. Among them, the generation speed of the shard permission can be determined according to the first transmission speed and the size of the mirror shard. Exemplarily, assuming that the first transmission speed is 80M / S and the size of the mirror shard is 8M, at this time, the generation speed of the shard permission can be the ratio of the first transmission speed to the size of the mirror shard, that is, 10 per second. It can be seen that the generation speed of the shard permission represents the number of shard permissions generated per unit time.

[0096] Exemplarily, referring to Figure 8 , the mirror management component can create a flow-limiting component. The flow-limiting component includes two functions: the mirror shard acquisition function and the traffic control function. The flow-limiting component acquires the mirror shard from the first target cluster through the mirror shard acquisition function, and then the flow-limiting component controls the transmission speed of the mirror shard outward through the traffic control function. As a way, the flow-limiting component can be a part of the mirror management component.

[0097] Exemplarily, referring to Figure 9 , the mirror management component can create an iteration queue, a shard permission set, and a shard permission generator. The shard permission set is used to store the shard permissions generated by the shard permission generator, and the iteration queue is used to store multiple mirror shards acquired by the mirror management component. In this way, while the mirror management component acquires multiple mirror shards, on the one hand, it can save the acquired multiple mirror shards to the iteration queue, and on the other hand, it can obtain at least one to-be-transmitted mirror shard from the multiple mirror shards in the iteration queue, and obtain a corresponding shard permission from the shard permission set for the to-be-transmitted mirror shard. After obtaining the shard permission, the corresponding to-be-transmitted mirror shard can be transmitted to the second target storage cluster. It should be noted that the order of acquiring the mirror shards can be obtained in the first-in-first-out order of the mirror shards in the iteration queue, or in a random order, or in the last-in-first-out order of the mirror shards in the iteration queue.

[0098] After the mirror management component obtains multiple mirror shards, since only the to-be-transmitted mirror shards that have obtained the shard permission can be transmitted to the second target storage cluster, even if there are multiple mirror shards in the iteration queue, they can only be transmitted at a certain speed. That is, the transmission speed of multiple mirror shards can be controlled by obtaining the shard permission. And since the generation speed of the shard permission is determined according to the ratio of the first transmission speed and the size of the mirror shard, it is possible to avoid the network bandwidth being fully occupied during the transmission process of the mirror data, improve the network fluency, and then improve the service quality of the cloud platform and maintain the stability of the cloud platform.

[0099] Combined with the above embodiments, in some ways, the transmission speed of the storage network can be unrestricted, but only the transmission speed of the mirror data in the management network is restricted. At this time, the first transmission speed can refer to the sum of the mirror data transmission speed between the mirror management component and the block storage management component, and the mirror data transmission speed between the mirror management component and the virtual machine management component. Correspondingly, at this time, it is necessary to ensure that the first transmission speed is less than the maximum available bandwidth of the management network. Correspondingly, at this time, the mirror data is transmitted to the second target storage cluster through the intermediate component at the first transmission speed. The transmission process of the mirror data in this scenario is described in detail below.

[0100] Refer to Figure 9 and Figure 10 , the intermediate component is the block storage management component, the first target storage cluster is the Ceph storage cluster, the block storage component calls the download interface of the mirror management component to download the mirror data, and the mirror management component calls the read interface of the Ceph volume object rbd (rados block device) of the storage cluster to cyclically read the mirror shards until all the mirror data is read. Among them, each mirror shard includes two basic mirror blocks of 4M in size, that is, the size of each mirror shard is 8M. On the one hand, after the mirror management component cyclically obtains multiple mirror shards, it stores the multiple mirror shards in the iteration queue. On the other hand, the mirror management component obtains at least one to-be-transmitted mirror shard from the iteration queue, and for the obtained to-be-transmitted mirror shard, it obtains a corresponding shard permission from the shard to shard permission set. After obtaining the shard permission, the corresponding to-be-transmitted mirror shard can be dequeued and transmitted to the block storage management component. After receiving the mirror shard, the block storage management component can write the mirror shard into a temporary file in the / var / lib / cinder / tmp directory for storage, and continue to wait for the remaining mirror shards. After receiving all the mirror shards, all the mirror shards can be transmitted to the docked second target storage cluster through the storage network.

[0101] Such as Figure 11As shown, as a way, for the mirror shards to be transmitted, obtain a corresponding shard permission, including:

[0102] Step S341, determine whether there is a remaining shard permission in the shard permission set.

[0103] Step S342, when there is a remaining shard permission in the shard permission set, for the mirror shard to be transmitted, obtain a corresponding shard permission from the remaining shard permissions.

[0104] Step S343, when there is no remaining shard permission in the shard permission set, generate a shard permission according to the generation speed of the shard permission, where the generation speed of the shard permission represents the number of shard permissions generated per unit time; after generating the shard permission, for the mirror shard to be transmitted, obtain a corresponding shard permission from the generated shard permissions.

[0105] After the mirror management component obtains at least one mirror shard to be transmitted, it can determine whether there is a remaining shard permission in the shard permission set. Exemplarily, continue to refer to Figure 9, the image slices are acquired in the first-in-first-out order of the image slices in the iteration queue, that is, from the right side to the left side of the iteration queue, the image management component sequentially acquires at least one image slice, the image slice to be transmitted acquired for the first time is image slice 11, and at the same time, it is determined that there are remaining slice licenses 21 and slice licenses 22 in the slice license set. For image slice 11, slice license 21 can be acquired. At this time, image slice 11 can be dequeued and transmitted to the second target storage cluster. After slice license 21 is acquired, it will be deleted from the slice license set, that is, the remaining slice license 22 in the slice license set; the image slice to be transmitted acquired for the second time is image slice 12, and at the same time, it is determined that there are remaining slice licenses 21 and slice licenses 22 in the slice license set. The remaining shard license 22 in the shard license set 2 can be obtained for mirror shard 12. At this time, mirror shard 12 can be dequeued and transferred to the second target storage cluster. After shard license 22 is obtained, it will be deleted from the shard license set, that is, there are no remaining shard licenses in the shard license set; the third mirror shard to be transmitted is mirror shard 13. For mirror shard 13, since shard license 21 and shard license 22 have been deleted from the shard license set, there are temporarily no remaining shard licenses in the shard license set. At this time, the image management component can enter the sleep state and wait for the shard license generator to generate a new shard license. The sleep state means that the image management component no longer obtains mirror shards from the iteration queue, and will not dequeue the mirror shard currently obtained from the iteration queue, while other functions of the image management component will not be affected. For example, the image management component will still cyclically obtain mirror shards from the docked first target cluster and save them in the iteration queue. The duration of the sleep state is the time to generate one shard license, that is, after a new shard license is generated, the image management component can be released from the sleep state. When the shard license generator generates shard licenses, it generates them according to the generation speed of the shard licenses, and the generation speed of the shard licenses represents the number of shard licenses generated per unit time. The generation speed of the shard licenses can refer to the above description.

[0106] See also Figure 12 , Figure 12 against Figure 8 The specific process of the image shard acquisition function and the traffic limiting function included in the current limiting component is described in detail, which specifically includes the following steps:

[0107] Step 501 , the current limiting component determines whether there are unobtained mirror shards in the first target storage cluster. If yes, proceed to step 502 ; if no, proceed to step 506 .

[0108] Step 502: The current limiting component cyclically obtains mirror shards from the first target storage cluster.

[0109] Step 503: The current-limiting component determines whether there are remaining shard permissions in the shard permission set. If there are, go to Step 504; if not, go to Step 507.

[0110] Step 504: Decrease the number of shard permissions in the shard permission set by 1.

[0111] Step 505: Transmit the image shard corresponding to the shard permission outward.

[0112] Step 506: Determine whether there is an image shard in the current-limiting component. If there is, return to Step 503; if not, end.

[0113] In some ways, each shard permission can be set to include a first number of shard permission blocks, that is, the generation time of a shard permission is divided into smaller time granularities, so as to avoid the situation of suddenly generating shard permissions. At this time, when there are no remaining shard permissions in the shard permission set, shard permissions are generated according to the generation speed of shard permissions, including: generating shard permission blocks according to the generation speed of shard permission blocks, and the generation speed of shard permission blocks is determined according to the generation speed of shard permissions and the first number; when the number of shard permission blocks reaches the first number, it is determined that a shard permission is generated.

[0114] Among them, a shard permission consists of a first number of shard permission blocks. The shard permission generator can generate one shard permission block each time. When the generated shard permission blocks reach the first number, 1 shard permission is added to the shard permission set. It should be noted that the first number can be set by the operator.

[0115] For example, in some ways, the first number can be set to 10, that is to say, every time the shard permission generator generates 10 shard permission blocks, 1 shard permission can be added to the shard permission set.

[0116] In some ways, the shard permission generator can generate shard permission blocks in the way of generating tick events by using a Timer control. Exemplarily, assume that the generation speed of shard permissions is 10 per second and the first number is 10. Therefore, in order to generate 10 shard permissions within 1 second, 100 shard permission blocks need to be generated within 1 second. At this time, the generation speed of shard permission blocks can be obtained as 100 per second, that is, one shard permission block is generated every 0.01 second. At this time, it can be set to generate a tick event every 0.01s, and generating a tick event represents generating one shard permission block.

[0117] To better explain the embodiments of the present application, the following describes a method for creating a virtual machine provided by the embodiments of the present application in combination with specific implementation scenarios. This method is applied to a virtual machine creation system, which includes a first target storage cluster, an image management component, and a second target storage cluster. This method is executed through the interaction between the image management component and the block storage management component, as Figure 13 shown, and specifically includes the following steps:

[0118] Step S41, the image management component receives a virtual machine creation request, which includes a first storage cluster identifier and a second storage cluster identifier.

[0119] Step S42, the image management component obtains image data from the first target storage cluster corresponding to the first storage cluster identifier.

[0120] Step S43, the image management component transfers the image data to the second target storage cluster corresponding to the second storage cluster identifier at a first transfer speed, where the first transfer speed is less than the available bandwidth of the second target storage cluster.

[0121] Step S44, when the second target storage cluster receives the image data, it creates a virtual machine according to the image data.

[0122] In the method for creating a virtual machine provided in this embodiment, after receiving a virtual machine creation request including a first storage cluster identifier and a second storage cluster identifier, first obtain image data from the first target storage cluster corresponding to the first storage cluster identifier, and then transfer the image data to the second target storage cluster corresponding to the second storage cluster identifier at a first transfer speed, so that the second target storage cluster creates a virtual machine according to the received image data. Since the first transfer speed for transferring the image data to the second target storage cluster is less than the available bandwidth of the second target cluster, in this way, there is still remaining bandwidth in the network between the image management component and the second target storage cluster that can be used by other components, thereby avoiding the network bandwidth being fully occupied during the transmission process of the image data, improving network fluency, and further improving the service quality of the cloud platform and maintaining the stability of the cloud platform.

[0123] Refer to Figure 14 which shows a virtual machine creation system provided by an exemplary embodiment of the present application. This virtual machine creation system includes a first target storage cluster, an image management component, and a second target storage cluster, as Figure 14 shown. Each part within this virtual machine creation system can respectively execute the following steps:

[0124] Step S51, the first target cluster stores multiple image shards.

[0125] Step S52, the image management component receives a virtual machine creation request, which includes a first storage cluster identifier and a second storage cluster identifier.

[0126] Step S53, the image management component obtains image data from the first target storage cluster corresponding to the first storage cluster identifier.

[0127] Step S54, the image management component transfers the image data to the second target storage cluster corresponding to the second storage cluster identifier at a first transfer speed, where the first transfer speed is less than the available bandwidth of the second target storage cluster.

[0128] Step S55, when the second target storage cluster receives the image data, it creates a virtual machine according to the image data.

[0129] A method for virtual machine creation provided in this embodiment, after receiving a virtual machine creation request including a first storage cluster identifier and a second storage cluster identifier, first obtains image data from the first target storage cluster corresponding to the first storage cluster identifier, and then transfers the image data to the second target storage cluster corresponding to the second storage cluster identifier at a first transfer speed, so that the second target storage cluster creates a virtual machine according to the received image data. Since the first transfer speed for transferring the image data to the second target storage cluster is less than the available bandwidth of the second target cluster, in this way, there is still remaining bandwidth in the network between the image management component and the second target storage cluster that can be used by other components, thus avoiding the network bandwidth being fully occupied during the transmission process of the image data, improving network fluency, and further improving the service quality of the cloud platform and maintaining the stability of the cloud platform.

[0130] It should be noted that the parameter names used in the embodiments of the present application are exemplary and can be changed according to actual needs, not limited to the situations listed in the embodiments of the present application.

[0131] Please refer to Figure 15 , a virtual machine creation device 60 provided in the embodiments of the present application, the virtual machine creation device 60 includes:

[0132] A receiving module 61, configured to receive a virtual machine creation request, which includes a first storage cluster identifier and a second storage cluster identifier;

[0133] An obtaining module 62, configured to obtain image data from the first target storage cluster corresponding to the first storage cluster identifier;

[0134] A transmission module 63 is configured to transmit the image data to a second target storage cluster corresponding to a second storage cluster identifier at a first transmission speed, so that when the second target storage cluster receives the image data, a virtual machine is created according to the image data, wherein the first transmission speed is less than the available bandwidth of the second target storage cluster.

[0135] A virtual machine creation device provided in this embodiment, after receiving a virtual machine creation request including a first storage cluster identifier and a second storage cluster identifier, first obtains image data from a first target storage cluster corresponding to the first storage cluster identifier, and then transmits the image data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that the second target storage cluster creates a virtual machine according to the received image data. Since the first transmission speed for transmitting the image data to the second target storage cluster is less than the available bandwidth of the second target cluster, in this way, there is still remaining bandwidth in the network between the image management component and the second target storage cluster that can be used by other components, thereby avoiding occupying the network bandwidth during the transmission process of the image data, improving network fluency, and further improving the service quality of the cloud platform and maintaining the stability of the cloud platform.

[0136] Optionally, the transmission module includes:

[0137] A first acquisition sub-module is configured to acquire at least one to-be-transmitted image slice among multiple image slices;

[0138] A second acquisition sub-module is configured to acquire a corresponding slice permission for the to-be-transmitted image slice, wherein the generation speed of the slice permission is determined according to the ratio of the first transmission speed and the size of the image slice;

[0139] A first transmission sub-module is configured to transmit the corresponding to-be-transmitted image slice to a second target storage cluster corresponding to the second storage cluster identifier after acquiring the slice permission.

[0140] Optionally, the second acquisition sub-module includes:

[0141] A first acquisition unit is configured to acquire a corresponding slice permission for the to-be-transmitted image slice from the remaining slice permissions when there are remaining slice permissions in the slice permission set.

[0142] Optionally, the second acquisition sub-module includes:

[0143] A generation unit is configured to generate a slice permission at the generation speed of the slice permission when there are no remaining slice permissions in the slice permission set, and the generation speed of the slice permission represents the number of slice permissions generated per unit time;

[0144] A second acquisition unit, configured to, after generating a shard permission, acquire a corresponding shard permission from the generated shard permissions for a mirror shard to be transmitted.

[0145] Optionally, the generation unit includes:

[0146] A generation subunit, configured to generate shard permission blocks according to the generation speed of the shard permission blocks, where the generation speed of the shard permission blocks is determined according to the generation speed of the shard permissions and a first quantity;

[0147] A determination subunit, configured to determine to generate shard permissions when the quantity of the shard permission blocks reaches the first quantity.

[0148] Optionally, referring to Figure 16 , the virtual machine creation device further includes:

[0149] A determination module 64, configured to determine an intermediate component for forwarding and transmitting mirror data according to the virtual machine startup method;

[0150] Correspondingly, the transmission module includes:

[0151] A second transmission sub-module 631, configured to transmit the mirror data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed through the intermediate component.

[0152] Optionally, each of the multiple mirror shards includes a first quantity of basic mirror blocks.

[0153] It should be noted that the device embodiments in this application correspond to the foregoing method embodiments. For the specific principles in the device embodiments, reference may be made to the content in the foregoing method embodiments, which will not be elaborated here.

[0154] Next, a server provided in this application will be described in conjunction with Figure 17 .

[0155] Referring to Figure 17 , based on the foregoing virtual machine creation method, another server 200 provided in an embodiment of this application includes a processor 104 that can execute the foregoing virtual machine creation method. The server 200 further includes a memory 104, a network module 106, and a screen 108. Among them, a program that can execute the content in the foregoing embodiments is stored in the memory 104, and the processor 102 can execute the program stored in the memory 104.

[0156] Among them, the processor 102 may include one or more cores for processing data and a message matrix unit. The processor 102 connects various parts within the entire server 200 through various interfaces and lines, and executes various functions of the server 200 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and by calling the data stored in the memory 104. Optionally, the processor 102 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 102 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing display content; the modem is used to process wireless communication. It can be understood that the above modem may not be integrated into the processor 102 and may be implemented separately through a communication chip.

[0157] The memory 104 may include random access memory (RAM) and may also include read-only memory. The memory 104 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 104 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created during the use of the server 200 (such as phone books, audio and video data).

[0158] The network module 106 is used to receive and transmit electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, such as communicating with an audio playback device. The network module 106 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, subscriber identity module (SIM) cards, memories, and the like. The network module 106 can communicate with various networks such as the Internet, an enterprise intranet, a wireless network or communicate with other devices through a wireless network. The above-mentioned wireless network may include a cellular phone network, a wireless local area network or a metropolitan area network. For example, the network module 106 can interact with a base station.

[0159] It should be noted that in order to implement more functions, the server 200 can also protect more devices. For example, it can also protect a structured light sensor for collecting face information or a camera for collecting irises, etc.

[0160] Please refer to Figure 18 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. Program code is stored in the computer-readable medium 1100, and the program code can be called by a processor to execute the method described in the above method embodiment.

[0161] The computer-readable storage medium 1100 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. Optionally, the computer-readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1100 has a storage space for the program code 810 for executing any method step in the above method. These program codes can be read out from or written into one or more computer program products. The program code 1110 can be compressed in an appropriate form, for example.

[0162] In summary, a method, system, device, server, and storage medium for creating a virtual machine provided by this application, after receiving a virtual machine creation request including a first storage cluster identifier and a second storage cluster identifier, first obtains mirror data from a first target storage cluster corresponding to the first storage cluster identifier, and then transmits the mirror data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that the second target storage cluster creates a virtual machine according to the received mirror data. Since the first transmission speed for transmitting the mirror data to the second target storage cluster is less than the available bandwidth of the second target cluster, in this way, there is still remaining bandwidth in the network between the mirror management component and the second target storage cluster that can be used by other components, thereby avoiding occupying the network bandwidth during the transmission process of the mirror data, improving network fluency, further improving the service quality of the cloud platform, and maintaining the stability of the cloud platform.

[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for creating a virtual machine, characterized in that, the method comprises: receiving a virtual machine creation request, the virtual machine creation request including a first storage cluster identifier and a second storage cluster identifier; obtaining mirror data from a first target storage cluster corresponding to the first storage cluster identifier; transmitting the mirror data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that when the second target storage cluster receives the mirror data, a virtual machine is created according to the mirror data, wherein the first transmission speed is less than the available bandwidth of the second target storage cluster; wherein the mirror data includes a plurality of mirror shards, and the transmitting the plurality of mirror shards to the second target storage cluster corresponding to the second storage cluster identifier at the first transmission speed includes: obtaining at least one mirror shard to be transmitted among the plurality of mirror shards; for the mirror shard to be transmitted, obtaining a corresponding shard permission, wherein the generation speed of the shard permission is determined according to the ratio of the first transmission speed and the size of the mirror shard; after obtaining the shard permission, transmitting the corresponding mirror shard to be transmitted to the second target storage cluster corresponding to the second storage cluster identifier.

2. The method according to claim 1, characterized in that, the obtaining a corresponding shard permission for the mirror shard to be transmitted includes: when there are remaining shard permissions in the shard permission set, obtaining a corresponding shard permission for the mirror shard to be transmitted from the remaining shard permissions.

3. The method according to claim 1, characterized in that, the obtaining a corresponding shard permission for the mirror shard to be transmitted includes: when there are no remaining shard permissions in the shard permission set, generating shard permissions according to the generation speed of the shard permissions, the generation speed of the shard permissions representing the number of shard permissions generated per unit time; after generating the shard permissions, obtaining a corresponding shard permission for the mirror shard to be transmitted from the generated shard permissions.

4. The method according to claim 3, characterized in that, the shard permission includes a first number of shard permission blocks, and the generating shard permissions according to the generation speed of the shard permissions when there are no remaining shard permissions in the shard permission set includes: generating shard permission blocks according to the generation speed of the shard permission blocks, the generation speed of the shard permission blocks being determined according to the generation speed of the shard permissions and the first number; when the number of the shard permission blocks reaches the first number, determining that shard permissions are generated.

5. The method according to claim 1, characterized in that, the virtual machine creation request further includes a virtual machine startup mode, and the method further includes: determining an intermediate component for transmitting the mirror data according to the virtual machine startup mode; the transmitting the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at the first transmission speed includes: Transfer the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at the first transfer speed through the intermediate component.

6. The method according to claim 1, wherein, each of the multiple mirror shards includes a first number of basic mirror blocks.

7. A method for creating a virtual machine, wherein, applied to a virtual machine creation system, the virtual machine creation system includes a first target storage cluster, a mirror management component, and a second target storage cluster, and the method includes: The mirror management component receives a virtual machine creation request, and the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier; The mirror management component obtains mirror data from the first target storage cluster corresponding to the first storage cluster identifier; the mirror data includes multiple mirror shards; The mirror management component transfers the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at the first transfer speed, including: obtaining at least one mirror shard to be transferred among the multiple mirror shards; for the mirror shard to be transferred, obtaining a corresponding shard permission, wherein the generation speed of the shard permission is determined according to the ratio of the first transfer speed and the size of the mirror shard; after obtaining the shard permission, transferring the corresponding mirror shard to be transferred to the second target storage cluster corresponding to the second storage cluster identifier; wherein, the first transfer speed is less than the available bandwidth of the second target storage cluster; When receiving the mirror data, the second target storage cluster creates a virtual machine according to the mirror data.

8. A virtual machine creation system, wherein, including: A first target storage cluster for storing multiple mirror shards; A mirror management component for receiving a virtual machine creation request, and the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier; Obtaining mirror data from the first target storage cluster corresponding to the first storage cluster identifier; Transferring the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at the first transfer speed, wherein the first transfer speed is less than the available bandwidth of the second target storage cluster; A second target storage cluster for creating a virtual machine according to the mirror data when receiving the mirror data; The mirror data includes multiple mirror shards, and transferring the multiple mirror shards to the second target storage cluster corresponding to the second storage cluster identifier at the first transfer speed includes: obtaining at least one mirror shard to be transferred among the multiple mirror shards; for the mirror shard to be transferred, obtaining a corresponding shard permission, wherein the generation speed of the shard permission is determined according to the ratio of the first transfer speed and the size of the mirror shard; after obtaining the shard permission, transferring the corresponding mirror shard to be transferred to the second target storage cluster corresponding to the second storage cluster identifier.

9. A virtual machine creation device, wherein, including: A receiving module, configured to receive a virtual machine creation request, where the virtual machine creation request includes a first storage cluster identifier and a second storage cluster identifier; An obtaining module, configured to obtain mirror data from a first target storage cluster corresponding to the first storage cluster identifier; A transmitting module, configured to transmit the mirror data to a second target storage cluster corresponding to the second storage cluster identifier at a first transmission speed, so that when the second target storage cluster receives the mirror data, a virtual machine is created according to the mirror data, where the first transmission speed is less than the available bandwidth of the second target storage cluster; Wherein, the transmitting module includes: A first obtaining sub-module, configured to obtain at least one mirror shard to be transmitted among a plurality of mirror shards; A second obtaining sub-module, configured to obtain a corresponding shard permission for the mirror shard to be transmitted, where the generation speed of the shard permission is determined according to the ratio of the first transmission speed and the size of the mirror shard; A first transmitting sub-module, configured to transmit the corresponding mirror shard to be transmitted to the second target storage cluster corresponding to the second storage cluster identifier after obtaining the shard permission.

10. The apparatus according to claim 9, wherein, the second obtaining sub-module includes: a first obtaining unit, configured to obtain a corresponding shard permission for the mirror shard to be transmitted from the remaining shard permissions when there are remaining shard permissions in the shard permission set.

11. The apparatus according to claim 9, wherein, the second obtaining sub-module includes: a generating unit, configured to generate a shard permission at the generation speed of the shard permission when there are no remaining shard permissions in the shard permission set, where the generation speed of the shard permission represents the number of shard permissions generated per unit time; a second obtaining unit, configured to obtain a corresponding shard permission for the mirror shard to be transmitted from the generated shard permission after generating the shard permission.

12. The apparatus according to claim 11, wherein, the shard permission includes a first number of shard permission blocks; the generating unit includes: a generating sub-unit, configured to generate shard permission blocks at the generation speed of the shard permission blocks, where the generation speed of the shard permission blocks is determined according to the generation speed of the shard permission and the first number; a determining sub-unit, configured to determine the generation of the shard permission when the number of the shard permission blocks reaches the first number.

13. The apparatus according to claim 9, wherein, the virtual machine creation request further includes a virtual machine startup mode; the apparatus further includes: a determining module, configured to determine an intermediate component for transmitting the mirror data according to the virtual machine startup mode; the transmitting module includes: a second transmitting sub-module, configured to transmit the mirror data to the second target storage cluster corresponding to the second storage cluster identifier at the first transmission speed through the intermediate component.

14. The apparatus according to claim 9, wherein, each of the mirror shards among the plurality of mirror shards includes a first number of basic mirror blocks.

15. A server, characterized in that, comprising: one or more processors; a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-6, or execute the method according to claim 7.

16. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method according to any one of claims 1-6, or execute the method according to claim 7.

Citation Information

Patent Citations

  • Creation method and component of virtual machine in cloud platform and server

    CN111209090A