Virtual machine management method and device, equipment and computer storage medium
By creating a virtual machine switch set in virtual machine management and setting an associated switch strategy, the problem of the inability to associate the virtual machine in the existing technology is solved, and the stability and normal startup of the virtual machine during business processing is achieved.
Patent Information
- Application Number
- CN202311005001.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2025-02-25
AI Technical Summary
The existing technology cannot make associated settings for virtual machines in virtual machine management, resulting in data blocking or errors in virtual machines during business processing, and the normal startup of the virtual machine cannot be guaranteed.
By receiving the creation information of the user creating a virtual machine switch set, creating a virtual machine switch set based on this information, and setting the power-off policy of the virtual machine in each on/off sequence, so that the power-off policies of each virtual machine in each on/off sequence have an association relationship. Finally, based on the power-off policy of the virtual machine switch set, the power-off operation is performed on/off operations on the virtual machine switch set.
The associated settings for the virtual machine are implemented, which avoids data blocking or errors of the virtual machine during business processing, and ensures the normal startup of the virtual machine.
Smart Images

Figure CN119512675A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a virtual machine management method, device, equipment and computer storage medium. Background Art
[0002] At present, when managing virtual machines, the technical solutions of the related art generally use the virtual machine software (VMWare) to set the related information of the virtual machine startup and shutdown in the high availability web client (vSphere Web Client). In addition, the startup and shutdown settings of the virtual machine in the related art are performed for a single virtual machine, without considering whether there is a correlation between the virtual machines in business processing; then, once the virtual machines have a certain correlation when processing business, this setting solution in the related art will cause data processing blockage or errors, and will cause the virtual machine to have insufficient resources to start. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application hope to provide a virtual machine management method, device, equipment and computer storage medium, which solves the problem that the virtual machine startup and shutdown settings in the related technology cannot be associated with the virtual machine, avoids data blockage or errors when the virtual machine is processing business, and ensures the normal startup of the virtual machine.
[0004] The technical solution of this application is implemented as follows:
[0005] A method for managing a virtual machine, the method comprising:
[0006] Receiving creation information sent by a user for creating a virtual machine on / off group; wherein the virtual machine on / off group includes at least one group of virtual machines, and each group of virtual machines includes a pair of on / off sequences;
[0007] When it is determined that there is a virtual machine to be added to the virtual machine switch group and the virtual machine switch group is not read, create the virtual machine switch group based on the creation information;
[0008] Based on the setting parameters in the creation information, setting the power on / off strategy of each virtual machine in the power on / off sequence; wherein the power on / off strategy of each virtual machine in each power on / off sequence is associated with each other;
[0009] Based on the power on / off policy, a power on / off operation is performed on the virtual machines in the virtual machine power on / off group.
[0010] In the above scheme, the method further comprises:
[0011] Receiving an operation request sent by a user for operating a virtual machine in the virtual machine switch group;
[0012] If it is determined based on the operation request that a virtual machine is to be added to the virtual machine switch group and the virtual machine switch group is read, determining whether a virtual machine in the virtual machine switch group is in the process of executing a power on / off event;
[0013] When it is determined that there is no virtual machine executing the power on / off event in the virtual machine switch group, the virtual machines in the virtual machine switch group are operated based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine in the virtual machine switch group.
[0014] In the above solution, the operation on the virtual machines in the virtual machine switch group based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine in the virtual machine switch group includes:
[0015] In the case where the first configuration attribute and the second configuration attribute indicate that both the virtual machine to be added and the virtual machine of the virtual machine switch group have high availability, the virtual machine to be added is added to the first target position of the first target sequence of the virtual machine switch group, and the virtual machine to be added is deleted from the basic switch management queue; wherein the switch policy of the virtual machine in the basic switch management queue is different from the switch policy of the virtual machine in the virtual machine switch group;
[0016] Or, when the first configuration attribute and the second configuration attribute represent that the virtual machine to be added and the virtual machines of the virtual machine switch group both have high availability, the virtual machine to be added at the second target position of the second target sequence of the virtual machine switch group is deleted, and the virtual machine to be added is added to the basic switch management queue.
[0017] In the above scheme, the method further includes:
[0018] When the first configuration attribute and the second configuration attribute represent that the virtual machine to be added and the virtual machines of the virtual machine switch group do not all have high availability, first prompt information for prompting an operation failure is generated.
[0019] In the above scheme, the method further includes:
[0020] When it is determined that a virtual machine that executes a power on / off event exists in the virtual machine switch group, second prompt information is generated for prompting that an event is being processed in the virtual machine switch group.
[0021] In the above solution, the performing of the power on / off operation on the virtual machines in the virtual machine power on / off group based on the power on / off policy includes:
[0022] Based on the trigger instruction of the power on / off event, read the target group virtual machine corresponding to the trigger instruction;
[0023] In a case where the target group virtual machine exists in the virtual machine on / off group, a power on / off operation is performed on the target virtual machine in the target group virtual machine based on the power on / off policy.
[0024] In the above solution, the trigger instruction based on the power on / off event, reading the target group virtual machine corresponding to the trigger instruction, includes:
[0025] Based on the trigger instruction of the power on / off event, reading the target group virtual machine corresponding to the group identifier in the trigger instruction;
[0026] Correspondingly, performing a power on / off operation on a target virtual machine in the target group of virtual machines based on the power on / off policy includes:
[0027] Determine a target virtual machine identifier in a target field corresponding to the target group virtual machine;
[0028] Determine a target power on / off policy corresponding to the target virtual machine identifier from the power on / off policies;
[0029] Based on the target power on / off policy, a power on / off operation is performed on the target virtual machine corresponding to the target virtual machine identifier in the target group of virtual machines.
[0030] In the above solution, the performing a power on / off operation on the target virtual machine corresponding to the target virtual machine identifier in the target group of virtual machines based on the target power on / off policy includes:
[0031] If the target virtual machine has high availability and the target virtual machine is a primary virtual machine, performing a power on / off operation on the target virtual machine based on the target power on / off policy;
[0032] If the target virtual machine has high availability and the target virtual machine is a standby virtual machine, performing a power on / off operation on the target virtual machine based on an execution policy input by a user;
[0033] Accordingly, the method further includes:
[0034] Update the virtual machine identifier in the target field corresponding to the virtual machine in the target group.
[0035] A virtual machine management device, the device comprising:
[0036] A receiving unit, configured to receive creation information sent by a user for creating a virtual machine on / off group; wherein the virtual machine on / off group includes at least one group of virtual machines, and each group of virtual machines includes a pair of on / off sequences;
[0037] a creating unit, configured to create the virtual machine switch group based on the creation information when it is determined that there is a virtual machine to be added to the virtual machine switch group and the virtual machine switch group is not read;
[0038] A setting unit, configured to set a power on / off strategy for each virtual machine in the power on / off sequence based on the setting parameters in the creation information; wherein the power on / off strategy for each virtual machine in each power on / off sequence is associated with each other;
[0039] A processing unit is used to perform a power on / off operation on the virtual machines in the virtual machine power on / off group based on the power on / off policy.
[0040] A virtual machine management device, the device comprising: a processor, a memory and a communication bus;
[0041] The communication bus is used to realize the communication connection between the processor and the memory;
[0042] The processor is used to execute the file screening program in the memory to implement the steps of the virtual machine management method as described above.
[0043] A computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the virtual machine management method as described above.
[0044] The virtual machine management method, apparatus, device and computer storage medium provided in the embodiments of the present application can receive creation information sent by a user for creating a virtual machine switch group including at least one group of virtual machines, each group of virtual machines including a pair of power on / off sequences, and when it is determined that a virtual machine needs to be added to the virtual machine switch group and the virtual machine switch group is not read, the virtual machine switch group is created based on the creation information, and then the power on / off policy of the virtual machine in each power on / off sequence is set based on the setting parameters in the creation information, and the power on / off policy of each virtual machine in each power on / off sequence is associated with each other, and finally the power on / off operation is performed on the virtual machines in the virtual machine switch group based on the power on / off policy, so that it can be for a virtual machine including at least A group of virtual machines is powered on and off by setting the power on and off policies of the virtual machines in the virtual machine power on and off group, and a group of virtual machines includes a pair of power on / off sequences, and the power on and off policies of each virtual machine in each power on / off sequence are associated with each other, so that the power on and off policies of the set virtual machines are associated with an overall power on and off sequence in a group of virtual machines, rather than being set for a single virtual machine as in the related art, thereby solving the problem in the related art of being unable to perform associated settings for virtual machines in the schemes for starting and shutting down virtual machines; moreover, the virtual machines in a sequence of a group are associated with each other when they are turned on and off, which can avoid data blockage or errors when the virtual machines are processing business, and ensure the normal startup of the virtual machines. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A flowchart of a virtual machine management method provided in an embodiment of the present application;
[0046] Figure 2 A flowchart of another virtual machine management method provided in an embodiment of the present application;
[0047] Figure 3 A flowchart of another virtual machine management method provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of a virtual machine switch group in a virtual machine management method provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of a power-on / power-off sequence in a virtual machine management method provided in an embodiment of the present application;
[0050] Figure 6 A schematic diagram of a power on / off event timer control operation in a virtual machine management method provided by an embodiment of the present application;
[0051] Figure 7A flowchart of a virtual machine management method provided by another embodiment of the present application;
[0052] Figure 8 A schematic diagram of the structure of a virtual machine management device provided in an embodiment of the present application;
[0053] Fig. 9 A schematic diagram of the structure of a virtual machine management device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0055] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0056] Unless otherwise specified, any step in the embodiments of the present application may be performed by a processor of the device. It is also worth noting that the embodiments of the present application do not limit the order in which the device executes the following steps. In addition, the methods used to process data in different embodiments may be the same method or different methods. It should also be noted that any step in the embodiments of the present application can be independently executed by the device, that is, when the device executes any step in the following embodiments, it may not rely on the execution of other steps.
[0057] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] The present application embodiment provides a virtual machine management method, which can be applied to a virtual machine management device, referring to Figure 1 As shown, the method comprises the following steps:
[0059] Step 101: Receive creation information sent by a user for creating a virtual machine switch group.
[0060] The virtual machine on / off group includes at least one group of virtual machines, and each group of virtual machines includes a pair of on / off sequences.
[0061] In an embodiment of the present application, a virtual machine switch group includes one or more virtual machines selected by a user, and the power-on / shutdown sequence and power-on / shutdown interval between these virtual machines are set by the user. Of course, the virtual machine switch group can also be referred to as a "switch group" for short; a group of virtual machines can be obtained by dividing several virtual machines into a logical grouping for the purpose of convenient batch management, and the virtual machines in a group usually include virtual machines for batch operations.
[0062] It should be noted that the creation information may be generated after the user operates on the operable web interface of the client; in a feasible implementation, the creation information may be generated after the user clicks on the option for creating a virtual machine switch group on the operable web interface.
[0063] Step 102: When it is determined that there are virtual machines to be added to the virtual machine switch group and the virtual machine switch group is not read, create the virtual machine switch group based on the creation information.
[0064] In an embodiment of the present application, determining that there are virtual machines to be added to the virtual machine switch group may refer to determining that an external virtual machine that was not previously in the virtual machine switch group needs to be added to the virtual machine switch group; not reading the virtual machine switch group may refer to the fact that no virtual machine switch group is stored in the management device of the current virtual machine; the creation information may be generated in advance by the user on the operable web interface of the client and stored in the management device of the virtual machine; after obtaining the creation information generated by the user, the management device of the virtual machine can respond to the creation information to create a virtual machine switch group when it detects that a virtual machine needs to be added to the virtual machine switch group and the created virtual machine switch group is not read.
[0065] Step 103: Based on the setting parameters in the creation information, set the power on / off policy of the virtual machine in each power on / off sequence.
[0066] There is an association between the power on / off strategies of each virtual machine in each power on / off sequence.
[0067] In an embodiment of the present application, the setting parameters may be input by a user to a management device of a virtual machine through an operable web interface of a client, and may be carried in the creation information. The setting parameters may refer to some parameters for powering on and off a virtual machine in a created virtual machine power-on and power-off group.
[0068] In other embodiments of the present application, the power on / off policy may refer to a policy for controlling the power on and off operations of the virtual machines in each power on sequence (power_on_chain) and power off sequence (power_off_chain) in the virtual machine power on / off group; and the power on / off policy may be a setting for the association of virtual machines in a power on sequence or power off sequence in a group of virtual machines in the virtual machine power on / off group. It should be noted that the virtual machines in a pair of power on sequences and power off sequences in a group of virtual machines are the same, that is, the virtual machine identity documents (IDs) of the members included in a pair of power on sequences and power off sequences may be the same, but the policies for the virtual machines may be different.
[0069] In a feasible implementation, the power on and off strategy may include: power on sequence, power on interval, power off sequence, and power off interval; wherein, the power on sequence and power on interval are for the virtual machines in the power on sequence, and the power off interval and power off sequence are for the virtual machines in the power off sequence; the power on sequence refers to the startup sequence of each virtual machine in the power on sequence, and the power on interval refers to the interval time between starting each virtual machine in the power on sequence; the power off sequence refers to the shutdown sequence of each virtual machine in the power off sequence, and the power off interval refers to the interval time between shutting down each virtual machine in the power off sequence.
[0070] Step 104: Based on the power on / off policy, a power on / off operation is performed on the virtual machines in the virtual machine power on / off group.
[0071] In the embodiment of the present application, the specific startup sequence, startup interval, shutdown sequence, and shutdown interval can be determined from the startup and shutdown strategy, and then the virtual machines in the startup sequence of each group of virtual machines in the virtual machine startup and shutdown group are started according to the determined startup sequence and startup interval, and the virtual machines in the shutdown sequence of each group of virtual machines in the virtual machine startup and shutdown group are shut down according to the determined shutdown sequence and shutdown interval. In other words, the virtual machines in a sequence of a group of virtual machines are set with a startup / shutdown strategy as a whole, and when executing a specific startup / shutdown operation, they are also executed as a whole and in a related manner according to the set startup / shutdown strategy, so that the virtual machines in a sequence are started / shutdowned in an orderly and related manner, thereby ensuring that data blocking or errors will not occur.
[0072] The virtual machine management method provided in the embodiment of the present application is to set the power on / off policy of the virtual machine for the virtual machine in the virtual machine power on / off group including at least one group of virtual machines, and a group of virtual machines includes a pair of power on / off sequences, and the power on / off policy of each virtual machine in each power on / off sequence is associated with each other, so that the power on / off policy of the set virtual machine is associated with the overall setting of a power on / off sequence in a group of virtual machines, rather than being set for a single virtual machine as in the related art, thereby solving the problem that the virtual machine startup and shutdown setting scheme in the related art cannot be associated with the virtual machine; moreover, the virtual machines in a sequence of a group are associated when they are turned on and off, which can avoid data blocking or errors when the virtual machine is processing business, and ensure the normal startup of the virtual machine.
[0073] Based on the above embodiments, the present application provides a method for managing a virtual machine. Figure 2 and 3 As shown, the method may include the following steps:
[0074] Step 201: A management device of a virtual machine receives creation information sent by a user for creating a virtual machine switch group.
[0075] The virtual machine on / off group includes at least one group of virtual machines, and each group of virtual machines includes a pair of on / off sequences.
[0076] Step 202: When it is determined that a virtual machine needs to be added to the virtual machine switch group and the virtual machine switch group is not read, the virtual machine management device creates the virtual machine switch group based on the creation information.
[0077] In the embodiment of the present application, the created virtual machine switch group may include multiple groups of virtual machines, and each group of virtual machines includes a pair of power-on sequences and power-off sequences; Figure 4 As shown, among the multiple groups of virtual machines included in the virtual machine power on / off group, each group of virtual machines is correspondingly provided with a group ID (groupID), a current virtual machine ID (thisVMID), power_on_chain and power_off_chain, and each power on sequence is correspondingly provided with a virtual machine ID (VMID), an expected state (Expect state), a position in the queue (Position-in-list) and a delay (delay); and, as Figure 3 As shown, the virtual machine power on / off group may include N groups of virtual machines whose group identification numbers are groupID1, groupID2, ..., groupIDN. It should be noted that each group of virtual machines may include two sequences, namely, a paired power on sequence and a power off sequence.
[0078] In other embodiments of the present application, the power-on sequence and power-off sequence of a group of virtual machines in a virtual machine switch group can be as follows: Figure 5 As shown; among them, Figure 5 The virtual machines (VM) 1, VM2 and VM3 shown in the figure are virtual machines in the newly created startup sequence and shutdown sequence, and have corresponding startup order, startup interval, shutdown order and shutdown interval for VM1, VM2 and VM3; however, Figure 5 VM4 and VM5 shown in the figure do not belong to the virtual machine switch group, and thus corresponding parameters such as the startup sequence, startup interval, shutdown sequence, and shutdown interval are not set.
[0079] Step 203: The management device of the virtual machine sets the power on / off policy of the virtual machine in each power on / off sequence based on the setting parameters in the creation information.
[0080] There is an association between the power on / off strategies of each virtual machine in each power on / off sequence.
[0081] In an embodiment of the present application, the parameters included in the power-on and power-off strategy may be as shown in Table 1 below; wherein, sequence number 1 refers to the power-on sequence of each virtual machine in the power-on sequence, sequence number 2 refers to the power-on interval between adjacent virtual machines in the power-on sequence, sequence number 3 refers to the power-off sequence of each virtual machine in the power-off sequence, and sequence number 4 refers to the power-off interval between adjacent virtual machines in the power-off sequence; of course, the specific numerical settings of the power-on sequence, power-on interval, power-off sequence, and power-off interval in Table 1 are only exemplary and are not limited to such settings. It should be noted that the parameters such as the power-on sequence, power-on interval, power-off sequence, and power-off interval may be input by the user through the operable web page interface of the client's human-computer interaction (HCI).
[0082]
[0083] Table 1
[0084] Step 204: The virtual machine management device reads the target group virtual machine corresponding to the trigger instruction based on the trigger instruction of the power on / off event.
[0085] In the embodiment of the present application, the triggering instruction of the power on / off event can be triggered based on the power on / off event timer; that is, the user can set the timing time for the power on / off event timer according to the power on / off time, power on sequence, power off time, power off sequence and delay in the power on / off strategy, and then the power on / off event timer can be used to control the power on / off of each virtual machine in the power on / off sequence of each group of virtual machines in the virtual machine power on / off group and each virtual machine in the power on / off sequence; specifically, Figure 6As shown, for the serialized virtual machine on / off processing model (i.e., the virtual machine on / off processing model in the virtual machine on / off group), the on / off timer can be used to accurately control the parameters such as the on / off time, delay, on / off interval, off / off time, and off / off interval of each virtual machine in each on / off sequence in each group of virtual machines. In addition, for each group of virtual machines, a specific operation, i.e., on / off, event ID, and administrator ID are also set accordingly; wherein, event ID is used to uniquely identify the event, and admin ID is the ID that uniquely identifies the logged-in management user.
[0086] It should be noted that the target group virtual machine corresponding to the trigger instruction may refer to a specific group of virtual machines specified by the trigger instruction; and the target group virtual machine may be obtained in response to the trigger instruction.
[0087] In the embodiment of the present application, step 204 can be implemented in the following manner:
[0088] Step 204a: The virtual machine management device reads the target group virtual machine corresponding to the group identifier in the triggering instruction of the power on / off event based on the triggering instruction of the power on / off event.
[0089] The virtual machine management device can respond to the trigger instruction of the power on / off event, read the specific group virtual machine of the group identifier carried in the trigger instruction of the power on / off event, and obtain the target group virtual machine. It should be noted that the group identifier carried in the trigger instruction of the power on / off event can be preset by the user.
[0090] Step 205: When there is a target group virtual machine in the virtual machine on / off group, the virtual machine management device performs a power on / off operation on the target virtual machine in the target group virtual machine based on the power on / off policy.
[0091] In the embodiment of the present application, after the management device of the virtual machine reads the target group virtual machine, it can be considered that the reading of the power on / off event is successful; and after reading the target group virtual machine, it is necessary to further determine whether the target group virtual machine exists in the virtual machine power on / off group; if there is a group identifier in the virtual machine power on / off group that is the same as the group identifier of the target group virtual machine, it is considered that the target group virtual machine exists in the virtual machine power on / off group, and at this time, it can be considered that the read target group virtual machine is real; then, the previously set power on / off policy can be used to perform the corresponding power on or power off operation on the target virtual machine in the target group virtual machine. Among them, the target virtual machine can refer to the specific virtual machine indicated by the specific field in the target group virtual machine.
[0092] In the embodiment of the present application, the "performing a power on / off operation on a target virtual machine in a target group of virtual machines based on a power on / off policy" in step 205 can be implemented in the following manner:
[0093] Step 205a: The virtual machine management device determines a target virtual machine identifier in a target field corresponding to the target group virtual machine.
[0094] Among them, the target field may refer to a field used to indicate the virtual machine currently to be processed in the target group virtual machine; in a feasible implementation method, the target field may refer to the thisVMID field, and the target virtual machine identifier may refer to the virtual machine identification number referred to by the thisVMID field.
[0095] Step 205b: The virtual machine management device determines a target power on / off policy corresponding to the target virtual machine identifier from the power on / off policies.
[0096] Step 205c: The virtual machine management device performs a power on / off operation on the target virtual machine corresponding to the target virtual machine identifier in the target group of virtual machines based on the target power on / off policy.
[0097] In an embodiment of the present application, the virtual machine management device can obtain the target power on and off policy corresponding to the virtual machine identification number referred to by the thisVMID field from all power on and off policies; thereafter, based on the target power on sequence, target power on time, target shutdown sequence and target shutdown time in the target power on and off policy, the corresponding power on sub-operation or shutdown operation can be performed on the target virtual machine.
[0098] It should be noted that step 205c can be implemented in the following ways:
[0099] c1. If the target virtual machine has high availability and is a primary virtual machine, the management device of the virtual machine performs a power on / off operation on the target virtual machine based on the target power on / off policy.
[0100] In an embodiment of the present application, if the target virtual machine is a high-availability virtual machine and the target virtual machine exists as a primary virtual machine, i.e., a primary instance, then the virtual machine management device can perform a power on or power off operation on the target virtual machine according to the target power on and off policy in the power on and off policy set for the virtual machine power on and off group.
[0101] c2. If the target virtual machine has high availability and is a standby virtual machine, the management device of the virtual machine performs a power on / off operation on the target virtual machine based on the execution policy input by the user.
[0102] In the embodiment of the present application, if the target virtual machine is a high-availability virtual machine, and the target virtual machine exists as a standby virtual machine, i.e., a standby instance, then the virtual machine management device will not perform a power-on or power-off operation on the target virtual machine according to the target power-on and power-off policy in the power-on and power-off policy set for the virtual machine power-on and power-off group, but the standby virtual machine will refuse to power on, thus ensuring the consistency of external behavior. In addition, if the user really wants to shut down the primary virtual machine and trigger the high-availability mechanism to do an exercise, it can be specified that a prompt message will pop up when the primary virtual machine is powered on and off, asking the user to confirm whether to continue to operate the standby virtual machine; at this time, the target virtual machine (i.e., the standby virtual machine) can be powered on or off according to the execution policy entered by the user.
[0103] It should be noted that, for high-availability virtual machines, the virtual machines in the virtual machine switch group in the embodiments of the present application all have the same high-availability virtual machine attributes; that is, either the virtual machines in the virtual machine switch group are all high-availability virtual machines, or the virtual machines in the virtual machine switch group are not high-availability virtual machines.
[0104] Step 206: The virtual machine management device updates the virtual machine identifier in the target field corresponding to the virtual machine in the target group.
[0105] Among them, after the target virtual machine is powered on or off, the virtual machine identifier in the target field corresponding to the target group virtual machine can be updated in time to the identifier of the virtual machine in the next power-on / power-off sequence in the sequence where the target virtual machine is located; that is, the identifier of the virtual machine referred to by the thisVMID field corresponding to the target group virtual machine can be updated to the identifier of the virtual machine in the next power-on / power-off sequence in the sequence where the target virtual machine is located.
[0106] It should be noted that after the corresponding power-on or power-off operation is performed on the target virtual machine, the delay of the next virtual machine in the sequence where the target virtual machine is located can be reset as the next triggering time of the power-on and power-off event timer.
[0107] In other embodiments of the present application, refer to Figure 7 As shown, the method can also perform the following steps:
[0108] Step 207, the virtual machine management device receives an operation request sent by the user for operating a virtual machine in the virtual machine switch group, and when it is determined based on the operation request that there is a virtual machine to be added to the virtual machine switch group and the virtual machine switch group is read, determines whether there is a virtual machine in the virtual machine switch group that is in the process of executing a switch event.
[0109] In an embodiment of the present application, after receiving an operation request initiated by a user to operate a virtual machine in a virtual machine switch group, the management device of the virtual machine can respond to the operation request and determine that a virtual machine needs to be added to the virtual machine switch group and the virtual machine switch group has been created. At this time, it is considered that there is no need to re-create the virtual machine switch group, and it can be determined whether there is a virtual machine in the virtual machine switch group that is currently executing a switch event; it should be noted that determining whether there is a virtual machine in the virtual machine switch group that is executing a switch event can be achieved by determining whether the virtual machine switch group is executing a switch event and whether there are virtual machines that have not yet completed the switch event. In a feasible implementation, the operation request can refer to a request to delete a virtual machine in a virtual machine switch group or add a virtual machine to a virtual machine switch group.
[0110] It should be noted that after step 207, you can choose to execute step 208 or step 209.
[0111] Step 208: When it is determined that there is no virtual machine in the virtual machine switch group that executes the power on / off event, the virtual machine management device operates the virtual machines in the virtual machine switch group based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine in the virtual machine switch group.
[0112] In the embodiment of the present application, if it is determined that the virtual machine switch group is executing a power on / off event, and all virtual machines have completed the power on / off operation, or the virtual machine switch group has not executed a power on / off event, then it can be considered that there is no virtual machine in the virtual machine switch group that is currently executing a power on / off event; at this time, the virtual machine management device can perform an editing operation on the virtual machines in the virtual machine switch group according to the relationship between the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine in the virtual machine switch group. In a feasible implementation, the editing operation on the virtual machine may include an adding operation and a deleting operation.
[0113] In other embodiments of the present application, "operating the virtual machines in the virtual machine switch group based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine in the virtual machine switch group" in step 208 can be implemented in the following manner:
[0114] Step 208a, when the first configuration attribute and the second configuration attribute represent that both the virtual machine to be added and the virtual machines in the virtual machine switch group have high availability, the virtual machine management device adds the virtual machine to be added to the first target position of the first target sequence of the virtual machine switch group, and deletes the virtual machine to be added from the basic switch management queue.
[0115] The power on and off policies of the virtual machines in the basic power on and off management queue are different from the power on and off policies of the virtual machines in the virtual machine power on and off group.
[0116] In an embodiment of the present application, if the first configuration attribute indicates that the virtual machine to be added has high availability, and the second configuration attribute indicates that the virtual machine of the virtual machine switch group has high availability, then the virtual machine to be added can be added to the virtual machine switch group; it should be noted that the virtual machine to be added can be added to the first target position of the first target sequence of the virtual machine switch group; wherein the first target sequence and the first target position can be determined according to the operation parameters in the operation instruction.
[0117] In other embodiments of the present application, after adding the virtual machine to be added to the virtual machine switch group, it is also necessary to delete the virtual machine to be added from the basic switch management queue; wherein, the basic switch management queue may refer to the queue where the virtual machine without group management is located in the related technology. The switch policy of the virtual machine corresponding to the basic switch management queue may include: A, single setting of virtual machine startup and shutdown, B, batch setting of virtual machine startup and shutdown, C, all virtual machines configured as "on" when the host machine is powered on, D, shutting down all virtual machines configured as "on" when the host machine is shut down for maintenance, E, virtual machine high availability, two virtual machines are mutually primary and standby, after the main virtual machine fault is discovered, the virtual machine management system performs a power-on operation on the standby virtual machine. It should be noted that the priority of the switch policy for the virtual machine switch group set in this application is superior to the A, B, C and D policies; however, the switch policy for the virtual machine switch group set in this application coexists and coexists with policy E.
[0118] Step 208b, when the first configuration attribute and the second configuration attribute represent that both the virtual machine to be added and the virtual machine of the virtual machine switch group have high availability, the virtual machine management device deletes the virtual machine to be added at the second target position of the second target sequence of the virtual machine switch group, and adds the virtual machine to be added to the basic switch management queue.
[0119] In an embodiment of the present application, if the first configuration attribute indicates that the virtual machine to be added has high availability, and the second configuration attribute indicates that the virtual machine of the virtual machine switch group has high availability, then the virtual machine to be added can be deleted from the virtual machine switch group; it should be noted that the virtual machine to be added at the second target position of the second target sequence of the virtual machine switch group can be deleted; wherein the second target sequence and the second target position can be determined according to the operation parameters in the operation instruction.
[0120] In other embodiments of the present application, after the virtual machine to be added is deleted from the virtual machine power on / off group, the virtual machine to be added also needs to be added to the basic power on / off management queue.
[0121] Step 208c: The first configuration attribute and the second configuration attribute indicate that the virtual machine to be added and the virtual machines in the virtual machine switch group do not all have high availability, and first prompt information for prompting an operation failure is generated.
[0122] In an embodiment of the present application, if the first configuration attribute indicates that the virtual machine to be added does not have high availability, or the second configuration attribute indicates that the virtual machine in the virtual machine switch group does not have high availability, then the virtual machine in the virtual machine switch group cannot be edited, but a first prompt message is generated to prompt the failure of the operation.
[0123] Step 209: When it is determined that there is a virtual machine executing a power on / off event in the virtual machine switch group, the virtual machine management device generates second prompt information for prompting the virtual machine switch group that an event is being processed.
[0124] In an embodiment of the present application, if it is determined that a power on and off event is being executed in a virtual machine power on and off group, and there are virtual machines in the virtual machine power on and off group that have not yet completed the power on and off operation, then it can be considered that there is a virtual machine in the virtual machine power on and off group that is currently executing a power on and off event; at this time, the virtual machine management device can generate a second prompt message for prompting the user that a virtual machine power on and off event is in progress, and that the current power on and off event will be executed in a subsequent power on and off event.
[0125] It should be noted that the definition of the virtual machine power on / off group is initiated in the name of the group and takes effect in the following scenarios: host machine power on, host machine shutdown through the user interface provided by the hyper-converged system within the user's plan (rather than power off or direct shutdown in the background), user-selected power on group to start up, user-selected power on group to shut down; in addition, the basic operation is the user's addition, deletion, modification, and query of the list of virtual machine power on / off groups. In addition, the user can select the power on / off scheduling group, the user can "power on" the virtual machine that has been shut down, the user initiates a host shutdown request through the HCI WEB interface, the user can select the power on / off scheduling group, and the user can "shut down" the running virtual machine. It should be noted that when coexisting with the power on / off operation of a single virtual machine, if a single virtual machine is found to belong to the virtual machine power on / off group during power on / off, it will prompt whether to continue.
[0126] The user can also delete the created virtual machine startup and shutdown groups.
[0127] It should be noted that the embodiments of the present application propose a more flexible deployment method and a more controllable lifecycle management method, so that virtual machines with business logic dependencies (such as assembly line-type virtual machines) can have better logical consistency and data integrity in business processes during the power on and off process; reduce the risk of problems caused by inconsistent behavior due to randomness in the power on and off process, and have external visibility.
[0128] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0129] The virtual machine management method provided in the embodiment of the present application is to set the power on / off policy of the virtual machine for the virtual machine in the virtual machine power on / off group including at least one group of virtual machines, and a group of virtual machines includes a pair of power on / off sequences, and the power on / off policy of each virtual machine in each power on / off sequence is associated with each other, so that the power on / off policy of the set virtual machine is associated with the overall setting of a power on / off sequence in a group of virtual machines, rather than being set for a single virtual machine as in the related art, thereby solving the problem that the virtual machine startup and shutdown setting scheme in the related art cannot be associated with the virtual machine; moreover, the virtual machines in a sequence of a group are associated when they are turned on and off, which can avoid data blocking or errors when the virtual machine is processing business, and ensure the normal startup of the virtual machine.
[0130] Based on the above embodiments, the present application provides a virtual machine management device, which can be applied to Figure 1 , 2 In the virtual machine management method provided in the embodiment corresponding to 7, refer to Figure 8 As shown, the virtual machine management device 3 may include: a receiving unit 31, a creating unit 32, a setting unit 33 and a processing unit 34, wherein:
[0131] A receiving unit 31 is used to receive creation information sent by a user for creating a virtual machine switch group;
[0132] The virtual machine switch group includes at least one group of virtual machines, and each group of virtual machines includes a pair of switch on / off sequences;
[0133] A creating unit 32, configured to create a virtual machine switch group based on the creation information when it is determined that there is a virtual machine to be added to the virtual machine switch group and the virtual machine switch group is not read;
[0134] A setting unit 33, configured to set a power on / off strategy for the virtual machine in each power on / off sequence based on the setting parameters in the creation information;
[0135] There is a correlation between the power on / off strategies of each virtual machine in each power on / off sequence;
[0136] The processing unit 34 is used to perform a power on / off operation on the virtual machines in the virtual machine power on / off group based on the power on / off policy.
[0137] In other embodiments of the present application, the processing unit 34 is further configured to perform the following steps:
[0138] Receiving an operation request sent by a user for operating a virtual machine in the virtual machine switch group;
[0139] If it is determined based on the operation request that a virtual machine is to be added to the virtual machine switch group and the virtual machine switch group is read, determining whether a virtual machine in the virtual machine switch group is in the process of executing a switch event;
[0140] When it is determined that there is no virtual machine in the virtual machine switch group that executes the power on / off event, the virtual machines in the virtual machine switch group are operated based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machines in the virtual machine switch group.
[0141] In other embodiments of the present application, the processing unit 34 is further configured to perform the following steps:
[0142] When the first configuration attribute and the second configuration attribute indicate that both the virtual machine to be added and the virtual machine of the virtual machine switch group have high availability, adding the virtual machine to be added to the first target position of the first target sequence of the virtual machine switch group, and deleting the virtual machine to be added from the basic switch management queue;
[0143] The power on and off policies of the virtual machines in the basic power on and off management queue are different from the power on and off policies of the virtual machines in the virtual machine power on and off group;
[0144] Or, when the first configuration attribute and the second configuration attribute represent that both the virtual machine to be added and the virtual machines in the virtual machine switch group have high availability, delete the virtual machine to be added at the second target position of the second target sequence of the virtual machine switch group, and add the virtual machine to be added to the basic switch management queue.
[0145] In other embodiments of the present application, the processing unit 34 is further configured to perform the following steps:
[0146] The first configuration attribute and the second configuration attribute represent that the virtual machine to be added and the virtual machines of the virtual machine switch group do not all have high availability, and first prompt information for prompting an operation failure is generated.
[0147] In other embodiments of the present application, the processing unit 34 is further configured to generate second prompt information for prompting the virtual machine switch group that an event is being processed when it is determined that there is a virtual machine that executes a switch event in the virtual machine switch group.
[0148] In other embodiments of the present application, the processing unit 34 is further configured to perform the following steps:
[0149] Based on the trigger instruction of the power on / off event, read the target group virtual machine corresponding to the trigger instruction;
[0150] When there are target group virtual machines in the virtual machine on / off group, a power on / off operation is performed on the target virtual machines in the target group virtual machines based on the power on / off policy.
[0151] In other embodiments of the present application, the processing unit 34 is further configured to read the target group virtual machine corresponding to the group identifier in the trigger instruction based on the trigger instruction of the power on / off event;
[0152] Accordingly, the processing unit 34 is further configured to perform the following steps:
[0153] Determine a target virtual machine identifier in a target field corresponding to a target group virtual machine;
[0154] Determine a target power on / off policy corresponding to the target virtual machine identifier from the power on / off policy;
[0155] Based on the target power on / off policy, a power on / off operation is performed on the target virtual machine corresponding to the target virtual machine identifier in the target group virtual machines.
[0156] In other embodiments of the present application, the processing unit 34 is further configured to perform the following steps:
[0157] If the target virtual machine has high availability and the target virtual machine is the primary virtual machine, a power on / off operation is performed on the target virtual machine based on the target power on / off policy;
[0158] If the target virtual machine has high availability and the target virtual machine is a standby virtual machine, a power on / off operation is performed on the target virtual machine based on an execution policy input by the user;
[0159] Correspondingly, the processing unit 34 is further configured to update the virtual machine identifier in the target field corresponding to the virtual machine in the target group.
[0160] It should be noted that the specific description of the steps performed by each unit can be found in Figure 1 , 2 The virtual machine management method provided in the embodiment corresponding to 7 is not repeated here.
[0161] The virtual machine management device provided in the embodiment of the present application sets the power on / off policy of the virtual machine for the virtual machine in a virtual machine power on / off group including at least one group of virtual machines, and a group of virtual machines includes a pair of power on / off sequences, and the power on / off policy of each virtual machine in each power on / off sequence is associated with each other, so that the power on / off policy of the set virtual machine is associated with an overall power on / off sequence in a group of virtual machines, rather than being set for a single virtual machine as in the related art, thereby solving the problem that the virtual machines cannot be associated with each other in the schemes for starting and shutting down virtual machines in the related art; moreover, the virtual machines in a sequence of a group are associated with each other when they are turned on and off, which can avoid data blockage or errors when the virtual machines are processing business, and ensure the normal startup of the virtual machines.
[0162] Based on the above embodiments, the embodiments of the present application provide a virtual machine management device, which can be applied to Figure 1 , 2 In the virtual machine management method provided in the embodiment corresponding to 7, refer to Fig. 9 As shown, the virtual machine management device 4 may include: a processor 41, a memory 42 and a communication bus 43, wherein:
[0163] The communication bus 43 is used to realize the communication connection between the processor 41 and the memory 42;
[0164] The processor 41 is used to execute the hypervisor of the virtual machine in the memory 42 to implement the following steps:
[0165] Receiving creation information sent by a user for creating a virtual machine on / off group; wherein the virtual machine on / off group includes at least one group of virtual machines, and each group of virtual machines includes a pair of on / off sequences;
[0166] When it is determined that there is a virtual machine to be added to the virtual machine switch group and the virtual machine switch group is not read, create the virtual machine switch group based on the creation information;
[0167] Based on the setting parameters in the creation information, the power on / off strategy of the virtual machine in each power on / off sequence is set; wherein the power on / off strategy of each virtual machine in each power on / off sequence is associated with each other;
[0168] Based on the power on / off policy, the virtual machines in the virtual machine power on / off group are powered on / off.
[0169] In other embodiments of the present application, the processor 41 is used to execute the hypervisor of the virtual machine in the memory 42, and may also implement the following steps:
[0170] Receiving an operation request sent by a user for operating a virtual machine in the virtual machine switch group;
[0171] If it is determined based on the operation request that a virtual machine is to be added to the virtual machine switch group and the virtual machine switch group is read, determining whether a virtual machine in the virtual machine switch group is in the process of executing a switch event;
[0172] When it is determined that there is no virtual machine in the virtual machine switch group that executes the power on / off event, the virtual machines in the virtual machine switch group are operated based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machines in the virtual machine switch group.
[0173] In other embodiments of the present application, the processor 41 is used to execute the hypervisor of the virtual machine in the memory 42 to operate the virtual machines in the virtual machine switch group based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine of the virtual machine switch group to implement the following steps:
[0174] In the case where the first configuration attribute and the second configuration attribute indicate that both the virtual machine to be added and the virtual machines of the virtual machine switch group have high availability, the virtual machine to be added is added to the first target position of the first target sequence of the virtual machine switch group, and the virtual machine to be added is deleted from the basic switch management queue; wherein the switch policy of the virtual machine in the basic switch management queue is different from the switch policy of the virtual machine in the virtual machine switch group;
[0175] Or, when the first configuration attribute and the second configuration attribute represent that both the virtual machine to be added and the virtual machines in the virtual machine switch group have high availability, delete the virtual machine to be added at the second target position of the second target sequence of the virtual machine switch group, and add the virtual machine to be added to the basic switch management queue.
[0176] In other embodiments of the present application, the processor 41 is used to execute the hypervisor of the virtual machine in the memory 42, and may also implement the following steps:
[0177] The first configuration attribute and the second configuration attribute represent that the virtual machine to be added and the virtual machines of the virtual machine switch group do not all have high availability, and first prompt information for prompting an operation failure is generated.
[0178] In other embodiments of the present application, the processor 41 is used to execute the hypervisor of the virtual machine in the memory 42, and may also implement the following steps:
[0179] When it is determined that a virtual machine that executes a power on / off event exists in the virtual machine switch group, second prompt information is generated for prompting the virtual machine switch group that an event is being processed.
[0180] In other embodiments of the present application, the processor 41 is used to execute the virtual machine hypervisor in the memory 42 based on the power on / off policy, and perform power on / off operations on the virtual machines in the virtual machine power on / off group to implement the following steps:
[0181] Based on the trigger instruction of the power on / off event, read the target group virtual machine corresponding to the trigger instruction;
[0182] When there are target group virtual machines in the virtual machine on / off group, a power on / off operation is performed on the target virtual machines in the target group virtual machines based on the power on / off policy.
[0183] In other embodiments of the present application, the processor 41 is used to execute the trigger instruction based on the power on / off event of the hypervisor of the virtual machine in the memory 42, and read the target group virtual machine corresponding to the trigger instruction to implement the following steps:
[0184] Based on the trigger instruction of the power on / off event, read the target group virtual machine corresponding to the group identifier in the trigger instruction;
[0185] Accordingly, the processor 41 is used to execute the hypervisor of the virtual machine in the memory 42 to perform a power on / off operation on the target virtual machine in the target group of virtual machines based on the power on / off policy, so as to implement the following steps:
[0186] Determine a target virtual machine identifier in a target field corresponding to a target group virtual machine;
[0187] Determine a target power on / off policy corresponding to the target virtual machine identifier from the power on / off policy;
[0188] Based on the target power on / off policy, a power on / off operation is performed on the target virtual machine corresponding to the target virtual machine identifier in the target group virtual machines.
[0189] In other embodiments of the present application, the processor 41 is used to execute the target power on / off policy of the hypervisor of the virtual machine in the memory 42, and perform a power on / off operation on the target virtual machine corresponding to the target virtual machine identifier in the target group virtual machine, so as to implement the following steps:
[0190] If the target virtual machine has high availability and the target virtual machine is the primary virtual machine, a power on / off operation is performed on the target virtual machine based on the target power on / off policy;
[0191] If the target virtual machine has high availability and the target virtual machine is a standby virtual machine, a power on / off operation is performed on the target virtual machine based on an execution policy input by the user;
[0192] Accordingly, the processor 41 is used to execute the hypervisor of the virtual machine in the memory 42, and can also implement the following steps:
[0193] Update the VM ID in the Target field corresponding to the target group VM.
[0194] It should be noted that the specific description of the steps executed by the processor can be referred to Figure 1 , 2 The virtual machine management method provided in the embodiment corresponding to 7 is not repeated here.
[0195] The virtual machine management device provided in the embodiment of the present application sets the power on / off policy of the virtual machine for the virtual machine in a virtual machine power on / off group including at least one group of virtual machines, and a group of virtual machines includes a pair of power on / off sequences, and the power on / off policy of each virtual machine in each power on / off sequence is associated with each other, so that the power on / off policy of the set virtual machine is associated with an overall power on / off sequence in a group of virtual machines, rather than being set for a single virtual machine as in the related art, thereby solving the problem that the virtual machines cannot be associated with each other in the schemes for starting and shutting down virtual machines in the related art; moreover, the virtual machines in a sequence of a group are associated with each other when they are turned on and off, which can avoid data blockage or errors when the virtual machines are processing business, and ensure the normal startup of the virtual machines.
[0196] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement Figure 1 , 2 The steps of the virtual machine management method provided in the embodiment corresponding to 7.
[0197] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0198] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0199] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0200] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0201] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for managing a virtual machine, characterized in that: The method comprises: Receiving creation information sent by a user for creating a virtual machine on / off group; wherein the virtual machine on / off group includes at least one group of virtual machines, and each group of virtual machines includes a pair of on / off sequences; When it is determined that there is a virtual machine to be added to the virtual machine switch group and the virtual machine switch group is not read, create the virtual machine switch group based on the creation information; Based on the setting parameters in the creation information, setting the power on / off strategy of each virtual machine in the power on / off sequence; wherein the power on / off strategy of each virtual machine in each power on / off sequence is associated with each other; Based on the power on / off policy, a power on / off operation is performed on the virtual machines in the virtual machine power on / off group.
2. The method according to claim 1, characterized in that The method further comprises: Receiving an operation request sent by a user for operating a virtual machine in the virtual machine switch group; If it is determined based on the operation request that a virtual machine is to be added to the virtual machine switch group and the virtual machine switch group is read, determining whether a virtual machine in the virtual machine switch group is in the process of executing a power on / off event; When it is determined that there is no virtual machine executing the power on / off event in the virtual machine switch group, the virtual machines in the virtual machine switch group are operated based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine in the virtual machine switch group.
3. The method according to claim 2, characterized in that The operating the virtual machines in the virtual machine switch group based on the first configuration attribute of the virtual machine to be added and the second configuration attribute of the virtual machine in the virtual machine switch group includes: In the case where the first configuration attribute and the second configuration attribute indicate that both the virtual machine to be added and the virtual machine of the virtual machine switch group have high availability, the virtual machine to be added is added to the first target position of the first target sequence of the virtual machine switch group, and the virtual machine to be added is deleted from the basic switch management queue; wherein the switch policy of the virtual machine in the basic switch management queue is different from the switch policy of the virtual machine in the virtual machine switch group; Or, when the first configuration attribute and the second configuration attribute represent that the virtual machine to be added and the virtual machines of the virtual machine switch group both have high availability, the virtual machine to be added at the second target position of the second target sequence of the virtual machine switch group is deleted, and the virtual machine to be added is added to the basic switch management queue.
4. The method according to claim 3, characterized in that The method further comprises: When the first configuration attribute and the second configuration attribute represent that the virtual machine to be added and the virtual machines of the virtual machine switch group do not all have high availability, first prompt information for prompting an operation failure is generated.
5. The method according to claim 2, characterized in that: The method further comprises: When it is determined that a virtual machine that executes a power on / off event exists in the virtual machine switch group, second prompt information is generated for prompting that an event is being processed in the virtual machine switch group.
6. The method according to claim 1, characterized in that The performing a power on / off operation on the virtual machines in the virtual machine power on / off group based on the power on / off policy includes: Based on the trigger instruction of the power on / off event, read the target group virtual machine corresponding to the trigger instruction; In a case where the target group virtual machine exists in the virtual machine on / off group, a power on / off operation is performed on the target virtual machine in the target group virtual machine based on the power on / off policy.
7. The method according to claim 6, characterized in that The trigger instruction based on the power on / off event, and reading the target group virtual machine corresponding to the trigger instruction, include: Based on the trigger instruction of the power on / off event, reading the target group virtual machine corresponding to the group identifier in the trigger instruction; Correspondingly, performing a power on / off operation on a target virtual machine in the target group of virtual machines based on the power on / off policy includes: Determine a target virtual machine identifier in a target field corresponding to the target group virtual machine; Determine a target power on / off policy corresponding to the target virtual machine identifier from the power on / off policies; Based on the target power on / off policy, a power on / off operation is performed on the target virtual machine corresponding to the target virtual machine identifier in the target group of virtual machines.
8. The method according to claim 7, characterized in that The performing a power on / off operation on a target virtual machine corresponding to the target virtual machine identifier in the target group of virtual machines based on the target power on / off policy includes: If the target virtual machine has high availability and the target virtual machine is a primary virtual machine, performing a power on / off operation on the target virtual machine based on the target power on / off policy; If the target virtual machine has high availability and the target virtual machine is a standby virtual machine, performing a power on / off operation on the target virtual machine based on an execution policy input by a user; Accordingly, the method further includes: Update the virtual machine identifier in the target field corresponding to the virtual machine in the target group.
9. A virtual machine management device, characterized in that: The device comprises: A receiving unit, configured to receive creation information sent by a user for creating a virtual machine on / off group; wherein the virtual machine on / off group includes at least one group of virtual machines, and each group of virtual machines includes a pair of on / off sequences; a creating unit, configured to create the virtual machine switch group based on the creation information when it is determined that there is a virtual machine to be added to the virtual machine switch group and the virtual machine switch group is not read; A setting unit, configured to set a power on / off strategy for each virtual machine in the power on / off sequence based on the setting parameters in the creation information; wherein the power on / off strategy for each virtual machine in each power on / off sequence is associated with each other; A processing unit is used to perform a power on / off operation on the virtual machines in the virtual machine power on / off group based on the power on / off policy.
10. A virtual machine management device, characterized in that: The device comprises: a processor, a memory and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the management program of the virtual machine in the memory to implement the steps of the virtual machine management method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the virtual machine management method according to any one of claims 1 to 8.