CN113391879A - Virtual system switching method and host machine - Google Patents

Virtual system switching method and host machine Download PDF

Info

Publication number
CN113391879A
CN113391879A CN202110664322.6A CN202110664322A CN113391879A CN 113391879 A CN113391879 A CN 113391879A CN 202110664322 A CN202110664322 A CN 202110664322A CN 113391879 A CN113391879 A CN 113391879A
Authority
CN
China
Prior art keywords
virtual machine
image file
client
qemu
kvm
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
CN202110664322.6A
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.)
Ruijie Network Suzhou Co ltd
Original Assignee
Ruijie Network Suzhou 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 Ruijie Network Suzhou Co ltd filed Critical Ruijie Network Suzhou Co ltd
Priority to CN202110664322.6A priority Critical patent/CN113391879A/en
Publication of CN113391879A publication Critical patent/CN113391879A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a virtual system switching method and a host machine, wherein the virtual system switching method comprises the following steps: downloading a first image file and a second image file through a client based on a binding request initiated by the client to the client; the client responds to a selection instruction input by the user side to select a first image file so as to create and run a first virtual machine based on the first image file through a virtualization unit QEMU-KVM; and responding to a system switching instruction input by the user terminal, executing the operation of closing the first virtual machine by the QEMU-KVM, and starting the second virtual machine by the QEMU-KVM based on the second image file when the first virtual machine is determined to be closed. The invention solves the problem of low switching efficiency caused by the fact that the current virtual machine image file needs to be deleted and the virtual machine image file needs to be started is downloaded again when a system is switched in the prior art.

Description

Virtual system switching method and host machine
Technical Field
The invention relates to the technical field of data interaction, in particular to a virtual system switching method and a host machine.
Background
The Intelligent Desktop Virtualization (IDV) Desktop cloud system architecture is mainly characterized by centralized management and distributed operation, which is also called as a C/S architecture and mainly comprises a Desktop cloud background management system at a server and a local Desktop cloud client program. Different from a mode that all Desktop computing resources are concentrated in a data center to operate under a Virtual Desktop Infrastructure (VDI), a server side under an IDV architecture only needs to be responsible for unified configuration management of a Desktop environment, and a Virtual machine is placed in a terminal to operate locally, so that load pressure of a server can be greatly reduced, transmission of network bandwidth is reduced, and actual operation experience of a cloud Desktop is fundamentally improved.
Under the IDV architecture, the system image file of the virtual machine can be acquired through a network, can be cached locally, and supports the starting of a desktop environment in an offline mode. Unlike VDI, since the virtual machine runs locally, the local client host needs to be a thick client with some computing power. In addition, the IDV architecture has better peripheral support capability and graphic processing capability, so that the performance defects of the VDI architecture can be effectively overcome, and the use experience of the cloud desktop is improved. For scenes with special requirements for the cloud desktop, such as multimedia experiment rooms in colleges and universities, the IDV architecture can also use a device transparent transmission mode to distribute hardware devices of the local host to the cloud desktop for use, so that the cloud desktop is experienced in use.
Generally, when a virtual system is started under an IDV architecture, a mirror image file is issued to a fat terminal through a desktop cloud server, and the fat terminal starts the virtual machine system through a virtualization technology. For a use scene with a plurality of virtual systems, the image file corresponding to the current virtual system needs to be deleted when the system is switched every time, and then the image file is downloaded again from the desktop cloud server so as to start the virtual machine system according to the downloaded image file again. Therefore, when the virtual system is switched, the switching efficiency is low because the image file corresponding to the current virtual system needs to be deleted and the image file corresponding to the virtual system to be started needs to be downloaded again.
In view of the above, it is desirable to provide a switching method for a virtual system to solve the above problems.
Disclosure of Invention
The invention aims to disclose a virtual system switching method and a host machine, which solve the problem that in the prior art, when a system is switched, the current mirror image file of a virtual machine needs to be deleted and the mirror image file of the virtual machine needs to be started is downloaded again, so that the switching time is prolonged and the switching efficiency is low.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, the present invention provides a virtual system switching method, including:
downloading a first image file and a second image file through a client based on a binding request initiated by the client to the client;
the client responds to a selection instruction input by the user side to select the first image file so as to create and operate a first virtual machine based on the first image file through a virtualization unit QEMU-KVM;
responding to a system switching instruction input by a user side, executing the operation of closing the first virtual machine by the QEMU-KVM, and starting a second virtual machine by the QEMU-KVM based on the second image file when the first virtual machine is determined to be closed.
As a further improvement of the present invention, in response to a system switching command input from the user side, the QEMU-KVM performs an operation of turning off the first virtual machine, including:
the first virtual machine responds to the input of the user side to generate a system switching instruction so as to send the system switching instruction to the client side;
and the client sends an execution instruction for closing the first virtual machine based on the system switching instruction, so that the QEMU-KVM executes the operation for closing the first virtual machine based on the execution instruction.
As a further improvement of the present invention, sending the system switching instruction to the client includes:
and the first virtual machine sends the system switching instruction to a virtual machine message proxy component through a virtual machine message distribution component so as to send the system switching instruction to the client through the virtual machine message proxy component.
As a further improvement of the present invention, the client issues an execution instruction for closing the first virtual machine based on the system switching instruction, so that the QEMU-KVM performs an operation for closing the first virtual machine based on the execution instruction, including:
the client receives a system switching instruction sent to the virtual machine message agent component by the first virtual machine, and sends an execution instruction for closing the first virtual machine to the virtual machine message agent component through the client;
the virtual machine message agent component sends the execution instruction received by the virtual machine message agent component to QEMU-KVM so that the QEMU-KVM executes the operation of closing the first virtual machine based on the execution instruction.
As a further improvement of the present invention, the QEMU-KVM starting a second virtual machine based on the second image file when it is determined that the first virtual machine has been closed, includes:
the QEMU-KVM monitors the state of the first virtual machine and sends the monitored state information to the client;
and the client sends an opening instruction for starting a second virtual machine to the QEMU-KVM when determining that the first virtual machine is closed according to the state information, so that the QEMU-KVM starts the second virtual machine based on the opening instruction and the second image file.
As a further improvement of the present invention, the monitored state information is sent to the client, specifically: the QEMU-KVM sends the state information to a client through a virtual machine message agent component;
and sending an opening instruction for starting the second virtual machine to the QEMU-KVM, specifically, sending the opening instruction for starting the second virtual machine to the QEMU-KVM by the client through the virtual machine message agent component.
As a further improvement of the present invention, before downloading the first image file and the second image file through the client, the method includes:
the client requests image information from the server so that the client downloads the first image file and the second image file based on the image information through the BT downloading tool.
As a further improvement of the present invention, before enabling the client to download the first image file and the second image file based on the image information through the BT download tool, the method includes:
and detecting the disk space so as to download the first image file and the second image file based on the image information through the BT download tool when the disk space is greater than or equal to a preset threshold value.
In a second aspect, the present invention provides a virtual system switching method, including:
downloading at least one mirror image file through a client based on a binding request initiated from the client to the client;
the client responds to a selection instruction input by the user side to select one of the image files so as to create and operate an original virtual machine based on the selected image file through QEMU-KVM;
and responding to a system switching instruction input by a user terminal, executing the operation of closing the original virtual machine by the QEMU-KVM, and downloading a target image file through the client terminal when the original virtual machine is determined to be closed so as to create and run the target virtual machine based on the target image file through the QEMU-KVM.
In a third aspect, the present invention provides a host, comprising:
the client is used for downloading the first image file and the second image file based on a binding request initiated to the client by the client, and responding to a selection instruction input by the client to select the first image file;
and the QEMU-KVM is used for creating and running a first virtual machine based on the first image file, executing the operation of closing the first virtual machine in response to a system switching instruction input by a user side, and starting a second virtual machine according to the second image file when the first virtual machine is determined to be closed.
In a fourth aspect, the present invention provides a host, comprising:
the client is used for downloading at least one image file based on a binding request initiated to the client by the client, responding to a selection instruction input by the client to select one image file, and downloading a target image file when the original virtual machine is determined to be closed;
and the QEMU-KVM is used for creating and operating an original virtual machine based on the selected image file, executing the operation of closing the original virtual machine in response to a system switching instruction input by the user side, and creating and operating a target virtual machine according to the target image file.
Compared with the prior art, the invention has the following beneficial effects:
the virtual system switching method of the invention firstly controls the client to download the first image file and the second image file, then selects one of the image files (such as the first image file), controls the virtualization unit QEMU-KVM to create a corresponding first virtual machine according to the selected image file and runs the first virtual machine, controls the QEMU-KVM to close the first virtual machine in response to a system switching instruction input by the client, and controls the QEMU-KVM to start the second virtual machine according to the other image file (namely, the second image file) when the first virtual machine is determined to be closed. Therefore, the virtual machine can be switched only by closing the current virtual machine and starting the corresponding virtual machine according to the image file downloaded by the client, so that the problem of low switching efficiency caused by the fact that the switching time is prolonged because the image file of the current virtual machine needs to be deleted and the image file of the virtual machine needing to be started needs to be downloaded again when the system is switched in the prior art is solved.
Drawings
FIG. 1 is a schematic block diagram of a virtual system switching system according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a virtual system switching method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a virtual system switching method according to another embodiment of the present invention;
FIG. 4 is a schematic session diagram of a virtual system switching method according to an embodiment of the invention;
FIG. 5 is a schematic session diagram of a virtual system switching method according to another embodiment of the present invention;
FIG. 6 is a schematic flow chart diagram of a virtual system switching method according to yet another embodiment of the present invention;
FIG. 7 is a schematic session diagram of a virtual system switching method according to yet another embodiment of the present invention;
FIG. 8 is a schematic flow chart diagram of a virtual system switching method according to yet another embodiment of the present invention;
FIG. 9 is a schematic flow chart diagram of a virtual system switching method according to yet another embodiment of the present invention;
FIG. 10 is a schematic flow chart diagram of a virtual system switching method according to yet another embodiment of the present invention;
FIG. 11 is a schematic block diagram of a virtual system switching system according to another embodiment of the present invention;
FIG. 12 is a block diagram of a topology of a computer readable medium according to the present disclosure;
fig. 13 is a topology structure diagram of a terminal device according to the present invention.
Detailed Description
The present invention is described in detail with reference to the embodiments shown in the drawings, but it should be understood that these embodiments are not intended to limit the present invention, and those skilled in the art should understand that functional, methodological, or structural equivalents or substitutions made by these embodiments are within the scope of the present invention.
Before describing in detail the various embodiments of the present invention, the core inventive concepts of the present invention are summarized and described in detail by the following several embodiments.
The first embodiment is as follows:
referring to fig. 1 to fig. 2, the present embodiment provides a virtual system switching method, which can be applied to a host 200 and can also be applied to a virtual system switching device 10. The virtual system switching method of this embodiment may also be referred to as "method" for short, and the method includes:
step S202, based on the binding request initiated by the user terminal 100 to the client terminal 201, the first image file and the second image file are downloaded through the client terminal 201.
As shown in fig. 3, before step S202, the method further includes:
step s201, the client 201 requests image information from the server 300, so that the client 201 downloads the first image file and the second image file based on the image information through the BT download tool.
Specifically, as described in conjunction with fig. 4, the user terminal 100 binds an individual user through the client 201, wherein the user can support dual system handover. The client 201 obtains the image information from the WEB control center in the server 300 according to the bound user, and thus downloads the first image file and the second image file one by one according to the image information through the BT download tool. In the downloading process, the client displays the corresponding downloading progress and the mirror image information. And after the downloading is finished, the interface of the client side is switched to the login interface.
It should be noted that the operation before enabling the client 201 to download the first image file and the second image file based on the image information through a Bit Torrent (BT) downloading tool may further include: and detecting the disk space so as to download the first image file and the second image file based on the image information through the BT download tool when the disk space is greater than or equal to a preset threshold value. Through setting a preset threshold value, the disk can store the first image file and the second image file downloaded by the BT tool.
Step s204, the client 201 selects the first image file in response to the selection instruction input by the client 100, so as to create and run the first virtual machine VM1 based on the first image file through the virtualization unit QEMU-KVM 202.
Referring to fig. 5, when the client 100 logs in the first virtual machine VM1 through the client 201, the client 201 switches to a login virtual system selection interface, which is presented to the client according to which systems the client supports currently. After the user end 100 selects a virtual system (i.e. a first virtual machine) to be logged in, the client end 201 starts a corresponding image file (i.e. a first image file) according to the selected virtual system, and creates a first virtual machine according to the first image file through the virtualization unit QEMU-KVM202 to run or start the first virtual machine VM 1. The first virtual machine VM1 is activated to present an interface to the user, and the user can perform corresponding operations on the interface of the first virtual machine VM 1.
It should be noted that QEMU refers to an emulator, and QEMU is mainly used for the emulation of virtual machine peripherals and processing I/O. The KVM is a module in the kernel, and can directly control the kernel to implement operations such as the simulation and operation of the vCPU, the allocation management of the memory, and the like, so that the efficiency is high. But the KVM itself cannot handle I/O, which needs to be handled by the QEMU virtual management tool. The KVM only needs to provide an external interface for the QEMU to call, so as to manage and control the virtual machine. I.e. initially QEMU does not call KVM functionality, the code is modified on the basis of QEMU, forming a virtualization unit QEMU-KVM, i.e. virtualization unit QEMU-KVM202 contains QEMU2021 and KVM2022, and QEMU2021 is able to call KVM2022 to enable management of the virtual machine.
Step s206. in response to the system switching instruction input by the user side, the QEMU-KVM performs an operation of closing the first virtual machine, and starts the second virtual machine VM2 based on the second image file when it is determined that the first virtual machine VM1 has been closed.
It should be understood that, in the virtual system switching method of this embodiment, the client is controlled to download the first image file and the second image file, then one of the image files (for example, the first image file) is selected, and the virtualization unit QEMU-KVM is controlled to create the corresponding first virtual machine according to the selected image file and run the first virtual machine, so as to control the QEMU-KVM to close the first virtual machine in response to the system switching instruction input by the client, and control the QEMU-KVM to start the second virtual machine according to the other image file (i.e., the second image file) when it is determined that the first virtual machine is closed. Therefore, the virtual system switching method of this embodiment can realize switching of the virtual system only by closing the current virtual machine (but not deleting the image file corresponding to the current virtual machine) and starting the corresponding virtual machine according to the image file downloaded by the client, thereby solving the problem in the prior art that the switching efficiency is low because the switching time is increased because the image file of the current virtual machine needs to be deleted and the image file of the virtual machine to be started needs to be downloaded again when the system is switched. Compared with the scheme that a plurality of host machines are adopted to respectively start the virtual machines to achieve the purpose of quickly switching the virtual machines in the prior art, the virtual machine switching method and the virtual machine switching system can greatly save resources under the condition of quickly switching the virtual machines, and solve the problem of resource waste caused by the fact that the virtual machines need to be switched by using a plurality of host machines.
In the above embodiment, as described with reference to fig. 6 and fig. 7, the operation of "in response to the system switching command input by the user end, the QEMU-KVM executing to turn off the first virtual machine" in step S206 includes:
step s602, the first virtual machine VM1 generates a system switching instruction in response to the input of the user terminal 100, so as to send the system switching instruction to the client 201.
The first VM1 sends the system switch instruction to the VM message agent component, VMMAgent component 203, configured by the host 200 through its configured VM message distribution component, RJVmsgDisp component 401, so as to send the system switch instruction to the client 201 through the VMMAgent component 203.
Step s604, the client 201 issues an execution instruction to close the first virtual machine VM1 based on the system switching instruction, so that the QEMU-KVM202 performs an operation to close the first virtual machine VM1 based on the execution instruction.
Specifically, as described with reference to fig. 7 and 8, step S604 includes:
step s802, the client 201 receives a system switching instruction sent by the first virtual machine to the VMMAgent component 203, so as to send an execution instruction for closing the first virtual machine VM1 to the VMMAgent component 203 through the client 201.
Step s804, the vmmagent component 203 sends the execution instruction it received to the QEMU-KVM202, so that the QEMU-KVM202 performs an operation of closing the first virtual machine VM1 based on the execution instruction.
Further, referring to fig. 9, the operation of "QEMU-KVM starts a second virtual machine based on a second image file when it is determined that the first virtual machine is turned off" in step S206 includes:
step 902, QEMU-KVM202 monitors the state of the first virtual machine VM1 and sends the monitored state information to the client 201.
Continuing with the description of fig. 7, the QEMU-KVM202 sends the monitored status of whether the VM1 is powered off to the VMMAgent component 203, and when the client 201 queries the status information of the VM1, the VMMAgent component 203 feeds back the status information of whether the VM1 is powered off to the client 201.
And 904, the client 201 sends an opening instruction for starting the second virtual machine VM2 to the QEMU-KVM202 when determining that the first virtual machine VM1 is closed according to the state information, so that the QEMU-KVM202 starts the second virtual machine VM2 based on the opening instruction and the second image file.
With continued reference to fig. 7, when the client 201 determines that the first virtual machine VM1 is turned off, the VMMAgent component 203 sends an open command for starting the second virtual machine VM2 to the QEMU-KVM202, so as to start the second virtual machine VM2 through the QEMU-KVM202, and the user can perform corresponding operations through the started second virtual machine VM 2.
As can be seen from this, in the virtual system switching method of this embodiment, when the user terminal 100 inputs a system switching instruction to the first virtual machine VM1, the first virtual machine communicates with the virtual machine message agent component VMMAgent component 203 configured by the host 200 through the virtual machine message distribution component, i.e., the rjvmmsgdip component 401 configured by the first virtual machine, so as to send the system switching instruction to the host, and sends the system switching instruction to the client 201 through the virtual machine message agent component VMMAgent component 203, so as to send an execution instruction for closing the first virtual machine through the client, and the execution instruction sent by the client is sent to the QEMU-KVM202 through the virtual machine message agent component VMMAgent component 203, so as to execute an operation for closing the first virtual machine through the QEMU-KVM 202. The client inquires the state of the first virtual machine monitored by the QEMU-KVM202 through the virtual machine message agent component VMMAgent component 203, and issues a start instruction to start the second virtual machine VM2 to the QEMU-KVM202 through the virtual machine message agent component 203 when the first virtual machine is determined to be turned off, so as to execute a start operation on the second virtual machine through the QEMU-KVM202, thereby completing the switching process of switching the first virtual machine VM1 to the second virtual machine VM 2.
It is understood that, the virtual system switching method of this embodiment can realize fast switching of the virtual system only by closing the current first virtual machine and starting the corresponding second virtual machine according to the image file downloaded by the client, thereby avoiding a long delay caused by deleting the image file of the current virtual machine and downloading the image file of the virtual machine to be started again when the system is switched, and effectively improving the switching efficiency of the virtual system.
It is to be noted that the virtual system switching method of this embodiment may also switch different systems (e.g., a Windows system and a Linux system), and may also switch systems of the same type (e.g., Windows and Windows, Linux, and Linux), so as to improve not only the switching efficiency of the virtual system, but also the usage efficiency of the host. The Linux system may be an open source system reddat, Ubuntu, CentOS, Fedora, UOS, or Kylin system.
It should be noted that, in this embodiment, the first virtual machine VM1 is operated first, and then the first virtual machine VM1 is switched to the second virtual machine VM2 through the system switching instruction, or the second virtual machine VM2 is operated first, and then the second virtual machine VM2 is switched to the first virtual machine VM1 through the system switching instruction, and the specific switching process is described in the foregoing embodiments and is not described again.
In addition, the term "user side" in the present embodiment refers to a person or an executable program (e.g., a robot program) capable of issuing a control command, a physical device or a command issuing side including the executable program, and the like.
Example two:
as shown in fig. 10 and fig. 11, this embodiment further provides a virtual system switching method, including:
step S1002, based on a binding request initiated from a user side to a client side, downloading at least one mirror image file through the client side. In general, the client downloads one or two image files, or multiple image files.
Step S1004, the client responds to a selection instruction input by the user end to select one of the image files so as to create and run an original virtual machine (such as a first original virtual machine or a second original virtual machine) based on the selected image file through the QEMU-KVM. In this embodiment, the "original virtual machine" refers to a virtual machine created and operated from a downloaded image file.
Step S1006, in response to a system switching instruction input by the user side, the QEMU-KVM executes an operation of closing the original virtual machine, and downloads the target image file through the client when it is determined that the original virtual machine is closed and it is determined that the client does not download the target image file, so as to create and run the target virtual machine based on the target image file through the QEMU-KVM, or create and run the target virtual machine based on the target image file through the QEMU-KVM when it is determined that the original virtual machine is closed and the client downloads the target image file.
It should be understood that the virtual system switching method of this embodiment first controls the client to download at least one image file, then selects one of the image files (e.g. the first image file), controls the virtualization unit QEMU-KVM to create a corresponding virtual machine (e.g. the first original virtual machine or the second original virtual machine) according to the selected image file and run the original virtual machine, controls the QEMU-KVM to close the original virtual machine in response to a system switching instruction input by the client (without deleting the image file corresponding to the original virtual machine), determines whether the target image file is an image file downloaded by the client when it is determined that the original virtual machine is closed, downloads the target image file through the client when it is determined that the target image file is an image file not downloaded by the client, creates and runs the corresponding target virtual machine according to the target image file through the QEMU-KVM, or when the target image file is determined to be the image file downloaded by the client, the corresponding target virtual machine is directly created and operated according to the downloaded target image file through the QEMU-KVM. Therefore, the virtual system switching method of the embodiment can be applied to switching of multiple systems, and the embodiment can realize switching of the virtual system only by closing the current virtual machine and downloading the target image file through the client or starting the corresponding virtual machine according to the target image file downloaded by the client, thereby solving the problem that in the prior art, when the system is switched, the image file of the current virtual machine needs to be deleted and the image file of the virtual machine needs to be started is downloaded again, so that the switching time length is increased, and the switching efficiency is low.
It should be noted that, before downloading the target image file, the space of the disk needs to be detected, so that the target image file is downloaded by the BT download tool based on the image information when the disk space meets the download condition, thereby preventing the occurrence of the phenomena of jamming and the like during system switching.
Please refer to the description of the first embodiment, and further description thereof is omitted.
Example three:
as shown in fig. 1, the present embodiment provides a virtual system switching apparatus 10, which includes: a user terminal 100; a host machine 200; a server 300; and a first virtual machine VM1 and a second virtual machine VM 2. Wherein, host 200 includes: the client 201 is configured to download the first image file and the second image file based on a binding request initiated by the client 100 to the client 201, and select the first image file in response to a selection instruction input by the client 100; the QEMU-KVM202 is configured to create and run the first virtual machine VM1 based on the first image file, and perform an operation of shutting down the first virtual machine VM1 in response to a system switching instruction input from the user terminal 100, to boot the second virtual machine VM2 according to the second image file when it is determined that the first virtual machine VM1 is shut down. The server 300 is configured to respond to the image information sent by the client, download the first image file and the second image file based on the image information, and send the downloaded first image file and second image file to the client 201 through the BT tool.
The virtual system switching system of this embodiment first controls the client 201 to download the first image file and the second image file, and select one of the image files (e.g., the first image file), controls the virtualization unit QEMU-KVM202 to create the corresponding first virtual machine VM1 according to the selected image file and run the first virtual machine, so as to control the QEMU-KVM202 to close the first virtual machine in response to a system switching instruction input by the client, and controls the QEMU-KVM202 to start the second virtual machine VM2 according to the other image file (i.e., the second image file) when it is determined that the first virtual machine is completely closed. Therefore, the virtual system switching system of this embodiment can realize switching of the virtual system only by closing the current virtual machine and starting the corresponding virtual machine according to the image file downloaded by the client 201, thereby solving the problem that in the prior art, when the system is switched, the image file of the current virtual machine needs to be deleted and the image file of the virtual machine to be started needs to be downloaded again, so that the switching duration is increased, and the switching efficiency is low. Moreover, compared with the scheme that a plurality of hosts are adopted to respectively start the virtual machines so as to achieve the purpose of quickly switching the virtual machines in the prior art, the virtual machine switching method and the virtual machine switching system can greatly save resources under the condition of quickly switching the virtual machines, and solve the problem of resource waste caused by the fact that the virtual machines need to be switched by using a plurality of hosts.
Please refer to the description of the first embodiment, and further description thereof is omitted.
Example four:
the embodiment further provides a host 200, which includes: the client 201 is used for downloading the first image file and the second image file based on a binding request initiated by the client 100 to the client, and responding to a selection instruction input by the client to select the first image file; the QEMU-KVM202 is configured to create and run the first virtual machine VM1 based on the first image file, and perform an operation of shutting down the first virtual machine VM1 in response to a system switching instruction input from a user side, so as to boot the second virtual machine VM2 according to the second image file when it is determined that the first virtual machine VM1 is shut down.
It should be understood that the host 200 of the embodiment downloads the first image file and the second image file by controlling the client 201, then selects one of the image files (e.g. the first image file), and controls the virtualization unit QEMU-KVM202 to create the corresponding first virtual machine VM1 according to the selected image file and run the first virtual machine VM1, so as to control the QEMU-KVM202 to close the first virtual machine in response to the system switching command input by the client 100, and control the QEMU-KVM202 to start the second virtual machine VM2 according to the other image file (i.e. the second image file) when it is determined that the first virtual machine has been completely closed. Therefore, the host 200 of this embodiment can switch the virtual system by only turning off the current virtual machine and starting the corresponding virtual machine according to the image file downloaded by the client, thereby solving the problem in the prior art that the switching efficiency is low because the switching time is increased because the image file of the current virtual machine needs to be deleted and the image file of the virtual machine to be started needs to be downloaded again when the system is switched. Compared with the scheme that a plurality of host machines are adopted to respectively start the virtual machines to achieve the purpose of quickly switching the virtual machines in the prior art, the virtual machine switching method and the virtual machine switching system can greatly save resources under the condition of quickly switching the virtual machines, and solve the problem of resource waste caused by the fact that the virtual machines need to be switched by using a plurality of host machines.
Example five:
as shown in fig. 11, the present embodiment further provides a host 200, including: the client 201 is used for downloading at least one image file based on a binding request initiated by the client 100 to the client, responding to a selection instruction input by the client to select one image file, and downloading a target image file when the original virtual machine 400 is determined to be closed and the client is determined not to download the target image file; and the QEMU-KVM202 is configured to create and run the original virtual machine 400 based on the selected image file, perform an operation of closing the original virtual machine 400 in response to a system switching instruction input by the client, and create and run the target virtual machine 500 according to the target image file downloaded by the client.
The host 200 of this embodiment downloads at least one image file through the client, then selects one of the image files (e.g., the first image file), and controls the virtualization unit QEMU-KVM to create a corresponding original virtual machine 400 (e.g., the first original virtual machine 402 or the second original virtual machine 403) according to the selected image file and run the original virtual machine, so as to control the QEMU-KVM to close the original virtual machine in response to a system switching instruction input by the client, and determine whether the target image file is the image file downloaded by the client when it is determined that the original virtual machine is closed, and download the target image file through the client when it is determined that the target image file is the image file not downloaded by the client, so as to create and run the corresponding target virtual machine 500 according to the target image file through the QEMU-KVM, or directly create and run the target image file according to the target image file through the QEMU-KVM when it is determined that the target image file is the image file downloaded by the client The line corresponds to the target virtual machine. Therefore, the embodiment can be applied to switching of multiple systems, and the embodiment can realize switching of virtual systems only by closing the current virtual machine and starting the corresponding virtual machine according to the image file downloaded by the client, so that the problem that switching efficiency is low due to the fact that the switching time is prolonged because the image file of the current virtual machine needs to be deleted and the image file of the virtual machine needs to be started needs to be downloaded again when the system is switched in the prior art is solved.
Please refer to embodiment two, and detailed descriptions thereof are omitted herein for technical solutions of the same parts in this embodiment and embodiment two.
Example six:
referring to FIG. 12, the present example discloses one embodiment of a computer readable medium 1200. The computer readable medium 1200 may be disposed in whole or in part in a physical form of a computer, server, cluster server, or data center.
In this embodiment, a computer readable medium 1200 is provided, in which computer program instructions 1201 are stored in the computer readable medium 1200, and when the computer program instructions 1201 are read and executed by a processor 1202, the steps in the virtual system switching method according to an embodiment of the disclosure are executed.
Alternatively, the computer-readable medium 1200 may be configured as a server and the server run on a physical device that constructs a private cloud, a hybrid cloud, or a public cloud. Meanwhile, the computer readable medium 1200 may also be configured as a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The computer readable medium 1200 is used for storing a program, and the processor 1202 performs the virtual system switching method disclosed in an embodiment after receiving an execution instruction.
Meanwhile, the processor 1202 of the present embodiment may be an integrated circuit chip having signal processing capability. The Processor 1202 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. The general purpose processor may be a microprocessor or the general purpose processor may be any conventional processor.
Please refer to the description of the first embodiment, which will not be repeated herein, regarding a technical solution of the same portion in the computer-readable medium 1200 as that in the first embodiment.
Example seven:
referring to fig. 13 in combination, this embodiment discloses a terminal device 1300, which includes a processor 1301, a memory 1302, and a computer program stored in the memory 1302 and capable of running on the processor 1301, and when the computer program is executed by the processor 1301, the steps of the virtual system switching method according to the first embodiment are implemented. Meanwhile, a communication bus 1303 which establishes communication connection between the processor 1301 and the storage device 1302. The processor 1301 is configured to execute one or more programs stored in the storage device 1302, where the programs are the virtual system switching method according to the first embodiment.
In this embodiment, the storage device 1302 includes a storage unit 13021 to a storage unit 1302i, and the parameter i is a positive integer greater than or equal to 1. The terminal device 1300 may be understood as a computer, a cluster server, or a cloud platform.
Please refer to the description of the first embodiment, which will not be repeated herein, for a specific technical solution of the virtual system switching method relied on/included in the terminal device 1300 in this embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable medium. Based on such understanding, the technical solution of the present invention may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-listed detailed description is only a specific description of a possible embodiment of the present invention, and they are not intended to limit the scope of the present invention, and equivalent embodiments or modifications made without departing from the technical spirit of the present invention should be included in the scope of the present invention.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.

Claims (11)

1. A virtual system switching method is characterized by comprising the following steps:
downloading a first image file and a second image file through a client based on a binding request initiated by the client to the client;
the client responds to a selection instruction input by the user side to select the first image file so as to create and operate a first virtual machine based on the first image file through a virtualization unit QEMU-KVM;
responding to a system switching instruction input by a user side, executing the operation of closing the first virtual machine by the QEMU-KVM, and starting a second virtual machine by the QEMU-KVM based on the second image file when the first virtual machine is determined to be closed.
2. The virtual system switching method according to claim 1, wherein in response to a system switching command input from a user side, the QEMU-KVM performs an operation of turning off the first virtual machine, including:
the first virtual machine responds to the input of the user side to generate a system switching instruction so as to send the system switching instruction to the client side;
and the client sends an execution instruction for closing the first virtual machine based on the system switching instruction, so that the QEMU-KVM executes the operation for closing the first virtual machine based on the execution instruction.
3. The virtual system switching method according to claim 2, wherein sending the system switching instruction to a client comprises:
and the first virtual machine sends the system switching instruction to a virtual machine message proxy component through a virtual machine message distribution component so as to send the system switching instruction to the client through the virtual machine message proxy component.
4. The virtual system switching method according to claim 2, wherein the client issues an execution instruction to close the first virtual machine based on the system switching instruction, so that the QEMU-KVM performs the operation of closing the first virtual machine based on the execution instruction, including:
the client receives a system switching instruction sent to the virtual machine message agent component by the first virtual machine, and sends an execution instruction for closing the first virtual machine to the virtual machine message agent component through the client;
the virtual machine message agent component sends the execution instruction received by the virtual machine message agent component to QEMU-KVM so that the QEMU-KVM executes the operation of closing the first virtual machine based on the execution instruction.
5. The virtual system switching method of claim 1, wherein the QEMU-KVM starting a second virtual machine based on the second image file when determining that the first virtual machine has been turned off, comprises:
the QEMU-KVM monitors the state of the first virtual machine and sends the monitored state information to the client;
and the client sends an opening instruction for starting a second virtual machine to the QEMU-KVM when determining that the first virtual machine is closed according to the state information, so that the QEMU-KVM starts the second virtual machine based on the opening instruction and the second image file.
6. The virtual system switching method according to claim 5,
sending the monitored state information to a client, specifically: the QEMU-KVM sends the state information to a client through a virtual machine message agent component;
and sending an opening instruction for starting the second virtual machine to the QEMU-KVM, specifically, sending the opening instruction for starting the second virtual machine to the QEMU-KVM by the client through the virtual machine message agent component.
7. The virtual system switching method according to any one of claims 1 to 6, comprising, before downloading the first image file and the second image file through the client:
the client requests mirror image information from the server so that the client downloads a first mirror image file and a second mirror image file based on the mirror image information through a Bit Torrent (BT) downloading tool.
8. The virtual system switching method according to claim 7, before causing the client to download the first image file and the second image file based on the image information through the BT download tool, comprising:
and detecting the disk space so as to download the first image file and the second image file based on the image information through the BT download tool when the disk space is greater than or equal to a preset threshold value.
9. A virtual system switching method is characterized by comprising the following steps:
downloading at least one mirror image file through a client based on a binding request initiated from the client to the client;
the client responds to a selection instruction input by the user side to select one of the image files so as to create and operate an original virtual machine based on the selected image file through QEMU-KVM;
and responding to a system switching instruction input by a user terminal, executing the operation of closing the original virtual machine by the QEMU-KVM, downloading a target image file by the client when the original virtual machine is determined to be closed and the target image file is not downloaded by the client, creating and running the target virtual machine based on the target image file by the QEMU-KVM, or creating and running the target virtual machine based on the target image file by the QEMU-KVM when the original virtual machine is determined to be closed and the target image file is downloaded by the client.
10. A host machine, comprising:
the client is used for downloading the first image file and the second image file based on a binding request initiated to the client by the client, and responding to a selection instruction input by the client to select the first image file;
and the QEMU-KVM is used for creating and running a first virtual machine based on the first image file, executing the operation of closing the first virtual machine in response to a system switching instruction input by a user side, and starting a second virtual machine according to the second image file when the first virtual machine is determined to be closed.
11. A host machine, comprising:
the client is used for downloading at least one image file based on a binding request initiated to the client by the client, responding to a selection instruction input by the client to select one image file, and downloading the target image file when the original virtual machine is determined to be closed and the client is determined not to download the target image file;
and the QEMU-KVM is used for creating and running an original virtual machine based on the selected image file, executing the operation of closing the original virtual machine in response to a system switching instruction input by the user side, and creating and running a target virtual machine according to the target image file downloaded by the client side.
CN202110664322.6A 2021-06-16 2021-06-16 Virtual system switching method and host machine Pending CN113391879A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110664322.6A CN113391879A (en) 2021-06-16 2021-06-16 Virtual system switching method and host machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110664322.6A CN113391879A (en) 2021-06-16 2021-06-16 Virtual system switching method and host machine

Publications (1)

Publication Number Publication Date
CN113391879A true CN113391879A (en) 2021-09-14

Family

ID=77621641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110664322.6A Pending CN113391879A (en) 2021-06-16 2021-06-16 Virtual system switching method and host machine

Country Status (1)

Country Link
CN (1) CN113391879A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113886019A (en) * 2021-10-20 2022-01-04 北京字节跳动网络技术有限公司 Virtual machine creation method, device, system, medium and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309737A (en) * 2012-03-07 2013-09-18 联想(北京)有限公司 Method and device for switching operating system
CN107656757A (en) * 2016-07-25 2018-02-02 南京中兴新软件有限责任公司 operating system switching method and device
CN111367609A (en) * 2020-03-06 2020-07-03 北京云创世联科技股份有限公司 Desktop switching method based on intelligent desktop virtualization IDV framework
CN112667361A (en) * 2020-12-31 2021-04-16 北京北信源软件股份有限公司 Management method and device based on system virtual machine, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309737A (en) * 2012-03-07 2013-09-18 联想(北京)有限公司 Method and device for switching operating system
CN107656757A (en) * 2016-07-25 2018-02-02 南京中兴新软件有限责任公司 operating system switching method and device
CN111367609A (en) * 2020-03-06 2020-07-03 北京云创世联科技股份有限公司 Desktop switching method based on intelligent desktop virtualization IDV framework
CN112667361A (en) * 2020-12-31 2021-04-16 北京北信源软件股份有限公司 Management method and device based on system virtual machine, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113886019A (en) * 2021-10-20 2022-01-04 北京字节跳动网络技术有限公司 Virtual machine creation method, device, system, medium and equipment
CN113886019B (en) * 2021-10-20 2024-04-30 北京字节跳动网络技术有限公司 Virtual machine creation method, device, system, medium and equipment

Similar Documents

Publication Publication Date Title
US11765051B2 (en) Instantiation of cloud-hosted functions based on call to function graph
US8671403B2 (en) Pre-creating virtual machines in a grid environment
EP3073373B1 (en) Method for interruption affinity binding of virtual network interface card, and computer device
JP6927375B2 (en) How to handle deep learning tasks, devices and computer-readable storage media
CN106775946B (en) A kind of virtual machine Method of Creation Process
JP2011100431A (en) Device and method for controlling virtual machine
US20170168901A1 (en) Server backup method and backup system using the method
US20120047357A1 (en) Methods and systems for enabling control to a hypervisor in a cloud computing environment
Lee et al. Granular computing
CN105915583B (en) Method for starting service cluster and service cluster
WO2012177359A2 (en) Native cloud computing via network segmentation
CN113312142A (en) Virtualization processing system, method, device and equipment
WO2019028682A1 (en) Multi-system shared memory management method and device
JP6144639B2 (en) Network control device, communication system, network control method, and network control program
WO2019119315A1 (en) Input processing method and apparatus based on multiple operating systems, and electronic device
WO2022041507A1 (en) 3d rendering method and system
WO2024082985A1 (en) Unloading card provided with accelerator
US11513830B2 (en) Introspection into workloads running within virtual machines
CN113391879A (en) Virtual system switching method and host machine
US20240212255A1 (en) Scene Rendering Method, Apparatus, Device, and System
WO2022143717A1 (en) Method, apparatus, and system for migrating virtual machine
US20130219040A1 (en) Storage area network configuration of vitual fibre channel ports prior to client creation
CN113037795A (en) Thin terminal system and processing method thereof
US20190243673A1 (en) System and method for timing out guest operating system requests from hypervisor level
CN114217900A (en) Remote control method, device and system, computing equipment 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210914

RJ01 Rejection of invention patent application after publication