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

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

Info

Publication number
CN113467873A
CN113467873A CN202110726904.2A CN202110726904A CN113467873A CN 113467873 A CN113467873 A CN 113467873A CN 202110726904 A CN202110726904 A CN 202110726904A CN 113467873 A CN113467873 A CN 113467873A
Authority
CN
China
Prior art keywords
virtual machine
management module
data center
desktop
terminal
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
CN202110726904.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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202110726904.2A priority Critical patent/CN113467873A/en
Publication of CN113467873A publication Critical patent/CN113467873A/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/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a scheduling method and device of a virtual machine, electronic equipment and a storage medium. The method comprises the following steps: the method comprises the steps that a first management module detects the running state of a first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal; when the first virtual machine is detected to be out of order, controlling a second virtual machine to be connected with the terminal; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.

Description

Virtual machine scheduling method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of cloud computing, and in particular, to a method and an apparatus for scheduling a virtual machine, an electronic device, and a storage medium.
Background
In a Virtual Desktop Infrastructure (VDI), a terminal is implemented on a Desktop (i.e., a virtualized Desktop) of a Desktop cloud through a Virtual machine, and the Virtual machine runs on a server of a cloud data center. When a server of the cloud data center fails, the terminal cannot be connected to the virtual machine, so that the terminal cannot be used on a desktop of the desktop cloud, desktop services of a user are interrupted, and loss is caused to enterprises.
Disclosure of Invention
In order to solve related technical problems, embodiments of the present application provide a scheduling method and apparatus for a virtual machine, an electronic device, and a storage medium.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a scheduling method of a virtual machine, which is applied to a first management module and comprises the following steps:
detecting the running state of the first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal;
when the first virtual machine is detected to be out of order, controlling a second virtual machine to be connected with the terminal; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.
In the above-mentioned scheme, the first step of the method,
the first management module is a master management module or a slave management module in the management module cluster; the management module cluster comprises a master management module and at least one slave management module; the main management module is used for controlling each management module in the management module cluster to execute a scheduling task of a virtual machine, so that each management module in the management module cluster has balanced load, and each management module in the management module cluster is controlled to periodically perform data synchronization.
In the above solution, the first management module is a master management module in the management module cluster; the detecting the running state of the first virtual machine includes:
when a first request sent by the terminal and used for accessing the first virtual machine is received, detecting the load condition of each management module in the management module cluster; detecting the running state of the first virtual machine when detecting that the load condition of each management module in the management module cluster meets a first condition; the first condition characterizes that the load condition of the first management module is optimal.
In the above solution, the first management module is a slave management module in the management module cluster; the detecting the running state of the first virtual machine includes:
when a first request of the terminal forwarded by a second management module is received, detecting the running state of the first virtual machine; the first request is used for accessing the first virtual machine; the second management module is a master management module in the management module cluster.
In the foregoing solution, before the detecting the operating state of the first virtual machine, the method further includes:
inquiring mapping information according to a first user identifier carried by the first request so as to operate a first virtual machine corresponding to the first user identifier; the mapping information comprises mapping relations between a plurality of user identifications and a plurality of virtual machines.
In the above-mentioned scheme, the first step of the method,
the second virtual machine is one preset virtual machine of at least two preset virtual machines; at least one preset virtual machine of the at least two preset virtual machines except the second virtual machine runs in the second data center or a third data center; the at least two preset virtual machines are obtained by the corresponding data centers through virtual machine creation based on the same virtual machine template image.
In the foregoing solution, before the detecting the operating state of the first virtual machine, the method further includes:
receiving a first instruction; the first instruction is used for indicating to create a new virtual machine;
and responding to the first instruction, and controlling at least two data centers to perform virtual machine creation based on the virtual machine template image indicated by the first instruction.
In the foregoing solution, the controlling at least two data centers to create a virtual machine based on the virtual machine template image indicated by the first instruction includes:
and sending a second instruction to each data center of the at least two data centers to instruct each data center to acquire the virtual machine template mirror image indicated by the first instruction, and creating the virtual machine based on the acquired virtual machine template mirror image.
An embodiment of the present application further provides a scheduling apparatus for a virtual machine, including:
the detection unit is used for detecting the running state of the first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal;
the first processing unit is used for controlling a second virtual machine to establish connection with the terminal when the detection unit detects that the first virtual machine fails; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.
An embodiment of the present application further provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of any of the above methods when running the computer program.
Embodiments of the present application also provide a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of any one of the above methods.
According to the scheduling method and device of the virtual machine, the electronic device and the storage medium provided by the embodiment of the application, the first management module detects the running state of the first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal; when the first virtual machine is detected to be out of order, controlling a second virtual machine to be connected with the terminal; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same. According to the scheme of the embodiment of the application, when the virtual machine of one data center fails, the management module can control the virtual machine which is created based on the same virtual machine template image with the failed virtual machine in the other data center to be connected with the terminal; therefore, the two data centers can jointly bear the desktop service without independently establishing a disaster recovery data center to carry out disaster recovery on the virtual machine of the other data center, so that the construction cost for constructing the bandwidth between the data centers is saved; meanwhile, the continuity of the desktop service can be guaranteed, and particularly, under a cloud desktop service scene (such as a service scene of paying fees in a business hall and a medical workstation) which has higher requirements on the continuity of the desktop service and does not need service data backup, the loss of enterprises caused by the interruption of the desktop service can be avoided, so that the user experience is improved.
Drawings
Fig. 1 is a schematic flowchart of a scheduling method of a virtual machine according to an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a scheduling principle of a virtual machine according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a user accessing a management module cluster through a terminal in an embodiment of the present application;
fig. 4 is a schematic diagram illustrating that a master management module controls each management module in a management module cluster to execute a scheduling task of a virtual machine according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a management module controlling a virtual machine in a data center to establish a connection with a terminal according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a scheduling apparatus of a virtual machine according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples.
In the related art, in order to solve the problem that a terminal cannot access a virtual machine when a server of a cloud data center fails, thereby causing interruption of a desktop service of a user, a desktop cloud disaster recovery scheme is adopted in which one disaster recovery data center is separately created to perform disaster recovery on the virtual machine of another data center (which may be written as a main data center in the subsequent description). The main data center is used for supporting (running) desktop services of users, and the disaster recovery data center bears the disaster recovery services of the main data center; specifically, desktop data of the main data center (i.e., desktop service data stored by a user on a virtual machine of the main data center) is periodically synchronized to a desktop of the disaster recovery data center (i.e., synchronized to the virtual machine of the disaster recovery data center), so that the desktop data of the main data center and the desktop data of the disaster recovery data center are kept consistent. When the main data center fails, the management module automatically pulls up (i.e., controls) the corresponding virtual machine in the disaster recovery data center to establish connection with the terminal, thereby ensuring that desktop services of users are not interrupted.
However, the above desktop cloud disaster recovery scheme has the following problems:
firstly, in order to synchronize desktop data of a main data center to a disaster recovery data center periodically, bandwidth throughput between the main data center and the disaster recovery data center and a delay requirement of data synchronization need to be considered, and enough bandwidth is built between the two data centers to ensure that data synchronization can be performed normally; the construction cost required for constructing the bandwidth between the data centers is high;
secondly, the Recovery Point Object (RPO) time of the desktop data needs to be estimated according to the data increment of the actual service scene, and a situation that the desktop data of the main data center cannot be synchronized to the disaster Recovery data center in time within the set RPO time may occur, thereby causing difficulty in implementing the desktop cloud disaster Recovery scheme;
thirdly, the construction cost required for separately creating a disaster recovery data center which does not provide desktop services for users is high.
In summary, the implementation cost of the desktop cloud disaster recovery scheme in the related art is high, and the method is not suitable for a cloud desktop service scenario (such as a service scenario for paying by a business hall and a medical workstation) in which a desktop service scenario is single, a data synchronization requirement is not high (i.e., service data backup is not required), a desktop service continuity requirement is high, and a budget is limited.
Based on this, in various embodiments of the present application, when a virtual machine of one data center fails, the management module may control a virtual machine created based on the same virtual machine template image as the failed virtual machine in another data center to establish a connection with the terminal; therefore, the two data centers can jointly bear the desktop service without independently establishing a disaster recovery data center to carry out disaster recovery on the virtual machine of the other data center, so that the construction cost for constructing the bandwidth between the data centers is saved; meanwhile, the continuity of the desktop service can be guaranteed, and particularly, under a cloud desktop service scene (such as a service scene of paying fees in a business hall and a medical workstation) which has higher requirements on the continuity of the desktop service and does not need service data backup, the loss of enterprises caused by the interruption of the desktop service can be avoided, so that the user experience is improved.
An embodiment of the present application provides a virtual machine scheduling method, which is applied to a first management module, and as shown in fig. 1, the method includes:
step 101: detecting the running state of the first virtual machine;
here, the first virtual machine is used for implementing a first virtualized desktop of the terminal, that is, the first virtual machine is used for providing the first virtualized desktop to the terminal;
step 102: when the first virtual machine is detected to be out of order, controlling a second virtual machine to be connected with the terminal;
here, the second virtual machine is configured to implement a second virtualized desktop of the terminal, that is, the second virtual machine is configured to provide the second virtualized desktop to the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.
In practical application, the first management module may bear (i.e., deploy) a virtual desktop access management system, a virtual desktop access management platform, a virtual desktop manager, and the like.
In practical application, the first management module may specifically run on an electronic device such as a server.
In practical application, the functions of the first data center and the second data center may be the same or different, in other words, the desktop services supported by the first data center and the second data center may be the same or different.
In actual application, the virtual machine template image may contain basic software data required for implementing a desktop service of a user; the base software data may include Operating System (OS) data, office software (such as software specified for use by a user's desktop service), etc. Accordingly, the desktop contents of the first virtualized desktop and the second virtualized desktop are the same, which can be understood as: the first virtualized desktop and the second virtualized desktop are the same in basic software needed for realizing desktop services of users, such as an operating system, office software and the like.
In actual application, for desktop service data generated when a user uses a virtual machine, the first management module may control the first virtual machine and the second virtual machine to periodically synchronize the desktop service data, and the synchronization period may be specifically set according to requirements. Certainly, for a cloud desktop service scenario (for example, a service scenario paid by a business hall or a medical workstation) in which desktop service continuity requirements are high and service data backup is not required, the desktop service data may be stored in a third-party server except for the virtual machine and the first management module, in other words, the first virtual machine and the second virtual machine do not need to synchronize the desktop service data.
In step 101, in an actual application, in order to avoid a single point of failure of the first management module, a management module cluster may be deployed, where the management module cluster may include a master management module and at least one slave management module, and the master management module may be configured to perform information interaction with a terminal, and control each management module (including the master management module itself) in the management module cluster to execute a scheduling task of a virtual machine, so as to balance loads of each management module in the management module cluster, and control each management module in the management module cluster to periodically perform data synchronization.
In practical application, the first management module may be a master management module.
Based on this, in an embodiment, the detecting the running state of the first virtual machine may include:
when a first request sent by the terminal and used for accessing the first virtual machine is received, detecting the load condition of each management module in the management module cluster; detecting the running state of the first virtual machine when detecting that the load condition of each management module in the management module cluster meets a first condition; the first condition characterizes that the load condition of the first management module is optimal.
In practical application, the first condition may be set according to requirements. For example, the first condition may characterize that free resources of a master management module in the cluster of management modules are greater than or equal to a first threshold, and free resources of slave management modules in the cluster of management modules are less than the first threshold. Of course, the first threshold may also be set according to requirements, such as 70%.
In actual application, the first request may be sent by the user through the terminal when logging in the corresponding desktop (that is, the corresponding desktop is not opened on the terminal), or may be sent by the user through the terminal in a process of using the corresponding desktop (that is, the corresponding desktop is opened on the terminal); in other words, the first request may be specifically used to log in the first virtual machine, or the first request may be specifically used to use a desktop service provided by the first virtual machine.
In practical applications, in order to avoid a single point of failure of the management module cluster, at least two management modules (i.e., a master management module and at least one slave management module) in the management module cluster need to be deployed on at least two servers. Or, at least two management modules in the management module cluster may also be deployed in at least two data centers in the form of virtual machines. Of course, when deploying each management module in the management module cluster, the servers and the virtual machines in the data center may also be combined, in other words, a part of the management modules are deployed on at least one server, and other management modules are deployed on the virtual machines in at least one data center.
In actual application, the first management module may also be a slave management module.
Based on this, in an embodiment, the detecting the running state of the first virtual machine may include:
when a first request of the terminal forwarded by a second management module is received, detecting the running state of the first virtual machine; the first request is used for accessing the first virtual machine; the second management module is a master management module in the management module cluster.
In actual application, before detecting the running state of the first virtual machine, the first management module needs to determine the first virtual machine first.
Based on this, in an embodiment, before the detecting the running state of the first virtual machine, the method may further include:
inquiring mapping information according to a first user identifier carried by the first request so as to operate a first virtual machine corresponding to the first user identifier; the mapping information comprises mapping relations between a plurality of user identifications and a plurality of virtual machines.
In actual application, in the process of creating a virtual machine, the corresponding management module (which may be a master management module or a called slave management module) may store the mapping relationship between the user identifier and the virtual machine. Here, since the virtual machines can be respectively generated in the at least two data centers based on the same virtual machine template image, so as to obtain at least two virtual machines, one of the obtained at least two virtual machines can be set as a default virtual machine, and a mapping relationship is established with a corresponding user. Of course, the corresponding management module may also store the mapping relationship between the virtual machines generated based on the same virtual machine template image.
In actual application, when each management module in the management module cluster periodically performs data synchronization under the control of the master management module, data such as the mapping relationship (that is, the mapping relationship between the user and the default virtual machine and the mapping relationship between virtual machines generated based on the same virtual machine template image) may be synchronized; the period of synchronization can be set as required. In this way, any management module in the management module cluster (including the master management module itself) can execute the scheduling task of the virtual machine under the scheduling (i.e., allocation) of the master management module.
In actual application, the first management module can detect the running state of the first virtual machine through the first data center; specifically, the first management module may send a query command to the first data center, instruct the first data center to detect the operating state of the first virtual machine, and return a detection result to the first management module.
In step 102, in actual application, in order to further ensure continuity of desktop services of a user, when virtual machines are created based on the same virtual machine template image to obtain the first virtual machine and the second virtual machine, at least three virtual machines may be created at the same time; after the three virtual machines are obtained, one of the virtual machines may be set as a default virtual machine associated with a corresponding user according to a preset rule (for example, random selection), that is, determined as a first virtual machine, and at least two virtual machines except the first virtual machine may be determined as preset virtual machines. Therefore, the second virtual machine may be one of at least two preset virtual machines; at least one preset virtual machine of the at least two preset virtual machines except the second virtual machine may be operated in the second data center or a third data center.
In actual application, the first management module may determine the mode of the second virtual machine from the at least two preset virtual machines according to requirements. For example, the first management module may determine the second virtual machine from the at least two preset virtual machines according to priority information corresponding to each of the at least two preset virtual machines. Here, the priority information may be set according to a requirement in the process of creating the virtual machine. Of course, when each management module in the management module cluster periodically performs data synchronization under the control of the master management module, priority information corresponding to the virtual machine may also be synchronized.
In actual application, before controlling the second virtual machine to establish a connection with the terminal, the first management module may send an inquiry message to the terminal to confirm to a user whether to access the second virtual machine, and after receiving an access instruction sent by the terminal, control the second virtual machine to establish a connection with the terminal; in other words, in various embodiments of the present application, controlling the second virtual machine to establish a connection with the terminal may be implemented automatically by the first management module, or may be implemented manually by a user through the terminal. Here, when the first management module is a master management module, the access instruction is directly received by the first management module from the terminal; when the first management module is a slave management module, the access instruction is forwarded to the first management module by a master management module. Of course, the query message may also be used to confirm to the user whether to set the second virtual machine as the default virtual machine associated with the first subscriber identity.
In actual application, the first management module may create a virtual machine.
Based on this, in an embodiment, before the detecting the running state of the first virtual machine, the method may further include:
receiving a first instruction; the first instruction is used for indicating to create a new virtual machine;
and responding to the first instruction, and controlling at least two data centers to perform virtual machine creation based on the virtual machine template image indicated by the first instruction.
Here, the at least two data centers may include the first data center, the second data center, and the third data center; the created virtual machine may include the first virtual machine and the at least two preset virtual machines.
Specifically, in an embodiment, the controlling at least two data centers to perform virtual machine creation based on the virtual machine template image indicated by the first instruction may include:
and sending a second instruction to each data center of the at least two data centers to instruct each data center to acquire the virtual machine template mirror image indicated by the first instruction, and creating the virtual machine based on the acquired virtual machine template mirror image.
In practical application, when the first management module is a master management module, the receiving a first instruction may include: the first management module receives a first instruction sent by a terminal. Correspondingly, the first management module may detect a load condition of each management module in the management module cluster when receiving the first instruction; and when detecting that the load condition of each management module in the management module cluster meets the first condition, responding to the first instruction, and controlling at least two data centers to create virtual machines based on the virtual machine template images indicated by the first instruction. Of course, in the case that the first management module is a slave management module, the receiving the first instruction may include: and the first management module receives the first instruction forwarded by the second management module.
In practical application, after the first management module sends the second instruction to each of the at least two data centers, when each data center acquires the virtual machine template image indicated by the first instruction, the virtual machine template image may be acquired from a third-party device (i.e., other devices except the management module cluster and the devices in the data centers), or may be acquired from any device in any data center or any device in the management module cluster. The specific mode for the data center to acquire the virtual machine template mirror image can be set according to requirements.
In actual application, the first management module may also update the virtual machine template images of the data centers to update the virtual machines. Specifically, the method may further include: the first management module receives a third instruction; the third instruction is used for indicating to update the first virtual machine template mirror image; and responding to the third instruction, and controlling at least two data centers to update the first virtual machine template mirror images stored in the data centers. Specifically, the controlling at least two data centers to update the first virtual machine template image stored in the data centers may include: the first management module sends a fourth instruction to each data center of the at least two data centers to instruct each data center to update the first virtual machine template image stored by the first management module.
According to the scheduling method of the virtual machine, a first management module detects the running state of a first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal; when the first virtual machine is detected to be out of order, controlling a second virtual machine to be connected with the terminal; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same. According to the scheme of the embodiment of the application, when the virtual machine of one data center fails, the management module can control the virtual machine which is created based on the same virtual machine template image with the failed virtual machine in the other data center to be connected with the terminal; therefore, the two data centers can jointly bear the desktop service without independently establishing a disaster recovery data center to carry out disaster recovery on the virtual machine of the other data center, so that the construction cost for constructing the bandwidth between the data centers is saved; meanwhile, the continuity of the desktop service can be guaranteed, and particularly, under a cloud desktop service scene (such as a service scene of paying fees in a business hall and a medical workstation) which has higher requirements on the continuity of the desktop service and does not need service data backup, the loss of enterprises caused by the interruption of the desktop service can be avoided, so that the user experience is improved.
The present application will be described in further detail with reference to the following application examples.
In the embodiment of the application, a desktop cloud disaster tolerance scheme is provided for cloud desktop service scenes (such as charging window service scenes of business halls and medical workstations) which have high requirements on continuity of desktop services, do not need service data backup (namely, do not have synchronization requirements on desktop data), and have limited cost budgets. Specifically, in combination with a desktop cloud multi-cluster deployment mode, at least two data centers jointly bear desktop services of users. For example, desktops in the same office area or the same business property may be distributed in different data centers; or, at least two desktops of different data centers can be configured for each user, and the at least two desktops form mutual backup in the different data centers. Here, the same service desktop of different data centers is managed by the same virtual machine template mirror image, in other words, the same service desktop of different data centers is generated based on the same virtual machine template mirror image; therefore, the workload of virtual machine template image management can be reduced.
In the embodiment of the application, after one data center fails, the other data center still can take over part of the service; specifically, the management module may control a corresponding virtual machine of another data center to establish a communication connection with the terminal, so as to recover the desktop service of the user. Therefore, a set of disaster recovery data center does not need to be separately built, high bandwidth does not need to be built, the construction cost is saved, meanwhile, the continuity of desktop services of users can be guaranteed, and the reliability of desktop cloud disaster recovery is improved.
The scheduling principle of the virtual machine according to the embodiment of the present application is described below with reference to fig. 2.
As shown in fig. 2, for the billing window business scenario of a healthcare workstation, at least two data centers may be deployed: cluster 1 for deploying "single number" virtual machines and cluster 2 for deploying "double number" virtual machines. And a management module cluster is deployed, wherein the management module cluster at least comprises a master management module and at least one slave management module (also called as a standby management module), so that a double-active cluster of the management modules is realized, in other words, the management module cluster is ensured to be in a working mode of double-active disaster tolerance, and a single-point fault of the management modules is avoided. For desktops with the same business property in the same office area, desktops of all business departments can be respectively deployed in at least two data centers through a single-number/double-number deployment strategy, desktops with the same business property in different data centers can be derived (namely created) based on the same virtual machine template mirror image, and when the virtual machine template mirror image needs to be updated, the virtual machine template mirror images of at least two data centers can be updated so as to update all virtual machines derived based on the corresponding template mirror image, and the consistency of virtual machine systems with the same business property is ensured.
Here, "single" and "double" refer to whether the number to a virtual machine is odd or even. Of course, deploying the odd-numbered virtual machines to one data center and deploying the even-numbered virtual machines to another data center is only an exemplary deployment manner, and in actual application, the manner of deploying the virtual machines generated based on the same virtual machine template mirror image to at least two data centers may be set according to requirements.
In actual application, each management module in the management module cluster may be deployed on a server, or may be deployed in a data center through a virtual machine. The management module may store a deployment policy (such as the single-number/double-number deployment policy) of the virtual machine, and each management module in the management module cluster may also periodically synchronize data (which may also be understood as real-time synchronization of data) such as the deployment policy under the control of the master management module.
In actual application, a plurality of virtual machine resources can be configured for the same user in different data centers, and a virtual machine of a certain data center is automatically selected after the user is appointed (namely, defaulted) to log in a management module; therefore, the virtual machines of the same user in different data centers can form mutual backup, and the fluency of the cloud desktop service used by the user is improved.
In practical application, when one data center fails, the other data center can still normally operate to ensure the continuity of part of services, and meanwhile, a user of the failed data center can automatically or manually switch to other data centers to access the backup virtual machine to continue to use the desktop services.
The following describes a process in which a user accesses a virtual machine through a terminal with reference to fig. 3 to 5.
First, as shown in fig. 3 and fig. 4, a user may access a master management module in a management module cluster through a terminal, and the master management module schedules each management module in the management module cluster including the master management module to execute a virtual machine scheduling task based on a load balancing scheduling policy, so that the master management module or the slave management module applies for a virtual machine (i.e., a virtual machine associated with a user identifier) from a corresponding data center based on the user identifier.
Then, as shown in fig. 5, after receiving the application from the master management module or the slave management module, the data center will respond to the application from the master management module or the slave management module, search for the virtual machine corresponding to the application, and control the searched virtual machine to establish a communication connection with the terminal; after establishing communication connection with the terminal, the virtual machine transmits a desktop picture to the terminal, and meanwhile, a user can input data to the desktop through the terminal, namely, the data is transmitted to the virtual machine.
The application embodiment combines the reliability of desktop cloud service, provides a desktop cloud disaster tolerance scheme based on multiple data centers, and simultaneously can realize the mirror image derivation (namely creation) and updating of desktops of different data centers through the same virtual machine template, namely can perform unified management on desktops of different data centers. Therefore, a disaster-tolerant data center does not need to be independently established to carry out disaster tolerance on the desktop, and the mutual disaster tolerance of the desktop service can be carried out among the data centers carrying the desktop service at present.
In order to implement the method according to the embodiment of the present application, an embodiment of the present application further provides a scheduling apparatus for a virtual machine, where the scheduling apparatus is disposed on a first management module, and as shown in fig. 6, the apparatus includes:
a detecting unit 601, configured to detect an operating state of a first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal;
a first processing unit 602, configured to control a second virtual machine to establish a connection with the terminal when the detecting unit 601 detects that the first virtual machine fails; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.
In an embodiment, the first management module is a master management module in a management module cluster; the apparatus also includes a receiving unit to receive a first request; the first request is used for accessing the first virtual machine;
the detecting unit 601 is specifically configured to detect a load condition of each management module in the management module cluster when the receiving unit receives the first request sent by the terminal; detecting the running state of the first virtual machine when detecting that the load condition of each management module in the management module cluster meets a first condition; the first condition characterizes that the load condition of the first management module is optimal.
In one embodiment, the first management module is a slave management module in the management module cluster;
the detecting unit 601 is specifically configured to detect an operating state of the first virtual machine when the receiving unit receives the first request of the terminal forwarded by the second management module; the first request is used for accessing the first virtual machine; the second management module is a master management module in the management module cluster.
In an embodiment, the apparatus further includes a second processing unit, configured to query mapping information according to a first user identifier carried in the first request before the detecting unit 601 detects the running state of the first virtual machine, so as to run the first virtual machine corresponding to the first user identifier; the mapping information comprises mapping relations between a plurality of user identifications and a plurality of virtual machines.
In an embodiment, the receiving unit is further configured to receive a first instruction; the first instruction is used for indicating to create a new virtual machine;
correspondingly, the device further comprises a third processing unit, which is used for responding to the first instruction and controlling at least two data centers to perform virtual machine creation based on the virtual machine template image indicated by the first instruction.
In one embodiment, the device further comprises a sending unit, configured to send information to the terminal, the other management module, or the data center;
correspondingly, the third processing unit is specifically configured to send a second instruction to each data center of the at least two data centers through the sending unit to instruct each data center to acquire the virtual machine template image indicated by the first instruction, and create a virtual machine based on the acquired virtual machine template image.
In actual application, the receiving unit and the sending unit may be implemented by a communication interface in a scheduling device of the virtual machine; the detection unit 601 may be implemented by a processor in a scheduling apparatus of the virtual machine in combination with a communication interface; the first processing unit 602, the second processing unit, and the third processing unit may be implemented by a processor in a scheduling apparatus of the virtual machine.
It should be noted that: the scheduling apparatus for a virtual machine according to the foregoing embodiment is only illustrated by dividing each program module when scheduling the virtual machine, and in actual application, the processing allocation may be completed by different program modules according to needs, that is, the internal structure of the apparatus is divided into different program modules to complete all or part of the processing described above. In addition, the scheduling apparatus of a virtual machine and the scheduling method embodiment of a virtual machine provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments and are not described herein again.
Based on the hardware implementation of the program module, and in order to implement the method of the embodiment of the present application, an embodiment of the present application further provides an electronic device, configured to implement the first management module, as shown in fig. 7, where the electronic device 700 includes:
a communication interface 701 capable of performing information interaction with other electronic devices;
the processor 702 is connected with the communication interface 701 to implement information interaction with other electronic devices, and is configured to execute the method provided by one or more technical solutions when running a computer program;
a memory 703 storing a computer program capable of running on the processor 702.
Specifically, the processor 702 is configured to:
detecting the running state of the first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal;
when the first virtual machine is detected to be out of order, controlling a second virtual machine to be connected with the terminal; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.
In an embodiment, the first management module is a master management module in a management module cluster; the processor 702 is specifically configured to:
when receiving a first request sent by the terminal through the communication interface 701, detecting a load condition of each management module in a management module cluster; detecting the running state of the first virtual machine when detecting that the load condition of each management module in the management module cluster meets a first condition; the first request is used for accessing the first virtual machine; the first condition characterizes that the load condition of the first management module is optimal.
In one embodiment, the first management module is a slave management module in the management module cluster; the processor 702 is specifically configured to:
when a first request of the terminal forwarded by a second management module is received through the communication interface 701, detecting the running state of the first virtual machine; the first request is used for accessing the first virtual machine; the second management module is a master management module in the management module cluster.
In an embodiment, the processor 702 is further configured to query mapping information according to a first user identifier carried in the first request, so as to run a first virtual machine corresponding to the first user identifier; the mapping information comprises mapping relations between a plurality of user identifications and a plurality of virtual machines.
In an embodiment, the processor 702 is further configured to:
receiving a first instruction through the communication interface 701; the first instruction is used for indicating to create a new virtual machine;
and responding to the first instruction, and controlling at least two data centers to perform virtual machine creation based on the virtual machine template image indicated by the first instruction.
In an embodiment, the processor 702 is specifically configured to:
sending a second instruction to each data center of the at least two data centers through the communication interface 701 to instruct each data center to acquire the virtual machine template image indicated by the first instruction, and creating a virtual machine based on the acquired virtual machine template image.
It should be noted that: the process of the processor 702 specifically executing the above operations is detailed in the method embodiment, and is not described here again.
Of course, in practice, the various components in the electronic device 700 are coupled together by the bus system 704. It is understood that the bus system 704 is used to enable communications among the components. The bus system 704 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled in fig. 7 as the bus system 704.
The memory 703 in the embodiments of the present application is used to store various types of data to support the operation of the electronic device 700. Examples of such data include: any computer program for operating on electronic device 700.
The methods disclosed in the embodiments of the present application may be implemented in the processor 702 or implemented by the processor 702. The processor 702 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 702. The Processor 702 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 702 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 703, and the processor 702 reads the information in the memory 703 and performs the steps of the foregoing methods in combination with its hardware.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the foregoing methods.
It is to be understood that the memory 703 of the embodiments of the present application may be either volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memories described in the embodiments of the present application are intended to comprise, without being limited to, these and any other suitable types of memory.
In an exemplary embodiment, the present application further provides a storage medium, specifically a computer storage medium, for example, a memory 703 storing a computer program, which can be executed by a processor 702 of the electronic device 700 to perform the steps of the foregoing method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
It should be noted that: "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The technical means described in the embodiments of the present application may be arbitrarily combined without conflict.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application.

Claims (11)

1. A scheduling method of a virtual machine is applied to a first management module, and comprises the following steps:
detecting the running state of the first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal;
when the first virtual machine is detected to be out of order, controlling a second virtual machine to be connected with the terminal; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.
2. The method of claim 1,
the first management module is a master management module or a slave management module in the management module cluster; the management module cluster comprises a master management module and at least one slave management module; the main management module is used for controlling each management module in the management module cluster to execute a scheduling task of a virtual machine, so that each management module in the management module cluster has balanced load, and each management module in the management module cluster is controlled to periodically perform data synchronization.
3. The method of claim 2, wherein the first management module is a master management module in the cluster of management modules; the detecting the running state of the first virtual machine includes:
when a first request sent by the terminal and used for accessing the first virtual machine is received, detecting the load condition of each management module in the management module cluster; detecting the running state of the first virtual machine when detecting that the load condition of each management module in the management module cluster meets a first condition; the first condition characterizes that the load condition of the first management module is optimal.
4. The method of claim 2, wherein the first management module is a slave management module in the cluster of management modules; the detecting the running state of the first virtual machine includes:
when a first request of the terminal forwarded by a second management module is received, detecting the running state of the first virtual machine; the first request is used for accessing the first virtual machine; the second management module is a master management module in the management module cluster.
5. The method of any of claims 3 or 4, wherein prior to detecting the operational state of the first virtual machine, the method further comprises:
inquiring mapping information according to a first user identifier carried by the first request so as to operate a first virtual machine corresponding to the first user identifier; the mapping information comprises mapping relations between a plurality of user identifications and a plurality of virtual machines.
6. The method according to any one of claims 1 to 4,
the second virtual machine is one preset virtual machine of at least two preset virtual machines; at least one preset virtual machine of the at least two preset virtual machines except the second virtual machine runs in the second data center or a third data center; the at least two preset virtual machines are obtained by the corresponding data centers through virtual machine creation based on the same virtual machine template image.
7. The method of any of claims 1 to 4, wherein prior to detecting the operating state of the first virtual machine, the method further comprises:
receiving a first instruction; the first instruction is used for indicating to create a new virtual machine;
and responding to the first instruction, and controlling at least two data centers to perform virtual machine creation based on the virtual machine template image indicated by the first instruction.
8. The method of claim 7, wherein controlling at least two data centers to perform virtual machine creation based on the virtual machine template image indicated by the first instruction comprises:
and sending a second instruction to each data center of the at least two data centers to instruct each data center to acquire the virtual machine template mirror image indicated by the first instruction, and creating the virtual machine based on the acquired virtual machine template mirror image.
9. A scheduling apparatus of a virtual machine, comprising:
the detection unit is used for detecting the running state of the first virtual machine; the first virtual machine is used for providing a first virtualized desktop for the terminal;
the first processing unit is used for controlling a second virtual machine to establish connection with the terminal when the detection unit detects that the first virtual machine fails; the second virtual machine is used for providing a second virtualized desktop for the terminal; the first virtual machine and the second virtual machine respectively run in a first data center and a second data center; the first virtual machine and the second virtual machine are obtained by the first data center and the second data center through virtual machine creation based on the same virtual machine template image; the desktop content of the first virtualized desktop and the second virtualized desktop are the same.
10. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 8 when running the computer program.
11. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, performing the steps of the method of any one of claims 1 to 8.
CN202110726904.2A 2021-06-29 2021-06-29 Virtual machine scheduling method and device, electronic equipment and storage medium Pending CN113467873A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110726904.2A CN113467873A (en) 2021-06-29 2021-06-29 Virtual machine scheduling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110726904.2A CN113467873A (en) 2021-06-29 2021-06-29 Virtual machine scheduling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113467873A true CN113467873A (en) 2021-10-01

Family

ID=77873745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110726904.2A Pending CN113467873A (en) 2021-06-29 2021-06-29 Virtual machine scheduling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113467873A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499296A (en) * 2022-07-29 2022-12-20 天翼云科技有限公司 Cloud desktop hot standby management method, device and system
CN115794470A (en) * 2022-12-01 2023-03-14 北京首都在线科技股份有限公司 Operation management method and device of virtual machine, electronic equipment and storage medium
US11870866B1 (en) * 2017-07-13 2024-01-09 Parallels International Gmbh High availability virtual desktop infrastructure

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594881A (en) * 2012-02-08 2012-07-18 中兴通讯股份有限公司 Virtual machine load balancing method, management modules and virtual machine cluster system
CN105094897A (en) * 2015-07-02 2015-11-25 华为技术有限公司 Virtual machine starting method, cloud access equipment and cloud computing center
CN111400086A (en) * 2020-02-18 2020-07-10 上海交通大学 Method and system for realizing fault tolerance of virtual machine
CN112256477A (en) * 2020-10-09 2021-01-22 上海云轴信息科技有限公司 Virtualization fault-tolerant method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594881A (en) * 2012-02-08 2012-07-18 中兴通讯股份有限公司 Virtual machine load balancing method, management modules and virtual machine cluster system
CN105094897A (en) * 2015-07-02 2015-11-25 华为技术有限公司 Virtual machine starting method, cloud access equipment and cloud computing center
CN111400086A (en) * 2020-02-18 2020-07-10 上海交通大学 Method and system for realizing fault tolerance of virtual machine
CN112256477A (en) * 2020-10-09 2021-01-22 上海云轴信息科技有限公司 Virtualization fault-tolerant method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11870866B1 (en) * 2017-07-13 2024-01-09 Parallels International Gmbh High availability virtual desktop infrastructure
CN115499296A (en) * 2022-07-29 2022-12-20 天翼云科技有限公司 Cloud desktop hot standby management method, device and system
CN115499296B (en) * 2022-07-29 2024-03-12 天翼云科技有限公司 Cloud desktop hot standby management method, device and system
CN115794470A (en) * 2022-12-01 2023-03-14 北京首都在线科技股份有限公司 Operation management method and device of virtual machine, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10735509B2 (en) Systems and methods for synchronizing microservice data stores
CN107707393B (en) Multi-active system based on Openstack O version characteristics
US10983880B2 (en) Role designation in a high availability node
CN107526659B (en) Method and apparatus for failover
CN113467873A (en) Virtual machine scheduling method and device, electronic equipment and storage medium
CN108632067B (en) Disaster recovery deployment method, device and system
US20190235979A1 (en) Systems and methods for performing computing cluster node switchover
US8032786B2 (en) Information-processing equipment and system therefor with switching control for switchover operation
CN112448858B (en) Network communication control method and device, electronic equipment and readable storage medium
CN111130835A (en) Data center dual-active system, switching method, device, equipment and medium
CN112291298B (en) Data transmission method, device, computer equipment and storage medium of heterogeneous system
US20210089379A1 (en) Computer system
CN109254876A (en) The management method and device of database in cloud computing system
CN115576655B (en) Container data protection system, method, device, equipment and readable storage medium
CN111158949A (en) Configuration method, switching method and device of disaster recovery architecture, equipment and storage medium
CN115373799A (en) Cluster management method and device and electronic equipment
WO2020252724A1 (en) Log processing method and device, and computer-readable storage medium
WO1997049034A1 (en) Job taking-over system
CN116467120A (en) Database deployment method, database access method and device of main framework
CN107515725B (en) Method and device for sharing disk by core network virtualization system and network management MANO system
CN114398203A (en) Cloud disaster recovery system, method, electronic device and storage medium
EP3387533B1 (en) Disaster recovery of cloud resources
CN107644035B (en) Database system and deployment method thereof
CN114356214B (en) Method and system for providing local storage volume for kubernetes system
CN111431951A (en) Data processing method, node equipment, system and storage medium

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