CN113504872B - Method, system, equipment and medium for mounting virtual disk on cloud physical machine - Google Patents

Method, system, equipment and medium for mounting virtual disk on cloud physical machine Download PDF

Info

Publication number
CN113504872B
CN113504872B CN202110528300.7A CN202110528300A CN113504872B CN 113504872 B CN113504872 B CN 113504872B CN 202110528300 A CN202110528300 A CN 202110528300A CN 113504872 B CN113504872 B CN 113504872B
Authority
CN
China
Prior art keywords
virtual disk
physical machine
cloud physical
mounting
disk
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110528300.7A
Other languages
Chinese (zh)
Other versions
CN113504872A (en
Inventor
赵程程
张立鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202110528300.7A priority Critical patent/CN113504872B/en
Publication of CN113504872A publication Critical patent/CN113504872A/en
Application granted granted Critical
Publication of CN113504872B publication Critical patent/CN113504872B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method, a system, equipment and a storage medium for mounting a virtual disk on a cloud physical machine, wherein the method comprises the following steps: creating a virtual disk, and setting an identification of a use subject in the virtual disk; responding to a request for mounting a virtual disk, screening the virtual disk using a main body as a cloud physical machine according to the identification, and checking whether the virtual disk is available or not; generating a configuration file according to the address and authentication information of the virtual disk in response to the availability of the virtual disk, and mounting the virtual disk to a cloud physical machine based on the configuration file; and partitioning and formatting the mounted virtual disk to enable the cloud physical machine to use the virtual disk. The virtual disk mounted by the application can directly access the storage back end through the management network, so that the read-write speed is higher in use, the use of a real disk is more met, and the high-performance and high-efficiency read-write requirement of a user is met.

Description

Method, system, equipment and medium for mounting virtual disk on cloud physical machine
Technical Field
The present application relates to the field of cloud computing, and in particular, to a method, a system, a computer device, and a readable medium for mounting a virtual disk on a cloud physical machine.
Background
In recent years, cloud computing business needs develop rapidly, and cloud computing has gradually become a product from one concept into our daily lives. In the actual use process of a user, the user needs full hardware access and a scene of higher machine performance, all resources of server calculation, storage and network can be obtained by using bare computers, the bare computers can be managed into a system by Openstack for convenient unified deployment management, an operating system is installed on the bare computers by deploying cloud physical machines, and unified deployment management on the bare computers is realized. The deployment mode of the existing bare computer cloud is as follows: firstly, bare metal, mirror image, specification and network are selected in a cloud pipe platform to create a cloud physical machine for the bare metal, so that the use and management of the bare metal in the cloud pipe platform are realized.
The existing cloud physical machine can use a hard disk only corresponding to the hard disk information of a bare computer, if a disk is to be newly added, two modes exist, namely, a new hardware disk is added, the mode is troublesome to operate and wastes physical resources, and a virtual disk is mounted, but the read-write efficiency of the disk in the prior art is greatly different from that of a real disk, and in consideration of the original purpose of using the cloud physical machine, the higher requirements on the performance and hardware use of the machine are required, so that a more efficient storage mounting mode is needed, the user can conveniently add and delete the virtual disk, the read-write efficiency of the user can be ensured, and the use of the real disk is more met.
Disclosure of Invention
In view of the above, an object of the embodiments of the present application is to provide a method, a system, a computer device, and a computer readable storage medium for mounting a virtual disk on a cloud physical machine.
Based on the above object, an aspect of the embodiments of the present application provides a method for mounting a virtual disk on a cloud physical machine, including the following steps: creating a virtual disk, and setting an identification of a use subject in the virtual disk; responding to a request for mounting a virtual disk, screening the virtual disk using a main body as a cloud physical machine according to the identification, and checking whether the virtual disk is available or not; generating a configuration file according to the address and authentication information of the virtual disk in response to the availability of the virtual disk, and mounting the virtual disk to a cloud physical machine based on the configuration file; and partitioning and formatting the mounted virtual disk to enable the cloud physical machine to use the virtual disk.
In some embodiments, the checking whether the virtual disk is available comprises: judging whether the sharing attribute of the virtual disk is yes or not; and in response to the shared attribute of the virtual disk not being yes, deeming the virtual disk to be unavailable.
In some embodiments, the checking whether the virtual disk is available comprises: responding to the sharing attribute of the virtual disk is yes, and judging whether a storage pool where the virtual disk exists is communicated with the IP of the cloud physical machine management network; and in response to the IP communication of the storage pool of the virtual disk and the cloud physical machine management network, recognizing that the virtual disk is available.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and adding a mounting virtual disk interface to the cloud physical machine, and inputting a cloud physical machine ID and a virtual disk ID into the mounting virtual disk interface.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and mapping the virtual disk to the cloud physical machine according to the type of the storage pool where the virtual disk is located.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and updating the ID of the virtual disk in the configuration file by using the local disk path, and writing the network card information communicated with the virtual disk into the configuration file.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and establishing a connection relation between the cander and the ironic, and writing the connection relation into a database.
In another aspect of the embodiment of the present application, a system for mounting a virtual disk on a cloud physical machine is provided, including: the creation module is configured to create a virtual disk and set an identification of a use subject in the virtual disk; the checking module is configured to respond to the received request for mounting the virtual disk, screen the virtual disk using the main body as the cloud physical machine according to the identification, and check whether the virtual disk is available or not; the mounting module is configured to respond to the availability of the virtual disk, generate a configuration file according to the address and authentication information of the virtual disk, and mount the virtual disk to a cloud physical machine based on the configuration file; and a processing module configured to partition and format the mounted virtual disk so that the cloud physical machine can use the virtual disk.
In yet another aspect of the embodiment of the present application, there is also provided a computer apparatus, including: at least one processor; and a memory storing computer instructions executable on the processor, which when executed by the processor, perform the steps of the method as above.
In yet another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method steps as described above.
The application has the following beneficial technical effects: the cloud host capable of being mounted can be screened directly according to the identifier by optimizing the created virtual disk interface and adding the bare computer identifier without processing metadata, and in addition, the virtual disk mounted by the method can be directly communicated with the storage rear end, so that the continuous writing operation of the disk is realized, the reading and writing speed is higher, the use of a real disk is more met, and the high-performance and high-efficiency reading and writing requirements of a user are met.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of an embodiment of a method for mounting a virtual disk on a cloud physical machine provided by the present application;
fig. 2 is a schematic hardware structure diagram of an embodiment of a computer device with a virtual disk mounted on a cloud physical machine provided by the present application;
fig. 3 is a schematic diagram of an embodiment of a computer storage medium with a virtual disk mounted on a cloud physical machine according to the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the following embodiments of the present application will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present application, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present application, and the following embodiments are not described one by one.
Based on the above objective, in a first aspect of the embodiments of the present application, an embodiment of a method for mounting a virtual disk on a cloud physical machine is provided. Fig. 1 is a schematic diagram of an embodiment of a method for mounting a virtual disk on a cloud physical machine provided by the application. As shown in fig. 1, the embodiment of the present application includes the following steps:
s1, creating a virtual disk, and setting an identification of a using main body in the virtual disk;
s2, responding to a request for mounting the virtual disk, screening the virtual disk using the main body as a cloud physical machine according to the identification, and checking whether the virtual disk is available or not;
s3, responding to the availability of the virtual disk, generating a configuration file according to the address and authentication information of the virtual disk, and mounting the virtual disk to a cloud physical machine based on the configuration file; and
s4, partitioning and formatting the mounted virtual disk so that the cloud physical machine can use the virtual disk.
In a sense, the virtual machine is completely independent of hardware equipment, so that the virtual disk can be easily mounted and dismounted, but the cloud physical machine is different, and the virtual machine is also required to realize the management of logic by a virtualization technology, but basically has all resources of the current bare metal, the bare metal is in one-to-one relation, the existing virtual disk is mounted in a metadata way, the metadata of the cloud hard disk and the disk are stored together in the metadata way, and when the cloud hard disk performs a read operation or a write operation, certain throughput is occupied, because the write request of an application program can trigger the update of metadata, additional write operation is caused, and in practical application, the service flow is relatively large, and network blocking and pressure are caused to be relatively great, so that the method is inconsistent with the original purpose of using the bare metal by a user.
According to the embodiment of the application, the virtual disk interface is created, bare machine identification is added, ironic and cander modules are opened, and the cloud physical machine mounted disk interface attach_volume_ironic is newly added, so that the cloud physical machine mounts the virtual disk. An Ironic service is a collection of components that provide management and preparation of physical hardware support. The Cinder service is a component in openstack that provides block storage services, and mainly provides virtual disks for virtual machine instances.
The embodiment of the application ensures that the cloud physical machine network and the computer where the storage pool is located can be communicated when the network is constructed. When the cloud physical machine is deployed, a service network and a BMC network are arranged, and the BMC network is communicated with the control node. The cloud physical machine is required to be provided with an independent network card for mounting the virtual disk, the cloud physical machine is enabled to be enabled through an external route and an openstack management network, the networks on two sides can be enabled, and the openstack sends a request to an agent of the bare metal through a service network where the cloud physical machine is located for disk mounting operation.
The purpose of using the service network is to avoid the influence of factors such as network blocking and larger pressure as much as possible, and each group of management networks has special purposes in the actual use process and can be configured with corresponding security access rights. Compared with a service network, the service flow of the management network is smaller, the storage back end can be directly accessed through the management network, and in use, the read-write speed is higher, so that the management network is more suitable for the use of a real magnetic disk.
Creating a virtual disk, and setting an identification of a use subject in the virtual disk.
Irnoic makes a request to create and mount a virtual disk, requesting the user to create a virtual disk. And calling a client-api service, transmitting a message queue to the client-schedule after the client-api receives the request, and creating a virtual disk according to the acquired scheduling information, namely selecting an optimal node according to the environment of the system to create the virtual disk. For the extension of the original creation virtual disk interface, a default parameter is added on the basis of the original creation interface (URI format POST/v 1/volumes): { is_ironic (bol defaults to False) }. When is_ironic is False, the virtual disk is used for the virtual machine, and when is_ironic is True, the virtual disk is used for the cloud physical machine. The is_ironic Is used for distinguishing whether the virtual disk Is used for a cloud physical machine or a virtual machine, so that when the virtual disk Is mounted, the virtual disk which can be mounted can be screened directly according to the identifier, special processing such as metadata updating Is not needed, and interaction with other modules Is reduced.
After the virtual disk is created, os-bridge is called, the storage pool corresponding to the virtual disk is connected to the hypervisor, the connector information of the volume is empty at this time, and then the storage pool and the volume_id of the virtual disk are updated. The volume here is a virtual disk.
The code may be as follows:
Body:
{
volume_stor_id:volume_stor_id
Volume_id:volume_id
}
and responding to the received request for mounting the virtual disk, screening the virtual disk using the main body as the cloud physical machine according to the identification, and checking whether the virtual disk is available or not. The check-volume interface may be invoked by the ironic-api to check whether the virtual disk is available.
In some embodiments, the checking whether the virtual disk is available comprises: judging whether the sharing attribute of the virtual disk is yes or not; and in response to the shared attribute of the virtual disk not being yes, deeming the virtual disk to be unavailable. Firstly, checking whether the is_ironic shared attribute of the virtual disk is yes, if the shared attribute is no, not allowing the plurality of cloud physical machines to be mounted, and if the shared attribute is yes, allowing the plurality of cloud physical machines to be mounted.
In some embodiments, the checking whether the virtual disk is available comprises: responding to the sharing attribute of the virtual disk is yes, and judging whether a storage pool where the virtual disk exists is communicated with the IP of the cloud physical machine management network; and in response to the IP communication of the storage pool of the virtual disk and the cloud physical machine management network, recognizing that the virtual disk is available. If the virtual disk is available, calling a client-api, locking the virtual disk, preventing other users from using the virtual disk, and setting the state of the virtual disk as an attach (in-connection).
And generating a configuration file according to the address and authentication information of the virtual disk in response to the availability of the virtual disk, and mounting the virtual disk to a cloud physical machine based on the configuration file. The Ironic-conductor calls a client module to call a back-end storage pool through an os-bridge, obtains information such as an address, authentication information and the like of a virtual disk, generates a mounted xml configuration file, and then calls an attach_volume_ironic interface to mount the virtual disk to a cloud physical machine.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and adding a mounting virtual disk interface to the cloud physical machine, and inputting a cloud physical machine ID and a virtual disk ID into the mounting virtual disk interface. The cloud physical machine newly adds a virtual disk mounting interface to mount the virtual disk, and two interfaces are added with the essential entry: cloud physical machine id and virtual disk id. The code may be as follows:
attach_volume_ironic POST/v1/instances/{instance_id}
request body:{
"Volumeid": "volume_id", (string, cloud physical machine mounted virtual disk id)
"ProjectId": "project_id" (string, optional, project id where cloud physical machine is located)
}
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and mapping the virtual disk to the cloud physical machine according to the type of the storage pool where the virtual disk is located. The connector information of os-bridge can be called, and the virtual disk is mapped to the cloud physical machine according to the type of the storage pool where the virtual disk is located.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and updating the ID of the virtual disk in the configuration file by using the local disk path, and writing the network card information communicated with the virtual disk into the configuration file. Updating the path of the local disk block_volume_device to an xml configuration file, wherein the updating content comprises two parts: the method comprises the steps that firstly, information of a mounted virtual disk is updated to uuid (Universally Unique Identifier, universal unique identifier) of a block_volume_device by volume_id information of a connector, so that ironic can directly acquire the information of the disk without a client, and subsequent unloading of the disk is facilitated; the second network card information communicated with the virtual disk, namely the management network information, and the disk mounted in the mode can be directly communicated with the storage rear end, so that the read-write operation of the disk is realized.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and establishing a connection relation between the cander and the ironic, and writing the connection relation into a database. The connection information is obtained from the xml configuration file, and the disk can be mounted in the cloud physical machine by calling an attach_ir_volume through a new driver. And (3) initiating a mounting request to the cander-api, modifying the state of the virtual disk into in-use (in use), establishing a connection relationship between the cander and the ironic, and writing the association relationship into a database.
Partitioning and formatting the mounted virtual disk to enable the cloud physical machine to use the virtual disk. After the mounting is completed, the virtual disk can be seen by the cloud physical machine, and the virtual disk can be partitioned, formatted and the like, so that the virtual disk can be normally used.
The process of mounting the virtual disk on the cloud physical machine in the embodiment of the application can be as follows:
calling an ironic-api through a nova-api, and calling a check_ volume, cinder-api and an ironic-conductor through the ironic-api respectively; the check_volume is used for judging whether the virtual disk is available or not, namely, firstly screening the virtual disk for the cloud physical machine through the identification, then judging whether the sharing attribute of the virtual disk is yes, judging whether the storage pool of the virtual disk is communicated with the IP of the cloud physical machine management network or not, and if yes, calling a client-api to set the virtual disk as an attaching; on the other hand, the ironic-conductor calls the cander-conductor to produce an xml configuration file, calls an attach_volume_ironic mount virtual disk, and calls the cander-api to update the state of the virtual disk.
According to the embodiment of the application, the virtual disk interface is created, the bare metal identification is added, whether the disk can be applied to the cloud physical machine or not can be directly distinguished, and interaction with other modules is reduced; the service network is communicated with the openstack network, then an ironic and a cander module are communicated through a newly added driver, and a mounting interface, namely a mounting interface, is called to realize mounting of the cloud physical machine on the virtual disk, so that the operation is simple; the storage back end can be directly accessed through the management network, so that in use, the read-write speed is higher, the use of a real magnetic disk is more met, and the high-performance and high-efficiency read-write requirement of a user is met.
It should be noted that, in the embodiments of the method for mounting virtual disk on cloud physical machine, the steps may be intersected, replaced, added and deleted, so that the method for mounting virtual disk on cloud physical machine by using these reasonable permutation and combination transformation should also belong to the protection scope of the present application, and the protection scope of the present application should not be limited to the embodiments.
Based on the above object, a second aspect of the embodiments of the present application provides a system for mounting a virtual disk on a cloud physical machine, including: the creation module is configured to create a virtual disk and set an identification of a use subject in the virtual disk; the checking module is configured to respond to the received request for mounting the virtual disk, screen the virtual disk using the main body as the cloud physical machine according to the identification, and check whether the virtual disk is available or not; the mounting module is configured to respond to the availability of the virtual disk, generate a configuration file according to the address and authentication information of the virtual disk, and mount the virtual disk to a cloud physical machine based on the configuration file; and a processing module configured to partition and format the mounted virtual disk so that the cloud physical machine can use the virtual disk.
In some embodiments, the inspection module is configured to: judging whether the sharing attribute of the virtual disk is yes or not; and in response to the shared attribute of the virtual disk not being yes, deeming the virtual disk to be unavailable.
In some embodiments, the inspection module is configured to: responding to the sharing attribute of the virtual disk is yes, and judging whether a storage pool where the virtual disk exists is communicated with the IP of the cloud physical machine management network; and in response to the IP communication of the storage pool of the virtual disk and the cloud physical machine management network, recognizing that the virtual disk is available.
In some embodiments, the mounting module is configured to: and adding a mounting virtual disk interface to the cloud physical machine, and inputting a cloud physical machine ID and a virtual disk ID into the mounting virtual disk interface.
In some embodiments, the mounting module is configured to: and mapping the virtual disk to the cloud physical machine according to the type of the storage pool where the virtual disk is located.
In some embodiments, the mounting module is configured to: and updating the ID of the virtual disk in the configuration file by using the local disk path, and writing the network card information communicated with the virtual disk into the configuration file.
In some embodiments, the mounting module is configured to: and establishing a connection relation between the cander and the ironic, and writing the connection relation into a database.
According to the embodiment of the application, the virtual disk interface is created, the bare metal identification is added, whether the disk can be applied to the cloud physical machine or not can be directly distinguished, and interaction with other modules is reduced; the service network is communicated with the openstack network, then an ironic and a cander module are communicated through a newly added driver, and a mounting interface, namely a mounting interface, is called to realize mounting of the cloud physical machine on the virtual disk, so that the operation is simple; the storage back end can be directly accessed through the management network, so that in use, the read-write speed is higher, the use of a real magnetic disk is more met, and the high-performance and high-efficiency read-write requirement of a user is met.
In view of the above object, a third aspect of the embodiments of the present application provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, creating a virtual disk, and setting an identification of a using main body in the virtual disk; s2, responding to a request for mounting the virtual disk, screening the virtual disk using the main body as a cloud physical machine according to the identification, and checking whether the virtual disk is available or not; s3, responding to the availability of the virtual disk, generating a configuration file according to the address and authentication information of the virtual disk, and mounting the virtual disk to a cloud physical machine based on the configuration file; and S4, partitioning and formatting the mounted virtual disk so that the cloud physical machine can use the virtual disk.
In some embodiments, the checking whether the virtual disk is available comprises: judging whether the sharing attribute of the virtual disk is yes or not; and in response to the shared attribute of the virtual disk not being yes, deeming the virtual disk to be unavailable.
In some embodiments, the checking whether the virtual disk is available comprises: responding to the sharing attribute of the virtual disk is yes, and judging whether a storage pool where the virtual disk exists is communicated with the IP of the cloud physical machine management network; and in response to the IP communication of the storage pool of the virtual disk and the cloud physical machine management network, recognizing that the virtual disk is available.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and adding a mounting virtual disk interface to the cloud physical machine, and inputting a cloud physical machine ID and a virtual disk ID into the mounting virtual disk interface.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and mapping the virtual disk to the cloud physical machine according to the type of the storage pool where the virtual disk is located.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and updating the ID of the virtual disk in the configuration file by using the local disk path, and writing the network card information communicated with the virtual disk into the configuration file.
In some embodiments, the mounting the virtual disk to a cloud physical machine based on the configuration file includes: and establishing a connection relation between the cander and the ironic, and writing the connection relation into a database.
Fig. 2 is a schematic hardware structure of an embodiment of the cloud physical machine-mounted virtual disk computer device according to the present application.
Taking the example of the apparatus shown in fig. 2, the apparatus includes a processor 201 and a memory 202, and may further include: an input device 203 and an output device 204.
The processor 201, memory 202, input devices 203, and output devices 204 may be connected by a bus or other means, for example in fig. 2.
The memory 202 is used as a non-volatile computer readable storage medium, and can be used to store non-volatile software programs, non-volatile computer executable programs, and modules, such as program instructions/modules corresponding to the method for mounting a virtual disk on a cloud physical machine in an embodiment of the present application. The processor 201 executes various functional applications and data processing of the server by running nonvolatile software programs, instructions and modules stored in the memory 202, that is, a method for implementing the cloud physical machine mounting virtual disk of the above method embodiment.
Memory 202 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of a method of mounting a virtual disk by a cloud physical machine, or the like. In addition, memory 202 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 202 may optionally include memory located remotely from processor 201, which may be connected to the local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 203 may receive input information such as a user name and a password. The output device 204 may include a display device such as a display screen.
Program instructions/modules corresponding to one or more methods for mounting virtual disks on a cloud physical machine are stored in the memory 202, and when executed by the processor 201, perform the method for mounting virtual disks on a cloud physical machine in any of the above method embodiments.
Any embodiment of the computer device executing the method for mounting the virtual disk on the cloud physical machine can achieve the same or similar effect as any corresponding embodiment of the method.
The application also provides a computer readable storage medium storing a computer program which when executed by a processor performs the method as above.
Fig. 3 is a schematic diagram of an embodiment of a computer storage medium with a virtual disk mounted on a cloud physical machine according to the present application. Taking a computer storage medium as shown in fig. 3 as an example, the computer readable storage medium 3 stores a computer program 31 that, when executed by a processor, performs the method as described above.
Finally, it should be noted that, as will be understood by those skilled in the art, implementing all or part of the above-mentioned embodiments of the method may be implemented by a computer program to instruct related hardware, and the program of the method for mounting a virtual disk on a cloud physical machine may be stored in a computer readable storage medium, where the program may include the steps of the embodiments of the above-mentioned methods when executed. The storage medium of the program may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (RAM), or the like. The computer program embodiments described above may achieve the same or similar effects as any of the method embodiments described above.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The foregoing embodiment of the present application has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the application, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the application, and many other variations of the different aspects of the embodiments of the application as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present application.

Claims (10)

1. The method for mounting the virtual disk on the cloud physical machine is characterized by comprising the following steps of:
creating a virtual disk, and setting an identification of a use subject in the virtual disk;
responding to a request for mounting a virtual disk, screening the virtual disk using a main body as a cloud physical machine according to the identification, and checking whether the virtual disk is available or not;
generating a configuration file according to the address and authentication information of the virtual disk in response to the availability of the virtual disk, and mounting the virtual disk to a cloud physical machine based on the configuration file; and
partitioning and formatting the mounted virtual disk to enable the cloud physical machine to use the virtual disk.
2. The method of claim 1, wherein the checking whether the virtual disk is available comprises:
judging whether the sharing attribute of the virtual disk is yes or not; and
and in response to the shared attribute of the virtual disk being not yes, identifying that the virtual disk is not available.
3. The method of claim 2, wherein the checking whether the virtual disk is available comprises:
responding to the sharing attribute of the virtual disk is yes, and judging whether a storage pool where the virtual disk exists is communicated with the IP of the cloud physical machine management network; and
and responding to the IP communication of the storage pool of the virtual disk and the cloud physical machine management network, and recognizing that the virtual disk is available.
4. The method of claim 1, wherein the mounting the virtual disk to a cloud physical machine based on the configuration file comprises:
and adding a mounting virtual disk interface to the cloud physical machine, and inputting a cloud physical machine ID and a virtual disk ID into the mounting virtual disk interface.
5. The method of claim 1, wherein the mounting the virtual disk to a cloud physical machine based on the configuration file comprises:
and mapping the virtual disk to the cloud physical machine according to the type of the storage pool where the virtual disk is located.
6. The method of claim 1, wherein the mounting the virtual disk to a cloud physical machine based on the configuration file comprises:
and updating the ID of the virtual disk in the configuration file by using the local disk path, and writing the network card information communicated with the virtual disk into the configuration file.
7. The method of claim 1, wherein the mounting the virtual disk to a cloud physical machine based on the configuration file comprises:
and establishing a connection relation between the cander and the ironic, and writing the connection relation into a database.
8. A system for mounting a virtual disk on a cloud physical machine, comprising:
the creation module is configured to create a virtual disk and set an identification of a use subject in the virtual disk;
the checking module is configured to respond to the received request for mounting the virtual disk, screen the virtual disk using the main body as the cloud physical machine according to the identification, and check whether the virtual disk is available or not;
the mounting module is configured to respond to the availability of the virtual disk, generate a configuration file according to the address and authentication information of the virtual disk, and mount the virtual disk to a cloud physical machine based on the configuration file; and
and the processing module is configured to partition and format the mounted virtual disk so that the cloud physical machine can use the virtual disk.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, which when executed by the processor, perform the steps of the method of any one of claims 1-7.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method of any one of claims 1-7.
CN202110528300.7A 2021-05-14 2021-05-14 Method, system, equipment and medium for mounting virtual disk on cloud physical machine Active CN113504872B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110528300.7A CN113504872B (en) 2021-05-14 2021-05-14 Method, system, equipment and medium for mounting virtual disk on cloud physical machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110528300.7A CN113504872B (en) 2021-05-14 2021-05-14 Method, system, equipment and medium for mounting virtual disk on cloud physical machine

Publications (2)

Publication Number Publication Date
CN113504872A CN113504872A (en) 2021-10-15
CN113504872B true CN113504872B (en) 2023-11-03

Family

ID=78008498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110528300.7A Active CN113504872B (en) 2021-05-14 2021-05-14 Method, system, equipment and medium for mounting virtual disk on cloud physical machine

Country Status (1)

Country Link
CN (1) CN113504872B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11816363B2 (en) 2021-11-04 2023-11-14 International Business Machines Corporation File based virtual disk management

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289513A (en) * 2011-09-05 2011-12-21 盛乐信息技术(上海)有限公司 Method and system for obtaining internal files of virtual machine
CN104331375A (en) * 2014-10-29 2015-02-04 中国建设银行股份有限公司 Shared virtualized resource management method and shared virtualized resource management device under shared virtualized resource pool environment
CN104461698A (en) * 2014-12-29 2015-03-25 成都致云科技有限公司 Dynamic virtual disk mounting method, virtual disk management device and distributed storage system
CN106503587A (en) * 2016-11-28 2017-03-15 航天恒星科技有限公司 A kind of hanging method of data disks and monitor of virtual machine
WO2017148382A1 (en) * 2016-03-03 2017-09-08 北京书生国际信息技术有限公司 Method and apparatus for accessing storage device by virtual machine in cloud computing management platform
CN107193491A (en) * 2017-05-17 2017-09-22 郑州云海信息技术有限公司 A kind of virtual environment disk operating method and apparatus
CN107291525A (en) * 2016-04-01 2017-10-24 华为技术有限公司 A kind of method, host and system for disposing virtual machine
CN109032753A (en) * 2018-06-20 2018-12-18 上海市信息网络有限公司 A kind of isomery virtual hard disk trustship method, system, storage medium and Nova platform
CN110058813A (en) * 2019-03-15 2019-07-26 启迪云计算有限公司 It is a kind of that management method is locally stored based on the storage of cloud platform block
CN110308972A (en) * 2019-07-05 2019-10-08 北京百度网讯科技有限公司 Method and apparatus for managing container mirror image
CN110677441A (en) * 2018-07-02 2020-01-10 中国移动通信集团有限公司 Access method and device of object storage cluster
WO2021012785A1 (en) * 2019-07-22 2021-01-28 平安科技(深圳)有限公司 Cloud disk mounting method and apparatus based on cloud storage, device, and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9767274B2 (en) * 2011-11-22 2017-09-19 Bromium, Inc. Approaches for efficient physical to virtual disk conversion
US10740133B2 (en) * 2018-01-30 2020-08-11 Nutanix, Inc. Automated data migration of services of a virtual machine to containers

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289513A (en) * 2011-09-05 2011-12-21 盛乐信息技术(上海)有限公司 Method and system for obtaining internal files of virtual machine
CN104331375A (en) * 2014-10-29 2015-02-04 中国建设银行股份有限公司 Shared virtualized resource management method and shared virtualized resource management device under shared virtualized resource pool environment
CN104461698A (en) * 2014-12-29 2015-03-25 成都致云科技有限公司 Dynamic virtual disk mounting method, virtual disk management device and distributed storage system
WO2017148382A1 (en) * 2016-03-03 2017-09-08 北京书生国际信息技术有限公司 Method and apparatus for accessing storage device by virtual machine in cloud computing management platform
CN107291525A (en) * 2016-04-01 2017-10-24 华为技术有限公司 A kind of method, host and system for disposing virtual machine
CN106503587A (en) * 2016-11-28 2017-03-15 航天恒星科技有限公司 A kind of hanging method of data disks and monitor of virtual machine
CN107193491A (en) * 2017-05-17 2017-09-22 郑州云海信息技术有限公司 A kind of virtual environment disk operating method and apparatus
CN109032753A (en) * 2018-06-20 2018-12-18 上海市信息网络有限公司 A kind of isomery virtual hard disk trustship method, system, storage medium and Nova platform
CN110677441A (en) * 2018-07-02 2020-01-10 中国移动通信集团有限公司 Access method and device of object storage cluster
CN110058813A (en) * 2019-03-15 2019-07-26 启迪云计算有限公司 It is a kind of that management method is locally stored based on the storage of cloud platform block
CN110308972A (en) * 2019-07-05 2019-10-08 北京百度网讯科技有限公司 Method and apparatus for managing container mirror image
WO2021012785A1 (en) * 2019-07-22 2021-01-28 平安科技(深圳)有限公司 Cloud disk mounting method and apparatus based on cloud storage, device, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
虚拟机使用主机物理硬盘;李占国;王春海;;网络安全和信息化(05);65-66 *

Also Published As

Publication number Publication date
CN113504872A (en) 2021-10-15

Similar Documents

Publication Publication Date Title
US10637796B2 (en) Linking instances within a cloud computing environment
CN111314141B (en) Route updating method and device
CN112118565A (en) Multi-tenant service gray level publishing method and device, computer equipment and storage medium
KR20190082926A (en) Messaging Protocol Communication Management
US20110314466A1 (en) Creating instances of cloud computing environments
US20150186129A1 (en) Method and system for deploying a program module
US20120096043A1 (en) Data graph cloud system and method
CN105247508A (en) Distributed network management using a logical multi-dimensional label-based policy model
US10594800B2 (en) Platform runtime abstraction
CN112925647A (en) Cloud edge coordination system, and control method and device of cluster resources
CN113301116A (en) Cross-network communication method, device, system and equipment for microservice application
WO2021258951A1 (en) Method and apparatus for generating mirror image file, and computer-readable storage medium
CN114586011A (en) Insertion of owner-specified data processing pipelines into input/output paths of object storage services
CN114281263B (en) Storage resource processing method, system and equipment of container cluster management system
CN105095103A (en) Storage device management method and device used for cloud environment
CN111258627A (en) Interface document generation method and device
US11159607B2 (en) Management for a load balancer cluster
JP2021515299A (en) A system for chronological out-of-place updates, a method for chronological out-of-place updates, and a computer program for chronological out-of-place updates.
CN113504872B (en) Method, system, equipment and medium for mounting virtual disk on cloud physical machine
US9350738B2 (en) Template representation of security resources
US20180046393A1 (en) Dynamic compression for runtime services
CN115774742A (en) Data storage newly-increased method, device, equipment, medium and product of private cloud
CN103067365A (en) Set top box, client-side, system and method for virtual desktop access
CN113691575A (en) Communication method, device and system
CN114911421B (en) Data storage method, system, device and storage medium based on CSI plug-in

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant