WO2022095844A1 - 一种云硬盘挂载方法及其装置 - Google Patents

一种云硬盘挂载方法及其装置 Download PDF

Info

Publication number
WO2022095844A1
WO2022095844A1 PCT/CN2021/128118 CN2021128118W WO2022095844A1 WO 2022095844 A1 WO2022095844 A1 WO 2022095844A1 CN 2021128118 W CN2021128118 W CN 2021128118W WO 2022095844 A1 WO2022095844 A1 WO 2022095844A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
hard disk
cloud hard
preset
target container
Prior art date
Application number
PCT/CN2021/128118
Other languages
English (en)
French (fr)
Inventor
姜智成
Original Assignee
北京金山云网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京金山云网络技术有限公司 filed Critical 北京金山云网络技术有限公司
Publication of WO2022095844A1 publication Critical patent/WO2022095844A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • the present application relates to the technical field of data processing, and in particular, to a method and device for mounting a cloud hard disk.
  • k8s kubernetes
  • kata a cluster system based on kubernetes (referred to as k8s) and kata
  • k8s kubernetes
  • kata a virtual machine serving as a computing node.
  • the cloud disk needs to be mounted inside the container, so that the container can directly read and write access to the cloud disk.
  • the present application provides a method and device for mounting a cloud hard disk, which can mount a cloud hard disk to a file directory of a container, so that the container can directly access the cloud disk through the file directory. hard disk for read and write access.
  • An embodiment of the present application provides a cloud hard disk mounting method, the method includes: receiving a device mounting request; wherein the device mounting request is used to request that a device to be mounted is mounted to a target container; the target container is deployed in the target virtual machine; according to the device information of the device to be mounted, it is determined whether the device to be mounted is a cloud hard disk; when it is determined that the device to be mounted is a cloud hard disk, the device to be mounted is Hot-plug into the target virtual machine, and mount the to-be-mounted device to the file directory of the target container.
  • the device information includes a file storage path, a device name and an attribute option
  • determining whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted including: when the character located at the first preset position in the file storage path of the device to be mounted is the first preset character, determining that the device to be mounted is a cloud hard disk; When the character in the second preset position in the device name of the device is the second preset character, it is determined that the device to be mounted is a cloud hard disk; when there is a preset option in the property options of the device to be mounted, it is determined that the device to be mounted is a cloud hard disk.
  • the device to be mounted is a cloud disk.
  • the device information includes a file storage path, a device name and an attribute option
  • determining whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted including: judging whether the character located at the first preset position in the file storage path of the device to be mounted is the first preset character; determining the first preset character in the file storage path of the device to be mounted When the character of the position is not the first preset character, it is judged whether there is a preset option in the property options of the device to be mounted; when it is determined that there is no preset option in the property options of the device to be mounted, it is determined that the Whether the character at the second preset position in the device name of the device to be mounted is the second preset character; it is determined that the character at the second preset position in the device name of the device to be mounted is not the second preset character character, it is determined that the device to be mounted is not a cloud hard disk.
  • the method further includes: if it is determined that the mounting requirement file of the device to be mounted is stored in the file storage path of the device to be mounted, acquiring the mounting requirement The permission information of the file; the mounting the device to be mounted to the file directory of the target container includes: when it is determined that the permission information of the mounting requirement file satisfies a first preset condition, adding the The device to be mounted is mounted under the file directory of the target container.
  • the mounting the device to be mounted to the file directory of the target container includes: parsing the file system protocol of the device to be mounted to obtain the to-be-mounted device The protocol analysis result of the mounted device; according to the protocol analysis result of the to-be-mounted device, the to-be-mounted device is mounted to the file directory of the target container.
  • the mounting the device to be mounted to the file directory of the target container includes: acquiring the file system type of the device to be mounted; The file system type of the device, and the device to be mounted is mounted to the file directory of the target container.
  • mounting the device to be mounted to the file directory of the target container includes: if the device to be mounted is If the file system type of the device satisfies the second preset condition, mount the device to be mounted to the file directory of the target container according to at least one candidate file system type; if the file system of the device to be mounted is If the type does not meet the second preset condition, the device to be mounted is mounted to the file directory of the target container according to the file system type of the device to be mounted.
  • An embodiment of the present application further provides a cloud hard disk mounting device, the device includes: a receiving unit, configured to receive a device mount request; wherein the device mount request is used to request to mount the device to be mounted to a target container; the target container is deployed in a target virtual machine; a determining unit is used to determine whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted; the mounting unit is used to determine whether the device to be mounted is a cloud hard disk; When the device to be mounted is a cloud hard disk, the device to be mounted is hot-plugged into the target virtual machine, and the device to be mounted is mounted to the file directory of the target container.
  • An embodiment of the present application further provides a device, the device includes a processor and a memory: the memory is used to store a computer program; the processor is used to execute the cloud hard disk mount provided by the embodiment of the present application according to the computer program any embodiment of the method.
  • Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, and the computer program is used to execute any implementation of the cloud hard disk mounting method provided by the embodiments of the present application Way.
  • the embodiments of the present application have at least the following advantages:
  • the device to be mounted after receiving a device mount request for requesting to mount a device to be mounted to a target container, the device to be mounted is determined according to the device information of the device to be mounted Whether the device to be mounted is a cloud hard disk, so that when it is determined that the device to be mounted is a cloud hard disk, the device to be mounted is hot-plugged to the target virtual machine where the target container is deployed, and the device to be mounted is mounted to the target in the container's file directory.
  • the cloud hard disk can be mounted to the file directory of the target container in the form of a directory, the target container can directly read and write access to the cloud hard disk through the file directory, so that the cloud hard disk can be mounted to the virtual machine. Business requirements inside the container.
  • FIG. 1 is a flowchart of a method for mounting a cloud hard disk according to an embodiment of the present application
  • FIG. 2 is a flowchart of identifying whether a device to be mounted is a cloud hard disk according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a cloud hard disk mounting process based on k8s and kata provided by the embodiment of the present application;
  • FIG. 4 is a flowchart of a cloud hard disk mounting device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • Kubernetes (referred to as k8s) is a container-based cluster management platform, and a kubernetes cluster can include a master node (Master Node) and multiple computing nodes (Work Node) that communicate with the master node respectively. Among them, the master node can be used to manage and control multiple computing nodes.
  • a computing node is a workload node, and each computing node can be deployed with at least one container group (Pod), and each pod group can encapsulate one or more containers (Containers) for carrying software programs.
  • Pod container group
  • Containers containers
  • a Pod is the basic unit of operation of Kubernetes and the smallest unit of deployment that can be created, debugged, and managed.
  • multiple containers (Containers) located in the same Pod can share network resources (eg, IP addresses). For example, when the first Pod includes 3 containers, and the first Pod has a first IP address, the 3 containers located on the first Pod share the first IP address.
  • kata is an open source container project that aims to unify the security benefits of virtual machines with the speed and manageability of containers.
  • kata is obtained by merging two related open source projects, Intel Clear Containers and Hyper runV, so that kata solves the security and isolation problems of traditional container shared kernels.
  • kata-runtime is a component of kata, and kata-runtime is used to process all commands specified by the OCI runtime specification and start a kata-shim instance when an OCI (Oracle Call Interface) compatible container is running.
  • OCI Organic Call Interface
  • kata-shim is also a component in kata, and kata-shim is used to monitor the container process.
  • kata-agent is a component in kata
  • kata-agent is a process running in the virtual machine to manage the container process in the virtual machine.
  • kata-agent is able to communicate with other components in kata through the GRPC protocol.
  • sheepdog is a distributed block storage file system applied to the open source community, and sheepdog adopts a completely symmetrical structure without a central node similar to metadata services.
  • cloud drives can use the sheepdog protocol.
  • qemu is a virtual operating system simulator, and kata-runtime can call commands (for example, call hot-plug commands of cloud disks) through the qmp interface provided by qemu.
  • qemu can integrate the parsing process of the sheepdog protocol, so that qemu can parse and identify the sheepdog protocol.
  • the cloud disk gateway service (that is, the EBS gateway service) is used to realize the network connection between the virtual machine and the cloud disk.
  • the cloud disk gateway service can convert the actual network address of a cloud disk into a local network address that qemu can access.
  • the inventor found that in order to avoid the degradation of the read and write performance of the cloud hard disk, the cloud hard disk can be mounted inside the container in the form of a directory, so as to ensure that the target container can quickly access the cloud disk through the file directory. hard disk for read and write access.
  • an embodiment of the present application provides a cloud hard disk mounting method, the method includes: receiving a device mounting request; wherein, the device mounting request is used to request to mount a device to be mounted to a target container; the target container is deployed In the target virtual machine; according to the device information of the device to be mounted, determine whether the device to be mounted is a cloud hard disk; when it is determined that the device to be mounted is a cloud hard disk, the device to be mounted is hot-plugged into the target virtual machine, and the The device to be mounted is mounted to the file directory of the target container.
  • the cloud hard disk can be mounted to the file directory of the target container in the form of a directory, so that the target container can directly read and write access to the cloud hard disk through the file directory, so that the read and write performance of the cloud hard disk is not reduced.
  • FIG. 1 this figure is a flowchart of a method for mounting a cloud hard disk according to an embodiment of the present application.
  • the cloud hard disk mounting method provided by the embodiment of the present application includes S101-S103:
  • the device mount request is used to request to mount the device to be mounted to the target container; and the target container is deployed in the target virtual machine.
  • the device to be mounted refers to the device that needs to be mounted on the target container.
  • the embodiment of the present application does not limit the device to be mounted, for example, the device to be mounted may be an input/output device (that is, an IO device), a cloud hard disk, and other devices.
  • the embodiment of the present application does not limit the number of devices to be mounted.
  • the device mounting process corresponding to the cloud disk can be used to complete the mounting of the device to be mounted.
  • S102 Determine whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted.
  • the device information of the device to be mounted is used to describe the related information of the device to be mounted.
  • the embodiments of the present application do not limit device information.
  • device information can include file storage paths, device names, and property options.
  • the file storage path is used to describe the access address of the device to be mounted; and the file storage path can usually include multiple levels of directories. For example, when the file storage path is "aaa ⁇ bbb ⁇ ... ⁇ ddd ⁇ eee", "aaa” is the first-level directory in the file storage path, "bbb” is the second-level directory in the file storage path, “ddd” is the penultimate level directory in the file storage path, and “eee” is the penultimate level directory in the file storage path.
  • the device name is used to uniquely identify the device to be mounted.
  • the attribute option is used to describe the attribute configuration information of the device to be mounted.
  • this embodiment of the present application does not limit attribute options, for example, the attribute options may include kata options.
  • the embodiment of the present application also provides an identification standard for cloud hard drives, which may be: when the character located at the first preset position in the file storage path of the device to be mounted is the first preset character, determine the device to be mounted It is a cloud hard disk; when the character located in the second preset position in the device name of the device to be mounted is the second preset character, it is determined that the device to be mounted is a cloud hard disk; when there is a preset in the property options of the device to be mounted When the option is selected, it is determined that the device to be mounted is a cloud hard disk; when the character located in the first preset position in the file storage path of the device to be mounted is not the first preset character, and there is no preset option in the property option of the device to be mounted, And when the character located at the second preset position in the device name of the device to be mounted is not the second preset character, it is determined that the device to be mounted is not a cloud hard disk.
  • an identification standard for cloud hard drives may be: when the character located at
  • the first preset position may be set in advance according to an application scenario.
  • the first preset location may be the location where the penultimate level directory is located.
  • the first preset character can also be set in advance according to the application scenario.
  • the first preset character may be the characters "kci ⁇ ebs”.
  • the second preset position may also be set in advance according to the application scenario.
  • the second preset position may be the position where the prefix word is located.
  • the prefix word can be located at the beginning of the device name. For example, if the device name is "sheepdog:22134aaa ⁇ bbb ⁇ ... ⁇ ddd ⁇ eee", "sheepdog:" can be the prefix of the device name.
  • the second preset character can also be set in advance according to the application scenario.
  • the second preset character may be the character "sheepdog:”.
  • Preset options can also be set in advance according to application scenarios.
  • the preset option can be the sheepdog option.
  • the device to be mounted is a cloud hard disk can be identified according to three cloud hard disk identification conditions, and when the device to be mounted meets at least one cloud hard disk identification condition, it can be determined
  • the device to be mounted is a cloud hard disk.
  • the above three cloud hard disk identification conditions may be: the character located in the first preset position in the file storage path of the device to be mounted is the first preset character; the character located in the second preset position in the device name of the device to be mounted The character of is the second preset character; there are preset options in the property options of the device to be mounted.
  • the identification standard of the cloud disk can be determined according to the relevant content of the sheepdog, so that the above three identification conditions of the cloud disk can be determined according to the relevant content of the sheepdog.
  • the three cloud hard disk identification conditions may be: the penultimate directory in the file storage path of the device to be mounted is kci ⁇ ebs; the prefix of the device name of the device to be mounted The word is "sheepdog:"; the sheepdog option exists in the property options of the device to be mounted.
  • the embodiment of the present application does not limit the judgment order of the three cloud hard disk identification conditions.
  • the following description is given in conjunction with a possible implementation manner of S102.
  • S102 may include S1021-S1023:
  • S1021 Determine whether the character located at the first preset position in the file storage path of the device to be mounted is the first preset character; if so, determine that the device to be mounted is a cloud hard disk; if not, execute S1022.
  • S1022 Determine whether there is a preset option in the attribute options of the device to be mounted; if yes, determine that the device to be mounted is a cloud hard disk; if not, execute S1023.
  • S1023 Determine whether the character located at the second preset position in the device name of the device to be mounted is the second preset character; if so, determine that the device to be mounted is a cloud hard disk; if not, determine the device to be mounted Not a cloud drive.
  • the device information of the device to be mounted is obtained, it can be determined whether the device to be mounted meets the three cloud hard disk identification conditions according to the device information of the device to be mounted , so that when it is determined that the device to be mounted satisfies at least one cloud hard disk identification condition, the device to be mounted is determined to be a cloud hard disk, so that the device mounting process corresponding to the cloud hard disk is performed for the device to be mounted.
  • the target virtual machine may be a computer node in k8s, and a target container is deployed on the target virtual machine.
  • the embodiments of the present application do not limit the hot-plugging process of the device to be mounted, and may be implemented in a related or future hot-plugging manner.
  • the embodiments of the present application do not limit the mounting process of the device to be mounted.
  • the following description is made with reference to three possible implementation manners.
  • the mounting process of the device to be mounted may include steps 11-12:
  • Step 11 Parse the file system protocol of the device to be mounted, and obtain a protocol parsing result of the device to be mounted.
  • the file system protocol of the cloud disk is the sheepdog protocol
  • Step 12 Mount the to-be-mounted device to the file directory of the target container according to the protocol analysis result of the to-be-mounted device.
  • the file system protocol of the cloud hard disk is the sheepdog protocol
  • the protocol analysis result of the device is loaded, and then based on the protocol analysis result, the device to be mounted is mounted to the file directory of the target container.
  • the mounting process of the device to be mounted may include step 21-step 22:
  • Step 21 Obtain the file system type of the device to be mounted.
  • step 21 may include steps 211-213:
  • Step 211 determine whether there is a pre-specified initial file system type; if yes, go to step 212 ; if not, go to step 213 .
  • the initial file system type is a file system type pre-specified by the pointer to the device to be mounted.
  • Step 212 Determine the file system type of the device to be mounted according to the initial file system type.
  • This embodiment of the present application does not limit step 212, and is described below with reference to two examples.
  • step 212 may be: determining the initial file system type as the file system type of the device to be mounted.
  • step 212 may be: adding a preset prefix to the initial file system type to obtain the file system type of the device to be mounted.
  • the preset prefix may be set according to the application scenario, for example, the preset prefix may be "Fstype-".
  • Step 213 Determine the file system type of the device to be mounted according to the preset automatic file system type.
  • the automatic file system type may be set in advance according to an application scenario, for example, the automatic file system type may be auto.
  • This embodiment of the present application also does not limit step 213, which is described below with reference to two examples.
  • step 213 may be: determining the automatic file system type as the file system type of the device to be mounted.
  • step 213 may be: adding a preset prefix to the automatic file system type to obtain the file system type of the device to be mounted.
  • the device to be mounted After the device to be mounted is obtained, it can be checked whether there is an initial file system type corresponding to the device to be mounted; if it exists, it can be determined according to the initial file system type.
  • the file system type of the device to be mounted; if it does not exist, the file system type of the device to be mounted can be determined according to the automatic file system type.
  • Step 22 Mount the device to be mounted to the file directory of the target container according to the file system type of the device to be mounted.
  • step 22 may include steps 221-223:
  • Step 221 Determine whether the file system type of the device to be mounted satisfies the second preset condition; if yes, go to step 222; if not, go to step 223.
  • the second preset condition may be preset according to the application scenario.
  • the second preset condition is that the file system type includes the automatic file system type.
  • step 221 In order to facilitate the understanding of step 221, the following description is given in conjunction with an example.
  • the second preset condition is that the file system type includes the automatic file system type, and the automatic file system type is auto
  • it is determined whether the file system type of the device to be mounted includes auto and if it includes auto, it is determined that the file system type of the device to be mounted includes auto.
  • step 222 can be used to mount; if auto is not included, it is determined that the file system type of the device to be mounted has been pre-specified, so step 223 can be used to mount.
  • Step 222 Mount the device to be mounted to the file directory of the target container according to the at least one candidate file system type.
  • the candidate file system type may be preset, for example, a common file system type in the target virtual machine may be determined as the candidate file system type.
  • the embodiment of the present application does not limit the number of candidate file system types, for example, the number of candidate file system types may be N. Among them, N is a positive integer.
  • step 222 In order to facilitate the understanding of step 222, the following description is given in conjunction with an example.
  • step 222 may include: according to the first candidate file system type, Mount to the file directory of the target container; if the mount is successful, the mounting process is ended; if the mount fails, the device to be mounted is mounted to the file directory of the target container according to the second candidate file system type ;If the mount is successful, end the mount process; if the mount fails, mount the device to be mounted to the file directory of the target container according to the third candidate file system type; ...
  • mount the device to be mounted to the file directory of the target container if the mount is successful, the mounting process is ended; if the mount fails, the N-th candidate file system type is used.
  • mount the device to be mounted to the file directory of the target container if the mounting is successful, the mounting process is ended; if the mounting fails, an error message carrying the device to be mounted failed is generated.
  • step 222 after determining that the file system type of the device to be mounted is not pre-specified, an attempt may be made to mount the device to be mounted to the file directory of the target container according to at least one candidate file system type, until Mount successfully or traverse each candidate file system type.
  • Step 223 Mount the device to be mounted to the file directory of the target container according to the file system type of the device to be mounted.
  • the device to be mounted may be directly mounted to the file directory of the target container according to the file system type of the device to be mounted; if If the mount is successful, the mount process ends; if the mount fails, an error message is generated carrying the failure to mount the device to be mounted.
  • the device to be mounted can be mounted to the target in the form of a directory according to the file system type of the device to be mounted The file directory of the container, so that the target container can read and write access to the device to be mounted through the file directory.
  • the mounting process of the device to be mounted needs to use some files (for example, the sheepdog network file). Therefore, in order to ensure that the mounting process of the device to be mounted can be executed smoothly, you can attach the device to be mounted to the target container. These files are checked before they are mounted.
  • the embodiment of the present application provides a third possible implementation manner of the mounting process of the device to be mounted, which may include steps 31 to 33:
  • Step 31 Determine whether a mount requirement file of the device to be mounted is stored in the file storage path of the device to be mounted; if so, perform step 32; if not, generate an error message carrying the lack of the mount requirement file.
  • the mount requirement file refers to a file (eg, sheepdog network file) that needs to be used during the mounting process of the device to be mounted, and the mount requirement file is usually stored in the file storage path of the device to be mounted.
  • Step 32 Obtain permission information for the mounting requirement file.
  • the permission information is used to describe whether the target container has the access permission of the device to be mounted.
  • Step 33 Determine whether the permission information of the mounting requirement file satisfies the first preset condition; if yes, perform step 34; if not, generate an error message carrying the permission abnormality of the mounting requirement file.
  • the first preset condition may be preset according to the application scenario.
  • the first preset condition may be that the target container has access rights to the device to be mounted.
  • Step 34 Mount the device to be mounted to the file directory of the target container.
  • the device to be mounted when it is determined that the device to be mounted is a cloud hard disk, it is possible to first check whether the file storage path of the device to be mounted is stored in the file storage path of the device to be mounted. If it exists, check whether the permission information of the mounting requirement file satisfies the first preset condition, so that when it is determined that the permission information of the mounting requirement file satisfies the first preset condition, mount the device to be mounted. Download to the file directory of the target container.
  • the device to be mounted is determined according to the device information of the device to be mounted It is a cloud hard disk, so that when the device to be mounted is determined to be a cloud hard disk, the device to be mounted is hot-plugged to the target virtual machine where the target container is deployed, and the device to be mounted is mounted to the file of the target container Under contents.
  • the cloud hard disk can be mounted to the file directory of the target container in the form of a directory, the target container can directly read and write access to the cloud hard disk through the file directory, so that the cloud hard disk can be mounted to the virtual machine. Business requirements inside the container.
  • the device name of the cloud disk can be constructed according to the preset structure, so the device name of the device to be mounted can be updated during the identification process of whether the device to be mounted is a cloud disk.
  • the embodiment of the present application also provides a possible implementation manner of identifying whether the device to be mounted is a cloud hard disk. As shown in FIG. 2 , it may include S201-S209:
  • S201 Determine whether the character located at the first preset position in the file storage path of the device to be mounted is the first preset character; if so, determine that the device to be mounted is a cloud hard disk and continue to execute S202; if not, then Execute S204.
  • S202 Determine whether a configuration file of the device to be mounted is stored in the file storage path of the device to be mounted; if yes, execute S203; if not, execute S204.
  • the configuration file of the device to be mounted is used to record relevant configuration parameters of the device to be mounted (for example, configuration parameters such as a device identifier of the device to be mounted). It should be noted that the embodiment of the present application does not limit the configuration file, for example, the configuration file may be a json file.
  • S203 Determine the device identifier of the device to be mounted according to the configuration file of the device to be mounted, and continue to perform S206.
  • the device identifier of the device to be mounted is used to uniquely identify the device to be mounted. It should be noted that the embodiment of the present application does not limit the device identifier of the device to be mounted.
  • the device identifier of the device to be mounted may be the parameter value of the parameter Volume Device Id recorded in the configuration file of the device to be mounted.
  • the device identifier of the device to be mounted can be directly read from the configuration file of the device to be mounted, so that the device to be mounted can be used subsequently.
  • the device ID of the device updates the device name of the device to be mounted.
  • S204 Determine whether there is a preset option in the attribute options of the device to be mounted; if so, determine that the device to be mounted is a cloud hard disk and continue to execute S205; if not, execute S209.
  • S205 Set the device identifier of the device to be mounted according to the device name of the device to be mounted.
  • the configuration file of the device to be mounted cannot be obtained, so that the configuration file cannot be obtained from the configuration file.
  • the device name of the device to be mounted can uniquely identify the device to be mounted, in order to obtain the device identifier that can uniquely identify the device to be mounted, the device name of the device to be mounted can be directly set as the device name to be mounted. Device ID of the device to be mounted.
  • S206 Determine whether the management file corresponding to the device to be mounted records the network access path of the device to be mounted; if so, execute S208; if not, execute S207.
  • the management file corresponding to the device to be mounted refers to a related file that needs to be used when managing the target virtual machine. For example, if kata is used to manage the target virtual machine, the management file corresponding to the device to be mounted may refer to the kata configuration file.
  • the network access path of the device to be mounted refers to the access path used for read and write access to the device to be mounted.
  • the embodiment of the present application does not limit the network access path of the device to be mounted.
  • the network access path of the device to be mounted may refer to the parameter value of the parameter sheepdogpath recorded in the management file corresponding to the device to be mounted.
  • S207 Set the network access path recorded in the configuration file of the device to be mounted as the network access path of the device to be mounted, and continue to perform S208.
  • this embodiment of the present application does not limit the network access path recorded in the configuration file of the device to be mounted.
  • the network access path recorded in the configuration file of the device to be mounted may refer to the configuration file of the device to be mounted.
  • S208 Update the device name of the device to be mounted according to the second preset character, the device identifier of the device to be mounted, and the network access path of the device to be mounted.
  • S208 may be: splicing the second preset character, the device identifier of the device to be mounted, and the network access path of the device to be mounted to obtain an update
  • the device name of the device to be mounted is updated, so that the updated device name of the device to be mounted can carry the second preset character, the device identifier of the device to be mounted, and the network access path of the device to be mounted.
  • S209 Determine whether the character located at the second preset position in the device name of the device to be mounted is the second preset character; if so, determine that the device to be mounted is a cloud hard disk; if not, determine the device to be mounted Not a cloud drive.
  • the embodiment of the present application also provides an implementation of S209, which may be: judging whether the type identifier of the device to be mounted is a preset type identifier and is located at the second preset position in the device name of the device to be mounted Whether the character on the device to be mounted is the second preset character; if the type identifier of the device to be mounted is the preset type identifier and the character located at the second preset position in the device name of the device to be mounted is the second preset character, then Make sure that the device to be mounted is a cloud hard disk; otherwise, determine that the device to be mounted is not a cloud hard disk.
  • the preset type identifier is used to uniquely identify the type of the network hard disk, and the preset type identifier can be preset.
  • the preset type identifier can be bind.
  • the second preset character, the device identification of the device to be mounted, and the network access of the device to be mounted can be used. path, update the device name of the device to be mounted, so that the updated device name of the device to be mounted can carry the second preset character, the device identifier of the device to be mounted and the network access path of the device to be mounted, In order to obtain more information from the device name of the device to be mounted in the subsequent mounting process of the device to be mounted.
  • the cloud hard disk mounting method provided in the embodiment of the present application may be applied to the application scenario shown in FIG. 3 .
  • 3 is a schematic diagram of a cloud hard disk mounting process based on k8s and kata provided by an embodiment of the present application.
  • both the first cloud hard disk ebs1 and the second cloud hard disk ebs2 can be mounted in the form of directories to the file directory of the container 302 deployed on the virtual machine 300, so that the container 302 can pass the first mount directory Read and write access to the first cloud hard disk ebs1 and read and write access to the second cloud hard disk ebs2 through the second mount directory.
  • the mounting process of the first cloud hard disk ebs1 is similar to the mounting process of the second cloud hard disk ebs2, for the sake of brevity, the following describes the mounting process of the first cloud hard disk ebs1 as an example.
  • the first preset position is the position of the penultimate level directory
  • the first preset character is the character "kci ⁇ ebs”
  • the second preset position is the position of the prefix word
  • the second preset character is The character "sheepdog:”
  • the default option is sheepdog option
  • the default prefix is "Fstype-”
  • the automatic file system type is auto
  • the configuration file of the first cloud disk ebs1 is ebs1.json.
  • the mounting process of the first cloud hard disk ebs1 may include steps 401 to 406:
  • Step 401 kata-runtime determines whether the penultimate directory in the file storage path of the first cloud hard disk ebs1 is kci ⁇ ebs; if so, determine that the first cloud hard disk ebs1 is a cloud hard disk and execute step 402; if not, execute Step 404.
  • Step 402 kata-runtime determines whether ebs1.json is stored in the file storage path of the first cloud hard disk ebs1; if so, execute step 403; if not, execute step 404.
  • Step 403 kata-runtime determines the parameter value of the parameter Volume Device Id recorded in ebs1.json as the device identifier of the first cloud hard disk ebs1, and proceeds to step 406.
  • Step 404 kata-runtime determines whether the sheepdog option exists in the kata option of the first cloud hard disk ebs1; if so, determine that the first cloud hard disk ebs1 is a cloud hard disk and execute step 405; if not, execute step 410.
  • Step 405 kata-runtime sets the device name of the first cloud hard disk ebs1 as the device identifier of the first cloud hard disk ebs1.
  • Step 406 kata-runtime judges whether the parameter value of the parameter sheepdogpath is recorded in the kata configuration file; if so, the parameter value of the parameter sheepdogpath is determined as the network access path of the first cloud hard disk ebs1; if not, ebs1.json The parameter value of the parameter SockPath recorded in is determined as the network access path of the first cloud hard disk ebs1.
  • Step 407 kata-runtime concatenates the prefix "sheepdog:", the device identifier of the first cloud hard disk ebs1, and the network access path of the first cloud hard disk ebs1, as the updated device name of the first cloud hard disk ebs1.
  • Step 408 kata-runtime judges whether the initial file system type of the first cloud hard disk ebs1 is preset, if so, obtain the initial file system type of the first cloud hard disk ebs1; if not, set the initial file system type of the first cloud hard disk ebs1 The system type is set to auto.
  • Step 409 kata-runtime adds the prefix "Fstype-" to the initial file system type of the first cloud disk ebs1 to obtain the final file system type of the first cloud disk ebs1, and converts the final file system type of the first cloud disk ebs1 to The type is recorded in the property options of the first cloud disk ebs1.
  • Step 410 kata-runtime determines whether the type identifier of the first cloud hard disk ebs1 is bind and whether the device name of the first cloud hard disk ebs1 includes the prefix word "sheepdog"; if the type identifier of the first cloud hard disk ebs1 is bind and the first cloud hard disk ebs1 If the device name of the hard disk ebs1 includes the prefix "sheepdog", step 411 is executed; if not, the mounting process is ended.
  • Step 411 kata-runtime judges whether the file storage path of the first cloud hard disk ebs1 stores the mounting requirement file of the first cloud hard disk ebs1; if so, execute step 412; There is an error message that the mount requirement file is missing.
  • Step 412 kata-runtime judges whether the permission information of the mount requirement file of the first cloud hard disk ebs1 satisfies the preset condition; if so, execute step 413; if not, end the mount process and generate a file carrying the mount requirement file. Permission exception error message.
  • Step 413 kata-runtime updates the file system type parameter required in the block device management process to the final file system type of the first cloud hard disk ebs1.
  • step 413 may remove the selected bind option without using any option.
  • Step 414 kata-runtime parses the sheepdog protocol on the first cloud hard disk ebs1 , and hot-plugs the first cloud hard disk ebs1 into the virtual machine 300 .
  • Step 415 kata-agent mounts the device to be mounted to the file directory of the container 302 in the form of a directory, so that the container 302 can read and write access to the first cloud hard disk ebs1 through the first mounting directory.
  • the cloud hard disk can be hot-plugged to the target virtual machine where the target container is deployed, and then the cloud hard disk can be installed in the target virtual machine. It is mounted to the file directory of the target container in the form of a directory, so that the target container can read and write access to the cloud hard disk through the file directory.
  • an embodiment of the present application further provides a cloud hard disk mounting device, which is explained and described below with reference to the accompanying drawings.
  • FIG. 4 this figure is a flowchart of a cloud hard disk mounting apparatus provided by an embodiment of the present application.
  • the cloud hard disk mounting device 400 provided by the embodiment of the present application includes:
  • the receiving unit 401 is configured to receive a device mount request; wherein, the device mount request is configured to request that the device to be mounted is mounted to a target container; the target container is deployed in the target virtual machine;
  • the determining unit 402 is configured to determine whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted;
  • the mounting unit 403 is configured to, when it is determined that the device to be mounted is a cloud hard disk, hot-plug the device to be mounted to the target virtual machine, and mount the device to be mounted to the target in the container's file directory.
  • the determining unit 402 is configured to:
  • the device information includes a file storage path, a device name and an attribute option
  • the character located in the first preset position in the file storage path of the device to be mounted is the first preset character
  • it is determined that the to-be-mounted device is The device to be mounted is a cloud hard disk
  • the character at the second preset position in the device name of the device to be mounted is the second preset character
  • it is determined that the device to be mounted is a cloud hard disk
  • the device to be mounted is a cloud hard disk
  • the device to be mounted is a cloud hard disk.
  • the determining unit 402 is configured to:
  • the device information includes a file storage path, a device name and an attribute option, determine whether the character located at the first preset position in the file storage path of the device to be mounted is the first preset character; When the character in the first preset position in the file storage path of the device to be mounted is not the first preset character, determine whether there is a preset option in the attribute options of the device to be mounted; after determining the device to be mounted When there is no preset option in the attribute option of the device to be mounted, determine whether the character located at the second preset position in the device name of the device to be mounted is the second preset character; after determining the device name of the device to be mounted When the character in the second preset position is not the second preset character, it is determined that the device to be mounted is not a cloud hard disk.
  • the cloud hard disk mounting apparatus 400 further includes:
  • an acquiring unit configured to acquire the permission information of the mounting requirement file if it is determined that the mounting requirement file of the to-be-mounted device is stored in the file storage path of the to-be-mounted device;
  • the mounting unit 403 includes:
  • the first mounting subunit is configured to mount the device to be mounted to the file directory of the target container when it is determined that the permission information of the mounting requirement file satisfies a first preset condition.
  • the mounting unit 403 includes:
  • the second mounting subunit is configured to parse the file system protocol of the device to be mounted to obtain a protocol parsing result of the device to be mounted; according to the protocol parsing result of the device to be mounted, the The device to be mounted is mounted under the file directory of the target container.
  • the mounting unit 403 includes:
  • the third mounting subunit is configured to mount the device to be mounted to the file directory of the target container according to the file system type of the device to be mounted.
  • the third mounting subunit is set to:
  • the above related content of the cloud hard disk mounting apparatus 400 provided in this social situation embodiment, for the cloud hard disk mounting apparatus 400, after receiving the device mount request set as a request to mount the device to be mounted to the target container , according to the device information of the device to be mounted, determine whether the device to be mounted is a cloud hard disk, so that when it is determined that the device to be mounted is a cloud hard disk, the device to be mounted is hot-plugged to the device where the target container is deployed target virtual machine, and mount the device to be mounted to the file directory of the target container.
  • the cloud hard disk can be mounted to the file directory of the target container in the form of a directory
  • the target container can directly read and write access to the cloud hard disk through the file directory, so that the cloud hard disk can be mounted to the virtual machine.
  • Business requirements inside the container because the cloud hard disk can be mounted to the file directory of the target container in the form of a directory, the target container can directly read and write access to the cloud hard disk through the file directory, so that the cloud hard disk can be mounted to the virtual machine.
  • an embodiment of the present application further provides a device, which is explained and described below with reference to the accompanying drawings.
  • FIG. 5 this figure is a schematic structural diagram of a device provided by an embodiment of the present application.
  • the device 500 provided in this embodiment of the present application includes: a processor 501 and a memory 502;
  • the memory 502 is used to store computer programs
  • the processor 501 is configured to execute any implementation manner of the cloud hard disk mounting method provided by the above method embodiments according to the computer program. That is, the processor 501 is configured to perform the following steps:
  • the device mount request is used to request that the device to be mounted be mounted to a target container; the target container is deployed in the target virtual machine;
  • the device information of the device to be mounted determine whether the device to be mounted is a cloud hard disk
  • the device to be mounted is a cloud hard disk
  • the device to be mounted is hot-plugged into the target virtual machine, and the device to be mounted is mounted to the file directory of the target container.
  • determining whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted includes:
  • the device to be mounted is a cloud hard disk.
  • determining whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted includes:
  • the method further includes:
  • the mounting requirement file of the device to be mounted is stored in the file storage path of the device to be mounted, obtaining permission information of the mounting requirement file;
  • Mounting the to-be-mounted device to the file directory of the target container includes:
  • the device to be mounted is mounted to the file directory of the target container.
  • the method of mounting the device to be mounted to the file directory of the target container includes:
  • the device to be mounted is mounted to the file directory of the target container.
  • the method of mounting the device to be mounted to the file directory of the target container includes:
  • the device to be mounted is mounted to the file directory of the target container.
  • mounting the device to be mounted to the file directory of the target container includes:
  • the embodiments of the present application further provide a computer-readable storage medium.
  • An embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, and the computer program is used to execute any implementation manner of the cloud hard disk mounting method provided by the above method embodiments. That is, the computer program is used to perform the following steps:
  • the device mount request is used to request that the device to be mounted be mounted to a target container; the target container is deployed in the target virtual machine;
  • the device information of the device to be mounted determine whether the device to be mounted is a cloud hard disk
  • the device to be mounted is a cloud hard disk
  • the device to be mounted is hot-plugged into the target virtual machine, and the device to be mounted is mounted to the file directory of the target container.
  • determining whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted includes:
  • the device to be mounted is a cloud hard disk.
  • determining whether the device to be mounted is a cloud hard disk according to the device information of the device to be mounted includes:
  • the method further includes:
  • the mounting requirement file of the device to be mounted is stored in the file storage path of the device to be mounted, obtaining permission information of the mounting requirement file;
  • Mounting the to-be-mounted device to the file directory of the target container includes:
  • the device to be mounted is mounted to the file directory of the target container.
  • the method of mounting the device to be mounted to the file directory of the target container includes:
  • the device to be mounted is mounted to the file directory of the target container.
  • the method of mounting the device to be mounted to the file directory of the target container includes:
  • the device to be mounted is mounted to the file directory of the target container.
  • mounting the device to be mounted to the file directory of the target container includes:
  • At least one (item) refers to one or more, and "a plurality” refers to two or more.
  • “And/or” is used to describe the relationship between related objects, indicating that there can be three kinds of relationships, for example, “A and/or B” can mean: only A, only B, and both A and B exist , where A and B can be singular or plural.
  • the character “/” generally indicates that the related objects are an “or” relationship.
  • At least one item(s) below” or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s).
  • At least one (a) of a, b or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c" ", where a, b, c can be single or multiple.
  • the cloud hard disk mounting method and device After receiving a device mount request for requesting to mount a device to be mounted to a target container, determine the device according to the device information of the device to be mounted Whether the device to be mounted is a cloud hard disk, so that when it is determined that the device to be mounted is a cloud hard disk, the device to be mounted is hot-plugged to the target virtual machine where the target container is deployed, and the device to be mounted is mounted Download to the file directory of the target container.
  • the cloud hard disk can be mounted to the file directory of the target container in the form of a directory
  • the target container can directly read and write access to the cloud hard disk through the file directory, so that the cloud hard disk can be mounted to the virtual machine. Business requirements inside the container.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种云硬盘挂载方法及其装置,该方法包括:在接收到用于请求将待挂载设备挂载至目标容器的设备挂载请求之后,根据该待挂载设备的设备信息,确定该待挂载设备是否为云硬盘,以便在确定该待挂载设备为云硬盘时,将该待挂载设备热插至部署有该目标容器的目标虚拟机,并将该待挂载设备挂载至目标容器的文件目录下。其中,因云硬盘可以以目录形式挂载至目标容器的文件目录下,使得该目标容器能够通过该文件目录直接对该云硬盘进行读写访问,如此实现了将云硬盘挂载至虚拟机中容器内部的业务需求。

Description

一种云硬盘挂载方法及其装置
本公开要求于2020年11月05日提交中国专利局、申请号为202011222933.7、发明名称为“一种云硬盘挂载方法及其装置”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本申请涉及数据处理技术领域,尤其涉及一种云硬盘挂载方法及其装置。
背景技术
在基于kubernetes(简称为k8s)和kata的集群***中,作为计算节点的虚拟机中部署了至少一个容器。在一些情况下,需要将云硬盘挂载至容器内部,以使该容器能够直接对该云硬盘进行读写访问。
然而,如何将云硬盘挂载至虚拟机中容器内部是一个亟待解决的技术问题。
发明内容
为了解决相关技术中存在的以上技术问题,本申请提供一种云硬盘挂载方法及其装置,能够将云硬盘挂载至容器的文件目录下,以使该容器能够通过文件目录直接对该云硬盘进行读写访问。
为了实现上述目的,本申请实施例提供的技术方案如下:
本申请实施例提供一种云硬盘挂载方法,所述方法包括:接收设备挂载请求;其中,所述设备挂载请求用于请求将待挂载设备挂载至目标容器;所述目标容器部署在目标虚拟机中;根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘;在确定所述待挂载设备为云硬盘时,将所述待挂载设备热插至所述目标虚拟机,并将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:当位于所述待挂载设备的文件存储路径中第一预设位置的字符是第一预设字符时,确定所述待挂载设备为云硬盘;当位于所述待挂载设备的设备名称中第二预设位置的字符是第二预设字符时,确定所述待挂载设备 为云硬盘;当所述待挂载设备的属性选项中存在预设选项时,确定所述待挂载设备为云硬盘。
在一种可能的实施方式中,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:判断位于所述待挂载设备的文件存储路径中第一预设位置上的字符是否为第一预设字符;在确定位于所述待挂载设备的文件存储路径中第一预设位置的字符不是第一预设字符时,判断所述待挂载设备的属性选项中是否存在预设选项;在确定所述待挂载设备的属性选项不存在预设选项时,判断位于所述待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;在确定位于所述待挂载设备的设备名称中第二预设位置上的字符不是第二预设字符时,确定所述待挂载设备不是云硬盘。
在一种可能的实施方式中,所述方法还包括:若确定在所述待挂载设备的文件存储路径下存储有所述待挂载设备的挂载需求文件,则获取所述挂载需求文件的权限信息;所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:在确定所述挂载需求文件的权限信息满足第一预设条件时,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:对所述待挂载设备的文件***协议进行解析,得到所述待挂载设备的协议解析结果;根据所述待挂载设备的协议解析结果,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:获取所述待挂载设备的文件***类型;根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,所述根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下,包括:若所述待挂载设备的文件***类型满足第二预设条件,则根据至少一个候选文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下;若所述待挂载设备的文件***类型不满足第二预设条件,则按照所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
本申请实施例还提供了一种云硬盘挂载装置,所述装置包括:接收单元, 用于接收设备挂载请求;其中,所述设备挂载请求用于请求将待挂载设备挂载至目标容器;所述目标容器部署在目标虚拟机中;确定单元,用于根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘;挂载单元,用于在确定所述待挂载设备为云硬盘时,将所述待挂载设备热插至所述目标虚拟机,并将所述待挂载设备挂载至所述目标容器的文件目录下。
本申请实施例还提供了一种设备,所述设备包括处理器以及存储器:所述存储器用于存储计算机程序;所述处理器用于根据所述计算机程序执行本申请实施例提供的云硬盘挂载方法的任一实施方式。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,所述计算机程序用于执行本申请实施例提供的云硬盘挂载方法的任一实施方式。
与相关技术相比,本申请实施例至少具有以下优点:
本申请实施例提供的云硬盘挂载方法中,在接收到用于请求将待挂载设备挂载至目标容器的设备挂载请求之后,根据该待挂载设备的设备信息,确定该待挂载设备是否为云硬盘,以便在确定该待挂载设备为云硬盘时,将该待挂载设备热插至部署有该目标容器的目标虚拟机,并将该待挂载设备挂载至目标容器的文件目录下。其中,因云硬盘可以以目录形式挂载至目标容器的文件目录下,使得该目标容器能够通过该文件目录直接对该云硬盘进行读写访问,如此实现了将云硬盘挂载至虚拟机中容器内部的业务需求。
附图说明
为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本申请实施例提供的一种云硬盘挂载方法的流程图;
图2为本申请实施例提供的一种识别待挂载设备是否为云硬盘的流程图;
图3为本申请实施例提供的一种基于k8s和kata下的云硬盘挂载过程 示意图;
图4为本申请实施例提供的一种云硬盘挂载装置的流程图;
图5为本申请实施例提供的设备结构示意图。
具体实施方式
为了便于理解本申请的技术方案,下面对本申请涉及的一些技术名词进行说明。
kubernetes(简称为k8s)是一种基于容器的集群管理平台,而且kubernetes集群可以包括主节点(Master Node)、以及分别与主节点通信连接的多个计算节点(Work Node)。其中,主节点可以用于管理和控制多个计算节点。计算节点是一种工作负载节点,而且每个计算节点中可以部署有至少一个容器组(Pod),每个容器组中可以封装有一个或多个用于承载软件程序的容器(Container)。
Pod是Kubernetes的基本操作单元,而且是最小的可创建、调试和管理的部署单元。另外,位于同一个Pod中的多个容器(Container)可以共享网络资源(如,IP地址)。例如,当第一个Pod包括3个容器,且该第一个Pod具有第一IP地址时,位于该第一个Pod上的3个容器共享该第一IP地址。
kata是一项开源容器项目,旨在将虚拟机的安全优势与容器的速度以及可管理性统一起来。另外,kata是通过将Intel Clear Containers和Hyper runV这两个相关的开源项目进行合并得到的,以使kata解决了传统容器共享内核的安全和隔离问题。
kata-runtime是kata中的一个组件,而且kata-runtime用于在一个OCI(Oracle Call Interface)兼容的容器运行时,负责处理OCI运行时规范指定的所有命令并启动kata-shim实例。其中,kata-shim也是kata中的一个组件,而且kata-shim用于监控容器进程。
kata-agent是kata中的一个组件,而且kata-agent是一个运行在虚拟机中的进程管理虚拟机中的容器进程。另外,kata-agent能够通过GRPC协议与kata中的其他组件进行通信。
sheepdog是一种应用于开源社区的分布式块存储文件***,而且sheepdog采用完全对称的结构,没有类似元数据服务的中心节点。另外,云硬盘可以使用sheepdog协议。
qemu是虚拟操作***模拟器,而且kata-runtime可以通过qemu提供的qmp接口调用指令(例如,调用云硬盘的热插指令)。另外,qemu可以集成sheepdog协议的解析过程,以使qemu能够对该sheepdog协议进行解析识别。
云硬盘网关服务(也就是,EBS gateway服务)用于实现虚拟机和云硬盘之间的网络对接。另外,云硬盘网关服务能够将一个云硬盘的实际网络地址转换为qemu能够访问的本地网络地址。
发明人在对云硬盘挂载的研究中发现,为了避免云硬盘的读写性能下降,云硬盘可以以目录形式挂载至容器内部,以保证该目标容器能够通过该文件目录快速地对该云硬盘进行读写访问。
基于此,本申请实施例提供了一种云硬盘挂载方法,该方法包括:接收设备挂载请求;其中,设备挂载请求用于请求将待挂载设备挂载至目标容器;目标容器部署在目标虚拟机中;根据待挂载设备的设备信息,确定待挂载设备是否为云硬盘;在确定待挂载设备为云硬盘时,将待挂载设备热插至目标虚拟机,并将待挂载设备挂载至目标容器的文件目录下。
可见,因云硬盘可以以目录形式挂载至目标容器的文件目录下,使得该目标容器能够通过该文件目录直接对该云硬盘进行读写访问,如此实现了在不降低云硬盘的读写性能的前提下将云硬盘挂载至虚拟机中容器内部的业务需求。
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
方法实施例一
参见图1,该图为本申请实施例提供的一种云硬盘挂载方法的流程图。
本申请实施例提供的云硬盘挂载方法,包括S101-S103:
S101:接收设备挂载请求。
其中,设备挂载请求用于请求将待挂载设备挂载至目标容器;而且该目标容器部署在目标虚拟机中。
待挂载设备是指需要挂载到目标容器上的设备。另外,本申请实施例不限 定待挂载设备,例如,待挂载设备可以是输入/输出设备(也就是,IO设备)、云硬盘等等设备。此外,本申请实施例不限定待挂载设备的个数。
基于上述内容可知,由于一个容器上可以挂载不同类型的设备,而且不同类型的设备可以采用不同的设备挂载流程,故在接收到设备挂载请求之后,可以先识别待挂载设备的类型,再利用该类型对应的设备挂载流程来完成待挂载设备的挂载。例如,若待挂载设备为云硬盘,则可以利用云硬盘对应的设备挂载流程来完成待挂载设备的挂载。
S102:根据待挂载设备的设备信息,确定待挂载设备是否为云硬盘。
其中,待挂载设备的设备信息用于描述该待挂载设备的相关信息。另外,本申请实施例不限定设备信息。例如,设备信息可以包括文件存储路径、设备名称和属性选项。
文件存储路径用于描述待挂载设备的访问地址;而且文件存储路径通常可以包括多级目录。例如,当文件存储路径为“aaa\bbb\……\ddd\eee”时,“aaa”为该文件存储路径中的第一级目录,“bbb”该文件存储路径中的第二级目录,“ddd”该文件存储路径中的倒数第二级目录,“eee”该文件存储路径中的倒数第一级目录。
设备名称用于唯一标识待挂载设备。
属性选项用于描述待挂载设备的属性配置信息。另外,本申请实施例不限定属性选项,例如,该属性选项可以包括kata选项。
另外,本申请实施例还提供了云硬盘的识别标准,其可以为:当位于待挂载设备的文件存储路径中第一预设位置的字符是第一预设字符时,确定待挂载设备为云硬盘;当位于待挂载设备的设备名称中第二预设位置的字符是第二预设字符时,确定待挂载设备为云硬盘;当待挂载设备的属性选项中存在预设选项时,确定待挂载设备为云硬盘;当位于待挂载设备的文件存储路径中第一预设位置的字符不是第一预设字符、待挂载设备的属性选项不存在预设选项、且位于待挂载设备的设备名称中第二预设位置上的字符不是第二预设字符时,确定待挂载设备不是云硬盘。
其中,第一预设位置可以预先根据应用场景设定。例如,第一预设位置可以是倒数第二级目录所处的位置。
第一预设字符也可以预先根据应用场景设定。例如,第一预设字符可以是 字符“kci~ebs”。
第二预设位置也可以预先根据应用场景设定。例如,第二预设位置可以是前缀词所处的位置。需要说明的是,前缀词可以位于设备名称的起始位置。例如,若设备名称为“sheepdog:22134aaa\bbb\……\ddd\eee”,则“sheepdog:”可以是该设备名称的前缀词。
第二预设字符也可以预先根据应用场景设定。例如,第二预设字符可以是字符“sheepdog:”。
预设选项也可以预先根据应用场景设定。例如,预设选项可以为sheepdog选项。
基于上述云硬盘的识别标准可知,本申请实施例可以依据三个云硬盘识别条件来识别待挂载设备是否为云硬盘,而且当待挂载设备满足至少一个云硬盘识别条件时,即可确定该待挂载设备为云硬盘。其中,上述三个云硬盘识别条件可以为:位于待挂载设备的文件存储路径中第一预设位置的字符是第一预设字符;位于待挂载设备的设备名称中第二预设位置的字符是第二预设字符;待挂载设备的属性选项中存在预设选项。
另外,因云硬盘使用的是sheepdog协议,使得云硬盘的识别标准可以依据sheepdog的相关内容进行确定,从而使得上述三个云硬盘识别条件均就可以依据sheepdog的相关内容进行确定。基于此可知,在一种可能的实施方式中,三个云硬盘识别条件可以为:待挂载设备的文件存储路径中倒数第二级目录为kci~ebs;待挂载设备的设备名称的前缀词为“sheepdog:”;待挂载设备的属性选项中存在sheepdog选项。
此外,本申请实施例不限定三个云硬盘识别条件的判断顺序,为了便于理解,下面结合S102的一种可能的实施方式进行说明。
作为示例,S102其可以包括S1021-S1023:
S1021:判断位于待挂载设备的文件存储路径中第一预设位置上的字符是否为第一预设字符;若是,则确定该待挂载设备为云硬盘;若否,则执行S1022。
S1022:判断待挂载设备的属性选项中是否存在预设选项;若是,则确定该待挂载设备为云硬盘;若否,则执行S1023。
S1023:判断位于待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;若是,则确定该待挂载设备为云硬盘;若否,则确定待挂载设 备不是云硬盘。
基于上述S102的相关内容可知,本申请实施例中,在获取到待挂载设备的设备信息之后,可以依据待挂载设备的设备信息,确定该待挂载设备是否满足三个云硬盘识别条件,以便在确定该待挂载设备满足至少一个云硬盘识别条件时,确定该待挂载设备为云硬盘,从而针对该待挂载设备执行云硬盘对应的设备挂载流程。
S103:在确定待挂载设备为云硬盘时,将待挂载设备热插至目标虚拟机,并将待挂载设备挂载至目标容器的文件目录下。
其中,目标虚拟机可以是k8s中的计算机节点,而且该目标虚拟机上部署有目标容器。
另外,本申请实施例不限定待挂载设备的热插过程,可以采用相关的或将来出现的热插方式进行实施。
此外,本申请实施例不限定待挂载设备的挂载过程,为了便于理解,下面结合三种可能的实施方式进行说明。
在第一种可能的实施方式中,待挂载设备的挂载过程可以包括步骤11-步骤12:
步骤11:对待挂载设备的文件***协议进行解析,得到待挂载设备的协议解析结果。
实际上,因云硬盘的文件***协议是sheepdog协议,故在确定待挂载设备为云硬盘之后,可以对该待挂载设备进行sheepdog协议解析,得到该待挂载设备的协议解析结果。
需要说明的是,本申请实施例不限定sheepdog协议解析的实施方式,可以采用任一种能够对sheepdog协议进行解析的协议解析方法进行实施。
步骤12:根据待挂载设备的协议解析结果,将待挂载设备挂载至目标容器的文件目录下。
基于上述步骤11至步骤12的相关内容可知,若云硬盘的文件***协议为sheepdog协议,则在确定出待挂载设备为云硬盘之后,可以先对待挂载设备进行sheepdog协议解析,得到待挂载设备的协议解析结果,再基于该协议解析结果,将待挂载设备挂载至目标容器的文件目录下。
在第二种可能的实施方式中,待挂载设备的挂载过程可以包括步骤21-步 骤22:
步骤21:获取待挂载设备的文件***类型。
作为示例,步骤21可以包括步骤211-步骤213:
步骤211:判断是否存在预先指定的初始文件***类型;若是,则执行步骤212;若否,则执行步骤213。
其中,初始文件***类型是指针对待挂载设备预先指定的文件***类型。
步骤212:根据初始文件***类型,确定待挂载设备的文件***类型。
本申请实施例不限定步骤212,下面结合两个示例进行说明。
示例1,步骤212可以为:将初始文件***类型,确定为待挂载设备的文件***类型。
示例2,步骤212可以为:将预设前缀词添加到初始文件***类型,得到待挂载设备的文件***类型。其中,预设前缀词可以根据应用场景设定,例如,预设前缀词可以为“Fstype-”。
步骤213:根据预先设定的自动文件***类型,确定待挂载设备的文件***类型。
其中,自动文件***类型可以预先根据应用场景设定,例如,自动文件***类型可以为auto。
本申请实施例也不限定步骤213,下面结合两个示例进行说明。
示例1,步骤213可以为:将自动文件***类型,确定为待挂载设备的文件***类型。
示例2,步骤213可以为:将预设前缀词添加到自动文件***类型,得到待挂载设备的文件***类型。
基于上述步骤211至步骤213的相关内容可知,在获取到待挂载设备之后,可以先检查是否存在待挂载设备对应的初始文件***类型;若存在,则可以依据该初始文件***类型,确定待挂载设备的文件***类型;若不存在,则可以依据自动文件***类型,确定待挂载设备的文件***类型。
步骤22:根据待挂载设备的文件***类型,将待挂载设备挂载至目标容器的文件目录下。
作为示例:步骤22可以包括步骤221-步骤223:
步骤221:判断待挂载设备的文件***类型是否满足第二预设条件;若是, 则执行步骤222;若否,则执行步骤223。
其中,第二预设条件可以根据应用场景预先设定。例如,第二预设条件为文件***类型包括自动文件***类型。
为了便于理解步骤221,下面结合示例进行说明。
作为示例,当第二预设条件为文件***类型包括自动文件***类型,且自动文件***类型为auto时,则判断待挂载设备的文件***类型是否包括auto,若包括auto,则确定未预先指定待挂载设备的文件***类型,故可以采用步骤222进行挂载;若不包括auto,则确定已经预先指定了待挂载设备的文件***类型,故可以采用步骤223进行挂载。
步骤222:根据至少一个候选文件***类型,将待挂载设备挂载至目标容器的文件目录下。
其中,候选文件***类型可以预先设定,例如,可以将目标虚拟机中的常用文件***类型确定为候选文件***类型。
另外,本申请实施例不限定候选文件***类型的个数,例如,候选文件***类型的个数可以为N。其中,N为正整数。
为了便于理解步骤222,下面结合示例进行说明。
作为示例,若候选文件***类型的个数为N,则在确定未预先指定待挂载设备的文件***类型之后,步骤222可以包括为:按照第1个候选文件***类型,将待挂载设备向目标容器的文件目录进行挂载;若挂载成功,则结束挂载流程;若挂载失败,则按照第2个候选文件***类型,将待挂载设备向目标容器的文件目录进行挂载;若挂载成功,则结束挂载流程;若挂载失败,则按照第3个候选文件***类型,将待挂载设备向目标容器的文件目录进行挂载;……(依次类推);按照第N-1个候选文件***类型,将待挂载设备向目标容器的文件目录进行挂载;若挂载成功,则结束挂载流程;若挂载失败,则按照第N个候选文件***类型,将待挂载设备向目标容器的文件目录进行挂载;若挂载成功,则结束挂载流程;若挂载失败,则生成携带有待挂载设备挂载失败的报错信息。
基于上述步骤222的相关内容可知,在确定未预先指定待挂载设备的文件***类型之后,可以尝试根据至少一个候选文件***类型,将待挂载设备向目标容器的文件目录进行挂载,直至挂载成功或者遍历各个候选文件***类型。
步骤223:按照待挂载设备的文件***类型,将待挂载设备挂载至目标容器的文件目录下。
本申请实施例中,在确定已预先指定了待挂载设备的文件***类型之后,可以直接按照待挂载设备的文件***类型,将待挂载设备向目标容器的文件目录进行挂载;若挂载成功,则结束挂载流程;若挂载失败,则生成携带有待挂载设备挂载失败的报错信息。
基于上述步骤21至步骤22的相关内容可知,在将待挂载设备热插至目标虚拟机之后,可以依据待挂载设备的文件***类型,将该待挂载设备以目录形式挂载至目标容器的文件目录下,以使该目标容器能够通过文件目录对该待挂载设备进行读写访问。
在一些情况下,待挂载设备的挂载过程需要使用一些文件(如,sheepdog网络文件),故为了保证待挂载设备的挂载过程能够顺利执行,可以在将待挂载设备向目标容器的文件目录进行挂载之前先对这些文件进行检查。
基于此,本申请实施例提供了待挂载设备的挂载过程的第三种可能的实施方式,其可以包括步骤31-步骤33:
步骤31:判断在待挂载设备的文件存储路径下是否存储有待挂载设备的挂载需求文件;若是,则执行步骤32;若否,则生成携带有缺少挂载需求文件的报错信息。
其中,挂载需求文件是指待挂载设备的挂载过程中需要使用的文件(如,sheepdog网络文件),而且该挂载需求文件通常存储在待挂载设备的文件存储路径下。
步骤32:获取挂载需求文件的权限信息。其中,权限信息用于描述目标容器是否具有待挂载设备的访问权限。
步骤33:判断挂载需求文件的权限信息是否满足第一预设条件;若是,则执行步骤34;若否,则生成携带有挂载需求文件的权限异常的报错信息。
其中,第一预设条件可以根据应用场景预先设定,例如,第一预设条件可以为目标容器具有待挂载设备的访问权限。
步骤34:将待挂载设备挂载至目标容器的文件目录下。
基于上述步骤31至步骤34的相关内容可知,本申请实施例中,在确定待挂载设备为云硬盘时,可以先在待挂载设备的文件存储路径下检查是否存储有 待挂载设备的挂载需求文件;若存在,则检查该挂载需求文件的权限信息是否满足第一预设条件,以便在确定该挂载需求文件的权限信息满足第一预设条件时,将待挂载设备挂载至目标容器的文件目录下。
基于上述S101至S103的相关内容可知,在接收到用于请求将待挂载设备挂载至目标容器的设备挂载请求之后,根据该待挂载设备的设备信息,确定该待挂载设备是否为云硬盘,以便在确定该待挂载设备为云硬盘时,将该待挂载设备热插至部署有该目标容器的目标虚拟机,并将该待挂载设备挂载至目标容器的文件目录下。其中,因云硬盘可以以目录形式挂载至目标容器的文件目录下,使得该目标容器能够通过该文件目录直接对该云硬盘进行读写访问,如此实现了将云硬盘挂载至虚拟机中容器内部的业务需求。
方法实施例二
在一些情况下,为了便于进行云硬盘挂载,可以将云硬盘的设备名称按照预设结构进行构造,故可以在待挂载设备是否为云硬盘的识别过程中更新待挂载设备的设备名称。
基于此,本申请实施例还提供了识别待挂载设备是否为云硬盘的一种可能的实施方式,如图2所示,其可以包括S201-S209:
S201:判断位于待挂载设备的文件存储路径中第一预设位置上的字符是否为第一预设字符;若是,则确定该待挂载设备为云硬盘并继续执行S202;若否,则执行S204。
S202:判断在待挂载设备的文件存储路径下是否存储有待挂载设备的配置文件;若是,则执行S203;若否,则执行S204。
其中,待挂载设备的配置文件用于记录待挂载设备的相关配置参数(例如,待挂载设备的设备标识等配置参数)。需要说明的是,本申请实施例不限定配置文件,例如,配置文件可以是json文件。
S203:根据待挂载设备的配置文件,确定待挂载设备的设备标识,并继续执行S206。
其中,待挂载设备的设备标识用于唯一标识该待挂载设备。需要说明的是,本申请实施例不限定待挂载设备的设备标识,例如,待挂载设备的设备标识可以是待挂载设备的配置文件中记录的参数Volume Device Id的参数值。
本申请实施例中,在获取到待挂载设备的配置文件之后,可以直接从该待挂载设备的配置文件中读取到该待挂载设备的设备标识,以便后续能够利用该待挂载设备的设备标识更新该待挂载设备的设备名称。
S204:判断待挂载设备的属性选项中是否存在预设选项;若是,则确定该待挂载设备为云硬盘并继续执行S205;若否,则执行S209。
S205:根据待挂载设备的设备名称,设定待挂载设备的设备标识。
本申请实施例中,若确定位于待挂载设备的文件存储路径中第一预设位置上的字符不是第一预设字符,则无法获取该待挂载设备的配置文件,从而无法从该配置文件中读取待挂载设备的设备标识。此时,因待挂载设备的设备名称能够唯一标识该待挂载设备,故为了获取能够唯一标识待挂载设备的设备标识,可以直接将该待挂载设备的设备名称,设定为该待挂载设备的设备标识。
S206:判断待挂载设备对应的管理文件是否记录有待挂载设备的网络访问路径;若是,则执行S208;若否,则执行S207。
其中,待挂载设备对应的管理文件是指管理目标虚拟机时所需使用的相关文件。例如,若利用kata管理目标虚拟机,则待挂载设备对应的管理文件可以是指kata配置文件。
待挂载设备的网络访问路径是指对待挂载设备进行读写访问时所需使用的访问路径。另外,本申请实施例不限定待挂载设备的网络访问路径,例如,待挂载设备的网络访问路径可以是指待挂载设备对应的管理文件中记录的参数sheepdogpath的参数值。
S207:将待挂载设备的配置文件中记录的网络访问路径,设定为待挂载设备的网络访问路径,并继续执行S208。
需要说明的是,本申请实施例不限定待挂载设备的配置文件中记录的网络访问路径,例如,待挂载设备的配置文件中记录的网络访问路径可以是指待挂载设备的配置文件中记录的参数SockPath的参数值。
S208:根据第二预设字符、待挂载设备的设备标识和待挂载设备的网络访问路径,更新待挂载设备的设备名称。
需要说明的是,本申请实施例不限定S208的实施方式,例如,S208可以为:将第二预设字符、待挂载设备的设备标识和待挂载设备的网络访问路径进行拼接,得到更新后的待挂载设备的设备名称,以使更新后的待挂载设备的设 备名称能够携带有第二预设字符、待挂载设备的设备标识和待挂载设备的网络访问路径。
S209:判断位于待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;若是,则确定该待挂载设备为云硬盘;若否,则确定待挂载设备不是云硬盘。
实际上,因云硬盘是通过网络与虚拟机进行连接的,使得云硬盘属于网络硬盘。基于此,本申请实施例还提供了S209的一种实施方式,其可以为:判断待挂载设备的类型标识是否为预设类型标识且位于待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;若待挂载设备的类型标识为预设类型标识且位于待挂载设备的设备名称中第二预设位置上的字符为第二预设字符,则确定该待挂载设备为云硬盘;反之,则确定待挂载设备不是云硬盘。
其中,预设类型标识用于唯一标识网络硬盘类型,而且预设类型标识可以预先设定。例如,预设类型标识可以为bind。
基于上述S201至S209的相关内容可知,本申请实施例中,在确定待挂载设备为云硬盘之后,可以利用第二预设字符、待挂载设备的设备标识和待挂载设备的网络访问路径,对待挂载设备的设备名称进行更新,以使更新后的待挂载设备的设备名称能够携带有第二预设字符、待挂载设备的设备标识和待挂载设备的网络访问路径,以便在后续待挂载设备的挂载过程中能够从该待挂载设备的设备名称获取更多信息。
为了便于理解本申请实施例提供的云硬盘挂载方法,下面结合场景实施例进行说明。
场景实施例
在一些情况下,本申请实施例提供的云硬盘挂载方法可以应用于图3所示的应用场景中。其中,图3为本申请实施例提供的一种基于k8s和kata下的云硬盘挂载过程示意图。
如图3所示,可以将第一云硬盘ebs1和第二云硬盘ebs2均以目录形式挂载至虚拟机300上部署的容器302的文件目录下,以使容器302能够通过第一挂载目录对第一云硬盘ebs1进行读写访问以及通过第二挂载目录对第二云硬盘ebs2进行读写访问。
另外,因第一云硬盘ebs1的挂载过程与第二云硬盘ebs2的挂载过程类似,故为了简要起见,下面以第一云硬盘ebs1的挂载过程为例进行说明。
假设,第一预设位置为倒数第二级目录所处的位置,第一预设字符为字符“kci~ebs”,第二预设位置为前缀词所处的位置,第二预设字符为字符“sheepdog:”,预设选项为sheepdog选项,预设前缀词为“Fstype-”,自动文件***类型为auto,第一云硬盘ebs1的配置文件为ebs1.json。
作为示例,基于上述假设可知,第一云硬盘ebs1的挂载过程可以包括步骤401至步骤406:
步骤401:kata-runtime判断第一云硬盘ebs1的文件存储路径中倒数第二级目录是否为kci~ebs;若是,则确定第一云硬盘ebs1为云硬盘并执行步骤402;若否,则执行步骤404。
步骤402:kata-runtime判断在第一云硬盘ebs1的文件存储路径下是否存储有ebs1.json;若是,则执行步骤403;若否,则执行步骤404。
步骤403:kata-runtime将ebs1.json中记录的参数Volume Device Id的参数值,确定为第一云硬盘ebs1的设备标识,并继续执行步骤406。
步骤404:kata-runtime判断第一云硬盘ebs1的kata选项中是否存在sheepdog选项;若是,则确定第一云硬盘ebs1为云硬盘并执行步骤405;若否,则执行步骤410。
步骤405:kata-runtime将第一云硬盘ebs1的设备名称,设定为第一云硬盘ebs1的设备标识。
步骤406:kata-runtime判断kata配置文件中是否记录有参数sheepdogpath的参数值;若是,则将参数sheepdogpath的参数值,确定为第一云硬盘ebs1的网络访问路径;若否,则将ebs1.json中记录的参数SockPath的参数值,确定为第一云硬盘ebs1的网络访问路径。
步骤407:kata-runtime将前缀词“sheepdog:”、第一云硬盘ebs1的设备标识和第一云硬盘ebs1的网络访问路径进行拼接,作为更新后的第一云硬盘ebs1的设备名称。
步骤408:kata-runtime判断是否预先设置有第一云硬盘ebs1的初始文件***类型,若是,则获取第一云硬盘ebs1的初始文件***类型;若否,则将第一云硬盘ebs1的初始文件***类型设置为auto。
步骤409:kata-runtime将前缀词“Fstype-”添加至第一云硬盘ebs1的初始文件***类型,得到第一云硬盘ebs1的最终文件***类型,并将该第一云硬盘ebs1的最终文件***类型记录到第一云硬盘ebs1的属性选项中。
步骤410:kata-runtime判断第一云硬盘ebs1的类型标识是否为bind且第一云硬盘ebs1的设备名称是否包括前缀词“sheepdog”;若第一云硬盘ebs1的类型标识为bind且第一云硬盘ebs1的设备名称包括前缀词“sheepdog”,则执行步骤411;若否,则结束挂载过程。
步骤411:kata-runtime判断在第一云硬盘ebs1的文件存储路径下是否存储有第一云硬盘ebs1的挂载需求文件;若是,则执行步骤412;若否,则结束挂载过程并生成携带有缺少挂载需求文件的报错信息。
步骤412:kata-runtime判断第一云硬盘ebs1的挂载需求文件的权限信息是否满足预设条件;若是,则执行步骤413;若否,则结束挂载过程并生成携带有挂载需求文件的权限异常的报错信息。
步骤413:kata-runtime将块设备管理流程中所需使用的文件***类型参数更新为第一云硬盘ebs1的最终文件***类型。
需要说明的是,在一些情况下,步骤413可以将已选中的bind选项去掉,不使用任何选项。
步骤414:kata-runtime对第一云硬盘ebs1进行sheepdog协议解析,并将第一云硬盘ebs1热插至虚拟机300。
步骤415:kata-agent将待挂载设备以目录形式挂载至容器302的文件目录下,以使容器302能够通过第一挂载目录对第一云硬盘ebs1进行读写访问。
基于上述步骤401至步骤415的相关内容可知,针对基于k8s和kata下的云硬盘挂载过程来说,可以先将云硬盘热插至部署有目标容器的目标虚拟机,再将该云硬盘以目录的形式挂载到目标容器的文件目录下,以使该目标容器能够通过该文件目录对云硬盘进行读写访问。
基于上述方法实施例提供的云硬盘挂载方法,本申请实施例还提供了一种云硬盘挂载装置,下面结合附图进行解释和说明。
装置实施例
装置实施例提供的云硬盘挂载装置的技术详情,请参照上述方法实施例。
参见图4,该图为本申请实施例提供的一种云硬盘挂载装置的流程图。
本申请实施例提供的云硬盘挂载装置400,包括:
接收单元401,设置为接收设备挂载请求;其中,所述设备挂载请求设置为请求将待挂载设备挂载至目标容器;所述目标容器部署在目标虚拟机中;
确定单元402,设置为根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘;
挂载单元403,设置为在确定所述待挂载设备为云硬盘时,将所述待挂载设备热插至所述目标虚拟机,并将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,所述确定单元402,设置为:
若所述设备信息包括文件存储路径、设备名称和属性选项,则当位于所述待挂载设备的文件存储路径中第一预设位置的字符是第一预设字符时,确定所述待挂载设备为云硬盘;当位于所述待挂载设备的设备名称中第二预设位置的字符是第二预设字符时,确定所述待挂载设备为云硬盘;当所述待挂载设备的属性选项中存在预设选项时,确定所述待挂载设备为云硬盘。
在一种可能的实施方式中,所述确定单元402,设置为:
若所述设备信息包括文件存储路径、设备名称和属性选项,则判断位于所述待挂载设备的文件存储路径中第一预设位置上的字符是否为第一预设字符;在确定位于所述待挂载设备的文件存储路径中第一预设位置的字符不是第一预设字符时,判断所述待挂载设备的属性选项中是否存在预设选项;在确定所述待挂载设备的属性选项不存在预设选项时,判断位于所述待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;在确定位于所述待挂载设备的设备名称中第二预设位置上的字符不是第二预设字符时,确定所述待挂载设备不是云硬盘。
在一种可能的实施方式中,所述云硬盘挂载装置400还包括:
获取单元,设置为若确定在所述待挂载设备的文件存储路径下存储有所述待挂载设备的挂载需求文件,则获取所述挂载需求文件的权限信息;
所述挂载单元403,包括:
第一挂载子单元,设置为在确定所述挂载需求文件的权限信息满足第一预设条件时,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,所述挂载单元403,包括:
第二挂载子单元,设置为对所述待挂载设备的文件***协议进行解析,得到所述待挂载设备的协议解析结果;根据所述待挂载设备的协议解析结果,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,所述挂载单元403,包括:
获取子单元,设置为获取所述待挂载设备的文件***类型;
第三挂载子单元,设置为根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式中,所述第三挂载子单元,设置为:
若所述待挂载设备的文件***类型满足第二预设条件,则根据至少一个候选文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下;
若所述待挂载设备的文件***类型不满足第二预设条件,则按照所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
以上为本社情实施例提供的云硬盘挂载装置400的相关内容,对于云硬盘挂载装置400来说,在接收到设置为请求将待挂载设备挂载至目标容器的设备挂载请求之后,根据该待挂载设备的设备信息,确定该待挂载设备是否为云硬盘,以便在确定该待挂载设备为云硬盘时,将该待挂载设备热插至部署有该目标容器的目标虚拟机,并将该待挂载设备挂载至目标容器的文件目录下。其中,因云硬盘可以以目录形式挂载至目标容器的文件目录下,使得该目标容器能够通过该文件目录直接对该云硬盘进行读写访问,如此实现了将云硬盘挂载至虚拟机中容器内部的业务需求。
基于上述方法实施例提供的云硬盘挂载方法,本申请实施例还提供了一种设备,下面结合附图进行解释和说明。
设备实施例
设备实施例提供的设备技术详情,请参照上述方法实施例。
参见图5,该图为本申请实施例提供的设备结构示意图。
本申请实施例提供的设备500,包括:处理器501以及存储器502;
所述存储器502用于存储计算机程序;
所述处理器501用于根据所述计算机程序执行上述方法实施例提供的云硬盘挂载方法的任一实施方式。也就是说,处理器501用于执行以下步骤:
接收设备挂载请求;其中,所述设备挂载请求用于请求将待挂载设备挂载至目标容器;所述目标容器部署在目标虚拟机中;
根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘;
在确定所述待挂载设备为云硬盘时,将所述待挂载设备热插至所述目标虚拟机,并将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:
当位于所述待挂载设备的文件存储路径中第一预设位置的字符是第一预设字符时,确定所述待挂载设备为云硬盘;
当位于所述待挂载设备的设备名称中第二预设位置的字符是第二预设字符时,确定所述待挂载设备为云硬盘;
当所述待挂载设备的属性选项中存在预设选项时,确定所述待挂载设备为云硬盘。
在一种可能的实施方式下,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:
判断位于所述待挂载设备的文件存储路径中第一预设位置上的字符是否为第一预设字符;
在确定位于所述待挂载设备的文件存储路径中第一预设位置的字符不是第一预设字符时,判断所述待挂载设备的属性选项中是否存在预设选项;
在确定所述待挂载设备的属性选项不存在预设选项时,判断位于所述待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;
在确定位于所述待挂载设备的设备名称中第二预设位置上的字符不是第二预设字符时,确定所述待挂载设备不是云硬盘。
在一种可能的实施方式下,所述方法还包括:
若确定在所述待挂载设备的文件存储路径下存储有所述待挂载设备的挂载需求文件,则获取所述挂载需求文件的权限信息;
所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
在确定所述挂载需求文件的权限信息满足第一预设条件时,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
对所述待挂载设备的文件***协议进行解析,得到所述待挂载设备的协议解析结果;
根据所述待挂载设备的协议解析结果,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
获取所述待挂载设备的文件***类型;
根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,所述根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
若所述待挂载设备的文件***类型满足第二预设条件,则根据至少一个候选文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下;
若所述待挂载设备的文件***类型不满足第二预设条件,则按照所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
以上为本申请实施例提供的设备500的相关内容。
基于上述方法实施例提供的云硬盘挂载方法,本申请实施例还提供了一种计算机可读存储介质。
介质实施例
介质实施例提供的计算机可读存储介质的技术详情,请参照方法实施例。
本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质用于存储计算机程序,所述计算机程序用于执行上述方法实施例提供的云硬盘挂载方法的任一实施方式。也就是说,该计算机程序用于执行以下步骤:
接收设备挂载请求;其中,所述设备挂载请求用于请求将待挂载设备挂载至目标容器;所述目标容器部署在目标虚拟机中;
根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘;
在确定所述待挂载设备为云硬盘时,将所述待挂载设备热插至所述目标虚拟机,并将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:
当位于所述待挂载设备的文件存储路径中第一预设位置的字符是第一预设字符时,确定所述待挂载设备为云硬盘;
当位于所述待挂载设备的设备名称中第二预设位置的字符是第二预设字符时,确定所述待挂载设备为云硬盘;
当所述待挂载设备的属性选项中存在预设选项时,确定所述待挂载设备为云硬盘。
在一种可能的实施方式下,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:
判断位于所述待挂载设备的文件存储路径中第一预设位置上的字符是否为第一预设字符;
在确定位于所述待挂载设备的文件存储路径中第一预设位置的字符不是第一预设字符时,判断所述待挂载设备的属性选项中是否存在预设选项;
在确定所述待挂载设备的属性选项不存在预设选项时,判断位于所述待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;
在确定位于所述待挂载设备的设备名称中第二预设位置上的字符不是第二预设字符时,确定所述待挂载设备不是云硬盘。
在一种可能的实施方式下,所述方法还包括:
若确定在所述待挂载设备的文件存储路径下存储有所述待挂载设备的挂载需求文件,则获取所述挂载需求文件的权限信息;
所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
在确定所述挂载需求文件的权限信息满足第一预设条件时,将所述待挂载 设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
对所述待挂载设备的文件***协议进行解析,得到所述待挂载设备的协议解析结果;
根据所述待挂载设备的协议解析结果,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
获取所述待挂载设备的文件***类型;
根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
在一种可能的实施方式下,所述根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
若所述待挂载设备的文件***类型满足第二预设条件,则根据至少一个候选文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下;
若所述待挂载设备的文件***类型不满足第二预设条件,则按照所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
以上为本申请实施例提供的计算机可读存储介质的相关内容。
应当理解,在本申请中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。
以上所述,仅是本公开的较佳实施例而已,并非对本公开作任何形式上的限制。虽然本公开已以较佳实施例揭露如上,然而并非用以限定本公开。任何 熟悉本领域的技术人员,在不脱离本公开技术方案范围情况下,都可利用上述揭示的方法和技术内容对本公开技术方案做出许多可能的变动和修饰,或修改为等同变化的等效实施例。因此,凡是未脱离本公开技术方案的内容,依据本公开的技术实质对以上实施例所做的任何简单修改、等同变化及修饰,均仍属于本公开技术方案保护的范围内。
工业实用性
基于本公开实施例提供的云硬盘挂载方法及其装置,在接收到用于请求将待挂载设备挂载至目标容器的设备挂载请求之后,根据该待挂载设备的设备信息,确定该待挂载设备是否为云硬盘,以便在确定该待挂载设备为云硬盘时,将该待挂载设备热插至部署有该目标容器的目标虚拟机,并将该待挂载设备挂载至目标容器的文件目录下。其中,因云硬盘可以以目录形式挂载至目标容器的文件目录下,使得该目标容器能够通过该文件目录直接对该云硬盘进行读写访问,如此实现了将云硬盘挂载至虚拟机中容器内部的业务需求。

Claims (10)

  1. 一种云硬盘挂载方法,所述方法包括:
    接收设备挂载请求;其中,所述设备挂载请求用于请求将待挂载设备挂载至目标容器;所述目标容器部署在目标虚拟机中;
    根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘;
    在确定所述待挂载设备为云硬盘时,将所述待挂载设备热插至所述目标虚拟机,并将所述待挂载设备挂载至所述目标容器的文件目录下。
  2. 根据权利要求1所述的方法,其中,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:
    当位于所述待挂载设备的文件存储路径中第一预设位置的字符是第一预设字符时,确定所述待挂载设备为云硬盘;
    当位于所述待挂载设备的设备名称中第二预设位置的字符是第二预设字符时,确定所述待挂载设备为云硬盘;
    当所述待挂载设备的属性选项中存在预设选项时,确定所述待挂载设备为云硬盘。
  3. 根据权利要求1或2所述的方法,其中,若所述设备信息包括文件存储路径、设备名称和属性选项,则所述根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘,包括:
    判断位于所述待挂载设备的文件存储路径中第一预设位置上的字符是否为第一预设字符;
    在确定位于所述待挂载设备的文件存储路径中第一预设位置的字符不是第一预设字符时,判断所述待挂载设备的属性选项中是否存在预设选项;
    在确定所述待挂载设备的属性选项不存在预设选项时,判断位于所述待挂载设备的设备名称中第二预设位置上的字符是否为第二预设字符;
    在确定位于所述待挂载设备的设备名称中第二预设位置上的字符不是第二预设字符时,确定所述待挂载设备不是云硬盘。
  4. 根据权利要求1-3任一项所述的方法,其中,所述方法还包括:
    若确定在所述待挂载设备的文件存储路径下存储有所述待挂载设备的挂载需求文件,则获取所述挂载需求文件的权限信息;
    所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
    在确定所述挂载需求文件的权限信息满足第一预设条件时,将所述待挂载设备挂载至所述目标容器的文件目录下。
  5. 根据权利要求1-4任一项所述的方法,其中,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
    对所述待挂载设备的文件***协议进行解析,得到所述待挂载设备的协议解析结果;
    根据所述待挂载设备的协议解析结果,将所述待挂载设备挂载至所述目标容器的文件目录下。
  6. 根据权利要求1-5任一项所述的方法,其中,所述将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
    获取所述待挂载设备的文件***类型;
    根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
  7. 根据权利要求6所述的方法,其中,所述根据所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下,包括:
    若所述待挂载设备的文件***类型满足第二预设条件,则根据至少一个候选文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下;
    若所述待挂载设备的文件***类型不满足第二预设条件,则按照所述待挂载设备的文件***类型,将所述待挂载设备挂载至所述目标容器的文件目录下。
  8. 一种云硬盘挂载装置,所述装置包括:
    接收单元,设置为接收设备挂载请求;其中,所述设备挂载请求设置为请求将待挂载设备挂载至目标容器;所述目标容器部署在目标虚拟机中;
    确定单元,设置为根据所述待挂载设备的设备信息,确定所述待挂载设备是否为云硬盘;
    挂载单元,设置为在确定所述待挂载设备为云硬盘时,将所述待挂载设备热插至所述目标虚拟机,并将所述待挂载设备挂载至所述目标容器的文件目录下。
  9. 一种设备,所述设备包括处理器以及存储器:
    所述存储器用于存储计算机程序;
    所述处理器用于根据所述计算机程序执行权利要求1-7中任一项所述的方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,所述计算机程序用于执行权利要求1-7中任一项所述的方法。
PCT/CN2021/128118 2020-11-05 2021-11-02 一种云硬盘挂载方法及其装置 WO2022095844A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011222933.7A CN112328363B (zh) 2020-11-05 2020-11-05 一种云硬盘挂载方法及其装置
CN202011222933.7 2020-11-05

Publications (1)

Publication Number Publication Date
WO2022095844A1 true WO2022095844A1 (zh) 2022-05-12

Family

ID=74315332

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/128118 WO2022095844A1 (zh) 2020-11-05 2021-11-02 一种云硬盘挂载方法及其装置

Country Status (2)

Country Link
CN (1) CN112328363B (zh)
WO (1) WO2022095844A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328363B (zh) * 2020-11-05 2022-12-20 北京金山云网络技术有限公司 一种云硬盘挂载方法及其装置
CN114697331B (zh) * 2022-03-29 2024-06-07 浪潮云信息技术股份公司 一种云盘挂载数量调度方法、***、装置及存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541475A (zh) * 2012-03-12 2012-07-04 成都市华为赛门铁克科技有限公司 数据存储方法和数据存储装置
CN103559029A (zh) * 2013-10-24 2014-02-05 北京奇虎科技有限公司 云盘文件状态显示方法及装置
CN103780417A (zh) * 2012-10-23 2014-05-07 上海盛大网络发展有限公司 一种基于云硬盘的数据库故障转移方法及装置
US20150220561A1 (en) * 2012-10-16 2015-08-06 Rackspace Us, Inc. System and Method for Exposing Cloud Stored Data to a Content Delivery Network
CN107124438A (zh) * 2016-02-25 2017-09-01 杭州海康威视数字技术股份有限公司 一种云存储***中动态接入存储设备的方法及装置
CN107967120A (zh) * 2017-09-26 2018-04-27 国云科技股份有限公司 一种桌面云并发读写云盘内容的方法
CN109542862A (zh) * 2018-11-21 2019-03-29 北京百度网讯科技有限公司 用于控制文件***的挂载的方法、装置和***
CN109951525A (zh) * 2019-02-18 2019-06-28 山东浪潮云信息技术有限公司 一种基于容器的云盘挂载***及方法
CN112328363A (zh) * 2020-11-05 2021-02-05 北京金山云网络技术有限公司 一种云硬盘挂载方法及其装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9813353B1 (en) * 2012-06-07 2017-11-07 Open Invention Network Llc Migration of files contained on virtual storage to a cloud storage infrastructure
CN109254825A (zh) * 2017-07-12 2019-01-22 中兴通讯股份有限公司 一种纳管虚拟机硬盘的方法及装置
CN108549550A (zh) * 2018-04-13 2018-09-18 郑州云海信息技术有限公司 一种硬盘挂载方法及装置
US11775475B2 (en) * 2019-03-05 2023-10-03 Microsoft Technology Licensing, Llc Deferred path resolution during container deployment
CN110795029B (zh) * 2019-10-08 2022-06-17 济南浪潮数据技术有限公司 一种云硬盘管理方法、装置、服务器及介质

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541475A (zh) * 2012-03-12 2012-07-04 成都市华为赛门铁克科技有限公司 数据存储方法和数据存储装置
US20150220561A1 (en) * 2012-10-16 2015-08-06 Rackspace Us, Inc. System and Method for Exposing Cloud Stored Data to a Content Delivery Network
CN103780417A (zh) * 2012-10-23 2014-05-07 上海盛大网络发展有限公司 一种基于云硬盘的数据库故障转移方法及装置
CN103559029A (zh) * 2013-10-24 2014-02-05 北京奇虎科技有限公司 云盘文件状态显示方法及装置
CN107124438A (zh) * 2016-02-25 2017-09-01 杭州海康威视数字技术股份有限公司 一种云存储***中动态接入存储设备的方法及装置
CN107967120A (zh) * 2017-09-26 2018-04-27 国云科技股份有限公司 一种桌面云并发读写云盘内容的方法
CN109542862A (zh) * 2018-11-21 2019-03-29 北京百度网讯科技有限公司 用于控制文件***的挂载的方法、装置和***
CN109951525A (zh) * 2019-02-18 2019-06-28 山东浪潮云信息技术有限公司 一种基于容器的云盘挂载***及方法
CN112328363A (zh) * 2020-11-05 2021-02-05 北京金山云网络技术有限公司 一种云硬盘挂载方法及其装置

Also Published As

Publication number Publication date
CN112328363B (zh) 2022-12-20
CN112328363A (zh) 2021-02-05

Similar Documents

Publication Publication Date Title
US11044230B2 (en) Dynamically opening ports for trusted application processes hosted in containers
US11218445B2 (en) System and method for implementing a web application firewall as a customized service
US20220078092A1 (en) Provisioning a service
US10671285B2 (en) Tier based data file management
WO2022095844A1 (zh) 一种云硬盘挂载方法及其装置
JP2017503421A (ja) ネットワーク機能仮想化nfv障害管理の装置、デバイス、および方法
CN103810444B (zh) 一种云计算平台中多租户应用隔离的方法和***
CN104220987A (zh) 应用安装
CN109788068B (zh) 心跳状态信息上报方法、装置和设备及计算机存储介质
WO2018233630A1 (zh) 故障发现
US10282120B2 (en) Method, apparatus and system for inserting disk
CN113704790A (zh) 一种异常日志信息汇总方法及计算机设备
US11385905B2 (en) Managing boot device orders for computing devices
US9032484B2 (en) Access control in a hybrid environment
KR20150139546A (ko) 탈착가능형 저장 디바이스 아이덴티티 및 구성 정보
US9032179B2 (en) Device for selecting and configuring a default storage section and the corresponding method
WO2018028321A1 (zh) 一种虚拟外置存储设备的管理方法、装置及终端
CN112738181B (zh) 集群外部ip接入的方法、装置及服务器
US20230119782A1 (en) Method and apparatus for allocating ctdb-based virtual ip address, and distributed storage device
CN116166205B (zh) 文件***存储和挂载方法、装置、设备及存储介质
CN117971262A (zh) ***升级方法、装置、电子设备及可读存储介质
CN116185586A (zh) 资源对象调度方法、***、集群及计算机可读介质
CN112799952A (zh) 用于自动测试云平台账户体系权限的方法与设备
CN113765944A (zh) 一种微服务治理方法、装置、设备和存储介质
CN115964118A (zh) Vnf实例生成方法、vnf蓝图生成方法、nfvo及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21888541

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21888541

Country of ref document: EP

Kind code of ref document: A1