CN113448676A - Control method, device and equipment of virtual machine - Google Patents

Control method, device and equipment of virtual machine Download PDF

Info

Publication number
CN113448676A
CN113448676A CN202010214111.8A CN202010214111A CN113448676A CN 113448676 A CN113448676 A CN 113448676A CN 202010214111 A CN202010214111 A CN 202010214111A CN 113448676 A CN113448676 A CN 113448676A
Authority
CN
China
Prior art keywords
disk
virtual machine
target
logical
logical 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.)
Pending
Application number
CN202010214111.8A
Other languages
Chinese (zh)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010214111.8A priority Critical patent/CN113448676A/en
Publication of CN113448676A publication Critical patent/CN113448676A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space
    • 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/0614Improving the reliability of storage systems
    • 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/0629Configuration or reconfiguration of storage systems
    • 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
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The embodiment of the application provides a method, a device and equipment for controlling a virtual machine, wherein the method comprises the following steps: determining the physical disk fault of a target slot position according to fault information, wherein the physical disk and a target logical disk of a virtual machine have a mapping relation; and controlling the logical disks mounted on the virtual machine to be other logical disks except the target logical disk, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine. The method and the device can reduce the influence of the physical disk fault on the virtual machine.

Description

Control method, device and equipment of virtual machine
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for controlling a virtual machine.
Background
With the continuous development of resource sharing requirements, the application of virtual machines is more and more extensive, and the resource sharing of a plurality of virtual machines to a physical machine, namely a host machine of the plurality of virtual machines, can be realized by virtualizing a plurality of independent virtual machines on the physical machine.
Generally, in the process of starting a virtual machine, all logical devices (including logical disks) to be used by the virtual machine need to be mounted, and when a physical disk corresponding to a part of the logical disks of the virtual machine fails, there is a problem that the logical disks cannot be mounted due to the failure of the physical disk, so that the virtual machine cannot be started. At this time, to start the virtual machine, the user can only initiate virtual machine migration to migrate the data of the virtual machine and other logical disks to other physical machines. For large data scenes, tens of tera (T) or even 100 more T data size is often, the workload of user initiated data synchronization and migration is huge and the time consumption is also long.
Therefore, in a scenario of a physical disk failure, how to reduce the influence of the failed physical disk on the virtual machine becomes a problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the application provides a method, a device and equipment for controlling a virtual machine, which are used for solving the problem that in the prior art, a physical disk fault has a large influence on the virtual machine.
In a first aspect, an embodiment of the present application provides a method for controlling a virtual machine, including:
determining the physical disk fault of a target slot position according to fault information, wherein the physical disk and a target logical disk of a virtual machine have a mapping relation;
and controlling the logical disks mounted on the virtual machine to be other logical disks except the target logical disk, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
In a second aspect, an embodiment of the present application provides a method for controlling a virtual machine, which is applied to a first system, and the method includes:
determining the physical disk fault of a target slot position according to fault information, wherein the physical disk and a target logical disk of a virtual machine have a mapping relation;
and informing a second system to isolate the target logical disk so that the second system controls the logical disk mounted on the virtual machine to be other logical disks except the target logical disk, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
In a third aspect, an embodiment of the present application provides a method for controlling a virtual machine, which is applied to a second system, and the method includes:
acquiring a notice of a target logic disk of a first system isolation virtual machine; the notification is sent by the first system under the condition that a physical disk of a target slot position is determined to be in fault, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
and controlling the logical disk mounted on the virtual machine to be other logical disks except the target logical disk according to the notification, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
In a fourth aspect, an embodiment of the present application provides a control apparatus for a virtual machine, including:
the determining module is used for determining the physical disk fault of the target slot position according to the fault information, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
and the control module is used for controlling the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk, the other logical disks have a mapping relationship with the physical disk other than the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
In a fifth aspect, an embodiment of the present application provides a control apparatus for a virtual machine, where the apparatus is applied to a first system, and the apparatus includes:
the determining module is used for determining the physical disk fault of the target slot position according to the fault information, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
a notification module, configured to notify a second system to isolate a target logical disk of a virtual machine, so that the second system controls a logical disk mounted on the virtual machine to be another logical disk except the target logical disk, where the other logical disk has a mapping relationship with a physical disk except a physical disk of the target slot, and the other logical disk is used to support operation of the virtual machine.
In a sixth aspect, an embodiment of the present application provides a control apparatus for a virtual machine, where the apparatus is applied to a second system, and the apparatus includes:
the acquisition module is used for acquiring a notification of a target logical disk of the first system isolation virtual machine; the notification is sent by the first system under the condition that a physical disk of a target slot position is determined to be in fault, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
and the control module is used for controlling the logical disks mounted on the virtual machine to be other logical disks except the target logical disk according to the notification, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
In a seventh aspect, an embodiment of the present application provides a computer device, including: a memory, a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of the first aspects.
In an eighth aspect, an embodiment of the present application provides a computer device, including: a memory, a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of the second aspects.
In a ninth aspect, an embodiment of the present application provides a computer device, including: a memory, a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of the third aspects.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, the computer program comprising at least one code, which is executable by a computer to control the computer to perform the method according to any one of the first aspect.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, the computer program comprising at least one code, which is executable by a computer to control the computer to perform the method according to any one of the second aspect.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, the computer program comprising at least one code, which is executable by a computer to control the computer to perform the method according to any one of the third aspects.
Embodiments of the present application also provide a computer program, which is used to implement the method according to any one of the first aspect when the computer program is executed by a computer.
Embodiments of the present application also provide a computer program, which is used to implement the method according to any one of the second aspect when the computer program is executed by a computer.
Embodiments of the present application also provide a computer program, which is used to implement the method according to any one of the third aspect when the computer program is executed by a computer.
The method, the device and the equipment for controlling the virtual machine provided by the embodiment of the application determine the physical disk fault of the target slot position according to the fault information, the physical disk and the target logical disk of the virtual machine have a mapping relation, the logical disk mounted on the virtual machine is controlled to be other logical disks except the target logical disk, the other logical disks have mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine, so that under the condition that the physical disks of the target slot fail, the logical disks mounted on the virtual machine affected by the physical disk failure do not include the target logical disk mapped to the failed physical disk, so that the virtual machine can also run based on other logical disks than the target logical disk, compared with the virtual machine which cannot run or needs to be migrated to other physical machines, the influence of the physical disk fault on the virtual machine is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1-3 are schematic diagrams of application scenarios according to embodiments of the present application;
fig. 4 is a schematic flowchart of a control method for a virtual machine according to an embodiment of the present application;
5-6 are schematic diagrams of user interfaces provided by embodiments of the present application;
fig. 7 is a schematic flowchart of a control method for a virtual machine according to another embodiment of the present application;
fig. 8 is a schematic flowchart of a control method for a virtual machine according to another embodiment of the present application;
fig. 9 is a schematic flowchart of a control method for a virtual machine according to another embodiment of the present application;
fig. 10 is a schematic structural diagram of a control device of a virtual machine according to an embodiment of the present application;
FIG. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a control apparatus of a virtual machine according to another embodiment of the present application;
FIG. 13 is a schematic diagram of a computer device according to another embodiment of the present application;
fig. 14 is a schematic structural diagram of a control apparatus of a virtual machine according to yet another embodiment of the present application;
fig. 15 is a schematic structural diagram of a computer device according to yet another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a" and "an" typically include at least two, but do not exclude the presence of at least one.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
In addition, the sequence of steps in each method embodiment described below is only an example and is not strictly limited.
For the convenience of those skilled in the art to understand the technical solutions provided in the embodiments of the present application, a technical environment for implementing the technical solutions is described below.
A control method for a virtual machine, which is commonly used in the related art, mainly includes that, when a physical disk corresponding to a part of logical disks of the virtual machine fails, a user can only initiate virtual machine migration to migrate data of the virtual machine and other logical disks thereof to other physical machines, and a failed physical disk has a large influence on the virtual machine.
Based on the actual technical requirements similar to those described above, the control method for the virtual machine provided by the application can reduce the influence of the failed physical disk on the virtual machine by using a technical means.
The following describes a control method of a virtual machine provided in various embodiments of the present application in detail through an exemplary service scenario.
As shown in fig. 1, a virtual machine 12A and a virtual machine 12B are implemented on a physical machine 11, where the physical machine 11 is a host of the virtual machine 12A and the virtual machine 12B, and taking a cloud computing scene as an example, a virtual machine entity may be a cloud host. The physical machine 11 is provided with a physical disk P1 and a physical disk P2, where the physical disk refers to a physical hard disk, and P1 and P2 are two hard disks installed on the physical machine 11, and in actual use, the physical disk needs to be partitioned, and a new disk formed by partitioning is a logical disk. In fig. 1, physical disk P1 is partitioned to obtain logical disk L1 and logical disk L3, that is, logical disks L1 and L3 are mapped to physical disk P1; partitioning physical disk P2 results in logical disks L2, L4 and L5, i.e., logical disks L2, L4 and L5 map to physical disk P2. It should be noted that the number of virtual machines on the physical machine 11, the mapping relationship between the physical disk and the logical disk, and the correspondence relationship between the virtual machines and the logical disk in fig. 1 are only examples.
Also, for a while, as shown in FIG. 1, logical disks L1, L2, and L3 are mounted on virtual machine 12A, and logical disks L4 and L5 are mounted on virtual machine 12B. Assuming that physical disk P1 failed after that period of time, then, as shown in FIG. 2, during another period of time, logical disk L2 mounted on virtual machine 12A is controlled, without including logical disks L1 and L3 mapped to failed physical disk P1. Thus, it is achieved that the logical disk mounted on the virtual machine 12A is controlled not to include the target logical disk mapped to the failed physical disk, so that in the case of a physical disk failure, the virtual machine 12A may also run based on other logical disks besides the target logical disk, and compared with the case where the virtual machine 12A cannot run, or the virtual machine 12A needs to be migrated to other physical machines, the impact of the physical disk failure on the virtual machine is reduced.
Alternatively, in order to avoid the problem of disk identifier drift caused by the virtual machine 12A not having the target logical disk installed, as shown in fig. 3, a specific logical disk for occupying the target logical disk identifier may be installed, the disk identifier of the logical disk L1 may be occupied by the specific logical disk 1, and the disk identifier of the logical disk L2 may be occupied by the specific logical disk 2. Since the specific logical disk is used to occupy the drive letter of the target logical disk, is not a real logical disk capable of being used for data storage of the virtual machine 12A, but is equivalent to a dummy disk, the specific logical disk may be a read-only logical disk in order to avoid the virtual machine 12A writing data to the specific logical disk during operation. As shown in fig. 3, a specific logical disk may be created in the non-failed physical disk P2. Based on this, the specific logical disk 1 and the specific logical disk 2 of the virtual machine 12A may be mapped to the physical disk P2.
It should be noted that, the present application is mainly directed to a case where a part of logical disks of a virtual machine fails, and an operating system of the virtual machine is deployed in a non-failed logical disk.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 4 is a flowchart illustrating a control method of a virtual machine according to an embodiment of the present application, where an execution main body of the embodiment may be a control device of the virtual machine, and the control device may be included in the physical machine 11, or may also be included in another device, which is used for controlling the virtual machine on the physical machine 11, outside the physical machine 11. As shown in fig. 4, the method of this embodiment may include:
step 401, determining a physical disk fault of a target slot according to fault information, wherein a mapping relation exists between the physical disk and a target logical disk of a virtual machine;
step 402, controlling the logical disk mounted on the virtual machine to be another logical disk except the target logical disk, where the other logical disk and the physical disk except the physical disk of the target slot have a mapping relationship, and the other logical disk is used to support the running of the virtual machine.
In this embodiment, the control device may obtain the fault information from the hardware center, and the hardware center may monitor the state of the physical disk installed on the host in real time, and in the case of a fault of the physical disk of a target slot on the host, the hardware center may generate the fault information, where the fault information may include, for example, a slot number of the target slot. The hardware center may be a functional module implemented by software, and may be deployed on the host machine, or may be deployed on other devices besides the host machine, and when the number of host machines monitored by the hardware center is multiple, the fault information may further include an identifier of the host machine to which the target slot belongs, so as to indicate which slot of the host machine has a physical disk fault. The hardware center may actively send the fault information to the control device after the fault information, or the hardware center may return the fault information to the control device when the control device actively queries. Of course, in other embodiments, the control device may also obtain the fault information in other manners, which is not limited in this application.
After the control device obtains the failure information, it may determine that the physical disk of the target slot has a failure according to the failure information, where the physical disk and the target logical disk of the virtual machine have a mapping relationship, that is, the target logical disk is mapped to the physical disk. It is to be understood that the virtual machines are implemented in hosts corresponding to the target slots, the number of the virtual machines may be one or more, and the number of the target logical disks in one virtual machine may be one or more.
In this embodiment of the application, the control device may obtain information, such as a virtual machine and a disk, affected by the physical disk from a query. For example, according to the mapping relationship between the physical disk and the logical disk, a logical disk (i.e., a target logical disk) mapped to the physical disk may be determined to obtain a disk affected by the physical disk, and further, according to the mounting relationship between the logical disk and the virtual machine, a virtual machine mounted on the target logical disk may be determined to obtain a virtual machine affected by the physical disk. Of course, in other embodiments, the control device may also obtain information of the virtual machine, the disk, and the like affected by the physical disk in other manners.
In this embodiment of the present application, when it is determined that a physical disk of a target slot fails, and a logical disk having a mapping relationship with the physical disk is a target logical disk of the virtual machine, the logical disk mounted on the virtual machine may be controlled to be a logical disk other than the target logical disk, where the logical disk has a mapping relationship with the physical disk other than the physical disk of the target slot, and the logical disk is used to support the operation of the virtual machine. According to different stages of the virtual machine, specific ways of controlling the logical disk mounted on the virtual machine to be other logical disks than the target logical disk may be different.
Optionally, the controlling the logical disk mounted on the virtual machine to be another logical disk than the target logical disk specifically may include: and controlling the target logic disk to be unloaded from the virtual machine in the running process of the virtual machine. Based on the method, the logic disk mounted on the virtual machine can be controlled to be other logic disks under the condition of not stopping the virtual machine, so that the service provided by the virtual machine cannot be interrupted.
The control device may enable the target logical disk to be unloaded from the virtual machine by means of a virtualization service, and specifically, the control device may send an unloading message to the virtualization service, and the virtualization service may unload the target logical disk from the virtual machine according to the unloading message. The unloading of the target logical disk from the virtual machine may refer to removing the target logical disk from a Peripheral Component Interconnect (PCI) bus of the virtual machine. The virtualization service may be a software-implemented functional module, which may be deployed on a host, and may be used to be responsible for starting a Virtual Machine, unloading and mounting a disk, and the like, and specifically, the virtualization service may be a Kernel-based Virtual Machine (KVM) virtualization service. Of course, in other embodiments, the control of unloading the target logical disk from the virtual machine in the process of running the virtual machine may also be implemented in other ways, which is not limited in this application.
Optionally, the controlling the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk may specifically include: and controlling the logic disk mounted on the virtual machine to be the other logic disks in the process of starting the virtual machine. The disk identifier of the logical disk to be mounted by the virtual machine can be controlled to only include the disk identifiers of other logical disks, but not include the disk identifier of the target logical disk, so as to control the logical disk mounted on the virtual machine to be other logical disks. The control device may mount the other logical disk to the virtual machine by using a virtualization service, and the mounting of the other logical disk to the virtual machine may be to add the other logical disk to a PCI bus of the virtual machine. Of course, in other embodiments, it may also be implemented in other manners that, in the process of starting the virtual machine, the logical disk mounted on the virtual machine is controlled to be the other logical disk, which is not limited in this application.
In this embodiment of the present application, optionally, in the case that it is determined that the physical disk of the target slot is failed, the physical disk of the target slot may be removed from the resource pool. The resource pool may be understood as a resource set that can be used for a virtual machine, and by removing the physical disk of the target slot from the resource pool, problems caused by resale of the physical disk of the target slot, for example, problems caused by newly creating a logical disk in the physical disk to newly create a failed logical disk, can be prevented. For example, the removal of the physical disk of the target slot from the resource pool may be achieved by setting an unavailable flag for the physical disk of the target slot in the resource pool. Of course, in other embodiments, the removal of the physical disk of the target slot from the resource pool may be implemented in other manners, which is not limited in this application.
In the embodiment of the application, the virtual machine may have a corresponding user, for example, in a cloud computing scenario, a cloud platform may provide different virtual machines for different users, so as to provide services for different users. Based on this, in order to ensure the control capability of the user on the virtual machine, before the logical disk mounted on the virtual machine is controlled to be a logical disk other than the target logical disk, the method may further include: a user of the virtual machine sends a fault message; and obtaining the isolation authorization of the user for the fault message feedback. For example, the control device may query for user information of the virtual machine to determine a user of the virtual machine. Of course, in other embodiments, the user of the virtual machine may be determined in other manners, which is not limited in this application.
For example, the failure message may carry an identifier of the virtual machine and an identifier of the target logical disk, so that the user may know which target logical disk or disks on which virtual machine failed. For example, after receiving the fault message, the terminal used by the user may display an interface as shown in fig. 5, and the user may select the "isolate" button or the "migrate" button in fig. 5, where selecting the "isolate" button may indicate that the user authorizes not to mount the fault logical disk, and based on this, the isolation authorization of the user for the fault message feedback may be obtained. Selecting a "migration" button may indicate that a user authorizes the migration of the virtual machine, based on which migration authorization of the user for the fault message feedback is obtained to migrate the virtual machine to a physical machine other than the physical machine. Of course, in other embodiments, the isolation authorization of the user for the fault message feedback may also be obtained in other manners, which is not limited in this application. It should be noted that the manner of prompting the user with the failure message in fig. 5 is only an example.
In this embodiment, as shown in fig. 3, to solve the problem of disk identifier drift, after the controlling the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk, the method may further include: and controlling to create a read-only specific logical disk on a physical disk other than the physical disk of the target slot, and controlling to mount the specific logical disk to the virtual machine, wherein the specific logical disk is used for occupying a drive letter of the target logical disk. In one example, the control device may implement creating the read-only specific logical disk by using a storage service, and specifically, the control device may send a creation message to the storage service, and the storage service may create the read-only specific logical disk according to the creation message. The storage service may be a software-implemented functional module, which may be deployed on a host, and may be used to take charge of operations such as creation and deletion of a logical disk. Further, the control device may mount the specific logical disk to the virtual machine by means of a virtualization service, and specifically, the control device may send a mount message to the virtualization service, and the virtualization service may mount the specific logical disk to the virtual machine according to the mount message. Of course, in other embodiments, the creation and mounting of a specific logical disk may be controlled in other ways, which is not limited in this application.
In general, for some virtualization services, such as KVM-based virtualization services, the disk drive determines the drive letter of the logical disk based on the scanning order of the logical disk, and the virtual machine includes three logical disks, and the drive letters are/dev/vda,/dev/vdb and/dev/vdc, respectively, according to the scanning order of the three logical disks. Assuming that the logical disk with the disk identifier/dev/vdb is unloaded and the virtual machine is restarted, the disk identifier of the logical disk with the original disk identifier/dev/vdc is updated to/dev/vdb, and thus disk identifier drift occurs. Based on this, in order to avoid the disk identifier drift, after the logical disk with the disk identifier/dev/vdb is unloaded, the specific logical disk may be mounted to the virtual machine, when the specific logical disk is mounted, since/dev/vdb is unoccupied, the disk drive may determine that the disk identifier of the specific logical disk is/dev/vdb, and then the virtual machine is restarted, the logical disk corresponding to the disk identifier/dev/vdc will not change, thereby avoiding the problem of disk identifier drift.
In this embodiment of the present application, in a case that reading and writing of a disk need to pass through a storage service, the read-only characteristic of the specific logical disk may be implemented by the storage service. Currently, in other embodiments, the read-only characteristic of a specific logical disk may be implemented in other ways, which is not limited in this application. By using the specific logical disk as a read-only logical disk, the virtual machine can be prevented from writing data into the specific logical disk during the operation process, so as to support the effect that the specific logical disk is used for occupying the drive letter of the target logical disk. Further, to save resources, the controlling to create the read-only specific logical disk may specifically include: and controlling to create a specific logical disk with an initial space of 0 and read only on a physical disk other than the physical disk of the target slot.
In the embodiment of the present application, the control device may authorize a hardware center to maintain the physical disk of the target slot when determining that the physical disk of the target slot has a fault. In one example, the control device may send an authorization message to the hardware center, and the hardware center may initiate a repair procedure for the physical disk of the target slot based on the authorization message. Of course, in other embodiments, servicing of the physical disk of the target slot may be triggered in other ways. It should be noted that, the maintenance of the target slot physical disk may be to unplug the failed physical disk of the target slot and reinsert a new physical disk with the same specification as the failed physical disk; or, the position of the physical disk of the target slot may be to unplug the physical disk of the target slot, repair the physical disk, and reinsert the repaired physical disk into the target slot. It can be seen that the physical disk of the target slot before the maintenance and the physical disk of the target slot after the maintenance may be the same physical disk or different physical disks.
Further, after determining that the maintenance of the physical disk of the target slot is completed, the hardware center may return a maintenance success message to the control device, and the control device may determine that the failure of the physical disk of the target slot has been recovered according to the maintenance success message. Of course, in other embodiments, the control device may also know that the physical disk failure of the target slot is recovered in other manners, which is not limited in this application.
In this embodiment of the present application, when it is determined that the physical disk failure of the target slot has recovered, the method may further include the following steps: and controlling to rebuild the target logical disk on the physical disk of the target slot position and controlling to mount the rebuilt target logical disk to the virtual machine. The target logical disk is reconstructed on the physical disk of the target slot position, so that the consistency of the logical disks of the virtual machine before and after the failure recovery of the physical disk is ensured.
Similar to the aforementioned controlling of the logical disk mounted on the virtual machine to be another logical disk than the target logical disk, the controlling of reconstructing the target logical disk on the physical disk of the target slot and controlling of mounting the reconstructed target logical disk to the virtual machine body may include: and in the running process of the virtual machine, controlling to rebuild the target logical disk on the physical disk of the target slot position, and controlling to mount the rebuilt target logical disk to the virtual machine. Therefore, the reconstruction of the target logical disk on the physical disk of the target slot position can be controlled under the condition of not stopping the virtual machine, so that the interruption of the service provided by the virtual machine is avoided. Alternatively, the controlling to reconstruct the target logical disk on the physical disk of the target slot and to mount the reconstructed target logical disk to the virtual machine entity may include: and in the process of starting the virtual machine, controlling to rebuild the target logical disk on the physical disk of the target slot position, and controlling to mount the rebuilt target logical disk to the virtual machine.
Similar to the foregoing, the control apparatus may control, by means of a storage service, to reconstruct the target logical disk on the physical disk of the target slot, and control, by means of a virtualization service, to mount the reconstructed target logical disk to the virtual machine. Of course, in other embodiments, the target logical disk may be controlled to be rebuilt and mounted in other manners, which is not limited in this application.
In this embodiment of the present application, optionally, under the condition that it is determined that the physical disk failure of the target slot is recovered, the physical disk of the target slot may also be placed in a resource pool. The physical disk of the target slot position is placed into a resource pool, so that the physical disk of the target slot position can be sold again, for example, a logical disk can be newly built in the physical disk of the target slot position, and the utilization rate of resources is improved. For example, the physical disk of the target slot may be placed in the resource pool by clearing the unavailable identifier of the physical disk of the target slot in the resource pool. Of course, in other embodiments, the physical disk of the target slot may be placed in the resource pool in other manners, which is not limited in this application.
Similar to the foregoing isolation authorization, in this embodiment of the application, before the controlling mounts the target logical disk to the virtual machine again, the method may further include: sending a failure recovery message to a user of the virtual machine; and acquiring the recovery authorization of the user for the fault recovery message feedback. For example, the failure recovery message may carry an identifier of the virtual machine and an identifier of the target logical disk, so that the user may know which target logical disk or target logical disks on which virtual machine failed to recover. For example, the terminal used by the user may display an interface as shown in fig. 6 after receiving the failure recovery message, and the user may select an "ok" button or a "cancel" button in fig. 6, where selecting the "ok" button may indicate that the user authorizes failure recovery of the target logical disk, and based on this, the recovery authorization fed back by the user for the failure recovery message may be obtained. Selecting the "cancel" button may indicate that the user does not authorize the failover authorization of the target logical disk to migrate the virtual machine, based on which the recovery authorization fed back by the user for the failover message cannot be obtained, and thus the step of rebuilding and mounting the target logical disk is not performed. Of course, in other embodiments, the recovery authorization of the user for the fault recovery message feedback may also be obtained in other manners, which is not limited in this application. It should be noted that the manner of prompting the user with the failure recovery message in fig. 6 is only an example.
In this embodiment of the application, when a specific logical disk for occupying a disk file is mounted on the virtual machine, before the controlling mounts the reconstructed target logical disk to the virtual machine, the method may further include: controlling the unloading of the particular logical disk from the virtual machine. For a specific way of controlling the unloading of a specific logical disk from the virtual machine, reference may be made to the foregoing description of unloading a logical disk, and details are not described herein again. On the basis that the drive letter of the specific logical disk is/dev/vdb, the specific logical disk is unloaded, the unloaded drive letter/dev/vdb is vacated, the reconstructed target logical disk is further mounted, and the drive letter of the reconstructed target logical disk can be/dev/vdb, so that the drive letter of the target logical disk is consistent before and after the physical disk fault of the target slot is recovered.
According to the control method of the virtual machine provided by the embodiment of the application, the physical disk fault of the target slot position is determined according to the fault information, the physical disk and the target logical disk of the virtual machine have a mapping relation, the logical disk mounted on the virtual machine is controlled to be the other logical disk except the target logical disk, the other logical disk and the physical disk except the physical disk of the target slot position have a mapping relation, and the other logical disk is used for supporting the running of the virtual machine.
The steps shown in fig. 4 may be implemented by one system, or may be implemented by a plurality of systems, for example, by two systems, where one system is a first system and the other system is a second system, and for the first system, the first system may be deployed in the physical machine 11 or may be deployed in another device besides the physical machine 11. As shown in fig. 7, the method for controlling the virtual machine may include the following steps:
step 701, a first system determines that a physical disk of a target slot has a fault according to fault information, and the physical disk and a target logical disk of a virtual machine have a mapping relation;
it should be noted that step 701 is similar to step 401, and is not described herein again.
Step 702, the first system notifies a second system to isolate the target logical disk of the virtual machine, so that the second system controls a logical disk mounted on the virtual machine to be another logical disk except the target logical disk, where the other logical disk has a mapping relationship with a physical disk except a physical disk of the target slot, and the other logical disk is used for supporting the running of the virtual machine.
In this embodiment of the application, the first system may notify the second system to isolate the target logical disk of the virtual machine by sending a message to the second system, or the first system may notify the second system to isolate the target logical disk of the virtual machine by calling an interface function provided by the second system. Of course, in other embodiments, the first system may also notify the second system of isolating the target logical disk of the virtual machine in other manners, which is not limited in this application.
In one example, the second system may be configured to manage a lifecycle of the virtual machine, the disk, and the like, and the first system may query the second system to obtain information of the virtual machine, the disk, and the like affected by the physical disk. The second system may maintain a mapping relationship between a physical disk and a logical disk and a mount relationship between the logical disk and a virtual machine, and may determine a logical disk (i.e., a target logical disk) mapped to the physical disk according to the mapping relationship, so as to obtain a disk affected by the physical disk. Further, according to the mount relationship, the virtual machine mounting the target logical disk can be determined, so as to obtain the virtual machine affected by the physical disk. Of course, in other embodiments, the first system may also obtain information of the virtual machine, the disk, and the like affected by the physical disk in other manners.
In this embodiment of the application, before the first system notifies the second system to isolate the target logical disk of the virtual machine, the method may further include: sending a fault message to a user of the virtual machine; and obtaining the isolation authorization of the user for the fault message feedback. In one example, the second system may also maintain user information for the virtual machine, upon which the first system may determine the user of the virtual machine by obtaining the user information for the virtual machine from a query of the second system. Of course, in other embodiments, the user of the virtual machine may be determined in other manners, which is not limited in this application. It should be noted that, for specific contents of the quarantine authorization, reference may be made to the related description of the embodiment shown in fig. 4, and details are not described here again.
In this embodiment of the application, the first system may further: notifying the second system to remove the physical disk of the target slot from the resource pool if it is determined that the physical disk of the target slot is failed. For example, the second system may be notified by a message or interface function or the like that the physical disk of the target slot is to be removed from the resource pool.
In this embodiment of the application, after the first system notifies the second system to isolate the target logical disk of the virtual machine, the method may further include: and under the condition that the failure of the physical disk of the target slot is determined to be recovered, informing the second system of recovering the target logical disk of the virtual machine, so that the second system controls to rebuild the target logical disk on the physical disk of the target slot and controls to mount the rebuilt logical disk to the virtual machine. It should be noted that, for specific contents of the target slot where the physical disk failure is recovered, reference may be made to the related description of the embodiment shown in fig. 4, and details are not described here again.
In this embodiment of the application, before notifying the second system to restore the target logical disk of the virtual machine, the method may further include: sending a failure recovery message to a user of the virtual machine; and acquiring the recovery authorization of the user for the fault recovery message feedback. It should be noted that, for specific contents of recovering the authorization, reference may be made to the related description of the embodiment shown in fig. 4, and details are not described herein again.
In this embodiment of the application, the first system may further: and under the condition that the physical disk fault of the target slot position is recovered, informing the second system to place the physical disk of the target slot position into a resource pool. For example, the second system may be notified by a message or an interface function, etc., that the physical disk of the target slot is to be placed in the resource pool.
In the control method for a virtual machine provided in the embodiment of the present application, a first system determines a physical disk fault of a target slot according to fault information, where the physical disk and a target logical disk of the virtual machine have a mapping relationship, and the first system notifies a second system to isolate the target logical disk of the virtual machine, so that the logical disk mounted on the second system to control the virtual machine is another logical disk than the target logical disk, the other logical disk has a mapping relationship with the physical disk than the physical disk of the target slot, and the other logical disk is used to support the running of the virtual machine, so that when the physical disk of the target slot fails, the first system notifies the second system to isolate the target logical disk of the virtual machine, so that the logical disk mounted on the virtual machine affected by the physical disk fault does not include the target logical disk mapped to the failed physical disk, and the virtual machine can run based on another logical disk than the target logical disk, compared with the virtual machine which cannot run or needs to be migrated to other physical machines, the influence of the physical disk fault on the virtual machine is reduced.
The second system may be deployed on the physical machine 11, or may be deployed on another device outside the physical machine 11, or the second system may employ a client-server (C-S) architecture, a client may be deployed on the physical machine 11, and a server may be deployed on another device outside the physical machine 11. For the second system, as shown in fig. 8, the method for controlling the virtual machine may include the steps of:
step 801, a second system acquires a notification of a target logical disk of a first system isolation virtual machine; the notification is sent by the first system under the condition that a physical disk of a target slot position is determined to be in fault, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
step 802, the second system controls the logical disk mounted on the virtual machine to be another logical disk except the target logical disk according to the notification, where the other logical disk has a mapping relationship with the physical disk except the physical disk of the target slot, and the other logical disk is used to support the running of the virtual machine.
In this embodiment of the application, the controlling, according to the notification, the logical disk mounted on the virtual machine to be another logical disk than the target logical disk may specifically include: controlling the target logic disk to be unloaded from the virtual machine in the running process of the virtual machine; or, in the process of starting the virtual machine, controlling the logical disk mounted on the virtual machine to be the other logical disk. It should be noted that, for specific contents of controlling the logical disk mounted on the virtual machine to be other logical disks than the target logical disk, reference may be made to the relevant description of the embodiment shown in fig. 4, and details are not repeated here.
In this embodiment of the application, after the second system controls the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk, the method may further include: and controlling to create a read-only specific logical disk on a physical disk other than the physical disk of the target slot, and controlling to mount the specific logical disk to the virtual machine, wherein the specific logical disk is used for occupying a drive letter of the target logical disk. It should be noted that, with regard to controlling the specific content of creating and mounting a specific logical disk, reference may be made to the related description of the embodiment shown in fig. 4, and details are not described here again.
In this embodiment of the application, the second system may further: acquiring a notice that the first system removes the physical disk of the target slot from a resource pool; and removing the physical disk of the target slot from the resource pool according to the notification. It should be noted that, for specific contents of removing the physical disk of the target slot from the resource pool, reference may be made to the related description of the embodiment shown in fig. 4, and details are not described here again.
In this embodiment of the application, the second system may further: acquiring a notification that the first system recovers the target logical disk; and controlling to rebuild the target logical disk on the physical disk of the target slot position according to the notification, and controlling to mount the rebuilt target logical disk to the virtual machine. It should be noted that, for specific contents of reconstructing and mounting the target logical disk, reference may be made to the related description of the embodiment shown in fig. 4, and details are not described here again.
In this embodiment of the application, the second system may further: acquiring a notice that the first system puts the physical disk of the target slot position into a resource pool; and according to the notification, placing the physical disk of the target slot position into a resource pool. It should be noted that, for specific contents of placing the physical disk of the target slot into the resource pool, reference may be made to the related description of the embodiment shown in fig. 4, and details are not described here again.
The control method for the virtual machine provided in the embodiment of the application obtains the notification of the target logical disk of the first system isolation virtual machine through the second system, and controlling the logical disk mounted on the virtual machine to be other than the target logical disk according to the notification, the other logical disks have mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine, so that under the condition that the physical disks of the target slot fail, the second system controls the logical disks mounted on the virtual machines affected by the physical disk failure according to the notification of the first system not to include the target logical disk mapped to the failed physical disk, therefore, the virtual machine can also run based on other logical disks except the target logical disk, and compared with the condition that the virtual machine cannot run or needs to be migrated to other physical machines, the influence of physical disk faults on the virtual machine is reduced.
It should be noted that, in the embodiment of the present application, the first system and the second system may be deployed in the same device, or may be deployed in different devices.
Fig. 9 is a flowchart illustrating a control method for a virtual machine according to another embodiment of the present application. In this embodiment, based on the embodiments shown in fig. 7 and fig. 8, taking a logical disk that is controlled to be mounted on a virtual machine in the running process of the virtual machine as an example of another logical disk, an interaction process between a first system and a second system is mainly described. As shown in fig. 9, this embodiment may include the following steps:
step 901, the first system obtains fault information from the hardware center.
And 902, determining the physical disk fault of the target slot position by the first system according to the fault information.
Step 903, the first system informs a second system to remove the physical disk of the target slot from the resource pool;
step 904, the second system removes the physical disk from the resource pool according to the notification of the first system;
step 905, the first system queries the second system for information of the virtual machine, the target logical disk and the user, which are affected by the physical disk.
Step 906, the second system determines information of the virtual machines, the target logical disk, and the user that are affected by the physical disk, and returns the information to the first system.
Step 907, the first system sends a failure message to the user according to the information obtained by the query.
Step 908, the user returns an isolation authorization based on the fault message.
Step 909, the first system notifies the second system to isolate the target logical disk of the virtual machine.
Step 910, the second system instructs the virtual machine service to uninstall the target logical disk from the virtual machine according to the notification of the first system.
Step 911, the virtual machine service uninstalls the target logical disk from the virtual machine.
At step 912, the second system instructs the storage service to create a particular logical disk.
Step 913, the storage service creates a read-only specific logical disk;
step 914, the second system instructs a virtualization service to mount the particular logical disk to the virtual machine.
Step 915, the virtual machine service mounts the specific logical disk to the virtual machine.
It should be noted that steps 908-915 can be understood as an isolation process.
Step 916, the first system authorizes the hardware center to repair the physical disk of the target slot.
Step 917, the hardware center returns a successful maintenance to the first system after the maintenance of the physical disk of the target slot is completed.
Step 918, the first system sends a failure recovery message to the user.
In step 919, the user returns a recovery authorization according to the failure recovery message.
Step 920, the first system notifies the second system to restore the target logical disk.
Step 921, the second system instructs, according to the notification of the first system, a virtual machine service to uninstall the specific logical disk from the virtual machine.
Step 922, the virtual machine service uninstalls the specific logical disk from the virtual machine.
Step 923, the second system instructs a storage service to rebuild a target logical disk on the physical disk of the target slot.
Step 924, the storage service reconstructs the target logical disk on the physical disk of the target slot;
step 925, the second system instructs the virtual machine service to mount the reconstructed target logical disk to the virtual machine;
in step 926, the virtual machine service mounts the reconstructed target logical disk to the virtual machine.
Among these, steps 919-926 may be understood as a recovery procedure.
Step 927, the first system notifies the second system to place the physical disk of the target slot into a resource pool;
step 928, the second system puts the physical disk of the target slot into a resource pool according to the notification of the first system.
The flow sequence in fig. 9 is exemplified. The dashed line in fig. 9 represents the response.
In the control method for the virtual machine provided in the embodiment of the present application, a first system determines a physical disk fault of a target slot according to fault information, where the physical disk and a target logical disk of the virtual machine have a mapping relationship, the first system notifies a second system to isolate the target logical disk, the second system controls a logical disk mounted on the virtual machine according to the notification of the first system to be another logical disk except the target logical disk, the other logical disk and the physical disk except the physical disk of the target slot have a mapping relationship, and the other logical disk is used to support the operation of the virtual machine, so that the first system and the second system are mutually matched, and in case of the physical disk fault of the target slot, the virtual machine can also operate based on the other logical disk except the target logical disk, and compared with the case that the virtual machine cannot operate or needs to migrate the virtual machine to another physical machine, the influence of physical disk failures on the virtual machine is reduced.
Fig. 10 is a schematic structural diagram of a control device of a virtual machine according to an embodiment of the present application; referring to fig. 10, the present embodiment provides a control device, which may perform the method of the embodiment of the method shown in fig. 4, and specifically, the control device may include:
a determining module 101, configured to determine, according to failure information, that a physical disk of a target slot fails, where a mapping relationship exists between the physical disk and a target logical disk of a virtual machine;
a control module 102, configured to control the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk, where the other logical disks have a mapping relationship with physical disks other than the physical disk of the target slot, and the other logical disks are used to support operation of the virtual machine.
The control module 102 is specifically configured to: controlling the target logic disk to be unloaded from the virtual machine in the running process of the virtual machine; or, in the process of starting the virtual machine, controlling the logical disk mounted on the virtual machine to be the other logical disk.
Optionally, the apparatus further includes a first sending module and a first obtaining module;
the first sending module is used for sending a fault message to a user of the virtual machine;
the first obtaining module is configured to obtain an isolation authorization of the user for the fault message feedback.
Optionally, the control module 102 is further configured to control to create a read-only specific logical disk on a physical disk other than the physical disk of the target slot, and control to mount the specific logical disk to the virtual machine, where the specific logical disk is used to occupy a disk identifier of the target logical disk.
Optionally, the control module 102 is further configured to remove the physical disk of the target slot from the resource pool if it is determined that the physical disk of the target slot fails.
Optionally, the control module 102 is further configured to, when it is determined that the physical disk failure of the target slot is recovered, control to reconstruct the target logical disk on the physical disk of the target slot, and control to mount the reconstructed logical disk to the virtual machine.
Optionally, the apparatus further includes a second sending module and a second obtaining module;
the second sending module is configured to send a failure recovery message to a user of the virtual machine;
and the second obtaining module is used for obtaining the recovery authorization of the user for the fault recovery message feedback.
Optionally, in a case that a specific logical disk for occupying a disk identifier is mounted on the virtual machine, the control module 102 is further configured to control to unload the specific logical disk from the virtual machine.
Optionally, the control module 102 is further configured to, under the condition that it is determined that the physical disk failure of the target slot is recovered, place the physical disk of the target slot into a resource pool.
The apparatus shown in fig. 10 can perform the method of the embodiment shown in fig. 4, and reference may be made to the related description of the embodiment shown in fig. 4 for a part of this embodiment that is not described in detail. The implementation process and technical effect of the technical solution refer to the description in the embodiment shown in fig. 4, and are not described herein again.
In one possible implementation, the structure of the control device shown in fig. 10 may be implemented as a computer device. As shown in fig. 11, the computer apparatus may include: a processor 111 and a memory 112. Wherein the memory 112 is used for storing programs that support the computer device to execute the method provided by the embodiment shown in fig. 4, and the processor 111 is configured to execute the programs stored in the memory 112.
The program comprises one or more computer instructions, wherein the one or more computer instructions, when executed by the processor 111, are capable of performing the steps of:
determining the physical disk fault of a target slot position according to fault information, wherein the physical disk and a target logical disk of a virtual machine have a mapping relation;
and controlling the logical disks mounted on the virtual machine to be other logical disks except the target logical disk, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
Optionally, the processor 111 is further configured to perform all or part of the steps in the foregoing embodiment shown in fig. 4.
The computer device may further include a communication interface 113 for the computer device to communicate with other devices or a communication network.
Fig. 12 is a schematic structural diagram of a control apparatus of a virtual machine according to another embodiment of the present application; referring to fig. 12, the present embodiment provides a control device, which may perform the method of the embodiment shown in fig. 7, and specifically, the control device may include:
a determining module 121, configured to determine, according to the failure information, that a physical disk of the target slot has a failure, where a mapping relationship exists between the physical disk and a target logical disk of the virtual machine;
a notifying module 122, configured to notify a second system to isolate a target logical disk of a virtual machine, so that the second system controls a logical disk mounted on the virtual machine to be another logical disk except the target logical disk, where the other logical disk has a mapping relationship with a physical disk except a physical disk of the target slot, and the other logical disk is used to support the running of the virtual machine.
Optionally, the apparatus further comprises: the device comprises a first sending module and a first obtaining module;
the first sending module is used for sending a fault message to a user of the virtual machine;
the first obtaining module is configured to obtain an isolation authorization of the user for the fault message feedback.
Optionally, the notifying module 112 is further configured to notify the second system to remove the physical disk of the target slot from the resource pool in case that it is determined that the physical disk of the target slot fails.
Optionally, the notifying module 112 is further configured to notify the second system to recover the target logical disk of the virtual machine when it is determined that the physical disk failure of the target slot is recovered, so that the second system controls to reconstruct the target logical disk on the physical disk of the target slot, and controls to mount the reconstructed logical disk to the virtual machine.
Optionally, the apparatus further comprises: the second sending module and the second obtaining module;
the second sending module is configured to send a failure recovery message to a user of the virtual machine;
and the second obtaining module is used for obtaining the recovery authorization of the user for the fault recovery message feedback.
Optionally, the notifying module 112 is further configured to notify the second system to place the physical disk of the target slot into the resource pool, when it is determined that the physical disk failure of the target slot is recovered.
The apparatus shown in fig. 12 can execute the method of the embodiment shown in fig. 7, and reference may be made to the related description of the embodiment shown in fig. 7 for a part of this embodiment that is not described in detail. The implementation process and technical effect of the technical solution are described in the embodiment shown in fig. 7, and are not described herein again.
In one possible implementation, the structure of the control apparatus shown in fig. 12 may be implemented as a computer device. As shown in fig. 13, the computer apparatus may include: a processor 131 and a memory 132. Wherein the memory 132 is used for storing programs that support the computer device to execute the methods provided in the above-described embodiment shown in fig. 7, and the processor 131 is configured for executing the programs stored in the memory 132.
The program comprises one or more computer instructions which, when executed by the processor 131, enable the following steps to be performed:
determining the physical disk fault of a target slot position according to fault information, wherein the physical disk and a target logical disk of a virtual machine have a mapping relation;
and informing a second system to isolate the target logical disk so that the second system controls the logical disk mounted on the virtual machine to be other logical disks except the target logical disk, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
Optionally, the processor 131 is further configured to perform all or part of the steps in the foregoing embodiment shown in fig. 7.
The structure of the computer device may further include a communication interface 133, which is used for the computer device to communicate with other devices or a communication network.
Fig. 14 is a schematic structural diagram of a control apparatus of a virtual machine according to yet another embodiment of the present application; referring to fig. 14, the present embodiment provides a control device, which may perform the method of the embodiment shown in fig. 8, and specifically, the control device may include:
an obtaining module 141, configured to obtain a notification of a target logical disk of a first system isolation virtual machine; the notification is sent by the first system under the condition that a physical disk of a target slot position is determined to be in fault, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
a control module 142, configured to control, according to the notification, the logical disk mounted on the virtual machine to be another logical disk than the target logical disk, where the other logical disk has a mapping relationship with a physical disk except a physical disk of the target slot, and the other logical disk is used to support the running of the virtual machine.
Optionally, the control module 142 is specifically configured to, in a process of running the virtual machine, control to unload the target logical disk from the virtual machine; or, in the process of starting the virtual machine, controlling the logical disk mounted on the virtual machine to be the other logical disk.
Optionally, the control module 142 is further configured to control to create a read-only specific logical disk on a physical disk other than the physical disk of the target slot, and control to mount the specific logical disk to the virtual machine, where the specific logical disk is used to occupy a disk identifier of the target logical disk.
Optionally, the obtaining module 141 is further configured to obtain a notification that the first system removes the physical disk of the target slot from the resource pool;
the control module 142 is further configured to remove the physical disk of the target slot from the resource pool according to the notification.
Optionally, the obtaining module 141 is further configured to obtain a notification that the first system recovers the target logical disk;
the control module 142 is further configured to control to reconstruct the target logical disk on the physical disk of the target slot according to the notification, and control to mount the reconstructed target logical disk to the virtual machine.
Optionally, in a case that a specific logical disk for occupying a disk identifier is mounted on the virtual machine, the control module 142 is further configured to control to unload the specific logical disk from the virtual machine.
Optionally, the obtaining module 141 is further configured to obtain a notification that the first system places the physical disk of the target slot into the resource pool;
the control module 142 is further configured to place the physical disk of the target slot into a resource pool according to the notification.
The apparatus shown in fig. 14 can execute the method of the embodiment shown in fig. 8, and reference may be made to the related description of the embodiment shown in fig. 8 for a part of this embodiment that is not described in detail. The implementation process and technical effect of the technical solution refer to the description in the embodiment shown in fig. 8, and are not described herein again.
In one possible implementation, the structure of the control apparatus shown in fig. 14 may be implemented as a computer device. As shown in fig. 15, the computer apparatus may include: a processor 151 and a memory 152. Wherein the memory 152 is used for storing programs that support the computer device to execute the method provided in the embodiment shown in fig. 8, and the processor 151 is configured for executing the programs stored in the memory 152.
The program comprises one or more computer instructions, wherein the one or more computer instructions, when executed by the processor 151, enable the following steps to be performed:
acquiring a notice of a target logic disk of a first system isolation virtual machine; the notification is sent by the first system under the condition that a physical disk of a target slot position is determined to be in fault, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
and controlling the logical disk mounted on the virtual machine to be other logical disks except the target logical disk according to the notification, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
Optionally, the processor 151 is further configured to perform all or part of the steps in the foregoing embodiment shown in fig. 8.
The computer device may further include a communication interface 183 for the computer device to communicate with other devices or a communication network.
In addition, the present application provides a computer storage medium for storing computer software instructions for a computer device, which includes a program for executing the method embodiment shown in fig. 4.
Embodiments of the present application provide a computer storage medium for storing computer software instructions for a computer device, which includes a program for executing the method embodiment shown in fig. 7.
The present application provides a computer storage medium for storing computer software instructions for a computer device, which includes a program for executing the method embodiment shown in fig. 8.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described technical solutions and/or portions thereof that contribute to the prior art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein (including but not limited to disk storage, CD-ROM, optical storage, etc.).
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (28)

1. A control method of a virtual machine includes:
determining the physical disk fault of a target slot position according to fault information, wherein the physical disk and a target logical disk of a virtual machine have a mapping relation;
and controlling the logical disks mounted on the virtual machine to be other logical disks except the target logical disk, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
2. The method according to claim 1, wherein the controlling of the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk comprises:
controlling the target logic disk to be unloaded from the virtual machine in the running process of the virtual machine; or, in the process of starting the virtual machine, controlling the logical disk mounted on the virtual machine to be the other logical disk.
3. The method according to claim 1, before controlling the logical disk mounted on the virtual machine to be another logical disk than the target logical disk, further comprising:
sending a fault message to a user of the virtual machine;
and obtaining the isolation authorization of the user for the fault message feedback.
4. The method according to claim 1, further comprising, after the controlling the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk:
and controlling to create a read-only specific logical disk on a physical disk other than the physical disk of the target slot, and controlling to mount the specific logical disk to the virtual machine, wherein the specific logical disk is used for occupying a drive letter of the target logical disk.
5. The method of claim 1, further comprising:
removing the physical disk of the target slot from the resource pool if it is determined that the physical disk of the target slot fails.
6. The method according to any one of claims 1 to 5, further comprising, after the controlling the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk:
and under the condition that the failure of the physical disk of the target slot position is recovered, controlling to rebuild the target logical disk on the physical disk of the target slot position and controlling to mount the rebuilt logical disk to the virtual machine.
7. The method of claim 6, the controlling further comprising, prior to rebuilding the target logical disk on a physical disk of the target slot:
sending a failure recovery message to a user of the virtual machine;
and acquiring the recovery authorization of the user for the fault recovery message feedback.
8. The method of claim 6, wherein before the controlling mounts the reconstructed logical disk to the virtual machine in a case that a specific logical disk for occupying a disk letter is mounted on the virtual machine, further comprising:
controlling the unloading of the particular logical disk from the virtual machine.
9. The method of claim 6, further comprising:
and under the condition that the physical disk fault of the target slot position is recovered, putting the physical disk of the target slot position into a resource pool.
10. A control method of a virtual machine is applied to a first system, and comprises the following steps:
determining the physical disk fault of a target slot position according to fault information, wherein the physical disk and a target logical disk of a virtual machine have a mapping relation;
and informing a second system to isolate the target logical disk so that the second system controls the logical disk mounted on the virtual machine to be other logical disks except the target logical disk, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
11. The method of claim 10, prior to notifying a second system to isolate the target logical disk of the virtual machine, further comprising:
sending a fault message to a user of the virtual machine;
and obtaining the isolation authorization of the user for the fault message feedback.
12. The method of claim 10, further comprising:
notifying the second system to remove the physical disk of the target slot from the resource pool if it is determined that the physical disk of the target slot is failed.
13. The method of any of claims 10-12, after the notifying the second system to isolate the target logical disk of the virtual machine, further comprising:
and under the condition that the failure of the physical disk of the target slot is determined to be recovered, informing the second system of recovering the target logical disk of the virtual machine, so that the second system controls to rebuild the target logical disk on the physical disk of the target slot and controls to mount the rebuilt logical disk to the virtual machine.
14. The method of claim 13, prior to notifying the second system to restore the target logical disk of the virtual machine, further comprising:
sending a failure recovery message to a user of the virtual machine;
and acquiring the recovery authorization of the user for the fault recovery message feedback.
15. The method of claim 13, further comprising:
and under the condition that the physical disk fault of the target slot position is recovered, informing the second system to place the physical disk of the target slot position into a resource pool.
16. A control method of a virtual machine is applied to a second system, and comprises the following steps:
acquiring a notice of a target logic disk of a first system isolation virtual machine; the notification is sent by the first system under the condition that a physical disk of a target slot position is determined to be in fault, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
and controlling the logical disk mounted on the virtual machine to be other logical disks except the target logical disk according to the notification, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
17. The method according to claim 16, wherein the controlling, according to the notification, the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk comprises:
controlling the target logic disk to be unloaded from the virtual machine in the running process of the virtual machine; or, in the process of starting the virtual machine, controlling the logical disk mounted on the virtual machine to be the other logical disk.
18. The method of claim 16, after the controlling the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk, further comprising:
and controlling to create a read-only specific logical disk on a physical disk other than the physical disk of the target slot, and controlling to mount the specific logical disk to the virtual machine, wherein the specific logical disk is used for occupying a drive letter of the target logical disk.
19. The method of claim 16, further comprising:
acquiring a notice that the first system removes the physical disk of the target slot from a resource pool;
and removing the physical disk of the target slot from a resource pool according to the notification.
20. The method according to any one of claims 16-19, further comprising:
acquiring a notification that the first system recovers the target logical disk;
and controlling to rebuild the target logical disk on the physical disk of the target slot position according to the notification, and controlling to mount the rebuilt target logical disk to the virtual machine.
21. The method of claim 20, wherein before the controlling mounts the reconstructed target logical disk to the virtual machine in a case that a specific logical disk for occupying a disk letter is mounted on the virtual machine, further comprising:
controlling the unloading of the particular logical disk from the virtual machine.
22. The method of claim 20, further comprising:
acquiring a notice that the first system puts the physical disk of the target slot position into a resource pool;
and according to the notification, placing the physical disk of the target slot position into a resource pool.
23. A control apparatus of a virtual machine, comprising:
the determining module is used for determining the physical disk fault of the target slot position according to the fault information, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
and the control module is used for controlling the logical disk mounted on the virtual machine to be a logical disk other than the target logical disk, the other logical disks have a mapping relationship with the physical disk other than the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
24. A control device of a virtual machine is applied to a first system, and comprises:
the determining module is used for determining the physical disk fault of the target slot position according to the fault information, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
a notification module, configured to notify a second system to isolate a target logical disk of a virtual machine, so that the second system controls a logical disk mounted on the virtual machine to be another logical disk except the target logical disk, where the other logical disk has a mapping relationship with a physical disk except a physical disk of the target slot, and the other logical disk is used to support operation of the virtual machine.
25. A control device of a virtual machine, which is applied to a second system, the device comprises:
the acquisition module is used for acquiring a notification of a target logical disk of the first system isolation virtual machine; the notification is sent by the first system under the condition that a physical disk of a target slot position is determined to be in fault, and the physical disk and the target logical disk of the virtual machine have a mapping relation;
and the control module is used for controlling the logical disks mounted on the virtual machine to be other logical disks except the target logical disk according to the notification, wherein the other logical disks have a mapping relation with the physical disks except the physical disk of the target slot, and the other logical disks are used for supporting the running of the virtual machine.
26. A computer device, comprising: a memory, a processor; the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of claims 1 to 9.
27. A computer device, comprising: a memory, a processor; the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of claims 10 to 15.
28. A computer device, comprising: a memory, a processor; the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of claims 16 to 22.
CN202010214111.8A 2020-03-24 2020-03-24 Control method, device and equipment of virtual machine Pending CN113448676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010214111.8A CN113448676A (en) 2020-03-24 2020-03-24 Control method, device and equipment of virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010214111.8A CN113448676A (en) 2020-03-24 2020-03-24 Control method, device and equipment of virtual machine

Publications (1)

Publication Number Publication Date
CN113448676A true CN113448676A (en) 2021-09-28

Family

ID=77807467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010214111.8A Pending CN113448676A (en) 2020-03-24 2020-03-24 Control method, device and equipment of virtual machine

Country Status (1)

Country Link
CN (1) CN113448676A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980137A (en) * 2010-10-19 2011-02-23 成都市华为赛门铁克科技有限公司 Method, device and system for reconstructing redundant array of inexpensive disks
US8683260B1 (en) * 2010-12-29 2014-03-25 Emc Corporation Managing ownership of logical volumes
CN105279010A (en) * 2015-10-20 2016-01-27 华为技术有限公司 Virtual machine-based equipment heat replacing method and device
CN107239233A (en) * 2017-05-10 2017-10-10 杭州宏杉科技股份有限公司 A kind of disk array and data reconstruction method and storage device based on it
CN109558273A (en) * 2014-11-21 2019-04-02 华为技术有限公司 A kind of disk array backup method, electronic equipment and disk array

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980137A (en) * 2010-10-19 2011-02-23 成都市华为赛门铁克科技有限公司 Method, device and system for reconstructing redundant array of inexpensive disks
US8683260B1 (en) * 2010-12-29 2014-03-25 Emc Corporation Managing ownership of logical volumes
CN109558273A (en) * 2014-11-21 2019-04-02 华为技术有限公司 A kind of disk array backup method, electronic equipment and disk array
CN105279010A (en) * 2015-10-20 2016-01-27 华为技术有限公司 Virtual machine-based equipment heat replacing method and device
CN107239233A (en) * 2017-05-10 2017-10-10 杭州宏杉科技股份有限公司 A kind of disk array and data reconstruction method and storage device based on it

Similar Documents

Publication Publication Date Title
US9092248B1 (en) Systems and methods for restoring distributed applications within virtual data centers
US10169173B2 (en) Preserving management services with distributed metadata through the disaster recovery life cycle
US11099953B2 (en) Automatic data healing using a storage controller
CN103176831B (en) A kind of dummy machine system and management method thereof
EP2856317B1 (en) System and method for disaster recovery of multi-tier applications
CN106528327A (en) Data processing method and backup server
CN113032085A (en) Management method, device, server, management system and medium of cloud operating system
CN112395047A (en) Virtual machine fault evacuation method, system and computer readable medium
CN109582459A (en) The method and device that the trustship process of application is migrated
US11226746B2 (en) Automatic data healing by I/O
CN111831393A (en) Method for managing virtual machine, server and storage medium
CN115576743B (en) Operating system recovery method, operating system recovery device, computer equipment and storage medium
CN103713952A (en) Virtual disk distributed-memory method based on UFS (Universal Flash Storage)
CN116389233A (en) Container cloud management platform active-standby switching system, method and device and computer equipment
CN113448676A (en) Control method, device and equipment of virtual machine
CN115878361A (en) Node management method and device for database cluster and electronic equipment
CN114840362A (en) Cloud host recovery method, device and medium
US10423506B1 (en) Fast rebuild using layered RAID
CN104407806A (en) Method and device for revising hard disk information of redundant array group of independent disk (RAID)
CN110727652B (en) Cloud storage processing system and method for realizing data processing
US20210334001A1 (en) Host-aware discovery and backup configuration for storage assets within a data protection environment
CN113157392A (en) High-availability method and equipment for mirror image warehouse
CN111176886A (en) Database mode switching method and device and electronic equipment
CN110688193B (en) Disk processing method and device
US20230401127A1 (en) Suggesting blueprints for recovering computing objects

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210928

RJ01 Rejection of invention patent application after publication