Shared storage service configuration method and device, electronic equipment and storage medium
By creating shared slice grouping and block device service parameters, the shared storage resources of multiple virtual machines are automatically managed, and the storage link drag down caused by fluctuations in virtual machine business load is solved, and stable, fair and efficient storage services are achieved.
Patent Information
- Application Number
- CN202411794808.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-05-09
AI Technical Summary
The existing technology is difficult to automatically deal with the ever-changing business load fluctuations between virtual machines, resulting in the drag of storage links, response delays and read and write rates, affecting the continuity of key business and service quality.
By obtaining the shared storage requirements of multiple virtual machines, creating shared slice grouping and block device service parameters, determining the target virtual machine of the shared type, and adding its process-related information to the shared slice grouping, realizing the coordinated management and control of shared storage resources for multiple virtual machines.
It realizes automated storage resource allocation and management, reduces management pressure on the operation and maintenance team, reduces system management complexity, and ensures the stability, fairness and efficiency of storage services.
Smart Images

Figure CN119960960A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a configuration method, device, electronic device and storage medium for a shared storage service. Background Art
[0002] With the rapid development of cloud computing and virtualization technology, the deployment scale of virtual machines in data centers has grown exponentially, and business scenarios have become increasingly complex and diverse. Enterprise-critical business applications, online services with extremely high real-time requirements, and big data analysis tasks with frequent data reading and writing often run on different virtual machines, and the requirements for storage resources of various virtual machines vary greatly. High-load database virtual machines require continuous, stable, and high-bandwidth disk I / O to support efficient data reading and writing; while lightweight front-end application virtual machines only need moderate storage performance to run smoothly.
[0003] In this context, the existing Libvirt mechanism for limiting the QoS of a single-machine disk has become increasingly problematic. When virtual machines of different priorities and different business types share storage resources, it is very easy for low-priority virtual machines to suddenly receive a large number of disk I / O requests, which in turn drags down the entire storage link, causing the high-priority virtual machine disk response delay to soar and the read and write rates to drop sharply, seriously affecting the continuity and service quality of key businesses. Furthermore, the multi-tenant model is widely used in cloud service providers. There are a large number of virtual machines between tenants, and each has different expectations for storage performance. The contradiction of resource competition is prominent. There is an urgent need for a solution that can accurately control the overall QoS of multiple virtual machines, coordinate storage resource allocation from a macro level, and ensure the stability, fairness, and efficiency of the overall storage service.
[0004] At the same time, the complexity of system management is increasing day by day. The operation and maintenance team not only has to take into account the daily startup, shutdown and resource allocation of virtual machines, but also needs to keep a close eye on storage performance indicators. Manually adjusting the QoS settings of a single machine can no longer cope with the ever-changing business load fluctuations. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a configuration method, device, electronic device and storage medium for a shared storage service to solve the problem that manually adjusting the QoS settings of a single machine can no longer cope with the ever-changing business load fluctuations.
[0006] In a first aspect, an embodiment of the present invention provides a method for configuring a shared storage service, the method comprising:
[0007] Obtain shared storage requirements for multiple virtual machines;
[0008] Creating a shared slice group based on the shared storage requirement, and creating a block device service parameter corresponding to the shared slice group;
[0009] Acquire multiple virtual machines currently created, and determine a target virtual machine of a shared type from the multiple virtual machines;
[0010] Obtain process-related information of the target virtual machine, and add the process-related information to the shared slice group, so that the target virtual machine managed by the shared slice performs a sharing operation of the shared storage service according to the block device service parameters.
[0011] Further, the creating a shared slice group based on the shared storage requirement includes:
[0012] Sending a first interface call request to the virtualization management library through the task scheduling framework;
[0013] Responding to the first interface call request through the virtualization management library, and opening the interface authority of the resource partition creation interface to the task scheduling framework;
[0014] Shared slice groups are created through the task scheduling framework based on the interface permissions of the resource partition creation interface.
[0015] Further, the creating of the block device service parameters corresponding to the shared slice group includes:
[0016] Sending a second interface call request to the virtualization management library through the task scheduling framework;
[0017] Responding to the second interface call request through the virtualization management library, and opening the interface permission of the quality of service configuration interface to the task scheduling framework;
[0018] The block device service parameters corresponding to the shared slice group are created through the task scheduling framework based on the interface permissions of the service quality configuration interface.
[0019] Furthermore, before obtaining the multiple virtual machines currently created, the method further includes:
[0020] Initiating a virtual machine creation task through a task scheduling framework, wherein the creation task includes configuration information and resource sharing attributes of each virtual machine;
[0021] A corresponding virtual machine is created based on the configuration information and the resource sharing attribute.
[0022] Further, the acquiring of the currently created multiple virtual machines and determining a target virtual machine of a shared type from the multiple virtual machines includes:
[0023] Acquire resource sharing attributes of the multiple virtual machines, and match the resource sharing attributes with attribute values corresponding to a sharing type and attribute values corresponding to an exclusive type;
[0024] The virtual machine whose resource sharing attribute matches the attribute value of the sharing type is used as the target virtual machine.
[0025] Further, the obtaining process-related information of the target virtual machine and adding the process-related information to the shared slice group includes:
[0026] Obtaining a process identifier of the target virtual machine and a process identifier of an associated process;
[0027] Add the process identifier of the target virtual machine and the process identifier of the associated process to the task list of the shared slice group.
[0028] Furthermore, the method further comprises:
[0029] Obtaining usage of each of the target virtual machines for the shared storage service;
[0030] Resources are allocated to each target virtual machine based on the usage and the block device service parameters.
[0031] In a second aspect, an embodiment of the present invention provides a configuration device for a shared storage service, the device comprising:
[0032] An acquisition module, used to obtain shared storage requirements of multiple virtual machines;
[0033] A creation module, used to create a shared slice group based on the shared storage requirement, and to create a block device service parameter corresponding to the shared slice group;
[0034] A determination module, used to obtain multiple virtual machines to be created, and determine a target virtual machine of a shared type from the multiple virtual machines;
[0035] A processing module is used to obtain process-related information of the target virtual machine and add the process-related information to the shared slice group, so that the target virtual machine managed by the shared slice performs a shared storage service sharing operation according to the block device service parameters.
[0036] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0038] This application obtains the shared storage requirements of multiple virtual machines, creates shared slice groups and corresponding block device service parameters based on this, and plans the framework and rules for storage resource allocation in advance; then, accurately determine the target virtual machine of the shared type from the multiple virtual machines currently created, and effectively distinguish virtual machines with different usage modes; then, obtain the process-related information of the target virtual machine and add it to the shared slice group, so that the target virtual machine can perform shared storage service operations according to the established block device service parameters. In this way, it is no longer necessary to manually monitor storage performance indicators and adjust the QoS settings of individual machines one by one. Instead, through the overall shared slice grouping and corresponding parameter settings, the shared storage resources are automatically coordinated and controlled. Regardless of how the business load changes, the shared storage services of multiple virtual machines can be reasonably allocated based on the configured rules, which reduces the pressure on the operation and maintenance team to take into account the daily startup, shutdown, resource allocation of virtual machines, and monitoring of storage performance indicators, and effectively reduces the complexity of system management. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 is a flowchart of a method for configuring a shared storage service according to some embodiments of the present invention;
[0041] Figure 2 is a schematic diagram of a framework for configuring a shared storage service according to some embodiments of the present invention;
[0042] Figure 3 is a structural block diagram of a configuration device for a shared storage service according to an embodiment of the present invention;
[0043] Figure 4 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0045] According to an embodiment of the present invention, a configuration method, apparatus, electronic device and storage medium for a shared storage service are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0046] In this embodiment, a method for configuring a shared storage service is provided. Figure 1 is a flow chart of a method for configuring a shared storage service according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0047] Step S101, obtaining shared storage requirements of multiple virtual machines.
[0048] In the embodiment of the present application, in a virtualized environment, when multiple virtual machines are involved, obtaining their shared storage needs requires comprehensive consideration of multiple aspects. For example, in actual scenarios, there are situations such as creating shared cloud hosts A and B, which means that multiple virtual machines will use storage resources together. On the one hand, it is necessary to ensure that each virtual machine can successfully mount the corresponding data disk in the storage device, such as adding the data disk a.qcow2 in the file system mounted by the block device / dev / sdc to the cloud host A, and adding the data disk b.qcow2 to the cloud host B, which reflects the virtual machine's need to be able to access the storage data normally. On the other hand, considering that multiple virtual machines may have resource contention problems when using storage resources at the same time, it is necessary to control the performance of storage resources, that is, to limit the read and write operations of each virtual machine on the storage resources, such as expecting to limit the read bandwidth of the block device / dev / sdc to no more than 2G, and the write bandwidth to no more than 1G, so as to ensure that each virtual machine can operate normally under reasonable resource allocation, and avoid affecting the use of other virtual machines due to excessive occupation of storage resources by a certain virtual machine.
[0049] Step S102, creating a shared slice group based on the shared storage requirements, and creating block device service parameters corresponding to the shared slice group.
[0050] In the embodiments of the present application, Figure 2As shown in the figure, the task scheduling framework (Gostack) calls the interface virCgroupSetBlkioDeviceQoS() of the virtualization management library (Libvirt) to set the blkio parameters of the Slice group. Since there are multiple virtual machines sharing storage resources, in order to ensure the rationality of resource allocation and meet the expectations for storage performance, it is necessary to set the block device-related quality of service (QoS) parameters for the newly created shared slice group, such as explicitly limiting the read bandwidth of the block device / dev / sdc to no more than 2G and the write bandwidth to no more than 1G. By setting the blkio parameters in this way, the virtual machines (such as cloud hosts A and B) subsequently added to the shared slice group will be subject to these parameters when performing read and write operations on the block device, thereby achieving refined management of shared storage resources and meeting the overall shared storage needs.
[0051] In an embodiment of the present application, a shared slice group is created based on a shared storage requirement, including: sending a first interface call request to a virtualization management library through a task scheduling framework; responding to the first interface call request through the virtualization management library, and opening interface permissions of a resource partition creation interface to the task scheduling framework; and creating a shared slice group based on the interface permissions of a resource partition creation interface through the task scheduling framework.
[0052] Specifically, first, the task scheduling framework plays its role of coordination and initiation of operations, and sends a first interface call request to the virtualization management library. The task scheduling framework here is like a command center, responsible for triggering corresponding function calls according to established requirements and processes. As the key to managing virtual machines and related virtualization functions, the virtualization management library will respond after receiving this first interface call request. It will open the interface permissions of the resource partition creation interface (such as the virCgroupCreateResourcePartition() interface) to the task scheduling framework based on its own security mechanism and function settings, so that the task scheduling framework obtains the permission to legally operate the interface. Subsequently, the task scheduling framework performs specific creation operations with the interface permissions of the resource partition creation interface obtained, and then creates a shared slice group. This shared slice group is like a "resource management space" specially created for subsequent multiple virtual machines to share storage resources, which facilitates the unified planning, allocation and control of the storage-related resources of these virtual machines, ensuring that they can run in an orderly and efficient manner in the shared storage scenario, and avoiding confusion or unreasonable resource usage.
[0053] In an embodiment of the present application, creating block device service parameters corresponding to a shared slice group includes: sending a second interface call request to a virtualization management library through a task scheduling framework; responding to the second interface call request through the virtualization management library, and opening interface permissions of a quality of service configuration interface to the task scheduling framework; and creating block device service parameters corresponding to a shared slice group based on the interface permissions of the quality of service configuration interface through the task scheduling framework.
[0054] Specifically, Figure 2 As shown in the figure, the task scheduling framework will first send a second interface call request to the virtualization management library. This request carries the expectation of further configuring resources and ensuring service quality, and is passed to the virtualization management library according to the established process. As the core part of controlling various resource management functions of virtual machines, the virtualization management library will respond in time after receiving this second interface call request. According to its internal logic and permission management rules, it will open the interface permissions of the service quality configuration interface (such as virCgroupSetBlkioDeviceQoS() interface) to the task scheduling framework, and grant legal operation qualifications for subsequent configuration operations. Then, the task scheduling framework will use the interface permissions of the service quality configuration interface obtained to create the block device service parameters corresponding to the shared slice group, such as limiting the read and write bandwidth of the block device in the shared storage scenario, or setting the priority of I / O operations, so as to accurately control the service quality when multiple virtual machines share storage resources, and ensure that each virtual machine can run in an orderly manner according to reasonable resource allocation and performance requirements when using shared storage, so as to avoid affecting the overall storage utilization efficiency due to problems such as resource competition.
[0055] Step S103, obtaining multiple virtual machines currently created, and determining a target virtual machine of a shared type from the multiple virtual machines.
[0056] In an embodiment of the present application, before obtaining the multiple virtual machines currently being created, the method also includes: initiating a virtual machine creation task through a task scheduling framework, wherein the creation task includes configuration information and resource sharing attributes of each virtual machine; and creating a corresponding virtual machine based on the configuration information and resource sharing attributes.
[0057] The task scheduling framework initiates the task of creating different virtual machines. For example, when creating a virtual machine vm1, its corresponding configuration information is presented in XML format. <resource>In the tag, <partition>The node is set to " / machine / share", and <share>The node is "1". These configuration information clearly specifies that vm1 is a shared virtual machine and needs to be added to machine-share.slice, which also reflects the resource sharing attribute of vm1. Similarly, for virtual machine vm2, its XML configuration is the same as vm1, and it also has shared resource sharing attributes, and will be added to machine-share.slice as required. However, when initiating the task of creating virtual machine vm3, the resource node is not configured in its XML, which represents another resource sharing attribute situation. That is, according to the existing default process, vm3.scope will be created in machine.slice, and the process ID of vm3 will be added. In short, the creation task initiated by the task scheduling framework covers the specific configuration information and corresponding resource sharing attributes of each virtual machine. In the future, based on these contents, the corresponding processes and mechanisms are used to accurately create various virtual machines that meet the requirements, ensuring that they can run in an orderly manner and use resources reasonably within the corresponding resource management group or scope.
[0058] In an embodiment of the present application, multiple virtual machines currently being created are obtained, and a target virtual machine of a shared type is determined from the multiple virtual machines, including: obtaining resource sharing attributes of the multiple virtual machines, and matching the resource sharing attributes with attribute values corresponding to the shared type and attribute values corresponding to the exclusive type; and taking the virtual machine whose resource sharing attributes match the attribute values of the shared type as the target virtual machine.
[0059] Specifically, we first need to obtain the resource sharing attributes of each virtual machine. Just like the example of creating virtual machines vm1, vm2, and vm3 mentioned above, the resource sharing attributes of each virtual machine are reflected in the relevant configuration information when it is created, such as the XML configuration of vm1 and vm2. <resource>Under the label <partition>and <share>Node information, which combined reflects that they have the characteristics of shared resources, while vm3 presents different resource usage tendency attributes because no resource node is configured in XML.
[0060] Then, the resource sharing attributes of these virtual machines are carefully matched and compared with the pre-set attribute values corresponding to the shared type and the attribute values corresponding to the exclusive type. The attribute values corresponding to the shared type may be as follows: <share>Nodes have specific values (such as "1") and <partition>Pointing to shared partitions (" / machine / share") can reflect the shared resource usage mode. The attribute values corresponding to the exclusive type may have specific identifiers indicating that the virtual machine independently occupies resources, which are significantly different from the shared configuration characteristics.
[0061] After the matching process, the virtual machines whose resource sharing attributes match the attribute values of the sharing type will be selected as the target virtual machines. For example, vm1 and vm2, because the resource sharing attributes reflected in their configuration information conform to the attribute value settings of the sharing type, they become the target virtual machines. Further operations can be performed on these target virtual machines according to the relevant processes of shared resource management, such as adding them to specific shared slice groups and performing unified resource management, so as to achieve reasonable distinction and precise management of resource usage of different types of virtual machines.
[0062] Step S104, obtaining process-related information of the target virtual machine, and adding the process-related information to the shared slice group, so that the target virtual machine managed by the shared slice performs a sharing operation of the shared storage service according to the block device service parameters.
[0063] In an embodiment of the present application, process-related information of the target virtual machine is obtained, and the process-related information is added to the shared slice group, including: obtaining the process identifier of the target virtual machine and the process identifier of the associated process; adding the process identifier of the target virtual machine and the process identifier of the associated process to the task list of the shared slice group.
[0064] After the target virtual machines have been determined (such as virtual machines such as vm1 and vm2 that meet the sharing type attribute values selected by resource sharing attribute matching in the previous example), the next step is to obtain their related process identifier information.
[0065] For each target virtual machine, as a process running in the system, it has a unique process identifier (PID), which can be used to accurately locate and distinguish the process corresponding to the virtual machine at the operating system level. At the same time, there are many related processes running inside the virtual machine, and each of these related processes also has a corresponding process identifier. Therefore, it is necessary to accurately obtain the process identifier of the target virtual machine itself and the process identifiers of its internal related processes through a specific system query or management mechanism.
[0066] After obtaining these process identifiers, the key operation of resource integration and group management is to add the process identifier of the target virtual machine and the process identifier of the associated process to the task list of the shared slice group. The shared slice group (such as the machine-share.slice mentioned above) is a resource management unit created specifically for the unified management of virtual machines that share resources. Adding these process identifiers to its task list is equivalent to incorporating the target virtual machine and its internal associated processes into the control scope of this shared slice group. In this way, the system can perform unified resource allocation, scheduling, and restriction operations on these target virtual machines and their associated processes based on the various resource rules set by the shared slice group (such as block device service quality parameters, etc.), ensuring that in the scenario of multiple virtual machines sharing resources, each virtual machine can use resources in a reasonable manner to avoid resource contention or unreasonable occupation, thereby achieving more orderly and efficient management of shared storage and other resources.
[0067] In the embodiment of the present application, the method further includes: obtaining usage of each target virtual machine for the shared storage service; and allocating resources to each target virtual machine based on the usage and block device service parameters.
[0068] In the operation process of virtualization resource management, after the target virtual machine has been determined (such as virtual machines such as vm1 and vm2 that meet the sharing type attribute value selected by resource sharing attribute matching in the previous example), the next step is to obtain their related process identifier information.
[0069] For each target virtual machine, as a process running in the system, it has a unique process identifier (PID), which can be used to accurately locate and distinguish the process corresponding to the virtual machine at the operating system level. At the same time, there are many related processes running inside the virtual machine, and each of these related processes also has a corresponding process identifier. Therefore, it is necessary to accurately obtain the process identifier of the target virtual machine itself and the process identifiers of its internal related processes through a specific system query or management mechanism.
[0070] After obtaining these process identifiers, the key operation of resource integration and group management is to add the process identifier of the target virtual machine and the process identifier of the associated process to the task list of the shared slice group. The shared slice group (such as the machine-share.slice mentioned above) is a resource management unit created specifically for the unified management of virtual machines that share resources. Adding these process identifiers to its task list is equivalent to incorporating the target virtual machine and its internal associated processes into the control scope of this shared slice group. In this way, the system can perform unified resource allocation, scheduling, and restriction operations on these target virtual machines and their associated processes based on the various resource rules set by the shared slice group (such as block device service quality parameters, etc.), ensuring that in the scenario of multiple virtual machines sharing resources, each virtual machine can use resources in a reasonable manner to avoid resource contention or unreasonable occupation, thereby achieving more orderly and efficient management of shared storage and other resources.
[0071] This application obtains the shared storage requirements of multiple virtual machines, creates shared slice groups and corresponding block device service parameters based on this, and plans the framework and rules for storage resource allocation in advance; then, accurately determine the target virtual machine of the shared type from the multiple virtual machines currently created, and effectively distinguish virtual machines with different usage modes; then, obtain the process-related information of the target virtual machine and add it to the shared slice group, so that the target virtual machine can perform shared storage service operations according to the established block device service parameters. In this way, it is no longer necessary to manually monitor storage performance indicators and adjust the QoS settings of individual machines one by one. Instead, through the overall shared slice grouping and corresponding parameter settings, the shared storage resources are automatically coordinated and controlled. Regardless of how the business load changes, the shared storage services of multiple virtual machines can be reasonably allocated based on the configured rules, which reduces the pressure on the operation and maintenance team to take into account the daily startup, shutdown, resource allocation of virtual machines, and monitoring of storage performance indicators, and effectively reduces the complexity of system management.
[0072] In this embodiment, a configuration device for a shared storage service is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0073] This embodiment provides a configuration device for a shared storage service, such as Figure 3 As shown, including:
[0074] An acquisition module 301 is used to acquire shared storage requirements of multiple virtual machines;
[0075] A creation module 302, used to create a shared slice group based on the shared storage requirements, and to create a block device service parameter corresponding to the shared slice group;
[0076] The determination module 303 is used to obtain multiple virtual machines to be created and determine a target virtual machine of a shared type from the multiple virtual machines;
[0077] The processing module 304 is used to obtain process-related information of the target virtual machine and add the process-related information to the shared slice group, so that the target virtual machine managed by the shared slice performs the sharing operation of the shared storage service according to the block device service parameters.
[0078] In an embodiment of the present application, a creation module 302 is used to send a first interface call request to a virtualization management library through a task scheduling framework; respond to the first interface call request through the virtualization management library, and open the interface permissions of the resource partition creation interface to the task scheduling framework; create a shared slice group based on the interface permissions of the resource partition creation interface through the task scheduling framework.
[0079] In an embodiment of the present application, a module 302 is created, which is used to send a second interface call request to the virtualization management library through the task scheduling framework; respond to the second interface call request through the virtualization management library, and open the interface permissions of the service quality configuration interface to the task scheduling framework; create block device service parameters corresponding to the shared slice grouping based on the interface permissions of the service quality configuration interface through the task scheduling framework.
[0080] In an embodiment of the present application, the device also includes: a creation module, which is used to initiate a virtual machine creation task through a task scheduling framework, wherein the creation task includes configuration information and resource sharing attributes of each virtual machine; and creates a corresponding virtual machine based on the configuration information and resource sharing attributes.
[0081] In an embodiment of the present application, the determination module 303 is used to obtain the resource sharing attributes of multiple virtual machines, and match the resource sharing attributes with the attribute values corresponding to the sharing type and the attribute values corresponding to the exclusive type; the virtual machine whose resource sharing attributes match the attribute values of the sharing type is used as the target virtual machine.
[0082] In an embodiment of the present application, the processing module 304 is used to obtain the process identifier of the target virtual machine and the process identifier of the associated process; and add the process identifier of the target virtual machine and the process identifier of the associated process to the task list of the shared slice group.
[0083] In the embodiment of the present application, the apparatus further includes: an analysis module for obtaining usage of each target virtual machine for the shared storage service; and allocating resources to each target virtual machine based on the usage and block device service parameters.
[0084] See also Figure 4 , Figure 4 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0085] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0086] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0087] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0088] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0089] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0090] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0091] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.< / partition> < / share> < / share> < / partition> < / resource> < / share> < / partition> < / resource>
Claims
1. A method for configuring a shared storage service, characterized in that: The method comprises: Obtain shared storage requirements for multiple virtual machines; Creating a shared slice group based on the shared storage requirement, and creating a block device service parameter corresponding to the shared slice group; Acquire multiple virtual machines currently created, and determine a target virtual machine of a shared type from the multiple virtual machines; Obtain process-related information of the target virtual machine, and add the process-related information to the shared slice group, so that the target virtual machine managed by the shared slice performs a sharing operation of the shared storage service according to the block device service parameters.
2. The method according to claim 1, characterized in that The creating a shared slice group based on the shared storage requirement includes: Sending a first interface call request to the virtualization management library through the task scheduling framework; Responding to the first interface call request through the virtualization management library, and opening the interface authority of the resource partition creation interface to the task scheduling framework; Shared slice groups are created through the task scheduling framework based on the interface permissions of the resource partition creation interface.
3. The method according to claim 1, characterized in that The creating of the block device service parameters corresponding to the shared slice group includes: Sending a second interface call request to the virtualization management library through the task scheduling framework; Responding to the second interface call request through the virtualization management library, and opening the interface permission of the quality of service configuration interface to the task scheduling framework; The block device service parameters corresponding to the shared slice group are created through the task scheduling framework based on the interface permissions of the service quality configuration interface.
4. The method according to claim 1, characterized in that: Before obtaining the multiple virtual machines currently created, the method further includes: Initiating a virtual machine creation task through a task scheduling framework, wherein the creation task includes configuration information and resource sharing attributes of each virtual machine; A corresponding virtual machine is created based on the configuration information and the resource sharing attribute.
5. The method according to claim 4, characterized in that The acquiring of the currently created multiple virtual machines and determining a target virtual machine of a shared type from the multiple virtual machines includes: Acquire resource sharing attributes of the multiple virtual machines, and match the resource sharing attributes with attribute values corresponding to a sharing type and attribute values corresponding to an exclusive type; The virtual machine whose resource sharing attribute matches the attribute value of the sharing type is used as the target virtual machine.
6. The method according to claim 1, characterized in that The obtaining process related information of the target virtual machine and adding the process related information to the shared slice group includes: Obtaining a process identifier of the target virtual machine and a process identifier of an associated process; Add the process identifier of the target virtual machine and the process identifier of the associated process to the task list of the shared slice group.
7. The method according to claim 1, characterized in that The method further comprises: Obtaining usage of each of the target virtual machines for the shared storage service; Resources are allocated to each target virtual machine based on the usage and the block device service parameters.
8. A configuration device for a shared storage service, characterized in that: The device comprises: An acquisition module, used to obtain shared storage requirements of multiple virtual machines; A creation module, used to create a shared slice group based on the shared storage requirement, and to create a block device service parameter corresponding to the shared slice group; A determination module, used to obtain multiple virtual machines to be created, and determine a target virtual machine of a shared type from the multiple virtual machines; A processing module is used to obtain process-related information of the target virtual machine and add the process-related information to the shared slice group, so that the target virtual machine managed by the shared slice performs a shared storage service sharing operation according to the block device service parameters.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.