Storage volume mounting method and device, equipment and storage medium

By using the container storage interface in the Kubernetes cluster to obtain LAN information, establish the association between virtual machines and virtualized storage resource pools, automatically manage container storage volumes, solve the instability and high cost problems caused by manual operations, and achieve efficient Storage volume mounting and management.

CN118656022APending Publication Date: 2024-09-17JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410684113.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

When mounting container volumes in a Kubernetes cluster, manual operations are required to find and select target virtual machines and virtualized storage resource pools, which results in instability and is time-consuming and labor-intensive.

Method used

Obtain the LAN information of the virtual machines and virtualized storage resource pools in the target cluster through the container storage interface, establish an association, automatically create and mount container storage volumes, and use label information to filter and select the best virtual machines to achieve automated storage volume management. .

Benefits of technology

It improves the speed and accuracy of storage volume identification, reduces labor costs and time costs, and ensures the stability and isolation of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656022A
    Figure CN118656022A
Patent Text Reader

Abstract

The embodiment of the invention provides a storage volume mounting method, device and equipment and a storage medium, and the method comprises the steps: obtaining local area network information to which a target virtual machine and a target virtual storage resource pool belong in a target cluster through a container storage interface, establishing an association relationship for a target virtual machine and a target virtualized storage resource pool which belong to the same local area network through the local area network information, and in response to a target operation of a user on a user interface, creating a target container storage volume in a first virtualized storage resource pool, label information about the first virtualization storage resource pool is added to the target container storage volume through the incidence relation, the first virtual machines are screened out from the target virtual machines through the label information, and the optimal target virtual machine is selected from the first virtual machines through a preset rule to create the target container. According to the embodiment of the invention, the recognition speed and accuracy are improved, and the labor cost and the time cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a storage volume mounting method, device, equipment and storage medium. Background Art

[0002] Kubernetes, or K8s for short, is a lightweight and scalable open source platform for managing containerized applications and services. Kubernetes enables automated deployment and scaling of applications. With the continuous development of cloud-native technologies, Kubernetes has become an indisputable fact as the de facto standard in the field of container orchestration. However, cloud-native applications deployed on K8s need to mount container volumes to persist business data. However, since containers share the operating system kernel of the host, their isolation is relatively poor. K8s clusters are usually run on target virtual machines, combining the advantages of strong isolation of the target virtual machine to solve the problem of poor container isolation.

[0003] For disaster recovery or high availability considerations, the target virtual machine that hosts K8s often requires cross-domain and independent target virtualized storage resource pools. Therefore, when mounting a container volume, after specifying the target virtualized storage resource pool, the staff needs to find the target virtual machine that can access the target virtualized storage resource pool, and then select the target virtual machine that can mount the storage volume. The whole process needs to rely on the staff's operation, which is unstable and requires a lot of time and manpower. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a storage volume mounting method, device, equipment and storage medium to solve the problem that the current mounting of container volumes requires the operation of staff, is unstable and requires a lot of time and manpower. The specific technical solution is as follows:

[0005] In a first aspect of the present invention, a storage volume mounting method is provided, wherein the method comprises:

[0006] Obtain the local area network information of the target virtual machine and the target virtualized storage resource pool in the target cluster through the container storage interface;

[0007] Establishing an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network through the local area network information;

[0008] In response to a target operation of the user in the user interface, creating a target container storage volume in the first virtualized storage resource pool;

[0009] Adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship;

[0010] A first virtual machine associated with the first virtualized storage resource pool is screened out from the target virtual machines by using the tag information, and an optimal target virtual machine is selected from the first virtual machines by a preset rule to create a target container, and the target container storage volume is mounted on the target container.

[0011] Optionally, establishing an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network by using the local area network information includes:

[0012] Dividing the target virtual machine and the target virtualized storage resource pool according to the local area network information to generate target partitions, wherein the local area network information to which the target virtual machine and the target virtualized storage resource pool belong in each target partition is consistent, and each target partition includes one target virtualized storage resource pool;

[0013] Establishing an association relationship between the target virtual machine and the target virtualized storage resource pool in each target partition, and determining access rights of the target virtual machine to the target virtualized storage resource pool through the association relationship;

[0014] Adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship includes:

[0015] Obtaining a first identity identifier of the target virtualized storage resource pool in each target partition;

[0016] Using the first identity identifier as index information of the association relationship;

[0017] Obtain a second identity identifier of a first virtualized storage resource pool to which the target container storage volume belongs;

[0018] Retrieving the second identity identifier from the first identity identifier;

[0019] Acquire a third identity identifier that is consistent with the second identity identifier from the first identity identifier through the search result;

[0020] Acquire an association relationship about the first virtualized storage resource pool through the third identity identifier;

[0021] The association relationship of the first virtualized storage resource pool is used as label information added to the target container storage volume.

[0022] Optionally, in response to a target operation of the user in the user interface, creating a target container storage volume in the first virtualized storage resource pool includes:

[0023] In response to a user selecting a target virtualized storage resource pool in a user interface, selecting a first virtualized storage resource pool from the target virtualized storage resource pool;

[0024] Determine the size of the target container storage volume to be created;

[0025] Allocating corresponding storage space in the first virtualized storage resource pool according to the size of the target container storage volume;

[0026] In response to a creation operation of the user in the user interface, a target container storage volume is created in the storage space.

[0027] Optionally, establishing an association relationship between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network by using the local area network information includes:

[0028] Determine the target local area network information for each target virtualized storage resource pool;

[0029] Divide the target virtual machines belonging to the same local area network into the same partition using the local area network information, and add the first local area network information to each partition;

[0030] Comparing the target LAN information with the first LAN information;

[0031] If the comparison result is consistent, an association relationship is established between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network.

[0032] Optionally, selecting the best target virtual machine from the first virtual machines according to a preset rule to create a target container includes:

[0033] Obtaining status information of the first virtual machine, the status information including: CPU utilization, memory utilization, and the number of containers that have been run;

[0034] Comparing the CPU utilization with a first preset value, comparing the memory usage with a second preset value, and comparing the number of containers that have been run with a third preset value;

[0035] According to the comparison result, the best target virtual machine is selected from the first virtual machines to create a target container.

[0036] Optionally, selecting the best target virtual machine from the first virtual machines according to the comparison result to create a target container includes:

[0037] When the CPU utilization is less than a first preset value, the memory usage is less than a second preset value, and the number of running containers is less than a third preset value, determining the first virtual machine as a second virtual machine;

[0038] Setting a first weight for the CPU utilization, setting a second weight for the memory usage, and setting a third weight for the number of containers that have been run;

[0039] weighting and summing the state information in the second virtual machine to generate a target value;

[0040] The second virtual machine corresponding to the minimum target value among the target values ​​is used as the best target virtual machine to create a target container.

[0041] Optionally, before obtaining the local area network information to which the target virtual machine and the target virtualized storage resource pool in the target cluster belong through the container storage interface, the method further includes:

[0042] Replace the default scheduler of the target cluster with a target resource scheduler, wherein the target resource scheduler supports scheduling according to the target virtualized storage resource pool;

[0043] Deploy the container storage interface on the target cluster through a plug-in.

[0044] In a second aspect of the present invention, a storage volume mounting device is provided, which is characterized by comprising:

[0045] A first acquisition module is used to obtain local area network information to which a target virtual machine and a target virtualized storage resource pool in a target cluster belong through a container storage interface;

[0046] A relationship establishing module, used for establishing an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network through the local area network information;

[0047] A first creation module, configured to create a target container storage volume in a first virtualized storage resource pool in response to a target operation of a user in a user interface;

[0048] A first adding module, configured to add label information about the first virtualized storage resource pool to the target container storage volume through the association relationship;

[0049] The second creation module is used to filter out the first virtual machine associated with the first virtualized storage resource pool from the target virtual machines according to the tag information, and select the best target virtual machine from the first virtual machines according to preset rules to create a target container, and the target container storage volume is mounted on the target container.

[0050] In a third aspect of the implementation of the present invention, there is also provided a communication device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;

[0051] The processor is used to read the program in the memory to implement any of the above-mentioned storage volume mounting methods.

[0052] In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute any of the above-mentioned storage volume mounting methods.

[0053] The storage volume mounting method provided in the embodiment of the present invention obtains the local area network information of the target virtual machine and the target virtualized storage resource pool in the target cluster through the container storage interface, so as to realize the isolation between services enhanced by the virtual machine, and the local area network information of the virtual machine can be identified through the container storage interface without manual identification, thereby reducing the investment of manpower cost, and establishing an association relationship between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network through the local area network information, and creating a target container storage volume in the first virtualized storage resource pool in response to the user's target operation in the user interface, and adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship, so as to realize the subsequent rapid screening of suitable virtual machines through the label information, and Without manual identification, the first virtual machine associated with the first virtualized storage resource pool is screened out from the target virtual machines through the tag information, and the best target virtual machine is selected from the first virtual machines through the preset rules to create a target container. The target container storage volume is mounted on the target container, so that the data generated by the target container can be persisted in the target virtualized storage resource pool. The embodiment of the present invention automatically identifies the local area network information of the virtual machine by setting a container storage interface, and then establishes an association relationship between the target virtual machine and the target virtualized storage resource pool. After determining the first virtualized storage resource pool to which the target container storage volume belongs, the first virtual machine is quickly found, which not only improves the recognition rate and accuracy, ensures the stability of recognition, but also reduces labor costs and time costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0055] Figure 1 A flowchart of a method for mounting a storage volume provided by an embodiment of the present invention;

[0056] Figure 2 A flowchart of another method for mounting a storage volume provided by an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of a storage volume mounting method provided by an embodiment of the present invention;

[0058] Figure 4 is a structural schematic diagram of a storage volume mounting device provided by an embodiment of the present invention;

[0059] Figure 5 It is a structural diagram of a communication device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0061] Reference Figure 1 , shows a flowchart of a method for mounting a storage volume provided by an embodiment of the present invention, the method may include:

[0062] Step 101: obtain local area network information to which a target virtual machine and a target virtualized storage resource pool in a target cluster belong through a container storage interface.

[0063] In the embodiment of the present invention, the target cluster refers to the K8s cluster. The K8s cluster (Kubernetes) is an open source container orchestration system for automatically deploying, expanding and managing containerized applications. A virtual machine is a software-implemented computer system that allows multiple computer systems to be simulated on a physical computer. Like an independent physical machine, each virtual machine can run its own operating system and application. A virtual machine is a node in a K8s cluster. The virtualized storage resource pool abstracts and combines multiple physical storage devices (such as hard disk drives, solid-state drives, etc.) on the host that carries the virtualization system into a unified, logical storage resource pool, which can be provided to virtual machines for use, so that the data generated by the virtual machines when running applications can be persisted.

[0064] Among them, when deploying the K8s cluster, the staff will deploy at least one virtual machine on different LANs as a node of the K8s cluster. These virtual machines as K8s nodes can only use the virtualized storage resource pool under their own LAN and mount it to the business container running on the virtual machine. In order to reduce labor costs, in the embodiment of the present invention, CSI (Container Storage Interface) will be deployed on the K8s cluster in the form of a plug-in. When CSI starts, it interacts with the virtualized storage resource pool under each domain, obtains the LAN information of the virtualized cluster to which the K8s cluster node deployed on the virtual machine belongs and the virtualized storage resource pool information that the virtual machine can access and feeds it back to the virtual machine, and also updates the resource scheduler, and replaces the default scheduler of the K8s cluster with the resource scheduler that can support scheduling according to the LAN where the virtualized storage resource pool is located, so that it has the ability to schedule resources according to the virtualization domain. The specific steps include:

[0065] Replace the default scheduler of the target cluster with the target resource scheduler, which supports scheduling according to the target virtualized storage resource pool;

[0066] Deploy the container storage interface on the target cluster through a plug-in.

[0067] By replacing the resource scheduler, scheduling can be implemented according to the target virtualized storage resource pool in the subsequent process. By deploying the container storage interface, the LAN information of the target virtual machine and the target virtualized storage resource pool in the target cluster can be directly obtained. There is no need for manual judgment, which is simple, fast and cost-saving.

[0068] Step 102: Establish an association relationship between a target virtual machine and a target virtualized storage resource pool that belong to the same local area network through local area network information.

[0069] In the embodiment of the present invention, a container storage volume is first set in a virtualized storage resource pool, wherein the virtualized storage resource pool is a collection of storage resources managed in a centralized manner and can be dynamically allocated to different virtual machines for use. The container storage volume is a storage unit designed specifically for containers, which can be mounted in a container to store the data required for the container to run. The container is created and generated in a virtual machine, and then a suitable virtual machine is selected to create a container. In the process of creating the container, the previously set container storage volume is mounted on the container. In this way, the data generated by the container can be stored in the container storage volume to achieve data persistence. In order to ensure that the virtual machine can use a specific virtualized storage resource pool, it is necessary to establish an association between the target virtual machine and the target virtualized storage resource pool. This association ensures that the virtual machine can access and use the container storage volume in the target virtualized storage resource pool associated with it. In addition, since the virtual machine can only use the virtualized storage resource pool belonging to the same local area network, it is necessary to divide it according to the local area network. This means that the target virtual machine and the target virtualized storage resource pool belonging to the same local area network need to establish an association. This division ensures the effectiveness and security of network communication, and is also convenient for management and maintenance.

[0070] For example, assume that the network in the target cluster (K8s cluster) is divided into two LANs: LAN X and LAN Y, including virtual machines X1, X2, X3, Y1, Y2, Y3, virtualized storage resource pools A and B, identify virtual machines X1, X2, X3 belong to LAN X, virtual machines Y1, Y2, Y3 belong to LAN Y, virtualized storage resource pool A belongs to LAN X, virtualized storage resource pool B belongs to LAN Y, for LAN X, virtual machines X1, X2, X3 can be associated with virtualized storage resource pool A, which means This means that virtual machines X1, X2, and X3 can access the container storage volumes in virtualized storage resource pool A, and the corresponding container storage volumes in virtualized storage resource pool A can be mounted on the containers created by virtual machines X1, X2, and X3. For LAN Y, virtual machines Y1, Y2, and Y3 can be associated with virtualized storage resource pool B, which means that virtual machines Y1, Y2, and Y3 can access the container storage volumes in virtualized storage resource pool B, and the corresponding container storage volumes in virtualized storage resource pool B can be mounted on the containers created by virtual machines Y1, Y2, and Y3. By identifying LAN information and associating the target virtual machines belonging to the same LAN with the target virtualized storage resource pool, it is possible to ensure that the virtual machines can access the correct storage resources while maintaining network isolation and security.

[0071] It should be noted that when establishing an association relationship between the target virtual machine and the target virtualized storage resource pool, the LAN information of the target virtual machine and the target virtualized storage resource pool must first be determined, because there can be multiple target virtual machines under the same LAN but there is only one target virtualized storage resource pool. Therefore, after determining the LAN information of the target virtual machine, it will be divided according to the different LANs, and then the LAN information to which it belongs will be added, and it will be compared with the LAN information of the target virtualized storage resource pool. If they are consistent, an association relationship will be established. The specific steps include:

[0072] Determine the target local area network information for each target virtualized storage resource pool;

[0073] Divide the target virtual machines belonging to the same local area network into the same partition according to the local area network information, and add the first local area network information to each partition;

[0074] Comparing the target LAN information with the first LAN information;

[0075] If the comparison results are consistent, an association relationship is established between the target virtual machine and the target virtualization storage resource pool belonging to the same local area network.

[0076] This ensures that only target virtual machines belonging to the same LAN can access the target virtualized storage resource pool under the LAN, thereby maintaining the isolation and security of the network. This method helps to simplify the management of storage resources and ensure that resource allocation in the data center is based on the correct network configuration.

[0077] Step 103: Create a target container storage volume in the first virtualized storage resource pool in response to a target operation of the user in the user interface.

[0078] The target operation in the embodiment of the present invention includes a selection operation and a creation operation, wherein the selection operation is to select the first virtualized storage resource pool where the container storage volume needs to be created in the user interface, and then after allocating the corresponding space in the first virtualized storage resource pool, create the target container storage volume in the storage space through the creation operation, and the specific steps include:

[0079] In response to a user selecting a target virtualized storage resource pool in a user interface, selecting a first virtualized storage resource pool from the target virtualized storage resource pool;

[0080] Determine the size of the target container storage volume to be created;

[0081] Allocate corresponding storage space in the first virtualized storage resource pool according to the size of the target container storage volume;

[0082] In response to a creation operation of the user in the user interface, a target container storage volume is created in the storage space.

[0083] Through the above steps, users can intuitively manage storage resources through the user interface, including selecting a storage resource pool, specifying the storage volume size, and creating a storage volume. This method simplifies the management of storage resources and improves the user experience. After the creation is complete, users can mount this container storage volume to the container so that the container can access and use these storage resources.

[0084] It should be noted that in order to enable the user to select the target virtualized storage resource pool in the user interface, it is necessary to obtain the information of the target virtualized storage resource pool in the K8s cluster in advance and then display it in the user interface. The specific steps include:

[0085] Obtain target information of a target virtualized storage resource pool under a target cluster, the target information including:

[0086] Usage, identity, name, and storage type of the target virtualized storage resource pool;

[0087] After converting the target information into a format supported by the user interface for display, the target information is integrated into the user interface;

[0088] A selection interface including format-converted target information is provided on the user interface, wherein the selection interface allows a user to browse and select different target virtualized storage resource pools under the target cluster;

[0089] In response to a selection operation of the user on the selection interface for the first virtualized storage resource pool, the first virtualized storage resource pool is selected from the target virtualized storage resource pools.

[0090] Through the above steps, users can intuitively select the virtualized storage resource pool they want to use on the user interface, thereby simplifying the storage resource management process and improving the user experience.

[0091] Step 104: Add label information about the first virtualized storage resource pool to the target container storage volume through the association relationship.

[0092] In the embodiment of the present invention, the tag information is selected from the association relationship. Since the target container storage volume is created in the first virtualized storage resource pool, the association relationship of the first virtualized storage resource pool is obtained and used as the added tag information.

[0093] After adding the label, the detailed information of the target container storage volume will be queried through the kubectl describe command or through the Kubernetes API to verify whether the label has been successfully added. Once the label is added to the target container storage volume, you can use these labels to filter and manage storage resources in subsequent processes.

[0094] Step 105, filter out the first virtual machine associated with the first virtualized storage resource pool from the target virtual machines by using the tag information, select the best target virtual machine from the first virtual machines by using a preset rule to create a target container, and mount the target container storage volume on the target container.

[0095] In the embodiment of the present invention, mounting the target container storage volume refers to mounting the target container storage volume to a specific directory of the target container application to store the business data in the directory to the virtualized storage resource pool. The tag information is about the association relationship of the first virtualized storage resource pool, so the first virtual machine related to the first virtualized storage resource pool can be screened out through the tag information. However, there can be multiple first virtual machines. When there are multiple first virtual machines, it is necessary to select the best target virtual machine to create a container by analyzing these virtual machines. The specific steps include:

[0096] Obtaining status information of the first virtual machine, the status information including: CPU utilization, memory utilization, and the number of containers that have been run;

[0097] Comparing the CPU utilization with a first preset value, the memory usage with a second preset value, and the number of containers running with a third preset value;

[0098] According to the comparison result, the best target virtual machine is selected from the first virtual machine to create a target container.

[0099] Furthermore, there may be multiple situations during the comparison, such as the CPU utilization is greater than the first preset value, or the CPU utilization is less than the first preset value, the memory usage is greater than the second preset value, or the memory usage is less than the second preset value, and the number of containers that have been run is greater than the third preset value. Or the number of containers that have been run is less than the third preset value, but in order to select the best, the CPU utilization is required to be less than the first preset value, the memory usage is less than the second preset value, and the number of containers that have been run is less than the third preset value. The three conditions must be met at the same time to further filter the range, and then by assigning weights to these state information and then weighted summing them, the virtual machine corresponding to the minimum sum is used as the best target virtual machine. The specific steps include:

[0100] When the CPU utilization is less than a first preset value, the memory usage is less than a second preset value, and the number of containers that have been run is less than a third preset value, the first virtual machine is determined as the second virtual machine;

[0101] A first weight is set for CPU utilization, a second weight is set for memory usage, and a third weight is set for the number of containers running;

[0102] The state information in the second virtual machine is weighted and summed to generate a target value;

[0103] The second virtual machine corresponding to the minimum target value among the target values ​​is used as the best target virtual machine to create a target container.

[0104] Among them, the first preset value is defined as the upper limit of the central processing unit (CPU) utilization, the second preset value is defined as the upper limit of the memory usage, and the third preset value is defined as the upper limit of the number of containers that have been run. The weights set for the CPU utilization, the memory utilization, and the number of containers that have been run reflect the relative importance of different resources when selecting a virtual machine. Through these steps, it can be ensured that the target container is created on a virtual machine with optimal resource utilization, thereby improving resource utilization and the overall performance of the system. This method helps to achieve load balancing, avoid resource bottlenecks, and ensure that newly created containers can obtain sufficient resources to run.

[0105] The storage volume mounting method provided in the embodiment of the present invention obtains the local area network information of the target virtual machine and the target virtualized storage resource pool in the target cluster through the container storage interface, so as to realize the isolation between services enhanced by the virtual machine, and the local area network information of the virtual machine can be identified through the container storage interface without manual identification, thereby reducing the investment of manpower cost, and establishing an association relationship between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network through the local area network information, and creating a target container storage volume in the first virtualized storage resource pool in response to the user's target operation in the user interface, and adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship, so as to realize the subsequent rapid screening of suitable virtual machines through the label information, and Without manual identification, the first virtual machine associated with the first virtualized storage resource pool is screened out from the target virtual machines through the tag information, and the best target virtual machine is selected from the first virtual machines through the preset rules to create a target container. The target container storage volume is mounted on the target container, so that the data generated by the target container can be persisted in the target virtualized storage resource pool. The embodiment of the present invention automatically identifies the local area network information of the virtual machine by setting a container storage interface, and then establishes an association relationship between the target virtual machine and the target virtualized storage resource pool. After determining the first virtualized storage resource pool to which the target container storage volume belongs, the first virtual machine is quickly found, which not only improves the recognition rate and accuracy, ensures the stability of recognition, but also reduces labor costs and time costs.

[0106] Reference Figure 2 , shows a flowchart of another method for mounting a storage volume provided by an embodiment of the present invention, the method may include:

[0107] Step 201: Obtain local area network information to which a target virtual machine and a target virtualized storage resource pool in a target cluster belong through a container storage interface.

[0108] The above step 201 refers to the discussion of the above step 101, and the present invention will not elaborate on it here.

[0109] Step 202: Divide the target virtual machine and the target virtualized storage resource pool according to the local area network information to generate target partitions.

[0110] An embodiment of the present invention includes at least one target virtual machine and a target virtualized storage resource pool. Each target virtual machine and target virtualized storage resource pool has corresponding local area network information. Because virtual machines can only use virtualized storage resource pools belonging to the same local area network, the target virtual machines and target virtualized storage resource pools are divided according to the local area network information. The local area network information of the target virtual machines and the target virtualized storage resource pool in each target partition is consistent, and each target partition includes a target virtualized storage resource pool.

[0111] Step 203: Establish an association relationship between the target virtual machine and the target virtualized storage resource pool in each target partition.

[0112] In the embodiment of the present invention, the access rights of the target virtual machine to the target virtualized storage resource pool are determined through the association relationship.

[0113] Step 204: Create a target container storage volume in the first virtualized storage resource pool in response to a target operation of the user in the user interface.

[0114] The above step 204 refers to the discussion of the above step 103, and the present invention will not elaborate on it here.

[0115] Step 205: Obtain a first identity identifier of a target virtualized storage resource pool in each target partition.

[0116] In the embodiment of the present invention, for each target partition, the identity of the target virtualized storage resource pool inside the target partition is obtained. These identities may be the name, UUID or other unique identifier of the storage resource pool.

[0117] Step 206: Use the first identity identifier as index information of the association relationship.

[0118] In the embodiment of the present invention, the first identity identifier of each target virtualized storage resource pool is used as index information of the association relationship to facilitate subsequent retrieval and matching.

[0119] Step 207: Obtain a second identity identifier of the first virtualized storage resource pool to which the target container storage volume belongs.

[0120] The embodiment of the present invention determines the first virtualized storage resource pool to which the target container storage volume belongs, and obtains the identity identifier (second identity identifier) ​​of the resource pool.

[0121] Step 208: Search the second identity identifier in the first identity identifier.

[0122] In the embodiment of the present invention, there are multiple first identity identifiers, which can be made into a first identity identifier list, and then the records matching the second identity identifier are retrieved from the first identity identifier lists in all target partitions.

[0123] Step 209: Obtain a third identity identifier that is consistent with the second identity identifier from the first identity identifier through the search result.

[0124] There are two kinds of retrieval results, one is inconsistent with the second identity identifier, and the other is consistent with the second identity identifier. When it is consistent with the second identity identifier, the retrieval is considered successful. At this time, the identity identifier found that is consistent with the second identity identifier is called the third identity identifier, that is, the identity identifier of the first virtualized storage resource pool to which the target container storage volume belongs.

[0125] Step 210: Acquire an association relationship about the first virtualized storage resource pool through the third identity identifier.

[0126] In the embodiment of the present invention, the third identity identifier is used as key information to obtain association relationship information related to the first virtualized storage resource pool, and the association relationship related to the first virtualized storage resource pool includes the first virtual machine information associated with the first virtualized storage resource pool.

[0127] Step 211: Use the association relationship of the first virtualized storage resource pool as label information added to the target container storage volume.

[0128] The embodiment of the present invention converts the acquired association relationship information into a tag format and adds it to the metadata of the target container storage volume. These tags can help users and management systems determine the relationship between the virtualized storage resource pool and the virtual machine, facilitating subsequent search and screening.

[0129] Step 212, filter out the first virtual machine associated with the first virtualized storage resource pool from the target virtual machines through the tag information, and select the best target virtual machine from the first virtual machines through a preset rule to create a target container, and mount the target container storage volume on the target container.

[0130] The above step 212 refers to the discussion of the above-mentioned step 105, and the present invention will not elaborate on it here.

[0131] Through these steps, label information about the first virtualized storage resource pool can be added to the target container storage volume, thereby making storage resource management more intuitive and efficient, and quickly finding the first virtual machine that can access the first virtualized storage resource pool in the subsequent process.

[0132] In summary, the embodiment of the present invention implements the target container running node (virtual machine) of the business based on K8s scheduling technology and storage topology technology, and can normally use the virtualized storage resource pool of the domain where the container storage volume is located. For example, Figure 3As shown, the target cluster (K8s cluster) includes the virtualization environment of LAN 1 and the virtualization environment of LAN 2. Each LAN has 1 to N virtual machines and a virtualized storage resource pool. The CSI container storage interface and the target resource scheduler are set. The LAN information of the virtual machines and virtualized storage resource pools under all LANs is obtained through the CSI container storage interface, and then the association relationship between the virtual machines and the virtualized storage resource pool is established. The K8s cluster is managed through the UI. Through the visual page operation, a container storage volume can be created. After the container storage volume is created on the selected virtualized storage resource pool, the target resource scheduler is used to select a suitable node to create a container, and then the previously created container storage volume is mounted to the latest created container.

[0133] Reference Figure 4 , which shows a schematic diagram of the structure of a storage volume mounting device provided by an embodiment of the present invention, such as Figure 4 As shown, the device may include:

[0134] The first acquisition module 301 is used to acquire the local area network information to which the target virtual machine and the target virtualized storage resource pool in the target cluster belong through the container storage interface.

[0135] The relationship establishing module 302 is used to establish an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network through local area network information.

[0136] The first creation module 303 is configured to create a target container storage volume in the first virtualized storage resource pool in response to a target operation of the user in the user interface.

[0137] The first adding module 304 is configured to add label information about the first virtualized storage resource pool to the target container storage volume through an association relationship.

[0138] The second creation module 305 is used to filter out the first virtual machine associated with the first virtualized storage resource pool from the target virtual machines through the tag information, and select the best target virtual machine from the first virtual machines through preset rules to create a target container, and the target container storage volume is mounted on the target container.

[0139] Optionally, the relationship establishing module 302 specifically includes:

[0140] The first generating submodule is used to divide the target virtual machine and the target virtualized storage resource pool according to the local area network information to generate target partitions, wherein the local area network information of the target virtual machine and the target virtualized storage resource pool in each target partition is consistent, and each target partition includes a target virtualized storage resource pool.

[0141] The first relationship establishment submodule is used to establish an association relationship between the target virtual machine and the target virtualized storage resource pool in each target partition, and determine the access rights of the target virtual machine to the target virtualized storage resource pool through the association relationship.

[0142] The first adding module 304 specifically includes:

[0143] The first acquisition submodule is used to acquire a first identity identifier of a target virtualized storage resource pool in each target partition.

[0144] The index setting submodule is used to use the first identity identifier as index information of the association relationship.

[0145] The second acquisition submodule is used to obtain a second identity identifier of the first virtualized storage resource pool to which the target container storage volume belongs.

[0146] The first search submodule is used to search the second identity identifier in the first identity identifier.

[0147] The third acquisition submodule is used to acquire a third identity identifier that is consistent with the second identity identifier from the first identity identifier through the search result.

[0148] The fourth acquisition submodule is used to acquire the association relationship about the first virtualized storage resource pool through the third identity identifier.

[0149] The first adding submodule is used to use the association relationship about the first virtualized storage resource pool as label information added to the target container storage volume.

[0150] Optionally, the first creation module 303 specifically includes:

[0151] The first selection submodule is configured to select a first virtualized storage resource pool from the target virtualized storage resource pools in response to a user's selection operation on the target virtualized storage resource pool in the user interface.

[0152] The first determination submodule is used to determine the size of the target container storage volume to be created.

[0153] The first allocation submodule is used to allocate corresponding storage space in the first virtualized storage resource pool according to the size of the target container storage volume.

[0154] The first creation submodule is used to create a target container storage volume in the storage space in response to a creation operation of the user in the user interface.

[0155] Optionally, the relationship establishing module 302 further includes:

[0156] The second determination submodule is used to determine the target local area network information for each target virtualized storage resource pool.

[0157] The first partitioning submodule is used to partition the target virtual machines belonging to the same local area network into the same partition according to the local area network information, and add the first local area network information to each partition.

[0158] The first comparison submodule is used to compare the target LAN information with the first LAN information.

[0159] The second relationship establishing submodule is used to establish an association relationship between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network if the comparison results are consistent.

[0160] Optionally, the second creation module 305 specifically includes:

[0161] The fifth acquisition submodule is used to obtain status information of the first virtual machine, where the status information includes: CPU utilization, memory utilization, and the number of running containers.

[0162] The second comparison submodule is used to compare the CPU utilization with the first preset value, the memory usage with the second preset value, and the number of containers that have been run with the third preset value.

[0163] The second creation submodule is used to select the best target virtual machine from the first virtual machine according to the comparison result to create a target container.

[0164] Optionally, the second creation submodule specifically includes:

[0165] A determination unit is used to determine the first virtual machine as the second virtual machine when the central processing unit utilization is less than a first preset value, the memory usage is less than a second preset value, and the number of containers that have been run is less than a third preset value.

[0166] The weight setting unit is used to set a first weight for the CPU utilization, a second weight for the memory usage, and a third weight for the number of containers that have been run.

[0167] The generating unit is used to perform weighted summation on the state information in the second virtual machine to generate a target value.

[0168] The creation unit is used to create a target container by taking the second virtual machine corresponding to the minimum target value among the target values ​​as the best target virtual machine.

[0169] Optionally, the storage volume mounting device further includes:

[0170] The replacement module is used to replace the default scheduler of the target cluster with the target resource scheduler. The target resource scheduler supports scheduling according to the target virtualized storage resource pool.

[0171] The deployment module is used to deploy the container storage interface on the target cluster through a plug-in.

[0172] The storage volume mounting method provided in the embodiment of the present invention obtains the local area network information of the target virtual machine and the target virtualized storage resource pool in the target cluster through the container storage interface, so as to realize the isolation between services enhanced by the virtual machine, and the local area network information of the virtual machine can be identified through the container storage interface without manual identification, thereby reducing the investment of manpower cost, and establishing an association relationship between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network through the local area network information, and creating a target container storage volume in the first virtualized storage resource pool in response to the user's target operation in the user interface, and adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship, so as to realize the subsequent rapid screening of suitable virtual machines through the label information, and Without manual identification, the first virtual machine associated with the first virtualized storage resource pool is screened out from the target virtual machines through the tag information, and the best target virtual machine is selected from the first virtual machines through the preset rules to create a target container. The target container storage volume is mounted on the target container, so that the data generated by the target container can be persisted in the target virtualized storage resource pool. The embodiment of the present invention automatically identifies the local area network information of the virtual machine by setting a container storage interface, and then establishes an association relationship between the target virtual machine and the target virtualized storage resource pool. After determining the first virtualized storage resource pool to which the target container storage volume belongs, the first virtual machine is quickly found, which not only improves the recognition rate and accuracy, ensures the stability of recognition, but also reduces labor costs and time costs.

[0173] The embodiment of the present invention also provides a communication device, such as Figure 5 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.

[0174] Memory 403, used for storing computer programs;

[0175] The processor 401 is used to execute the program stored in the memory 403 to implement the following steps:

[0176] Obtain the local area network information of the target virtual machine and the target virtualized storage resource pool in the target cluster through the container storage interface;

[0177] Establishing an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network through the local area network information;

[0178] In response to a target operation of the user in the user interface, creating a target container storage volume in the first virtualized storage resource pool;

[0179] Adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship;

[0180] A first virtual machine associated with the first virtualized storage resource pool is screened out from the target virtual machines by using the tag information, and an optimal target virtual machine is selected from the first virtual machines by a preset rule to create a target container, and the target container storage volume is mounted on the target container.

[0181] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0182] The communication interface is used for communication between the above terminal and other devices.

[0183] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0184] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0185] The present invention also provides a readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the storage volume mounting method of the aforementioned embodiment.

[0186] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0187] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. According to the above description, it is obvious that the structure required for constructing this type of device is. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific language is to disclose the best mode of the present invention.

[0188] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0189] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.

[0190] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0191] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0192] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0193] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0194] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0195] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0196] It should be noted that the various data-related processes in the embodiments of the present application are all carried out in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.

Claims

1. A storage volume mounting method, It is characterized in that The method comprises: Obtain the local area network information of the target virtual machine and the target virtualized storage resource pool in the target cluster through the container storage interface; Establishing an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network through the local area network information; In response to a target operation of the user in the user interface, creating a target container storage volume in the first virtualized storage resource pool; Adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship; A first virtual machine associated with the first virtualized storage resource pool is screened out from the target virtual machines by using the tag information, and an optimal target virtual machine is selected from the first virtual machines by a preset rule to create a target container, and the target container storage volume is mounted on the target container.

2. The method according to claim 1, It is characterized in that The establishing of an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network through the local area network information includes: Dividing the target virtual machine and the target virtualized storage resource pool according to the local area network information to generate target partitions, wherein the local area network information to which the target virtual machine and the target virtualized storage resource pool belong in each target partition is consistent, and each target partition includes one target virtualized storage resource pool; Establishing an association relationship between the target virtual machine and the target virtualized storage resource pool in each target partition, and determining access rights of the target virtual machine to the target virtualized storage resource pool through the association relationship; Adding label information about the first virtualized storage resource pool to the target container storage volume through the association relationship includes: Obtaining a first identity identifier of the target virtualized storage resource pool in each target partition; Using the first identity identifier as index information of the association relationship; Obtain a second identity identifier of a first virtualized storage resource pool to which the target container storage volume belongs; Retrieving the second identity identifier from the first identity identifier; Acquire a third identity identifier that is consistent with the second identity identifier from the first identity identifier through the search result; The association relationship of the first virtualized storage resource pool is obtained through the third identity identifier; and the association relationship of the first virtualized storage resource pool is used as label information added to the target container storage volume.

3. The method according to claim 1, It is characterized in that The step of creating a target container storage volume in the first virtualized storage resource pool in response to a target operation of the user in the user interface includes: selecting the first virtualized storage resource pool from the target virtualized storage resource pool in response to a selection operation of the user on the target virtualized storage resource pool in the user interface; Determine the size of the target container storage volume to be created; Allocating corresponding storage space in the first virtualized storage resource pool according to the size of the target container storage volume; In response to a creation operation of the user in the user interface, a target container storage volume is created in the storage space.

4. The method according to claim 1, It is characterized in that The establishing of an association relationship between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network through the local area network information further includes: Determine the target local area network information for each target virtualized storage resource pool; Divide the target virtual machines belonging to the same local area network into the same partition using the local area network information, and add the first local area network information to each partition; Comparing the target LAN information with the first LAN information; If the comparison result is consistent, an association relationship is established between the target virtual machine and the target virtualized storage resource pool belonging to the same local area network.

5. The method according to claim 1, It is characterized in that The step of selecting the best target virtual machine from the first virtual machine according to a preset rule to create a target container includes: Obtaining status information of the first virtual machine, the status information including: CPU utilization, memory utilization, and the number of containers that have been run; Comparing the CPU utilization with a first preset value, comparing the memory usage with a second preset value, and comparing the number of containers that have been run with a third preset value; According to the comparison result, the best target virtual machine is selected from the first virtual machines to create a target container.

6. The method according to claim 5, It is characterized in that The step of selecting the best target virtual machine from the first virtual machine according to the comparison result to create a target container includes: When the CPU utilization is less than a first preset value, the memory usage is less than a second preset value, and the number of running containers is less than a third preset value, determining the first virtual machine as a second virtual machine; A first weight is set for the CPU utilization, and a second weight is set for the memory usage, Setting a third weight for the number of running containers; weighting and summing the state information in the second virtual machine to generate a target value; The second virtual machine corresponding to the minimum target value among the target values ​​is taken as the best target virtual machine for target Creation of a container.

7. The method according to claim 1, It is characterized in that Before obtaining the local area network information of the target virtual machine and the target virtualized storage resource pool in the target cluster through the container storage interface, the method further includes: replacing the default scheduler of the target cluster with the target resource scheduler, wherein the target resource scheduler supports scheduling according to the target virtualized storage resource pool; Deploy the container storage interface on the target cluster through a plug-in.

8. A storage volume mounting device, It is characterized in that include: A first acquisition module is used to obtain local area network information to which a target virtual machine and a target virtualized storage resource pool in a target cluster belong through a container storage interface; A relationship establishing module, used for establishing an association relationship between a target virtual machine and a target virtualized storage resource pool belonging to the same local area network through the local area network information; A first creation module, configured to create a target container storage volume in a first virtualized storage resource pool in response to a target operation of a user in a user interface; A first adding module, configured to add label information about the first virtualized storage resource pool to the target container storage volume through the association relationship; The second creation module is used to filter out the first virtual machine associated with the first virtualized storage resource pool from the target virtual machines according to the tag information, and select the best target virtual machine from the first virtual machines according to preset rules to create a target container, and the target container storage volume is mounted on the target container.

9. A communication device, It is characterized in that include: A transceiver, a memory, a processor, and a program stored on the memory and executable on the processor; The processor is used to read the program in the memory to implement the steps in the storage volume mounting method as described in any one of claims 1-7.

10. A readable storage medium for storing a program, It is characterized in that When the storage program is executed by the processor, the steps in the storage volume mounting method as described in any one of claims 1-7 are implemented.