Virtual machine data storage method, device, equipment and readable storage medium
By acquiring node storage capacity in cloud computing scenarios and flexibly allocating storage resources based on interface parameter information, the problem that traditional local disk storage solutions cannot meet the performance requirements of high throughput and low latency services is solved, and efficient and flexible storage of virtual machine data is achieved.
Patent Information
- Application Number
- CN202110005400.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-05
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-01-05
AI Technical Summary
Traditional local disk storage solutions cannot flexibly schedule storage resources when creating virtual machines, and cannot meet the performance needs of high throughput and low latency services.
By obtaining the storage capacity of the node, creating a virtual machine in a node whose storage capacity meets the preset requirements, and storing the data generated by the virtual machine in the corresponding block devices and partitions based on the newly set parameter information in the interface parameters. The new parameter information includes partition information and block devices that can be stored, and supports automatic creation of partitions to meet the storage needs of virtual machines.
It realizes flexible allocation and storage of virtual machines on local disks, improves storage efficiency, meets the performance requirements of high throughput and low latency services, and increases the storage flexibility of virtual machine data.
Smart Images

Figure CN114721766B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a virtual machine data storage method, device, equipment and readable storage medium. Background Art
[0002] In cloud computing scenarios, external storage is usually used to provide cloud storage services. Distributed storage and disk arrays are network-based storage and cannot meet the performance requirements of high-throughput, low-latency services. External storage also requires additional rack space. Therefore, for services with high throughput, low latency, and no migration requirements, the server local hard disk can be used as a storage method.
[0003] However, the traditional local disk storage solution usually specifies the root disk, swap disk, and ephemeral disk in the virtual machine hardware template flavor before creating the virtual machine. In this way, the flavor can only specify three disks, and storage resources cannot be flexibly scheduled. Summary of the invention
[0004] The embodiments of the present invention provide a virtual machine data storage method, device, equipment and readable storage medium, which enable the virtual machine to be flexibly allocated and stored on a local disk, thereby improving storage efficiency.
[0005] In a first aspect, an embodiment of the present invention provides a virtual machine data storage method, comprising:
[0006] By obtaining the storage capacity of the node, a virtual machine is created on the node whose storage capacity meets the preset requirements;
[0007] According to the newly added parameter information pre-set in the interface parameters, the data generated by the virtual machine is stored in the corresponding block device and partition, wherein the newly added parameter information includes the partition information and the block device information available for storage.
[0008] In addition, in a virtual machine data storage method provided by this embodiment, the newly added parameter information also includes business parameters, wherein the business parameters are preset requirements of the virtual machine.
[0009] In addition, this embodiment provides a virtual machine data storage method, which creates a virtual machine at a node whose storage capacity meets preset requirements based on the acquired storage capacity of the node, including: obtaining the storage capacity of all nodes that can create the virtual machine; sorting the nodes according to the values of the storage capacity; and using the node with the largest storage capacity value as the node for creating the virtual machine.
[0010] In addition, the present embodiment provides a method for storing virtual machine data, which, after obtaining the storage capacity of all nodes that can create the virtual machine, further includes: when the storage capacity exceeds a preset threshold, determining that the storage capacity of the node meets preset requirements; and according to the creation requirements of the virtual machine, selecting a node that meets the creation requirements from the nodes whose storage capacity meets the preset requirements as a node for creating the virtual machine.
[0011] In addition, the present embodiment provides a method for storing virtual machine data, which stores the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information pre-set in the interface parameters, and also includes: automatically creating partitions according to the information that the partitions exist in the newly added parameter information.
[0012] In addition, this embodiment provides a virtual machine data storage method, which stores the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information pre-set in the interface parameters, including: determining the fast device for storing data according to the capacity parameters of the virtual machine and the storage capacity of the block device in the node; creating partitions for the block device; and selecting the partition for the virtual machine to store data according to the storage requirements of the virtual machine.
[0013] In a second aspect, an embodiment of the present invention further provides a virtual machine data storage device, comprising:
[0014] A creation module, used to create a virtual machine at a node whose storage capacity meets preset requirements according to the acquired storage capacity of the node;
[0015] The configuration module is used to store the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information pre-set in the interface parameters, wherein the newly added parameter information includes the partition information and the block device information available for storage.
[0016] In addition, the creation module also includes:
[0017] A receiving submodule, used for obtaining the storage capacity of all nodes that can create the virtual machine;
[0018] The sorting submodule is used to sort the nodes according to the storage capacity values; and use the node with the largest storage capacity value as the node for creating the virtual machine.
[0019] The receiving submodule also includes:
[0020] A first judgment submodule, used to determine whether the storage capacity of the node meets a preset requirement when the storage capacity exceeds a preset threshold;
[0021] The selection submodule is used to select a node that meets the creation requirement from among the nodes whose storage capacity meets the preset requirement according to the creation requirement of the virtual machine as a node for creating the virtual machine.
[0022] In addition, the configuration module also includes:
[0023] A judging submodule, used for judging whether the information of the partition exists in the interface parameters;
[0024] The partition submodule is used to automatically create a partition according to the partition information if it exists.
[0025] In addition, the configuration module also includes:
[0026] A second determination submodule, configured to determine the fast device for storing data according to the capacity parameter of the virtual machine and the storage capacity of the block device in the node;
[0027] A partition submodule, used to create partitions for the block device;
[0028] The selection submodule is used to select the partition for the virtual machine to store data according to the storage requirement of the virtual machine.
[0029] In a third aspect, an embodiment of the present invention further provides a terminal device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the virtual machine data storage method as described above are implemented.
[0030] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the steps in the virtual machine data storage method as described above are implemented.
[0031] In a fifth aspect, an embodiment of the present invention further provides a virtual machine data storage device, including: a processor and a memory;
[0032] The processor is used to create a virtual machine at a node whose storage capacity meets a preset requirement according to the acquired storage capacity of the node;
[0033] The memory is used to store the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information pre-set in the interface parameters, wherein the newly added parameter information includes the partition information and the block device information available for storage.
[0034] The newly added parameter information also includes business parameters, wherein the business parameters are used to meet preset requirements of the virtual machine.
[0035] The processor is used to obtain the storage capacity of all nodes that can create the virtual machine;
[0036] Sort the nodes according to the values of the storage capacity;
[0037] The node with the largest storage capacity value is used as the node for creating the virtual machine.
[0038] Wherein, the processor is used to determine that the storage capacity of the node meets a preset requirement when the storage capacity exceeds a preset threshold;
[0039] According to the creation requirement of the virtual machine, a node that meets the creation requirement is selected from the nodes whose storage capacity meets the preset requirement as the node for creating the virtual machine.
[0040] The processor is used to determine whether the partition information exists in the interface parameters;
[0041] If it exists, the partition is automatically created according to the partition information.
[0042] The processor is used to determine the block device for storing data according to the capacity parameter of the virtual machine and the storage capacity of the block device in the node;
[0043] Creating a partition for the block device;
[0044] According to the storage requirement of the virtual machine, the partition is selected for the virtual machine to store data.
[0045] The preset requirement includes whether the system can be migrated and evacuated to other hosts.
[0046] In an embodiment of the present invention, according to the different storage capacities of different nodes, a virtual machine is created at a node whose storage capacity meets preset requirements, so that the virtual machine has a larger or more suitable memory space for processing and storing data; by adding parameters for class enumeration for demarcating partitions and block devices to the parameters, the virtual machine can map multiple block devices and corresponding partition areas, thereby increasing the storage flexibility of the virtual machine data, and can be stored in different block devices and different partitions according to different needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is one of the flow charts of the virtual machine data storage method provided by an embodiment of the present invention;
[0048] Figure 2 This is the second flowchart of the virtual machine data storage method provided by the embodiment of the present invention;
[0049] Figure 3is a structural diagram of a virtual machine data storage device provided by an embodiment of the present invention;
[0050] Figure 4 is a structural diagram of a creation module of a virtual machine data storage device provided in an embodiment of the present invention;
[0051] Figure 5 is a structural diagram of a configuration module of a virtual machine data storage device provided by an embodiment of the present invention;
[0052] Figure 6 is a structural diagram of a communication device provided by an embodiment of the present invention;
[0053] Figure 7 It is a structural diagram of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0055] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] See also Figure 1 , Figure 1 is a flow chart of a virtual machine data storage method provided by an embodiment of the present invention, such as Figure 1 As shown, the following steps are included:
[0058] Step 101: Create a virtual machine at a node whose storage capacity meets a preset requirement according to the acquired storage capacity of the node.
[0059] In this embodiment, the virtual layer includes a virtualized infrastructure management layer (VIM) and a virtual machine monitor (Hypervisor). The VIM is used to schedule nodes for creating virtual machines. To improve the scheduling capability of the VIM, the storage capacity of each node is obtained, and a suitable node is selected to create a virtual machine according to the storage capacity. The preset requirement may be, for example, that the storage capacity is greater than a preset value, which may be set as required.
[0060] Specifically, the selection methods include at least the following two:
[0061] First, the storage capacity values of each node are sorted and compared, and the node with the largest storage capacity is used as the node for creating the virtual machine;
[0062] Second, a minimum threshold is pre-set, and when the storage capacity value is greater than the minimum threshold, the node is determined to be a node whose storage capacity meets the preset requirement;
[0063] According to the creation requirement, a node that meets the creation requirement is selected from nodes whose storage capacity meets the preset requirement as a node for creating a virtual machine. The creation requirement may be a special capacity requirement, such as selecting a node whose storage capacity is within a certain range or a certain value as a node for creating a virtual machine.
[0064] It should be noted that the storage capacity of a node refers to the storage capacity of a block device in the node, and the block device includes but is not limited to a disk.
[0065] Step 102: store the data generated by the virtual machine in corresponding block devices and partitions according to the newly added parameter information pre-set in the interface parameters, wherein the newly added parameter information includes partition information and information of block devices available for storage.
[0066] Hypervisor is software, firmware or hardware used to build and execute virtual machines. Add partition information and available storage block device information to the parameters of the POST / servers interface. According to the storage requirements of the virtual machine, select the appropriate block device in the block device category to store the data generated by the virtual machine. The number of block device categories is greater than 1, that is, the block device category is an enumeration of all available storage block devices, so that the virtual machine can have multiple block device mappings. When there is partition information in the interface parameters, the selected block device is automatically partitioned into different areas.
[0067] At the same time, you can add business parameters to the interface parameters. Business is the preset requirement of the virtual machine. The preset requirement can include whether the virtual machine can be migrated to other hosts. If it cannot be migrated, set this business parameter to avoid erroneous operation.
[0068] The virtual machine data storage method of the embodiment of the present invention creates a virtual machine at a node whose storage capacity meets preset requirements according to the different storage capacities of different nodes, so that the virtual machine has a larger or more suitable memory space for processing and storing data; by adding parameters for class enumeration for demarcating partitions and block devices in the parameters, the virtual machine can map multiple block devices and corresponding partition areas, increase the storage flexibility of the virtual machine data, and can store it in different block devices and different partitions according to different requirements. At the same time, business parameters are set to limit the preset requirements of the virtual machine, making the creation and use of the virtual machine more convenient.
[0069] See also Figure 2 , Figure 2 An embodiment of the present invention provides a method for storing virtual machine data.
[0070] Step 201: Create a virtual machine on a node with sufficient capacity.
[0071] The implementation method of this step can refer to the description in step 101, and will not be repeated here to avoid repetition.
[0072] Step 202: Select appropriate block devices and partitions according to the storage requirements of the virtual machine and the storage capacity of the block devices in the node to store the data generated by the virtual machine.
[0073] Take the following code as an example:
[0074] "block_device_mapping_v2":[{
[0075] "guest_format":"disk",
[0076] "uuid":"ac408821-c95a-448f-9292-73986c790911 (automatically obtain the image from VIM)",
[0077] "boot_index":"0",
[0078] "source_type":"image",
[0079] "volume_size":"25",
[0080] "destination_type":"local",
[0081] "delete_on_termination":true,
[0082] "tag":"disk1",
[0083] "disk_bus":"scsi"},
[0084] {
[0085] "guest_format":"disk",
[0086] "boot_index":"1",
[0087] "source_type":"blank",
[0088] "volume_size":"25",
[0089] "destination_type":"local",
[0090] "delete_on_termination":true,
[0091] "tag":"disk1",
[0092] "disk_bus":"scsi"}]
[0093] Add disk to the guest_format parameter under the server.block_device_mapping_v2 interface;
[0094] The code and parameters are valid when source_type is image (creating a volume from an image) or blank (creating a new volume) and destination_type is local.
[0095] boot_index=0 indicates the root disk of the virtual machine, and boot_index=1 indicates the data disk of the virtual machine.
[0096] Select a suitable disk according to the size of volume_size (25 in this embodiment) and the storage capacity of each block device.
[0097] In addition, the parameter partition is set in guest_format to represent the partition information. That is, when guest_format is partition, the block device is automatically partitioned and the appropriate partition is selected for the virtual machine.
[0098] At the same time, the server.is_static parameter can be added in the POST / servers interface to represent a new business parameter. Different values of server.is_static are set to represent different business requirements. For example, server.is_static=1 means that the virtual machine can be migrated; server.is_static=0 means that the virtual machine cannot be migrated.
[0099] It should be noted that the guest_format parameter is used to indicate to the core network (MANO) how / whether to format the device before connection.
[0100] The disk enumeration value of guest_format (storable block device category) can be ext2 ext3 ext4 xfsswap;
[0101] The values of source_type are: image, volume, snapshot, blank;
[0102] The values of destination_type are: local and volume.
[0103] In this embodiment, the capacity of the computing server is obtained, and a node is selected based on the adequacy of the computing server capacity to install the virtual machine. When installing the virtual machine, the virtual machine is configured based on the enhanced POST / server guest_format and server.is_static parameters in this patent to determine whether the virtual machine can be migrated or evacuated, the number of block devices mapped to the virtual machine, and the local hard disk or partition, thereby completing the local deployment of the business virtual machine, that is, storing the data of the virtual machine locally according to the deployment situation.
[0104] This embodiment can also be applied to Figure 1 The same beneficial effects are achieved in the corresponding embodiments.
[0105] The embodiment of the present invention also provides a virtual machine data storage terminal. Figure 3 , Figure 3 The structure diagram of the virtual machine data storage terminal provided by the embodiment of the present invention is as follows. Since the principle of the terminal to solve the problem is similar to the method for storing virtual machine data in the embodiment of the present invention, the implementation of the virtual machine data storage terminal can refer to the implementation of the method, and the repeated parts will not be repeated.
[0106] like Figure 3 As shown, the virtual machine data storage device 300 includes:
[0107] A creation module 301 is used to create a virtual machine at a node whose storage capacity meets a preset requirement according to the acquired storage capacity of the node;
[0108] Furthermore, if Figure 4 As shown, the creation module 301 also includes:
[0109] The receiving submodule 3011 is used to obtain the storage capacity of all nodes that can create the virtual machine;
[0110] The sorting submodule 3012 is used to sort the nodes according to the storage capacity values; and use the node with the largest storage capacity value as the node for creating the virtual machine.
[0111] The receiving submodule further includes:
[0112] The first judgment submodule 30111 is used to determine whether the storage capacity of the node meets a preset requirement when the storage capacity exceeds a preset threshold;
[0113] The selection submodule 30112 is used to select a node that meets the creation requirement from the nodes whose storage capacity meets the preset requirement according to the creation requirement of the virtual machine, as the node for creating the virtual machine.
[0114] The configuration module 302 is used to store the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information pre-set in the interface parameters, wherein the newly added parameter information includes the partition information and the block device information available for storage.
[0115] Furthermore, if Figure 5 As shown, the configuration module 302 also includes:
[0116] The second determination submodule 3021 is used to determine the fast device for storing data according to the capacity parameter of the virtual machine and the storage capacity of the block device in the node;
[0117] A partition submodule 3022, used to create partitions for the block device;
[0118] Determine whether the partition information exists in the interface parameters;
[0119] If it exists, the partition is automatically created based on the partition information.
[0120] The selection submodule 3023 is used to select the partition for the virtual machine to store data according to the storage requirement of the virtual machine.
[0121] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0123] The embodiment of the present invention further provides a communication device. Since the principle of solving the problem by the communication device is similar to the method for storing virtual machine data in the embodiment of the present invention, the implementation of the communication device can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 6 As shown, the embodiment of the present invention includes: a processor 600, which is used to read the program in the memory 620 and execute the following process:
[0124] According to the obtained storage capacity of the node, a virtual machine is created on the node whose storage capacity meets the preset requirements;
[0125] According to the newly added parameter information pre-set in the interface parameters, the data generated by the virtual machine is stored in the corresponding block device and partition, wherein the newly added parameter information includes the partition information and the block device information available for storage.
[0126] The processor 600 is used to read the program in the memory 620 and execute the following process: receiving the storage capacity of each node through the transceiver 610 and sending the determined block device location.
[0127] The transceiver 610 is configured to receive and send data under the control of the processor 600 .
[0128] Among them, Figure 4In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 600 and memory represented by memory 620. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 may store data used by the processor 600 when performing operations.
[0129] The processor 610 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a complex programmable logic device (CPLD). The processor may also adopt a multi-core architecture.
[0130] The processor 600 is responsible for managing the bus architecture and general processing, and the memory 720 can store data used by the processor 700 when performing operations.
[0131] The processor 600 is further configured to read the program and execute the following steps:
[0132] Obtaining the storage capacity of all nodes that can create the virtual machine;
[0133] Sort the nodes according to the values of the storage capacity;
[0134] The node with the largest storage capacity value is used as the node for creating the virtual machine.
[0135] and, when the storage capacity exceeds a preset threshold, determining that the storage capacity of the node meets a preset requirement;
[0136] According to the creation requirement of the virtual machine, a node that meets the creation requirement is selected from the nodes whose storage capacity meets the preset requirement as the node for creating the virtual machine.
[0137] And, automatically create a partition based on the information of the partition existing in the newly added parameter information.
[0138] and, determining the fast device for storing data according to the capacity parameter of the virtual machine and the storage capacity of the block device in the node;
[0139] Creating a partition for the block device;
[0140] According to the storage requirement of the virtual machine, the partition is selected for the virtual machine to store data.
[0141] The communication device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0142] In addition, the readable storage medium of the embodiment of the present invention is used to store a program, and the program can be executed by the processor to implement the following steps:
[0143] According to the obtained storage capacity of the node, a virtual machine is created on the node whose storage capacity meets the preset requirements;
[0144] According to the newly added parameter information pre-set in the interface parameters, the data generated by the virtual machine is stored in the corresponding block device and partition, wherein the newly added parameter information includes the partition information and the block device information available for storage.
[0145] Obtaining the storage capacity of all nodes that can create the virtual machine;
[0146] Sort the nodes according to the values of the storage capacity;
[0147] The node with the largest storage capacity value is used as the node for creating the virtual machine.
[0148] and, when the storage capacity exceeds a preset threshold, determining that the storage capacity of the node meets a preset requirement;
[0149] According to the creation requirement of the virtual machine, a node that meets the creation requirement is selected from the nodes whose storage capacity meets the preset requirement as the node for creating the virtual machine.
[0150] And, automatically create a partition based on the information of the partition existing in the newly added parameter information.
[0151] and, determining the fast device for storing data according to the capacity parameter of the virtual machine and the storage capacity of the block device in the node;
[0152] Creating a partition for the block device;
[0153] According to the storage requirement of the virtual machine, the partition is selected for the virtual machine to store data.
[0154] See also Figure 7 , an embodiment of the present invention further provides a device, including a processor and a memory;
[0155] Processor 701, configured to create a virtual machine at a node whose storage capacity meets a preset requirement according to the acquired storage capacity of the node;
[0156] The memory 702 is used to store the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information pre-set in the interface parameters, wherein the newly added parameter information includes the partition information and the block device information available for storage.
[0157] The newly added parameter information also includes business parameters, wherein the business parameters are used to meet preset requirements of the virtual machine.
[0158] The processor is used to obtain the storage capacity of all nodes that can create the virtual machine;
[0159] Sort the nodes according to the values of the storage capacity;
[0160] The node with the largest storage capacity value is used as the node for creating the virtual machine.
[0161] Wherein, the processor is used to determine that the storage capacity of the node meets a preset requirement when the storage capacity exceeds a preset threshold;
[0162] According to the creation requirement of the virtual machine, a node that meets the creation requirement is selected from the nodes whose storage capacity meets the preset requirement as the node for creating the virtual machine.
[0163] The processor is used to determine whether the partition information exists in the interface parameters;
[0164] If it exists, the partition is automatically created according to the partition information.
[0165] The processor is used to determine the block device for storing data according to the capacity parameter of the virtual machine and the storage capacity of the block device in the node;
[0166] Creating a partition for the block device;
[0167] According to the storage requirement of the virtual machine, the partition is selected for the virtual machine to store data.
[0168] The preset requirement includes whether the system can be migrated and evacuated to other hosts.
[0169] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0170] The embodiment of the present invention also provides a readable storage medium, on which a program is stored. When the program is executed by a processor, each process of the above-mentioned virtual machine data storage method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disk, hard disk, tape, magneto-optical disk (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state drive (SSD)), etc.
[0171] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0172] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) to execute the methods described in each embodiment of the present invention.
[0173] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A virtual machine data storage method, characterized in that: include: By obtaining the storage capacity of the node, a virtual machine is created on the node whose storage capacity meets the preset requirements; According to the newly added parameter information pre-set in the interface parameters, the data generated by the virtual machine is stored in the corresponding block device and partition, wherein the newly added parameter information includes partition information, information of the block device available for storage, and business parameters, wherein the business parameters are used to meet the preset requirements of the virtual machine, and the preset requirements include whether the virtual machine can be migrated and evacuated to other hosts.
2. The virtual machine data storage method according to claim 1, characterized in that: The step of creating a virtual machine at a node whose storage capacity meets a preset requirement according to the acquired storage capacity of the node includes: Obtaining the storage capacity of all nodes that can create the virtual machine; Sort the nodes according to the values of the storage capacity; The node with the largest storage capacity value is used as the node for creating the virtual machine.
3. The virtual machine data storage method according to claim 2, characterized in that: After obtaining the storage capacity of all nodes that can create the virtual machine, the method further includes: When the storage capacity exceeds a preset threshold, determining that the storage capacity of the node meets a preset requirement; According to the creation requirement of the virtual machine, a node that meets the creation requirement is selected from the nodes whose storage capacity meets the preset requirement as the node for creating the virtual machine.
4. The virtual machine data storage method according to claim 1, characterized in that: The method further includes storing the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information preset in the interface parameter: Determine whether the partition information exists in the interface parameters; If it exists, the partition is automatically created according to the partition information.
5. The virtual machine data storage method according to claim 1, characterized in that: According to the newly added parameter information pre-set in the interface parameters, storing the data generated by the virtual machine in the corresponding block device and partition includes: Determining the block device for storing data according to the capacity parameter of the virtual machine and the storage capacity of the block device in the node; Creating a partition for the block device; According to the storage requirement of the virtual machine, the partition is selected for the virtual machine to store data.
6. A virtual machine data storage device, characterized in that: include: A creation module, used to create a virtual machine at a node whose storage capacity meets preset requirements according to the acquired storage capacity of the node; A configuration module is used to store the data generated by the virtual machine in corresponding block devices and partitions according to the newly added parameter information pre-set in the interface parameters, wherein the newly added parameter information includes partition information, information of block devices available for storage, and business parameters, wherein the business parameters are used to meet the preset requirements of the virtual machine, and the preset requirements include whether the virtual machine can be migrated and evacuated to other hosts.
7. A virtual machine data storage device, characterized in that: include: Processor and memory; The processor is used to create a virtual machine at a node whose storage capacity meets a preset requirement according to the acquired storage capacity of the node; The memory is used to store the data generated by the virtual machine in the corresponding block device and partition according to the newly added parameter information pre-set in the interface parameters, wherein the newly added parameter information includes partition information, information of block devices available for storage and business parameters, wherein the business parameters are used to meet the preset requirements of the virtual machine, and the preset requirements include whether the virtual machine can be migrated and evacuated to other hosts.
8. A communication device, comprising: A transceiver, a memory, a processor, and a program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the virtual machine data storage method as described in any one of claims 1 to 5.
9. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps of the virtual machine data storage method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Virtual machine creating method and device, electronic equipment and storage medium
CN109933405A