Method, device, electronic device and medium for deploying virtual machines on a virtualized cloud platform
By mapping the storage space of different storage devices for the computing nodes of the virtualized cloud platform and generating mirror logical disks, the interruption and data loss caused by disk failure of the virtual machine is solved, and the stable and reliable operation of the virtual machine business is achieved.
Patent Information
- Application Number
- CN202111004554.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-08-30
AI Technical Summary
Virtual machine services running on virtualized cloud platforms are prone to interruption due to disk failures, and the prior art cannot switch to another replica without perception when one replica fails, resulting in data loss and risk of business interruption.
By mapping storage space from different storage devices for the computing nodes of the virtualized cloud platform, mirrored logical disks are generated, and the disk space of each mirrored logical disk stores the same data, ensuring that other disks can be seamlessly replaced when one disk fails. Avoid business disruptions and data loss.
It effectively reduces the probability of interruption and data loss of virtual machine business running on the virtualization platform, improves the stability and reliability of virtual machine business, and ensures that virtual machines can run stably and reliably on the virtualized cloud platform.
Smart Images

Figure CN113821302B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and readable storage medium for deploying virtual machines on a virtualized cloud platform. Background Art
[0002] In the era of cloud computing, more and more businesses will be deployed on the cloud. Specifically, most businesses will choose to run their servers on the cloud in the form of virtual machines, which greatly facilitates business deployment and operation and maintenance.
[0003] It is understandable that the disks of virtual machines running on virtualized cloud platforms will inevitably fail. Since the virtual disks used by virtual machines in virtualized cloud platforms are all single copies, after the disk fails, the virtual machine cannot operate normally, which will not only cause data loss, but also affect the normal operation of the business on the virtual machine. Moreover, even if there are two copies, it is impossible to switch the business to another copy without shutting down the virtual machine when one copy has a problem, which will bring business interruption risks to the business deployment of the virtualization platform.
[0004] In view of this, how to reduce the probability of virtual machine business interruption and data loss running on the virtualized cloud platform and improve the stability and reliability of virtual machine business running on the virtualized cloud platform is a technical problem that technical personnel in the field need to solve. Summary of the invention
[0005] The present application provides a method, device, electronic device and readable storage medium for deploying virtual machines on a virtualized cloud platform, which can effectively reduce the probability of interruption of virtual machine services running on the virtualized platform and reduce the possibility of virtual machine data loss, thereby ensuring that the virtual machine services can run stably and reliably on the virtualized cloud platform.
[0006] To solve the above technical problems, the embodiments of the present invention provide the following technical solutions:
[0007] An embodiment of the present invention provides a method for deploying virtual machines on a virtualized cloud platform, which pre-maps storage spaces from different storage devices for computing nodes of the virtualized cloud platform; the method comprises:
[0008] Determine the disk space capacity of the virtual machine according to the configuration file of the virtual machine; mount the virtual machine on the target computing node;
[0009] Generate a mirror logical disk of the virtual machine based on the disk space capacity and each storage space of the target computing node; each disk space of the mirror logical disk stores the same data;
[0010] The disk space location of the configuration file is modified to the mirrored logical disk, so that the mirrored logical disk provides disk space for the virtual machine.
[0011] Optionally, the generating the mirror logical disk of the virtual machine based on the disk space capacity and each storage space of the target computing node includes:
[0012] Based on the capacity of the disk space, respectively divide the target disk space in each storage space of the target computing node;
[0013] Generate a mirrored logical disk consisting of target disk spaces with consistent data content and mutual data backup functions.
[0014] Optionally, the dividing the target disk space in each storage space of the target computing node based on the disk space capacity includes:
[0015] In each storage space of the target computing node, a target disk space having the same capacity as the disk space is created for the virtual machine.
[0016] Optionally, mapping the storage space from different storage devices to the computing nodes of the virtualized cloud platform includes:
[0017] Construct multiple node lists with different business fault tolerance capabilities; the computing nodes in each node list have the same business fault tolerance capabilities;
[0018] According to the physical parameters of each computing node of the virtual machine cloud platform, the number of running services and the stability requirements of running services, each computing node is divided into a corresponding node list;
[0019] Based on the total number of storage devices and the space capacity of each storage device, the storage space from different storage devices is preferentially mapped to the computing nodes in the node list with low service failure tolerance capability.
[0020] Optionally, before determining the disk space capacity of the virtual machine according to the configuration file of the virtual machine, the method further includes:
[0021] Automatically determine multiple candidate computing nodes that meet resource requirements for the virtual machine according to the configuration file;
[0022] A target computing node having storage space from different storage devices is selected from each candidate computing node to mount the virtual machine on the target computing node.
[0023] Optionally, before determining the disk space capacity of the virtual machine according to the configuration file of the virtual machine, the method further includes:
[0024] When receiving a virtual machine mount instruction, parsing the virtual machine mount instruction to obtain target virtual machine information;
[0025] Respond to the virtual machine mounting instruction to mount the virtual machine on the target computing node.
[0026] Another aspect of the present invention provides a device for deploying a virtual machine on a virtualized cloud platform, including:
[0027] A storage space mapping module is used to map storage spaces from different storage devices for computing nodes of a virtualized cloud platform in advance;
[0028] A virtual machine disk information acquisition module, used to determine the disk space capacity of the virtual machine according to the configuration file of the virtual machine; the virtual machine is mounted on the target computing node;
[0029] A mirror logical disk generation module, used to generate a mirror logical disk of the virtual machine based on the disk space capacity and each storage space of the target computing node; each disk space of the mirror logical disk stores the same data;
[0030] The configuration file modification module is used to modify the disk space location of the configuration file to the mirrored logical disk, so that the mirrored logical disk provides disk space for the virtual machine.
[0031] Optionally, the mirror logical disk generation module is further used to: divide the target disk space in each storage space of the target computing node based on the disk space capacity; generate a mirror logical disk consisting of target disk spaces with consistent data content and mutual data backup function.
[0032] An embodiment of the present invention further provides an electronic device, comprising a processor, wherein the processor is configured to implement the steps of the method for deploying a virtual machine on a virtualized cloud platform as described in any of the preceding items when executing a computer program stored in a memory.
[0033] Finally, an embodiment of the present invention further provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for deploying a virtual machine on a virtualized cloud platform as described in any of the preceding items are implemented.
[0034] The advantage of the technical solution provided by the present application is that the computing nodes of the virtualized cloud platform share multiple groups of different shared storages, which come from different storage devices. The disk data is automatically written on each disk space of the mirrored logical disk, and the data of each disk space is consistent. In this way, after a disk fails, the remaining disks can replace the failed disk as a disk that can be used by the virtual machine. Since multiple disk spaces are composed of a mirrored logical disk, they appear as one inside the virtual machine, and the use of the virtual machine is the same as that of an ordinary virtual machine. In this way, when a disk space at the bottom of the virtual machine fails, since there is another disk that is running normally, the virtual machine is not aware of it. The failed virtual disk can be seamlessly switched to a normal virtual disk, and the virtual machine business and data will not be affected, which can effectively reduce the probability of interruption of the virtual machine business running on the virtualization platform and reduce the possibility of data loss of the virtual machine. At the same time, after the failed virtual disk is repaired, it can also be normally added to the redundant virtual disk group for data reconstruction to ensure the active-active state of the virtual disk of the virtual machine, thereby ensuring that the virtual machine business can run stably and reliably on the virtualized cloud platform.
[0035] In addition, the embodiments of the present invention also provide corresponding implementation devices, electronic devices and readable storage media for the method of deploying virtual machines on a virtualized cloud platform, further making the method more practical, and the devices, electronic devices and readable storage media have corresponding advantages.
[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A flow chart of a method for deploying virtual machines on a virtualized cloud platform provided in an embodiment of the present invention;
[0039] Figure 2 A flowchart of another method for deploying virtual machines on a virtualized cloud platform provided by an embodiment of the present invention;
[0040] Figure 3 A structural diagram of a specific implementation of an apparatus for deploying virtual machines on a virtualized cloud platform provided in an embodiment of the present invention;
[0041] Figure 4A structural diagram of a specific implementation of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0043] The terms "first", "second", "third", "fourth", etc. in the specification and claims of this application and the above drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0044] After introducing the technical solutions of the embodiments of the present invention, various non-limiting implementation methods of the present application are described in detail below.
[0045] See first Figure 1 , Figure 1 A flowchart of a method for deploying a virtual machine on a virtualized cloud platform provided in an embodiment of the present invention may include the following contents:
[0046] S101: Pre-map storage spaces from different storage devices for computing nodes of a virtualized cloud platform.
[0047] In this embodiment, each server runs on a virtualized cloud platform in the form of a virtual machine. Each server is a virtual machine. The virtualized cloud platform includes multiple computing nodes and management nodes, and each virtual machine is mounted on a computing node. Each computing node or certain designated computing nodes of the virtualized cloud platform of this embodiment share multiple groups of different shared storages, such as 2 groups of shared storages, and map these multiple storage spaces from different storage devices to all computing nodes in the virtualized cloud platform; the function of all computing nodes using the shared disk at the same time is realized through the cluster file system. These multiple groups of different shared storages can realize active-active disks, and each disk is placed on different storages. This ensures that the active-active virtual disks are placed on different shared storages, and there will be no simultaneous failure of these multiple active-active disks. The active-active in this step refers to a storage form with at least one redundant disk.
[0048] S102: Determine the disk space capacity of the virtual machine according to the configuration file of the virtual machine.
[0049] The management node of the virtualization cloud platform creates a disk active-active virtual machine and then sends it to the computing node of the virtualization cloud platform. That is, when the virtual machine is mounted on the computing node, the virtualization cloud platform sends the configuration file of the virtual machine to the corresponding computing node through its management node. The configuration file of the virtual machine can be an XML file of the detailed configuration of the virtual machine on the virtualization platform. The configuration file may include the size of the virtual disk. The computing node obtains the size of the virtual disk of the virtual machine mounted on it based on the received configuration file.
[0050] S103: Generate a mirrored logical disk for the virtual machine based on the disk space capacity and each storage space of the target computing node.
[0051] In this step, for the convenience of description, the computer node mounted by the virtual machine of S102 can be called the target computing node. The target computing node has been set up with multiple shared storage spaces in S101. In each storage space of the target computing node, a target disk space that can be used by the virtual machine can be created, and then these multiple target disk spaces are combined into a mirror logical disk. The data of the mirror logical disk is provided by multiple disks from different storage devices in S101, which means that the data will be written in multiple copies to provide redundancy, so that each disk space of the mirror logical disk can store the same data. These multiple disk spaces storing the same data are used as the disk space of the virtual machine together, so that the data of the virtual machine is written in each disk space of this mirror logical disk, so that the data will exist in multiple different storage spaces on the computing node. After one of the disks fails, it will not affect the data of the remaining storage spaces. The data of the remaining disks is still there, and the logical mirror disk can provide normal reading and writing. For the virtual machine, because the disk is active-active, the business is not affected in any way, ensuring that the business is not affected by disk failure at all times. When the faulty storage space is repaired, the raid technology can also be used to automatically reconstruct the data to keep the virtual machine's disk in an active-active state.
[0052] S104: Modify the disk space location of the configuration file to a mirrored logical disk, so that the mirrored logical disk provides disk space for the virtual machine.
[0053] After providing the virtual machine with a mirrored logical disk consisting of multiple disk spaces in the previous step, since this mirrored logical disk is to be used as the storage space of the virtual machine, it is necessary to change the disk path of the virtual machine on the target computing node by modifying the configuration file of the virtual machine on the target computing node, that is, to change the mirrored logical disk to the disk space location of the virtual machine, so that the virtual disk of the virtual machine becomes this mirrored logical disk. When data is written to this mirrored logical disk, the data of the virtual machine will be sent to each disk space of the mirrored logical disk. The data is written to the previous multiple storage spaces, thereby ensuring that if any disk has a problem, the virtual machine business will not be affected.
[0054] In the technical solution provided by the embodiment of the present invention, the computing nodes of the virtualized cloud platform share multiple groups of different shared storages, which come from different storage devices. The disk data is automatically written on each disk space of the mirrored logical disk, and the data of each disk space is consistent. In this way, after a disk fails, the remaining disks can replace the failed disk as a disk that can be used by the virtual machine. Since multiple disk spaces are composed of a mirrored logical disk, they are presented as one inside the virtual machine, and the use of the virtual machine is the same as that of an ordinary virtual machine. In this way, when a disk space at the bottom of the virtual machine fails, since there are other disks that are running normally, the virtual machine is not aware of it. The failed virtual disk can be seamlessly switched to a normal virtual disk, and the virtual machine business and data will not be affected, which can effectively reduce the probability of interruption of the virtual machine business running on the virtualization platform and reduce the possibility of data loss of the virtual machine. At the same time, after the failed virtual disk is repaired, it can also be normally added to the redundant virtual disk group for data reconstruction to ensure the active-active state of the virtual disk of the virtual machine, thereby ensuring that the virtual machine business can run stably and reliably on the virtualized cloud platform.
[0055] It should be noted that there is no strict order of execution between the steps in this application. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1 This is just a schematic and does not mean that this is the only execution order.
[0056] In the above embodiment, there is no limitation on how to execute step S103. In this embodiment, an optional method for generating a mirrored logical disk is provided, such as: Figure 2 As shown, the following steps may be included:
[0057] Based on the disk space capacity, the target disk space is divided in each storage space of the target computing node; in this embodiment, in order to facilitate management and take into account the total storage space of the computing node and the space occupied by the business execution of the virtual machine, a target disk space with the same disk space capacity can be created for the virtual machine in each storage space of the target computing node. That is, in this step, the soft raid technology can be used to take the same disk space as the virtual machine disk space on two different storages mounted on the computing node.
[0058] Generate a mirrored logical disk consisting of target disk spaces with consistent data content and data mutual backup function. In this step, disk mirroring technology such as RAID1 can be used to treat these multiple disks as a logical disk, and the data in the two disks remain consistent, so that data can be backed up mutually. If one disk fails, it will not affect the use of the logical disk.
[0059] This embodiment creates a disk space with the same size as the virtual machine disk, and uses soft raid technology to make a mirror logical disk for the two created disk spaces. The created logical mirror disk is changed to the active-active logical disk used by the virtual machine by modifying the virtual machine's xml file. In this way, when the data of the virtual machine is written, it is written on this active-active logical disk. In this way, the data will exist in two different storage spaces on the computing node. When the data in one storage space is lost, it will not affect the data in one storage space, and the active-active logical disk used by the virtual machine will not be affected.
[0060] It is understandable that there are multiple computing nodes in the virtualized cloud platform, and each computing node is allocated storage space of at least two different storage devices. However, the storage space of each storage device is limited, and it is very likely that the storage space of different storage devices cannot be allocated to each computing node of the current virtualized cloud platform. Based on this, the present application also provides another embodiment, which may include the following content:
[0061] Construct multiple node lists with different business fault tolerance capabilities; the computing nodes in each node list have the same business fault tolerance capabilities; divide each computing node into a corresponding node list based on the physical parameters of each computing node of the virtual machine cloud platform, the number of running businesses, and the requirements for the stability of running businesses; based on the total number of storage devices and the space capacity of each storage device, give priority to mapping storage space from different storage devices to the computing nodes in the node list with low business fault tolerance capabilities.
[0062] In this embodiment, the business fault tolerance capability refers to the requirements of the virtual machine business running on the computing node for business interruption. The higher the business fault tolerance capability, the lower the probability of the allowable interruption of the virtual machine business running on the computing node, and the data security impact is not high. The lower the business fault tolerance capability, the virtual machine business running on the computing node cannot be interrupted, and the data security requirement is high. Therefore, redundant disk space should be allocated to computing nodes with low business fault tolerance capability first, so that the virtual disks of the virtual machines running on them are in active-active state. The physical parameters of this step refer to the hardware and software environment and configuration of the computing node.
[0063] When storage resources are insufficient, this embodiment gives priority to allocating resources to computing nodes with low business fault tolerance capabilities, thereby improving the flexibility of deploying virtual machines on the virtualized cloud platform and ensuring the stability and security of the operation of virtual machines deployed on the virtualized cloud platform.
[0064] It can be understood that when a virtual machine is deployed on a virtual machine cloud platform, a suitable computing node will be matched for the virtual machine on the virtual machine cloud platform. This embodiment also provides multiple optional implementations of matching and mounting computing nodes for virtual machines, which may include:
[0065] As an optional implementation, multiple candidate computing nodes that meet resource requirements can be automatically determined for the virtual machine based on the configuration file; a target computing node with storage space from different storage devices is selected from each candidate computing node to mount the virtual machine on the target computing node. When matching the mounted computing node for the virtual machine, this embodiment gives priority to selecting a computing node with multiple shared storages as the target computing node, which can ensure the stable execution of the virtual machine business and the data security of the virtual machine cloud platform.
[0066] As another optional implementation method parallel to the above embodiment, when a virtual machine mount instruction is received, the virtual machine mount instruction is parsed to obtain target virtual machine information; the virtual machine mount instruction is responded to so as to mount the virtual machine on the target computing node. The virtual machine mount instruction of this embodiment is the computing node specified by the user for the mounting of the virtual machine, and the relevant information of the specified computing node is carried in the virtual machine mount instruction and sent to the management node. The management node obtains the target computing node information by parsing the instruction, and then sends the configuration file of the virtual machine to the target computing node so that the virtual machine is mounted on the target computing node.
[0067] This embodiment provides a variety of target computing node selection methods for virtual machines, improves the flexibility of virtualized cloud platforms in deploying virtual machines, and enhances user experience.
[0068] The embodiment of the present invention also provides a corresponding device for the method of deploying virtual machines on a virtualized cloud platform, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The device for deploying virtual machines on a virtualized cloud platform provided by an embodiment of the present invention is introduced below. The device for deploying virtual machines on a virtualized cloud platform described below and the method for deploying virtual machines on a virtualized cloud platform described above can be referred to each other.
[0069] From the perspective of functional modules, see Figure 3 , Figure 3 A structural diagram of a device for deploying a virtual machine on a virtualized cloud platform provided in an embodiment of the present invention in a specific implementation manner, the device may include:
[0070] The storage space mapping module 301 is used to pre-map storage spaces from different storage devices for computing nodes of the virtualized cloud platform.
[0071] The virtual machine disk information acquisition module 302 is used to determine the disk space capacity of the virtual machine according to the configuration file of the virtual machine; the virtual machine is mounted on the target computing node.
[0072] The mirror logical disk generation module 303 is used to generate a mirror logical disk for the virtual machine based on the disk space capacity and each storage space of the target computing node; each disk space of the mirror logical disk stores the same data.
[0073] The configuration file modification module 304 is used to modify the disk space location of the configuration file to a mirrored logical disk, so that the mirrored logical disk provides disk space for the virtual machine.
[0074] Optionally, in some implementations of the present embodiment, the mirror logical disk generation module 303 may be further used to: divide the target disk space in each storage space of the target computing node based on the disk space capacity; generate a mirror logical disk consisting of target disk spaces with consistent data content and mutual data backup functions.
[0075] As an optional implementation of this embodiment, the mirror logical disk generation module 303 may be further used to: create a target disk space with the same capacity as the disk space for the virtual machine in each storage space of the target computing node.
[0076] Optionally, in some other implementations of the present embodiment, the above-mentioned storage space mapping module 301 can be further used to: construct multiple node lists with different business fault tolerance capabilities; the business fault tolerance capability of the computing nodes in each node list is the same; according to the physical parameters of each computing node of the virtual machine cloud platform, the number of running businesses and the stability requirements of running businesses, each computing node is divided into a corresponding node list; based on the total number of storage devices and the space capacity of each storage device, the storage space from different storage devices is preferentially mapped to the computing nodes in the node list with low business fault tolerance capability.
[0077] Optionally, in some other implementations of the present embodiment, the above-mentioned device may also include a mounting node selection module, for example, for automatically determining multiple candidate computing nodes that meet the resource requirements for the virtual machine according to the configuration file; selecting a target computing node that has storage space from different storage devices from each candidate computing node, so as to mount the virtual machine on the target computing node.
[0078] As an implementation method parallel to the above embodiment, the above mount node selection module can also be used for: when receiving a virtual machine mount instruction, parsing the virtual machine mount instruction to obtain target virtual machine information; responding to the virtual machine mount instruction to mount the virtual machine on the target computing node.
[0079] The functions of the functional modules of the device for deploying virtual machines on a virtualized cloud platform described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0080] It can be seen from the above that the embodiments of the present invention can effectively reduce the probability of interruption of virtual machine services running on the virtualization platform and reduce the possibility of virtual machine data loss, thereby ensuring that the virtual machine services can run stably and reliably on the virtualization platform.
[0081] The device for deploying virtual machines on a virtualized cloud platform mentioned above is described from the perspective of functional modules. Furthermore, the present application also provides an electronic device, which is described from the perspective of hardware. Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application in one implementation manner. Figure 4 As shown, the electronic device includes a memory 40 for storing computer programs; a processor 41 for implementing the steps of the method for deploying virtual machines on a virtualized cloud platform as mentioned in any of the above embodiments when executing the computer program.
[0082] Among them, the processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 41 may also be a controller, a microcontroller, a microprocessor or other data processing chip. The processor 41 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 41 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 41 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 41 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0083] The memory 40 may include one or more computer-readable storage media, which may be non-transitory. The memory 40 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. The memory 40 may be an internal storage unit of an electronic device in some embodiments, such as a hard disk of a server. The memory 40 may also be an external storage device of an electronic device in other embodiments, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. Further, the memory 40 may also include both an internal storage unit of an electronic device and an external storage device. The memory 40 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program for executing the vulnerability processing method, etc., but may also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 40 is at least used to store the following computer program 401, wherein, after the computer program is loaded and executed by the processor 41, the relevant steps of the method for deploying a virtual machine on a virtualized cloud platform disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, and the storage method may be temporary storage or permanent storage. The operating system 402 may include Windows, Unix, Linux, etc. The data 403 may include but is not limited to data corresponding to the result of deploying a virtual machine on a virtualized cloud platform.
[0084] In some embodiments, the electronic device may further include a display screen 42, an input / output interface 43, a communication interface 44 or a network interface, a power supply 45 and a communication bus 46. Among them, the display screen 42 and the input / output interface 43 such as a keyboard belong to the user interface, and the optional user interface may also include a standard wired interface, a wireless interface, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 44 may optionally include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, etc., which is usually used to establish a communication connection between the electronic device and other electronic devices. The communication bus 46 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0085] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than those shown in the figure, for example, it may also include a sensor 47 for realizing various functions.
[0086] The functions of the functional modules of the electronic device described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0087] It can be seen from the above that the embodiments of the present invention can effectively reduce the probability of interruption of virtual machine services running on the virtualization platform and reduce the possibility of virtual machine data loss, thereby ensuring that the virtual machine services can run stably and reliably on the virtualization platform.
[0088] It is understandable that if the method for deploying virtual machines on the virtualized cloud platform in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution 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 to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, disk or optical disk, etc. Various media that can store program codes.
[0089] Based on this, an embodiment of the present invention further provides a readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the method for deploying a virtual machine on a virtualized cloud platform as described in any of the above embodiments are performed.
[0090] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the hardware disclosed in the embodiments, including devices and electronic devices, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0091] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0092] The above is a detailed introduction to the method, device, electronic device and readable storage medium for deploying virtual machines on a virtualized cloud platform provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for deploying virtual machines on a virtualized cloud platform, characterized in that: Pre-map storage space from different storage devices to the computing nodes of the virtualized cloud platform; including: Determine the disk space capacity of the virtual machine according to the configuration file of the virtual machine; mount the virtual machine on the target computing node; Generate a mirror logical disk of the virtual machine based on the disk space capacity and each storage space of the target computing node; each disk space of the mirror logical disk stores the same data; Modify the disk space location of the configuration file to the mirrored logical disk, so that the mirrored logical disk provides disk space for the virtual machine; The mapping of computing nodes of the virtualized cloud platform to storage spaces from different storage devices includes: Construct multiple node lists with different business fault tolerance capabilities; the computing nodes in each node list have the same business fault tolerance capabilities; According to the physical parameters of each computing node of the virtual machine cloud platform, the number of running services and the stability requirements of running services, each computing node is divided into a corresponding node list; Based on the total number of storage devices and the space capacity of each storage device, the storage space from different storage devices is mapped to the computing nodes in the node list with low business failure tolerance capability first; The step of generating the mirror logical disk of the virtual machine based on the disk space capacity and each storage space of the target computing node includes: Based on the capacity of the disk space, respectively divide the target disk space in each storage space of the target computing node; Generate a mirrored logical disk consisting of target disk spaces with consistent data content and mutual data backup functions.
2. The method for deploying virtual machines on a virtualized cloud platform according to claim 1, characterized in that: The dividing the target disk space in each storage space of the target computing node based on the disk space capacity includes: In each storage space of the target computing node, a target disk space having the same capacity as the disk space is created for the virtual machine.
3. The method for deploying virtual machines on a virtualized cloud platform according to claim 1, characterized in that: Before determining the disk space capacity of the virtual machine according to the configuration file of the virtual machine, the method further includes: Automatically determine multiple candidate computing nodes that meet resource requirements for the virtual machine according to the configuration file; A target computing node having storage space from different storage devices is selected from each candidate computing node, so as to mount the virtual machine on the target computing node.
4. The method for deploying virtual machines on a virtualized cloud platform according to claim 1, characterized in that: Before determining the disk space capacity of the virtual machine according to the configuration file of the virtual machine, the method further includes: When receiving a virtual machine mount instruction, parsing the virtual machine mount instruction to obtain target virtual machine information; In response to the virtual machine mounting instruction, the virtual machine is mounted on the target computing node.
5. A device for deploying virtual machines on a virtualized cloud platform, characterized in that: include: A storage space mapping module is used to map storage spaces from different storage devices for computing nodes of a virtualized cloud platform in advance; A virtual machine disk information acquisition module, used to determine the disk space capacity of the virtual machine according to the configuration file of the virtual machine; The virtual machine is mounted on the target computing node; A mirror logical disk generation module, used to generate a mirror logical disk of the virtual machine based on the disk space capacity and each storage space of the target computing node; Each disk space of the mirrored logical disk stores the same data; A configuration file modification module, used for modifying the disk space location of the configuration file to the mirrored logical disk, so that the mirrored logical disk provides disk space for the virtual machine; Wherein, the storage space mapping module is further used for: Construct multiple node lists with different business fault tolerance capabilities; the computing nodes in each node list have the same business fault tolerance capabilities; According to the physical parameters of each computing node of the virtual machine cloud platform, the number of running services and the stability requirements of running services, each computing node is divided into a corresponding node list; Based on the total number of storage devices and the space capacity of each storage device, the storage space from different storage devices is mapped to the computing nodes in the node list with low business failure tolerance capability first; The mirror logical disk generation module is further used to: divide the target disk space in each storage space of the target computing node based on the disk space capacity; generate a mirror logical disk composed of target disk spaces with consistent data content and mutual data backup function.
6. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to implement the steps of the method for deploying a virtual machine on a virtualized cloud platform as claimed in any one of claims 1 to 4 when executing a computer program stored in the memory.
7. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for deploying a virtual machine on a virtualized cloud platform as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Management method and system for disk mirror images
CN102981929A
Recovery method for various granularities after mirror-image-level backup of virtual machine
CN104407938A