CN112181593A - Virtual machine scheduling method, device, equipment and storage medium - Google Patents

Virtual machine scheduling method, device, equipment and storage medium Download PDF

Info

Publication number
CN112181593A
CN112181593A CN202011032087.2A CN202011032087A CN112181593A CN 112181593 A CN112181593 A CN 112181593A CN 202011032087 A CN202011032087 A CN 202011032087A CN 112181593 A CN112181593 A CN 112181593A
Authority
CN
China
Prior art keywords
virtual machine
standby virtual
nfs server
identification information
standby
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
CN202011032087.2A
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.)
Capitalonline Data Service Co ltd
Original Assignee
Capitalonline Data Service Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Capitalonline Data Service Co ltd filed Critical Capitalonline Data Service Co ltd
Priority to CN202011032087.2A priority Critical patent/CN112181593A/en
Publication of CN112181593A publication Critical patent/CN112181593A/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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Abstract

The application provides a method, a device, equipment and a storage medium for scheduling a virtual machine, wherein the method comprises the following steps: the method comprises the steps that first equipment receives state information of a Network File System (NFS) server; the first device determines whether the NFS server fails according to the state information; and sending a switching request to a second device under the condition that the first device determines that the NFS server fails, wherein the switching request is used for indicating the second device to switch the NFS server to the standby virtual machine according to the identification information of the standby virtual machine. The method and the device realize effective handling and processing of the faults of the NFS server, so that the NFS server can provide continuous and stable services, and the safety of data in the NFS server is improved.

Description

Virtual machine scheduling method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for scheduling a virtual machine.
Background
With the continuous development of computer technology, many techniques for improving the working efficiency of computers, such as virtualization, have appeared in the prior art.
Virtualization refers to virtualizing a physical computer into a plurality of logical computers by a virtualization technology, wherein each logical computer can be used as a virtual machine. That is, multiple logical computers can run simultaneously on one physical computer. In addition, a different operating system may run on each logical computer. In addition, each logic computer can be provided with a corresponding application program, so that the application programs on different logic computers can run independently without influencing each other.
In the prior art, a virtual machine may have multiple applications, one of the applications is that the virtual machine is used as a Network File System (NFS) server, and the NFS server may provide NFS services for a client. However, the NFS server may fail in some cases, so that the NFS server cannot provide a continuous and stable service, and the security of data in the NFS server is reduced.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for scheduling a virtual machine, which are used for solving the problems in the related art, and the technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a virtual machine scheduling method, including:
the method comprises the steps that first equipment receives state information of a Network File System (NFS) server;
the first device determines whether the NFS server fails according to the state information;
and sending a switching request to a second device under the condition that the first device determines that the NFS server fails, wherein the switching request is used for indicating the second device to switch the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
In one embodiment, the status information includes a fault type;
the determining, by the first device, whether the NFS server fails according to the state information includes:
the first equipment determines whether the fault type in the state information is a preset type;
if the fault type is a preset type, the first device sends fault verification information to the NFS server according to the preset type;
and if the first equipment does not receive the response information of the NFS server within the preset time, determining that the NFS server fails.
In one embodiment, the preset type includes at least one of: the NFS server timeout failure, the NFS server communication failure, the NFS service failure.
In a second aspect, an embodiment of the present application provides a virtual machine scheduling method, including:
the method comprises the steps that a second device receives a switching request sent by a first device when the NFS server is determined to be in fault;
the second equipment acquires the identification information of the standby virtual machine according to the switching request;
and the second device switches the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
In one embodiment, the obtaining, by the second device, the identification information of the standby virtual machine according to the switch request includes:
the second equipment queries a first preset table according to the switching request;
and if the first preset table comprises the identification information of the standby virtual machine, the second equipment acquires the identification information of the standby virtual machine from the first preset table.
In one embodiment, if the first preset table does not have identification information of the standby virtual machine, the second device creates the standby virtual machine.
In one embodiment, the obtaining, by the second device, the identification information of the standby virtual machine according to the switch request includes:
the second device sends an identification obtaining request to the third device according to the switching request, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine;
the second device receives identification information of the standby virtual machine from the third device.
In one embodiment, the method further comprises:
and if the second equipment does not receive the identification information of the standby virtual machine from the third equipment, the second equipment creates the standby virtual machine.
In one embodiment, switching the NFS server to the standby virtual machine includes:
migrating the storage disk of the NFS server to the standby virtual machine;
and exchanging the IP address of the NFS server and the IP address of the standby virtual machine.
In one embodiment, migrating the storage disk of the NFS server to the standby virtual machine includes:
migrating a storage disk of the NFS server to the standby virtual machine, starting NFS services in the standby virtual machine, and configuring a shared directory of the standby virtual machine according to data stored in the storage disk.
In a third aspect, an embodiment of the present application provides a virtual machine scheduling method, including:
the third equipment receives an identification obtaining request sent by the second equipment, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine;
the third equipment queries a first preset table according to the identification acquisition request;
if the first preset table comprises the identification information of the standby virtual machine, the third equipment sends the identification information of the standby virtual machine to the second equipment;
and if the first preset table does not have the identification information of the standby virtual machine, the third equipment creates the standby virtual machine and sends the identification information of the created standby virtual machine to the second equipment.
In one embodiment, before the third device receives the identifier obtaining request sent by the second device, the method further includes:
the third equipment acquires a second preset table, wherein the second preset table comprises the expected number of the standby virtual machines and the target configuration information of the standby virtual machines;
the third device creates the expected number of standby virtual machines according to the target configuration information;
the third equipment stores the information of the established standby virtual machine in the first preset table;
wherein, the information of the standby virtual machine comprises at least one of the following:
the identification information of the standby virtual machine, the address information of the standby virtual machine, the available area to which the standby virtual machine belongs, and the actual configuration information of the standby virtual machine.
In one embodiment, before the third device receives the identifier obtaining request sent by the second device, the method further includes:
the third device obtains the expected number of the standby virtual machines included in the second preset table;
the third device compares the expected number of the standby virtual machines with the number of the standby virtual machines actually available in the first preset table;
if the expected number of the standby virtual machines is greater than the number of the actually available standby virtual machines, the third device creates a preset number of standby virtual machines, wherein the preset number is an absolute value of a difference value between the expected number of the standby virtual machines and the number of the actually available standby virtual machines;
and if the expected number of the standby virtual machines is less than the number of the actually available standby virtual machines, deleting the preset number of standby virtual machines by the third equipment.
In one embodiment, the method further comprises:
after the third device creates or deletes the preset number of standby virtual machines, the third device updates the first preset table.
In a fourth aspect, an embodiment of the present application provides a virtual machine scheduling apparatus, where the apparatus includes:
the receiving module is used for receiving the state information of the network file system NFS server;
a determining module, configured to determine whether the NFS server fails according to the status information;
a sending module, configured to send, to the second device, a switching request when the determining module determines that the NFS server fails, where the switching request is used to instruct the second device to switch the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
In one embodiment, the status information includes a fault type; the determination module is specifically configured to: determining whether the fault type in the state information is a preset type; if the fault type is a preset type, the sending module is used for sending fault verification information to the NFS server according to the preset type; if the first device does not receive the response information of the NFS server within the preset time, the determining module determines that the NFS server fails.
In one embodiment, the preset type includes at least one of: the NFS server timeout failure, the NFS server communication failure, the NFS service failure.
In a fifth aspect, an embodiment of the present application provides a virtual machine scheduling apparatus, where the apparatus includes:
a receiving module, configured to receive a switching request sent by a first device when determining that an NFS server fails;
the acquisition module is used for acquiring the identification information of the standby virtual machine according to the switching request;
and the switching module is used for switching the NFS server into the standby virtual machine according to the identification information of the standby virtual machine.
In one embodiment, the obtaining module is specifically configured to: inquiring a first preset table according to the switching request; and if the first preset table comprises the identification information of the standby virtual machine, acquiring the identification information of the standby virtual machine from the first preset table.
In one embodiment, the apparatus further comprises: and the creating module is used for creating the standby virtual machine under the condition that the first preset table does not have the identification information of the standby virtual machine.
In one embodiment, the obtaining module is specifically configured to: sending an identification acquisition request to the third equipment according to the switching request, wherein the identification acquisition request is used for requesting identification information of the standby virtual machine; identification information of the standby virtual machine is received from the third device.
In one embodiment, the creation module is further configured to: creating the standby virtual machine in a case where the second device does not receive identification information of the standby virtual machine from the third device.
In one embodiment, the switching module is specifically configured to: migrating the storage disk of the NFS server to the standby virtual machine; and exchanging the IP address of the NFS server and the IP address of the standby virtual machine.
In one embodiment, the switching module is specifically configured to: migrating a storage disk of the NFS server to the standby virtual machine, starting NFS services in the standby virtual machine, and configuring a shared directory of the standby virtual machine according to data stored in the storage disk.
In a sixth aspect, an embodiment of the present application provides a virtual machine scheduling apparatus, where the apparatus includes:
the receiving module is used for receiving an identification obtaining request sent by the second equipment, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine;
the query module is used for querying the first preset table according to the identification acquisition request;
the sending module is used for sending the identification information of the standby virtual machine to the second equipment under the condition that the first preset table comprises the identification information of the standby virtual machine;
and the creating module is used for creating the standby virtual machine under the condition that the first preset table does not have the identification information of the standby virtual machine, and sending the identification information of the created standby virtual machine to the second equipment.
In one embodiment, the apparatus further comprises: the acquisition module is used for acquiring a second preset table before the receiving module receives the identifier acquisition request sent by the second device, wherein the second preset table comprises the expected number of the standby virtual machines and the target configuration information of the standby virtual machines; the creating module is further used for creating the expected number of standby virtual machines according to the target configuration information; the device also includes: the storage module is used for storing the information of the created standby virtual machine in the first preset table; wherein, the information of the standby virtual machine comprises at least one of the following: the identification information of the standby virtual machine, the address information of the standby virtual machine, the available area to which the standby virtual machine belongs, and the actual configuration information of the standby virtual machine.
In an embodiment, the obtaining module is further configured to obtain an expected number of the standby virtual machines included in the second preset table before the receiving module receives the identifier obtaining request sent by the second device; the device also includes: a comparing module, configured to compare the expected number of the standby virtual machines with the number of the standby virtual machines actually available in the first preset table; the creation module is further to: under the condition that the expected number of the standby virtual machines is larger than the number of the actually available standby virtual machines, creating a preset number of standby virtual machines, wherein the preset number is an absolute value of a difference value between the expected number of the standby virtual machines and the number of the actually available standby virtual machines; the device also includes: and the deleting module is used for deleting the preset number of the standby virtual machines under the condition that the expected number of the standby virtual machines is less than the number of the actually available standby virtual machines.
In one embodiment, the apparatus further comprises: and the updating module is used for updating the first preset table after the preset number of standby virtual machines are created or deleted.
In a seventh aspect, an embodiment of the present application provides a server, where the device includes: a memory and a processor. Wherein the memory and the processor are in communication with each other via an internal connection path, the memory is configured to store instructions, the processor is configured to execute the instructions stored by the memory, and the processor is configured to perform the method of any of the above aspects when the processor executes the instructions stored by the memory.
In an eighth aspect, embodiments of the present application provide a computer-readable storage medium, which stores a computer program, and when the computer program runs on a computer, the method in any one of the above-mentioned aspects is executed.
The advantages or beneficial effects in the above technical solution at least include: the state information of the NFS server is reported to the first equipment through the NFS server, and the switching request is sent to the second equipment when the first equipment determines that the NFS server fails according to the state information. The second device may obtain identification information of the standby virtual machine according to the switching request, and switch the NFS server having the failure to the standby virtual machine according to the identification information of the standby virtual machine, so that the standby virtual machine may serve as the NFS server to continue providing services, thereby achieving effective handling and processing of the NFS server failure, enabling the NFS server to provide continuous and stable services, and improving the security of data in the NFS server.
The foregoing summary is provided for the purpose of description only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present application will be readily apparent by reference to the drawings and following detailed description.
Drawings
In the drawings, like reference numerals refer to the same or similar parts or elements throughout the several views unless otherwise specified. The figures are not necessarily to scale. It is appreciated that these drawings depict only some embodiments in accordance with the disclosure and are therefore not to be considered limiting of its scope.
Fig. 1 is a flowchart of a virtual machine scheduling method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an application scenario according to an embodiment of the present application;
FIG. 3 is a flowchart of virtual machine scheduling according to an embodiment of the present application;
FIG. 4 is a flow diagram of virtual machine scheduling according to another embodiment of the present application;
FIG. 5 is a flow diagram of virtual machine scheduling according to another embodiment of the present application;
FIG. 6 is a flow diagram of virtual machine scheduling according to another embodiment of the present application;
FIG. 7 is a flow diagram of virtual machine scheduling according to another embodiment of the present application;
FIG. 8 is a schematic diagram of an application scenario according to another embodiment of the present application;
fig. 9 is a block diagram of a virtual machine scheduling apparatus according to an embodiment of the present application;
fig. 10 is a block diagram of a virtual machine scheduling apparatus according to another embodiment of the present application;
fig. 11 is a block diagram of a virtual machine scheduling apparatus according to another embodiment of the present application;
fig. 12 is a block diagram of a server according to an embodiment of the present application.
Detailed Description
In the following, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present application. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.
Virtualization refers to virtualizing a physical computer into a plurality of logical computers by a virtualization technology, wherein each logical computer can be used as a virtual machine. That is, multiple logical computers can run simultaneously on one physical computer. In addition, a different operating system may run on each logical computer. In addition, each logic computer can be provided with a corresponding application program, so that the application programs on different logic computers can run independently without influencing each other.
In addition, the virtualization may adopt a software method to redefine and divide Information Technology (IT) resources. Therefore, the IT resources can be dynamically allocated, flexibly scheduled and shared in a cross-domain mode, the utilization rate of the IT resources is improved, the IT resources can really become social infrastructure, and flexible and changeable application requirements in various industries are met. Multiple virtual machines created by virtualization technology may share storage resources of the physical layer of a physical computer.
In the prior art, a virtual machine may have multiple applications, one of the applications is to use the virtual machine as a Network File System (NFS) server, for example, one virtual machine may be used as an NFS server, and the NFS server may also be referred to as an NFS File server or a File storage server. Specifically, the NFS server may provide NFS services for the client. However, the NFS server may fail in some cases, so that the NFS server cannot provide a continuous and stable service, and the security of data in the NFS server is reduced. In order to solve the problem, an embodiment of the present application provides a virtual machine scheduling method. The following describes a virtual machine scheduling method provided in the embodiments of the present application in detail with reference to specific embodiments.
Fig. 1 shows a flowchart of a virtual machine scheduling method according to an embodiment of the present application. As shown in fig. 1, the method may include:
s101, receiving state information of a Network File System (NFS) server by first equipment.
The method according to the embodiment of the present application may be adapted to the application scenario as shown in fig. 2. As shown in fig. 2, the NFS server cluster includes a plurality of NFS servers, each of which may also be referred to as an NFS file server or a file storage server. Each NFS server in this embodiment may specifically be a virtual machine created based on virtual (VMware) technology. That is, the virtual machine in the present embodiment may be a VMware type virtual machine. Specifically, the method provided by the embodiment of the application can be applied to cloud computing in the field of computers, and monitoring and scheduling of NFS servers are performed based on VMware technology.
Specifically, the NFS server may provide an NFS service (NFS service) or a file storage service. Each NFS server may correspond to one or more storage disks storing data, a shared directory of the NFS server may be generated according to data in the one or more storage disks corresponding to each NFS server, and the NFS server may share the shared directory to a client or other applications when providing NFS services or file storage services.
Specifically, each NFS server may run both NFS services and Agent (Agent) services. In the NFS HA detection and alarm process, the proxy service is configured to detect status information of the NFS server periodically or aperiodically, and report the status information of the NFS server to a first device, where the first device may specifically be 21 shown in fig. 2. The process in which the proxy service periodically or non-periodically detects the state information of the NFS server may be referred to as an NFS high availability cluster (HA) detection process. For example, the NFS server cluster shown in fig. 2 includes a plurality of NFS servers, and a proxy service running in each NFS server may send, to the first device 21, status information of an NFS server corresponding to the proxy service. Accordingly, the first device 21 may receive status information of each NFS server in the NFS server cluster. Optionally, the status information may also be referred to as health status information. The status information may include a detection time of the status information and a fault type. Optionally, a notification (Notifier) service may be run in the first device 21.
And S102, the first device determines whether the NFS server fails according to the state information.
When receiving the state information of the NFS server, the first device 21 may determine whether the NFS server fails according to the state information of the NFS server. Specifically, the process of determining whether the NFS server fails according to the state information of the NFS server may specifically be an alarm process.
S103, sending a switching request to a second device when the first device determines that the NFS server fails, where the switching request is used to instruct the second device to switch the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
For example, in a case where the first device 21 determines that the NFS server fails, a switching request may be sent to the second device 22, and the second device 22 may be referred to as a virtual machine management center. The handover request may also be referred to as a handover NFS server request. When the second device 22 receives the switching request sent by the first device 21, the second device 22 may obtain the identification information of the standby virtual machine according to the switching request, and switch the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
It is understood that the handover request sent by the first device 21 to the second device 22 may include the number of failed NFS servers detected by the first device 21. Specifically, when the number of the NFS servers that have failed in the switching request is 1, the second device 22 may obtain identification information of one standby virtual machine, and replace the NFS server that has failed with the standby virtual machine. When the number of the NFS servers that have failed in the switching request is multiple, the second device 22 may obtain identification information of one standby virtual machine for each NFS server that has failed, and replace each NFS server that has failed with one standby virtual machine. In addition, the handover request sent by the first device 21 to the second device 22 may further include information such as identification information of the NFS server that has failed, an Internet Protocol (IP) address, and a port number.
The method and the device for switching the state information of the NFS server report the state information of the NFS server to the first device through the NFS server, and send a switching request to the second device when the first device determines that the NFS server fails according to the state information. The second device may obtain identification information of the standby virtual machine according to the switching request, and switch the NFS server having the failure to the standby virtual machine according to the identification information of the standby virtual machine, so that the standby virtual machine may serve as the NFS server to continue providing services, thereby achieving effective handling and processing of the NFS server failure, enabling the NFS server to provide continuous and stable services, and improving the security of data in the NFS server.
On the basis of the above embodiment, the status information includes a fault type; the first device determines whether the NFS server fails according to the status information, including the following steps as shown in fig. 3:
s301, the first device determines whether the fault type in the status information is a preset type.
For example, when the first device 21 receives the state information of the NFS server, it may detect whether the fault type is a preset type according to the fault type included in the state information. Optionally, the preset type includes at least one of the following types: the NFS server timeout failure, the NFS server communication failure, the NFS service failure. The NFS server timeout failure may specifically refer to that a proxy service in the NFS server reports status information overtime. The NFS server (NFS server) communication failure may specifically refer to a network communication failure of the NFS server. The NFS service failure may specifically refer to a failure of an NFS service running in an NFS server. The NFS server may be determined to be malfunctioning in the event of at least one of a timeout failure of the NFS server, a communication failure of the NFS server, and a service failure of the NFS server.
S302, if the fault type is a preset type, the first device sends fault verification information to the NFS server according to the preset type.
For example, in a case where the first device 21 determines that the state information of the NFS server includes at least one of the NFS server timeout failure, the NFS server communication failure, and the NFS service failure, the first device 21 may determine that the NFS server fails.
Or in a case that the first device 21 determines that the status information of the NFS server includes at least one of the NFS server timeout failure, the NFS server communication failure, and the NFS service failure, the first device 21 may further perform secondary confirmation, for example, the status information of the NFS server may further include an IP address and a port number of the NFS server. The first device 21 may send failure verification information to the NFS server according to the IP address and the port number of the NFS server. After confirming that the failure actually exists, the first device 21 may report a request for switching the NFS server to the virtual machine management center.
S303, if the first device does not receive the response information of the NFS server within a preset time, determining that the NFS server fails.
For example, when the fault type included in the state information of the NFS server is a timeout fault of the NFS server, the first device 21 may send fault verification information to the NFS server, where the fault verification information is used to request the NFS server to report the state information. If the first device 21 does not receive response information, such as status information, of the NFS server within a preset time after sending the failure verification information, the first device 21 determines that the NFS server fails.
Or in a case that the fault type included in the state information of the NFS server is a communication fault of the NFS server, the first device 21 may send fault verification information to the NFS server, where the fault verification information is used to detect network communication of the NFS server. If the first device 21 does not receive the response information of the NFS server within the preset time after sending the failure verification information, the first device 21 determines that the NFS server fails.
For another example, when the fault type included in the state information of the NFS server is an NFS service fault, the first device 21 may send fault verification information to the NFS server, where the fault verification information is used to query the shared directory of the NFS server. If the first device 21 does not receive response information of the NFS server, for example, the shared directory, within a preset time after sending the failure verification information, the first device 21 determines that the NFS server fails.
In this embodiment, whether the fault type in the status information is a preset type is determined by the first device, where the first device sends fault verification information to the NFS server according to the preset type when the fault type is the preset type, and the first device determines that the NFS server fails when the first device does not receive response information of the NFS server within a preset time, so that secondary confirmation of the NFS server failure is achieved, and accuracy of NFS server fault detection is improved.
Fig. 4 shows a flowchart of a virtual machine scheduling method according to another embodiment of the present application. As shown in fig. 4, the method may include:
s401, the second device receives a switching request sent by the first device when the NFS server is determined to have a fault.
As shown in fig. 2, when the first device 21 determines that the NFS server fails, a handover request is sent to the second device 22, and accordingly, the second device 22 receives the handover request sent by the first device 21. The second device 22 may execute a fail-over algorithm. The fail-over algorithm may include the steps of S402 and S403 as follows. In this embodiment, the first device 21 may be a physical computer, or the first device 21 may also be a virtual machine.
S402, the second device acquires the identification information of the standby virtual machine according to the switching request.
For example, in a case where the second device 22 receives the switching request sent by the first device 21, the second device 22 may obtain the identification information of the standby virtual machine according to the switching request. Specifically, there may be a plurality of implementation manners for the second device 22 to obtain the identification information of the standby virtual machine according to the switching request, and several possible implementation manners are described below.
In a possible implementation manner, the obtaining, by the second device, the identification information of the standby virtual machine according to the switching request includes: the second equipment queries a first preset table according to the switching request; and if the first preset table comprises the identification information of the standby virtual machine, the second equipment acquires the identification information of the standby virtual machine from the first preset table.
For example, in a case where the second device 22 receives the handover request sent by the first device 21, the second device 22 queries a first preset table according to the handover request, and the first preset table may specifically be a virtual machine pool state table. As shown in fig. 2, a plurality of virtual machines are included in the virtual machine pool, the virtual machines in the virtual machine pool are standby virtual machines, that is, the virtual machines in the virtual machine pool have not been used as NFS servers, and the virtual machines in the virtual machine pool are in a ready (ready) state. The virtual machine pool state table is used for recording information of the standby virtual machines in the virtual machine pool, for example, identification information of the standby virtual machines, address information of the standby virtual machines, available Areas (AZ) to which the standby virtual machines belong, actual configuration information of the standby virtual machines, and the like. The identification information of the standby virtual machine may be, for example, an identification number (ID), the address information of the standby virtual machine may be, for example, an IP address, and the actual configuration information of the standby virtual machine may specifically include a Central Processing Unit (CPU) and a memory corresponding to the standby virtual machine. The virtual machine pool state table may be stored in a database in which the second device 22 may query the virtual machine pool state table. In the case where the second device 22 determines that the virtual machine pool state table includes the identification information of the standby virtual machine, the identification information of the standby virtual machine may be acquired from the virtual machine pool state table.
Optionally, if the first preset table does not have the identification information of the standby virtual machine, the second device creates the standby virtual machine.
For example, in the case where the second device 22 determines that the virtual machine pool state table does not have identification information of the standby virtual machine, the second device 22 may create the standby virtual machine by itself. For example, the second device 22 may call the VMware virtual machine creation interface by itself to create a standby virtual machine, and then switch.
In another possible implementation manner, the obtaining, by the second device, the identification information of the standby virtual machine according to the switching request includes: the second device sends an identification obtaining request to the third device according to the switching request, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine; the second device receives identification information of the standby virtual machine from the third device.
For example, when the second device 22 receives the switching request sent by the first device 21, the second device 22 sends an identification obtaining request to the third device 23 according to the switching request, where the identification obtaining request is used for requesting identification information of the standby virtual machine. The third device 23 may run a virtual machine pool management service. The third device 23 may be a physical computer or a virtual machine. In addition, it is understood that the first device, the second device, and the third device in this embodiment may be the same device, or may be different devices independent of each other.
For example, the identification acquisition request includes the number of standby virtual machines that the second device 22 requests to acquire. In some embodiments, the identification acquisition request may further include an available area to which the standby virtual machine requested to be acquired by the second device 22 belongs. Specifically, the usable zone includes one or more server clusters, each server cluster including one or more physical computers, each physical computer including one or more virtual machines. The third device 23 obtains the identification information of the standby virtual machine according to the identification obtaining request sent by the second device 22, and sends the identification information of the standby virtual machine to the second device 22, and correspondingly, the second device 22 may receive the identification information of the standby virtual machine fed back by the third device 23.
Optionally, if the second device does not receive the identification information of the standby virtual machine from the third device, the second device creates the standby virtual machine.
For example, when there is no available standby virtual machine in the virtual machine pool, the third device 23 may not obtain the identification information of the standby virtual machine according to the identification obtaining request sent by the second device 22, at this time, the third device 23 may send failure information to the second device 22, or the third device 23 may not send information to the second device 22. In the event that the second device 22 determines that the identification information of the standby virtual machine has not been successfully received from the third device 23, the second device 22 may create the standby virtual machine itself.
S403, the second device switches the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
For example, the second device 22 runs a switching algorithm, and the switching algorithm may select a standby virtual machine from the virtual machine pool according to the switching request sent by the first device 21, and switch the NFS server to the standby virtual machine.
Optionally, switching the NFS server to the standby virtual machine includes: migrating the storage disk of the NFS server to the standby virtual machine; and exchanging the IP address of the NFS server and the IP address of the standby virtual machine.
For example, when the second device 22 switches the NFS server that has failed to the standby virtual machine, the second device 22 may control the NFS server that has failed to shut down, and further migrate the storage disk of the NFS server that has failed to the standby virtual machine. Illustratively, the storage Disk of the NFS server may be a Virtual hard Disk Format (VMware Virtual Machine Disk Format, VMDK) storage Disk created by the VMware of the Virtual Machine. In addition, the second device 22 may also interchange the IP address of the failed NFS server and the IP address of the standby virtual machine, so as to ensure that the switched standby virtual machine can continue to normally provide the NFS service for the client according to the IP address of the failed NFS server, that is, it can ensure that the IP address of the NFS service provided by the NFS server to the outside is unchanged.
Optionally, migrating the storage disk of the NFS server to the standby virtual machine includes: migrating a storage disk of the NFS server to the standby virtual machine, starting NFS services in the standby virtual machine, and configuring a shared directory of the standby virtual machine according to data stored in the storage disk.
For example, while the second device 22 migrates the VMDK storage of the NFS server that has failed to the standby virtual machine, the second device 22 may also start the NFS service in the standby virtual machine and configure the shared directory of the standby virtual machine according to the data stored in the VMDK storage in the standby virtual machine, so that the standby virtual machine may share the shared directory to clients or other applications.
In this embodiment, when the NFS server is switched to the standby virtual machine by the second device, the storage disk of the NFS server is migrated to the standby virtual machine, so that the integrity of data in the standby virtual machine is ensured. In addition, by interchanging the IP address of the NFS server and the IP address of the standby virtual machine, it can be ensured that the IP address of the NFS service provided by the NFS server to the outside does not change, that is, it is ensured that the switched standby virtual machine can continue to normally provide the NFS service for the client according to the IP address of the NFS server that has failed, and reliability of the NFS service is improved.
Fig. 5 shows a flowchart of a virtual machine scheduling method according to another embodiment of the present application. As shown in fig. 5, the method may include:
s501, the third device receives an identification obtaining request sent by the second device, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine.
For example, when the second device 22 newly creates a virtual machine or switches a failed NFS server, the second device 22 may send an identification acquisition request to the third device 23. Accordingly, the third device 23 may receive the identification obtaining request sent by the second device 22, where the identification obtaining request is used to request the identification information of the standby virtual machine.
And S502, the third equipment queries a first preset table according to the identification acquisition request.
For example, the third device 23 may run a virtual machine pool scheduling algorithm. In a case where the third device 23 receives the identifier obtaining request sent by the second device 22, the third device 23 may query a first preset table according to the identifier obtaining request, where the first preset table may be the virtual machine pool state table as described above. In particular, the third device 23 may read the virtual machine pool state table from the database.
S503, if the first preset table includes the identification information of the standby virtual machine, the third device sends the identification information of the standby virtual machine to the second device.
In a case where the third device 23 determines that the virtual machine pool state table includes the identification information of the standby virtual machine, the third device 23 may obtain the identification information of the standby virtual machine from the virtual machine pool state table, and send the identification information of the standby virtual machine to the second device 22. Further, the second device 22 may switch the NFS server that has failed to the standby virtual machine according to the identification information of the standby virtual machine.
And S504, if the first preset table does not have the identification information of the standby virtual machine, the third device creates the standby virtual machine and sends the identification information of the created standby virtual machine to the second device.
For example, in a case that the third device 23 determines that the virtual machine pool state table does not have the identification information of the standby virtual machine, the third device 23 may create the standby virtual machine by itself, and specifically, the third device 23 may call the VMware virtual machine creation interface by itself to create the standby virtual machine, and send the identification information of the created standby virtual machine to the second device 22.
In this embodiment, a third device receives an identifier obtaining request sent by a second device, and queries a first preset table according to the identifier obtaining request, and if the first preset table includes identifier information of a standby virtual machine, the third device sends the identifier information of the standby virtual machine to the second device. And if the first preset table does not have the identification information of the standby virtual machine, the third equipment creates the standby virtual machine and sends the identification information of the created standby virtual machine to the second equipment. The second device can acquire the identification information of the standby virtual machine through the third device, and time required by the second device to establish the standby virtual machine is saved.
On the basis of the foregoing embodiment, before the third device receives the identifier obtaining request sent by the second device, the method further includes the following steps as shown in fig. 6:
s601, the third device obtains a second preset table, where the second preset table includes an expected number of standby virtual machines and target configuration information of the standby virtual machines.
For example, the database further stores a second preset table, and the second preset table may be a virtual machine pool configuration table. The third device 23 may retrieve the virtual machine pool configuration table from the database. For example, when the second device 22 newly creates a virtual machine or switches a failed NFS server, the second device 22 may send an identifier obtaining request to the third device 23, and the third device 23 may read the virtual machine pool configuration table from the database according to the identifier obtaining request. The virtual machine pool configuration table may include an expected number of standby virtual machines, and target configuration information for the standby virtual machines. The target configuration information of the standby virtual machine comprises a target CPU and a target memory of the standby virtual machine. Specifically, the expected number of standby virtual machines in the virtual machine pool configuration table, and the target configuration information of the standby virtual machines may be configured at initialization time.
And S602, the third device creates the expected number of standby virtual machines according to the target configuration information.
For example, in the virtual machine pool monitoring process, if there is no standby virtual machine in the virtual machine pool at the time of initialization, at this time, the third device 23 may create the standby virtual machines of the expected number according to the target configuration information of the standby virtual machines, so that the number of the standby virtual machines in the virtual machines is the expected number. The desired number may be set by the user or may be set by the third device 23.
S603, the third device stores the information of the created standby virtual machine in the first preset table.
For example, when the expected number of the standby virtual machines is 8, after the third device 23 has created 8 standby virtual machines, the third device 23 may store the information of the 8 standby virtual machines in a first preset table, such as a virtual machine pool state table. That is, the third device 23 may generate the virtual machine pool state table according to the virtual machine pool configuration table. Wherein, the information of the standby virtual machine comprises at least one of the following: the identification information of the standby virtual machine, the address information of the standby virtual machine, the available area to which the standby virtual machine belongs, and the actual configuration information of the standby virtual machine.
Optionally, the third device 23 may automatically maintain the virtual machine pool configuration table according to the available area, and further, the third device 23 may generate the virtual machine pool state table corresponding to the available area according to the available area and the virtual machine pool configuration table of the available area. In addition, in some other embodiments, the third device 23 may also maintain the virtual machine pool state table according to the virtual machine pool configuration table.
A procedure of the third device 23 maintaining the virtual machine pool state table according to the virtual machine pool configuration table will be described below with reference to an embodiment. Specifically, on the basis of the above embodiment, before the third device receives the identifier obtaining request sent by the second device, the method further includes the following steps as shown in fig. 7:
s701, the third device obtains an expected number of standby virtual machines included in the second preset table.
For example, the third device 23 may periodically or aperiodically obtain the virtual machine pool configuration table from the database and obtain the expected number of standby virtual machines included in the virtual machine pool configuration table.
S702, the third device compares the expected number of the standby virtual machines with the number of the standby virtual machines actually available in the first preset table.
For example, the third device 23 may run a virtual machine pool monitoring algorithm to periodically execute the monitoring program. The expected number of standby virtual machines configured in the virtual machine pool configuration table is compared with the number of standby virtual machines actually available in the virtual machine pool state table. After obtaining the expected number of standby virtual machines, further obtaining the number of actually available standby virtual machines included in the virtual machine pool state table. Wherein the number of the actually available standby virtual machines included in the virtual machine pool state table is the same as the number of the standby virtual machines included in the virtual machine pool as shown in fig. 2. Further, the third device 23 compares the expected number of standby virtual machines with the number of actually available standby virtual machines.
S703, if the expected number of the standby virtual machines is greater than the number of the actually available standby virtual machines, the third device creates a preset number of standby virtual machines, where the preset number is an absolute value of a difference between the expected number of the standby virtual machines and the number of the actually available standby virtual machines.
In the case where the expected number of the standby virtual machines is greater than the number of the actually available standby virtual machines, the third device 23 may create a preset number of the standby virtual machines according to a difference between the expected number of the standby virtual machines and the number of the actually available standby virtual machines, the preset number being an absolute value of the difference. For example, the third device 23 may put creation requests for creating a preset number of standby virtual machines into the creation queue, and further execute the creation requests in the creation queue, so that the number of actually available standby virtual machines may satisfy the expected number.
S704, if the expected number of the standby virtual machines is less than the number of the actually available standby virtual machines, the third device deletes the preset number of standby virtual machines.
In the case where the expected number of the standby virtual machines is smaller than the number of the actually available standby virtual machines, the third device 23 may delete a preset number of the standby virtual machines according to a difference between the expected number of the standby virtual machines and the number of the actually available standby virtual machines, where the preset number is an absolute value of the difference. For example, the third device 23 may place deletion requests for deleting a preset number of standby virtual machines into a deletion queue, and further execute the deletion requests in the deletion queue so that the number of actually available standby virtual machines may satisfy the expected number.
Optionally, after the third device creates or deletes the preset number of standby virtual machines, the third device updates the first preset table.
For example, after the third device 23 creates a preset number of standby virtual machines, the information of the preset number of standby virtual machines is further recorded in the virtual machine pool state table. After the third device 23 deletes the preset number of standby virtual machines, the information of the preset number of standby virtual machines is further deleted from the virtual machine pool state table. So that the virtual machine pool state table can be continuously updated as the number of actually available standby virtual machines changes.
In the embodiment of the application, a third device obtains an expected number of standby virtual machines included in a second preset table, compares the expected number of the standby virtual machines with the number of the standby virtual machines actually available in the first preset table, and if the expected number of the standby virtual machines is greater than the number of the standby virtual machines actually available, the third device creates a preset number of standby virtual machines, where the preset number is an absolute value of a difference value between the expected number of the standby virtual machines and the number of the standby virtual machines actually available; if the expected number of the standby virtual machines is smaller than the number of the actually available standby virtual machines, the third device deletes the preset number of the standby virtual machines, so that the number of the actually available standby virtual machines can meet the expected number.
The virtual machine scheduling method described above is described below with reference to a specific embodiment. The virtual machine scheduling method comprises the following steps as shown in fig. 8:
s801, the third device 23 obtains the expected number of the standby virtual machines from the virtual machine pool configuration table in the database 24.
S802, the third device 23 creates a desired number of standby virtual machines.
S803, the standby virtual machine transmits the information to the third device 23.
S804, the third device 23 stores the information of the standby virtual machine in the virtual machine pool state table in the database 24.
S805, the NFS server sends the state information of the NFS server to the first device 21.
S806, the first device 21 sends failure verification information to the NFS server.
S807, the first device 21 does not receive the response information of the NFS server, and the first device 21 determines that the NFS server fails, and sends a handover request to the second device 22.
S808, the second device 22 sends an identifier obtaining request to the third device 23 according to the handover request.
S809, the third device 23 queries the virtual machine pool state table in the database 24 according to the identifier obtaining request, obtains identifier information of the standby virtual machine from the virtual machine pool state table, and feeds back the identifier information of the standby virtual machine to the second device 22.
S810, the second device 22 controls shutdown of the failed NFS server.
S811, the second device 22 migrates the storage disk of the NFS server with failure to the standby virtual machine.
S812, the second device 22 exchanges the IP address of the failed NFS server with the IP address of the standby virtual machine.
S813, the third device 23 monitors and maintains the standby virtual machine, for example, after S810-S813, the standby virtual machine becomes the NFS server, which is equivalent to the standby virtual machine in the virtual machine pool decreasing, at this time, the third device 23 may newly create a virtual machine in the virtual machine pool, so that the number of the standby virtual machines in the virtual machine pool is kept at the expected number.
The method and the device for switching the state information of the NFS server report the state information of the NFS server to the first device through the NFS server, and send a switching request to the second device when the first device determines that the NFS server fails according to the state information. The second device may obtain identification information of the standby virtual machine according to the switching request, and switch the NFS server having the failure to the standby virtual machine according to the identification information of the standby virtual machine, so that the standby virtual machine may serve as the NFS server to continue providing services, thereby achieving effective handling and processing of the NFS server failure, enabling the NFS server to provide continuous and stable services, and improving the security of data in the NFS server.
Fig. 9 is a block diagram illustrating a configuration of a virtual machine scheduling apparatus according to an embodiment of the present application. In the embodiment of the present application, the apparatus may specifically be the first device as in the above embodiments, or a component in the first device. As shown in fig. 9, the apparatus 90 may include:
a receiving module 91, configured to receive status information of a network file system NFS server;
a determining module 92, configured to determine whether the NFS server fails according to the status information;
a sending module 93, configured to send, to the second device, a switching request when the determining module determines that the NFS server fails, where the switching request is used to instruct the second device to switch the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
Optionally, the status information includes a fault type; the determining module 92 is specifically configured to: determining whether the fault type in the state information is a preset type; if the fault type is a preset type, the sending module 93 is configured to send fault verification information to the NFS server according to the preset type; if the first device does not receive the response information of the NFS server within the preset time, the determining module 92 determines that the NFS server fails.
Optionally, the preset type includes at least one of the following types: the NFS server timeout failure, the NFS server communication failure, the NFS service failure.
The functions of each module in each apparatus in the embodiment of the present application may refer to corresponding descriptions in the above method, and are not described herein again.
Fig. 10 is a block diagram illustrating a configuration of a virtual machine scheduling apparatus according to an embodiment of the present application. In the embodiment of the present application, the apparatus may specifically be the second device as in the above embodiments, or a component in the second device. As shown in fig. 10, the apparatus 100 may include:
a receiving module 101, configured to receive a switching request sent by a first device when determining that an NFS server fails;
an obtaining module 102, configured to obtain identification information of the standby virtual machine according to the switching request;
a switching module 103, configured to switch the NFS server to the standby virtual machine according to the identification information of the standby virtual machine.
Optionally, the obtaining module 102 is specifically configured to: inquiring a first preset table according to the switching request; and if the first preset table comprises the identification information of the standby virtual machine, acquiring the identification information of the standby virtual machine from the first preset table.
Optionally, the apparatus 100 further includes: a creating module 104, configured to create a standby virtual machine if the first preset table does not have the identification information of the standby virtual machine.
Optionally, the obtaining module 102 is specifically configured to: sending an identification acquisition request to the third equipment according to the switching request, wherein the identification acquisition request is used for requesting identification information of the standby virtual machine; identification information of the standby virtual machine is received from the third device.
Optionally, the creating module 104 is further configured to: creating the standby virtual machine in a case where the second device does not receive identification information of the standby virtual machine from the third device.
Optionally, the switching module 103 is specifically configured to: migrating the storage disk of the NFS server to the standby virtual machine; and exchanging the IP address of the NFS server and the IP address of the standby virtual machine.
Optionally, the switching module 103 is specifically configured to: migrating a storage disk of the NFS server to the standby virtual machine, starting NFS services in the standby virtual machine, and configuring a shared directory of the standby virtual machine according to data stored in the storage disk.
The functions of each module in each apparatus in the embodiment of the present application may refer to corresponding descriptions in the above method, and are not described herein again.
Fig. 11 shows a block diagram of a virtual machine scheduling apparatus according to an embodiment of the present application. In the embodiment of the present application, the apparatus may specifically be the third device as in the above embodiments, or a component in the third device. As shown in fig. 11, the apparatus 110 may include:
a receiving module 111, configured to receive an identifier obtaining request sent by a second device, where the identifier obtaining request is used to request identifier information of a standby virtual machine;
a query module 112, configured to query the first preset table according to the identifier obtaining request;
a sending module 113, configured to send, when the first preset table includes identification information of a standby virtual machine, the identification information of the standby virtual machine to the second device;
a creating module 114, configured to create the standby virtual machine if the first preset table does not have the identification information of the standby virtual machine, and send the identification information of the created standby virtual machine to the second device.
Optionally, the apparatus 110 further includes: an obtaining module 115, configured to obtain a second preset table before the receiving module 111 receives the identifier obtaining request sent by the second device, where the second preset table includes an expected number of the standby virtual machines and target configuration information of the standby virtual machines; the creating module 114 is further configured to create the expected number of standby virtual machines according to the target configuration information; the apparatus 110 further comprises: a storage module 116, configured to store information of the created standby virtual machine in the first preset table; wherein, the information of the standby virtual machine comprises at least one of the following: the identification information of the standby virtual machine, the address information of the standby virtual machine, the available area to which the standby virtual machine belongs, and the actual configuration information of the standby virtual machine.
Optionally, the obtaining module 115 is further configured to obtain, before the receiving module 111 receives the identifier obtaining request sent by the second device, an expected number of the standby virtual machines included in the second preset table; the apparatus 110 further comprises: a comparing module 117, configured to compare the expected number of the standby virtual machines with the number of the standby virtual machines actually available in the first preset table; the creation module 114 is further operable to: under the condition that the expected number of the standby virtual machines is larger than the number of the actually available standby virtual machines, creating a preset number of standby virtual machines, wherein the preset number is an absolute value of a difference value between the expected number of the standby virtual machines and the number of the actually available standby virtual machines; the apparatus 110 further comprises: a deleting module 118, configured to delete the preset number of standby virtual machines when the expected number of standby virtual machines is less than the number of actually available standby virtual machines.
Optionally, the apparatus 110 further includes: an updating module 119, configured to update the first preset table after the preset number of standby virtual machines are created or deleted.
The functions of each module in each apparatus in the embodiment of the present application may refer to corresponding descriptions in the above method, and are not described herein again.
Fig. 12 shows a block diagram of a server according to an embodiment of the present application. In this embodiment, the server may specifically be the first device, the second device, or the third device in the above embodiments. As shown in fig. 12, the server includes: a memory 1210 and a processor 1220, the memory 1210 having stored therein computer programs operable on the processor 1220. The processor 1220, when executing the computer program, implements the virtual machine scheduling method in the above-described embodiments. The number of the memory 1210 and the processor 1220 may be one or more.
The application program field restoration device further includes:
the communication interface 1230 is configured to communicate with an external device for data interactive transmission.
If the memory 1210, the processor 1220, and the communication interface 1230 are implemented independently, the memory 1210, the processor 1220, and the communication interface 1230 may be connected to each other by a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 12, but this is not intended to represent only one bus or type of bus.
Optionally, in an implementation, if the memory 1210, the processor 1220, and the communication interface 1230 are integrated into a chip, the memory 1210, the processor 1220, and the communication interface 1230 may communicate with each other through an internal interface.
Embodiments of the present application provide a computer-readable storage medium, which stores a computer program, and when the program is executed by a processor, the computer program implements the method provided in the embodiments of the present application.
The embodiment of the present application further provides a chip, where the chip includes a processor, and is configured to call and execute the instruction stored in the memory from the memory, so that the communication device in which the chip is installed executes the method provided in the embodiment of the present application.
An embodiment of the present application further provides a chip, including: the system comprises an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the processor is used for executing the method provided by the embodiment of the application.
It should be understood that the processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like. It is noted that the processor may be an advanced reduced instruction set machine (ARM) architecture supported processor.
Further, optionally, the memory may include a read-only memory and a random access memory, and may further include a nonvolatile random access memory. The memory may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may include a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available. For example, Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the present application are generated in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process. And the scope of the preferred embodiments of the present application includes other implementations in which functions may be performed out of the order shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the method of the above embodiments may be implemented by hardware that is configured to be instructed to perform the relevant steps by a program, which may be stored in a computer-readable storage medium, and which, when executed, includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module may also be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various changes or substitutions within the technical scope of the present application, and these should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (19)

1. A method for scheduling a virtual machine, the method comprising:
the method comprises the steps that first equipment receives state information of a Network File System (NFS) server;
the first equipment determines whether the NFS server fails according to the state information;
and sending a switching request to a second device under the condition that the first device determines that the NFS server fails, wherein the switching request is used for indicating the second device to switch the NFS server to a standby virtual machine according to identification information of the standby virtual machine.
2. The method of claim 1, wherein the status information includes a fault type;
the determining, by the first device, whether the NFS server fails according to the status information includes:
the first equipment determines whether the fault type in the state information is a preset type or not;
if the fault type is a preset type, the first device sends fault verification information to the NFS server according to the preset type;
and if the first equipment does not receive the response information of the NFS server within the preset time, determining that the NFS server fails.
3. The method of claim 2, wherein the preset type comprises at least one of:
the NFS server is out of time, the NFS server is out of communication, and the NFS service is out of service.
4. A method for scheduling a virtual machine, the method comprising:
the method comprises the steps that a second device receives a switching request sent by a first device when the NFS server is determined to be in fault;
the second equipment acquires identification information of the standby virtual machine according to the switching request;
and the second equipment switches the NFS server into the standby virtual machine according to the identification information of the standby virtual machine.
5. The method according to claim 4, wherein the obtaining, by the second device, the identification information of the standby virtual machine according to the switching request includes:
the second equipment queries a first preset table according to the switching request;
and if the first preset table comprises the identification information of the standby virtual machine, the second equipment acquires the identification information of the standby virtual machine from the first preset table.
6. The method of claim 5, further comprising:
and if the first preset table does not contain the identification information of the standby virtual machine, the second equipment creates the standby virtual machine.
7. The method according to claim 4, wherein the obtaining, by the second device, the identification information of the standby virtual machine according to the switching request includes:
the second equipment sends an identification obtaining request to third equipment according to the switching request, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine;
the second device receives identification information of a standby virtual machine from the third device.
8. The method of claim 7, further comprising:
and if the second equipment does not receive the identification information of the standby virtual machine from the third equipment, the second equipment creates the standby virtual machine.
9. The method of any of claims 4 to 8, wherein switching the NFS server to the standby virtual machine comprises:
migrating a storage disk of the NFS server to the standby virtual machine;
and interchanging the IP address of the NFS server and the IP address of the standby virtual machine.
10. The method of claim 9, wherein migrating the storage disk of the NFS server to the standby virtual machine comprises:
migrating a storage disk of the NFS server to the standby virtual machine, starting NFS services in the standby virtual machine, and configuring a shared directory of the standby virtual machine according to data stored in the storage disk.
11. A method for scheduling a virtual machine, the method comprising:
the third equipment receives an identification obtaining request sent by the second equipment, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine;
the third equipment queries a first preset table according to the identification acquisition request;
if the first preset table comprises identification information of a standby virtual machine, the third equipment sends the identification information of the standby virtual machine to the second equipment;
if the first preset table does not have the identification information of the standby virtual machine, the third device creates the standby virtual machine and sends the identification information of the created standby virtual machine to the second device.
12. The method of claim 11, wherein before the third device receives the identifier acquisition request sent by the second device, the method further comprises:
the third equipment acquires a second preset table, wherein the second preset table comprises the expected number of the standby virtual machines and target configuration information of the standby virtual machines;
the third equipment creates the standby virtual machines with the expected number according to the target configuration information;
the third equipment stores the information of the created standby virtual machine in the first preset table;
wherein, the information of the standby virtual machine comprises at least one of the following:
the identification information of the standby virtual machine, the address information of the standby virtual machine, the available area to which the standby virtual machine belongs, and the actual configuration information of the standby virtual machine.
13. The method of claim 11, wherein before the third device receives the identifier acquisition request sent by the second device, the method further comprises:
the third equipment acquires the expected number of the standby virtual machines in the second preset table;
the third device compares the expected number of the standby virtual machines with the number of the standby virtual machines which are actually available in the first preset table;
if the expected number of the standby virtual machines is greater than the number of the actually available standby virtual machines, the third device creates a preset number of standby virtual machines, wherein the preset number is an absolute value of a difference value between the expected number of the standby virtual machines and the number of the actually available standby virtual machines;
and if the expected number of the standby virtual machines is smaller than the number of the actually available standby virtual machines, deleting the preset number of standby virtual machines by the third equipment.
14. The method of claim 13, further comprising:
after the third device creates or deletes the preset number of standby virtual machines, the third device updates the first preset table.
15. A virtual machine scheduling apparatus, comprising:
the receiving module is used for receiving the state information of the network file system NFS server;
a determining module, configured to determine whether the NFS server fails according to the status information;
a sending module, configured to send a switching request to a second device when the determining module determines that the NFS server fails, where the switching request is used to instruct the second device to switch the NFS server to a standby virtual machine according to identification information of the standby virtual machine.
16. A virtual machine scheduling apparatus, comprising:
a receiving module, configured to receive a switching request sent by a first device when determining that an NFS server fails;
the acquisition module is used for acquiring the identification information of the standby virtual machine according to the switching request;
and the switching module is used for switching the NFS server into the standby virtual machine according to the identification information of the standby virtual machine.
17. A virtual machine scheduling apparatus, comprising:
the receiving module is used for receiving an identification obtaining request sent by second equipment, wherein the identification obtaining request is used for requesting identification information of the standby virtual machine;
the query module is used for querying a first preset table according to the identification acquisition request;
a sending module, configured to send, when the first preset table includes identification information of a standby virtual machine, the identification information of the standby virtual machine to the second device;
and the creating module is used for creating the standby virtual machine under the condition that the first preset table does not have the identification information of the standby virtual machine, and sending the identification information of the created standby virtual machine to the second equipment.
18. A server, comprising: a processor and a memory, the memory having stored therein instructions that are loaded and executed by the processor to implement the method of any of claims 1 to 14.
19. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 14.
CN202011032087.2A 2020-09-27 2020-09-27 Virtual machine scheduling method, device, equipment and storage medium Pending CN112181593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011032087.2A CN112181593A (en) 2020-09-27 2020-09-27 Virtual machine scheduling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011032087.2A CN112181593A (en) 2020-09-27 2020-09-27 Virtual machine scheduling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112181593A true CN112181593A (en) 2021-01-05

Family

ID=73944199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011032087.2A Pending CN112181593A (en) 2020-09-27 2020-09-27 Virtual machine scheduling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112181593A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277810A (en) * 2022-08-03 2022-11-01 北京仁光科技有限公司 Signal source parallel interaction system
CN115794470A (en) * 2022-12-01 2023-03-14 北京首都在线科技股份有限公司 Operation management method and device of virtual machine, electronic equipment and storage medium
CN116662016A (en) * 2023-07-25 2023-08-29 太平金融科技服务(上海)有限公司 Port switching method, device, computer equipment, storage medium and program product

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100299666A1 (en) * 2009-05-25 2010-11-25 International Business Machines Corporation Live Migration of Virtual Machines In a Computing environment
CN103457775A (en) * 2013-09-05 2013-12-18 中国科学院软件研究所 High-availability virtual machine pooling management system based on roles
CN103618627A (en) * 2013-11-27 2014-03-05 华为技术有限公司 Method, device and system for managing virtual machines
CN104753992A (en) * 2013-12-29 2015-07-01 中国移动通信集团公司 Method, device and system for data storage and method and device for virtual platform failure recovery
CN106293874A (en) * 2016-07-29 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of method and device that high-availability cluster is monitored
CN106506201A (en) * 2016-10-31 2017-03-15 中国联合网络通信集团有限公司 VNF moving methods, MANO and system
CN108614728A (en) * 2018-04-27 2018-10-02 平安科技(深圳)有限公司 Virtual machine service providing method, device, equipment and computer readable storage medium
CN111181780A (en) * 2019-12-21 2020-05-19 苏州浪潮智能科技有限公司 HA cluster-based host pool switching method, system, terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100299666A1 (en) * 2009-05-25 2010-11-25 International Business Machines Corporation Live Migration of Virtual Machines In a Computing environment
CN103457775A (en) * 2013-09-05 2013-12-18 中国科学院软件研究所 High-availability virtual machine pooling management system based on roles
CN103618627A (en) * 2013-11-27 2014-03-05 华为技术有限公司 Method, device and system for managing virtual machines
CN104753992A (en) * 2013-12-29 2015-07-01 中国移动通信集团公司 Method, device and system for data storage and method and device for virtual platform failure recovery
CN106293874A (en) * 2016-07-29 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of method and device that high-availability cluster is monitored
CN106506201A (en) * 2016-10-31 2017-03-15 中国联合网络通信集团有限公司 VNF moving methods, MANO and system
CN108614728A (en) * 2018-04-27 2018-10-02 平安科技(深圳)有限公司 Virtual machine service providing method, device, equipment and computer readable storage medium
CN111181780A (en) * 2019-12-21 2020-05-19 苏州浪潮智能科技有限公司 HA cluster-based host pool switching method, system, terminal and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277810A (en) * 2022-08-03 2022-11-01 北京仁光科技有限公司 Signal source parallel interaction system
CN115277810B (en) * 2022-08-03 2024-02-09 北京仁光科技有限公司 Signal source parallel interaction system
CN115794470A (en) * 2022-12-01 2023-03-14 北京首都在线科技股份有限公司 Operation management method and device of virtual machine, electronic equipment and storage medium
CN116662016A (en) * 2023-07-25 2023-08-29 太平金融科技服务(上海)有限公司 Port switching method, device, computer equipment, storage medium and program product
CN116662016B (en) * 2023-07-25 2023-10-20 太平金融科技服务(上海)有限公司 Port switching method, device, computer equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
US10678648B2 (en) Method, apparatus, and system for migrating virtual machine backup information
EP3502877B1 (en) Data loading method and apparatus for virtual machines
CN112181593A (en) Virtual machine scheduling method, device, equipment and storage medium
JP4349871B2 (en) File sharing apparatus and data migration method between file sharing apparatuses
EP2923272B1 (en) Distributed caching cluster management
US10642694B2 (en) Monitoring containers in a distributed computing system
US8560628B2 (en) Supporting autonomous live partition mobility during a cluster split-brained condition
JP5902716B2 (en) Large-scale storage system
JP5011073B2 (en) Server switching method and server system
RU2595482C2 (en) Ensuring transparency failover in file system
JP7034806B2 (en) Data path monitoring in a distributed storage network
US11106556B2 (en) Data service failover in shared storage clusters
JP4659062B2 (en) Failover method, program, management server, and failover system
JP2007279890A (en) Backup system and method
US20020198996A1 (en) Flexible failover policies in high availability computing systems
US9792150B1 (en) Detecting site change for migrated virtual machines
TW201824823A (en) Methods and devices for switching a virtual internet protocol address
US11169835B1 (en) VM data migration between storage devices
US8015432B1 (en) Method and apparatus for providing computer failover to a virtualized environment
WO2018171728A1 (en) Server, storage system and related method
CN105740049A (en) Control method and apparatus
US11237747B1 (en) Arbitrary server metadata persistence for control plane static stability
CN112711469A (en) Cloud host migration method and device, computer equipment and storage medium
US10452321B2 (en) Storage system and control method therefor
KR101618992B1 (en) System for providing virtual desktop service, control method thereof, recording medium for recording program for executing the control method, application saved in the recording medium for executing the control method being combined with hardware

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210105