A system and method for dynamically changing templates in a VDI scenario
By exporting sub-image changes and generating a new base image through snapshot or backup technology, combined with automatic detection and link cloning, the waiting time and operational complexity of template updates in VDI scenarios are solved, enabling dynamic updates and simplified operations.
Patent Information
- Application Number
- CN202210959620.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-10
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-08-10
AI Technical Summary
In VDI scenarios, existing technologies require shutting down all sub-images and updating the base image, which presents an uncontrollable waiting time problem. Furthermore, the update process is complex and difficult for non-professional users to operate.
The changes to the sub-image are exported using snapshot or backup technology, a new base image is generated, and the new template base image is automatically detected when the virtual machine boots up. The new sub-image is then quickly generated using linked cloning, and the old template base image is deleted.
It enables dynamic updates of the template base image without affecting user business, reducing waiting time, simplifying operation process, and is suitable for non-professional users.
Smart Images

Figure CN115344351B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of desktop virtualization, and more particularly, to a system and method for dynamically changing templates in a VDI scenario. BACKGROUND
[0002] VDI refers to desktop virtualization, which is the abbreviation of Virtual Desktop Infrastructure, also known as virtual desktop architecture. VDI is a technology that uses virtualization to store operating systems and applications in servers and storage devices in a data center, and provides desktops for different users by establishing a virtual machine pool. Users use different terminal devices to connect to the corresponding virtual desktop display protocol and virtual machine, and display the operation interface of the virtual machine on the terminal. The terminal is only used as an input and output terminal, and the calculation and storage are all on the server side. Through the optimization of the display protocol and some peripheral redirection technology, the experience of accessing the virtual desktop and using the local PC is consistent. This architecture can provide centralized management and security advantages, and has the advantage of mobility, allowing users to access their desktop environment anywhere.
[0003] Cloud computing has become one of the trends in current IT development, and more and more organizations are migrating their services to the cloud, including VDI products that migrate desktops to the cloud. In VDI products, a template base image is usually created first, and then sub-images are quickly generated through link cloning to create cloud desktop systems in batches. The template base image is read-only and cannot be changed, and each user's changes are retained in the sub-image. For example, in a classroom scenario, 60 sub-images can be cloned from the base image to quickly create a unified computer environment for 60 students.
[0004] However, if the base image needs to be modified, there are two problems: 1. All sub-images need to be closed before the base image can be edited and generated again. If the sub-images are in use, they need to be waited for, and this waiting time is uncontrollable in an office scenario; 2. Updating the base image usually requires access to the VDI management system, which is too complex for people with only basic computer skills to learn. SUMMARY
[0005] In order to overcome the above-mentioned defects of the prior art, embodiments of the present application provide a system and method for dynamically changing templates in a VDI scenario, changes in a sub-image are exported through snapshot technology or through backup technology to generate a new base image, the new template base image is detected after the sub-image is shut down, the new sub-image is generated by cloning directly from the new template base image, so as to solve the problems proposed in the above background.
[0006] To achieve the above object, the present application provides the following technical scheme: a system for dynamically changing templates in a VDI scenario, comprising a cloud desktop creation module, a sub-image editing and exporting module, a template base image detection module, a cloning module, and a deletion module, the cloud desktop creation module is used to create a VDI scenario, the VDI scenario comprises a cloud server, a virtual machine, and an interaction unit, the operating system and the application program are stored in the cloud server, the template base image is installed in the cloud server, the virtual machine is a sub-image corresponding to the template base image, the interaction unit is used to connect the cloud server and the virtual machine and complete the communication connection between the cloud server and the virtual machine; the sub-image editing and exporting module is used to edit the sub-image and export the edited sub-image to the cloud server, the exported sub-image exists in the form of a template base image; the template base image detection module is used to automatically detect whether there is a new template base image in the cloud server when the virtual machine is started, and the detection result is transmitted to the cloning module; the cloning module quickly generates a sub-image in a linked cloning manner after receiving an instruction that there is a new template base image, and completes the update of the sub-image in the virtual machine; the deletion module is used to delete the template base image without a connected sub-image.
[0007] The virtual machine comprises a disk file and a configuration file, the virtual machine sub-image is cloned by copying the disk file, and the configuration file defines the disk position of the virtual machine, the network configuration in the virtual machine, and the hardware configuration information.
[0008] In a preferred embodiment, the snapshot technology is involved in the sub-mirror export process in the sub-mirror editing and exporting module, and the export process comprises the following steps: first, a user selects to create a snapshot at a certain time point, and data files generated in the creation process are copied through the snapshot technology; after the snapshot creation is completed, the snapshot generated file is stored in the cloud server; a template base image is created according to the snapshot file, and a tag is added in the new template base image; finally, the sub-mirror detection is waited, the snapshot file and the new template base image generated are separate files, the snapshot file records the complete state of the system at a certain time point, and the tag records various parameter descriptions: submitted description information, specified image author, image IP, specified target image name to be created, and creation time point, and whether the base image is a new template base image is judged according to the time point.
[0009] In a preferred embodiment, the detection process in the template base image detection module is as follows: after the virtual machine is restarted, the template base image is disconnected, and whether a new template base image exists in the file system is automatically detected; whether the template base image is a new template base image is judged through the image tag, and then the image IP of the template base image is obtained.
[0010] In a preferred embodiment, the cloning module replaces the template image through link cloning according to the image IP obtained through detection.
[0011] To achieve the above object, the present application provides the following technical scheme: a method for dynamically replacing a template system in a VDI scenario, comprising the following steps:
[0012] Step 101: creating a cloud desktop system through a cloud desktop creation module, first making a template base image in a cloud server, and then quickly generating n sub-mirrors in a virtual machine through link cloning, so as to batch create cloud desktop systems, each sub-mirror corresponding to a user, and each user's modification of an operating system and an application program being retained in the sub-mirror;
[0013] Step 102: editing and exporting a sub-mirror, editing the operating system or the application program in the sub-mirror created in step 101, exporting the edited sub-mirror through the snapshot technology, storing the sub-mirror in the cloud server, and obtaining a new template base image, wherein the snapshot creation comprises the following specific operation steps: first starting the virtual machine, expanding the snapshot menu in the menu, and clicking to create a snapshot from the current state; filling in the name and annotation of the snapshot in the snapshot creation window, and performing the snapshot operation;
[0014] Step 103, detecting whether there is a new template base image by a template base image detection module, after a new template base image is exported, the virtual machine installed with the sub-image is shut down, the sub-image is disconnected with the template base image, and after being started again, the virtual machine detects whether there is a new template base image, and if a new template base image is detected, the detection result is transmitted to a cloning module;
[0015] Step 104, generating the sub-image in the virtual machine by the cloning module in a linked clone manner according to the detection result;
[0016] Step 105, deleting the template base image by a deletion module, when all the sub-images are shut down once, the original template base image is not connected with any sub-image, and at this time, the system automatically deletes the original template base image.
[0017] In a preferred embodiment, the operation process of the linked clone is specifically as follows: the linked clone depends on the template base image creation, the file format of the template base image is determined to be the same before cloning; then the disk file of the template base image is cloned, the configuration file of the template is cloned, the MAC of the network card is deleted, the UUID of the template virtual machine is cleared, and the disk name is modified; if the template base image is moved, the position of the template base image needs to be specified again, and the linked clone sub-image is started again.
[0018] In a preferred embodiment, the snapshot technology in step 102 can be replaced by any one of the following backup technologies, the backup technologies include: Host, LAN, LAN-free, Server-free and Server-less backup, the backup data is obtained after backup, and the data after backup is transmitted to the same file system as the original template base image by the interaction unit in the cloud server.
[0019] Technical effects and advantages of the present application: the present application can generate a new sub-image by snapshotting another sub-image at any time without waiting for the shutdown of the sub-image, thereby saving time and being easy to operate; after the new template base image is generated, the sub-image can be automatically updated without the participation of the user or the administrator, the whole process is dynamic, does not affect the business use of the existing user, and the update is obtained immediately after shutdown. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 The system structure block diagram of the present application.
[0021] Figure 2 The method flow chart of the system of the present application. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort belong to the scope of the present application.
[0023] Embodiment 1
[0024] The embodiment provides a system for dynamically changing templates in a VDI scenario as shown in Figure 1 The system comprises a cloud desktop creation module, a sub-image editing and exporting module, a template base image detection module, a cloning module, and a deletion module. The cloud desktop creation module is used to create a VDI scenario, and the VDI scenario comprises a cloud server, a virtual machine, and an interaction unit. The cloud server stores an operating system and an application program. The cloud server is installed with a template base image. The virtual machine is a sub-image corresponding to the template base image. The interaction unit is used to connect the cloud server and the virtual machine and complete the communication connection between the cloud server and the virtual machine. The sub-image editing and exporting module is used to edit the sub-image and export the edited sub-image to the cloud server. The exported sub-image exists in the form of a template base image. The template base image detection module is used to automatically detect whether there is a new template base image in the cloud server when the virtual machine starts and transmit the detection result to the cloning module. The cloning module quickly generates a sub-image in a linked cloning manner after receiving an instruction that there is a new template base image and completes the update of the sub-image in the virtual machine. The deletion module is used to delete the template base image that is not connected with the sub-image.
[0025] The embodiment is different from the prior art in that the sub-image editing and exporting module, the template base image detection module, the cloning module, and the deletion module. The sub-image editing and exporting module increases the image exporting function. The template base image detection module increases the function of automatically detecting the template base image after restarting. The cloning module increases the function of dynamically changing the template. The sub-image editing and exporting module, the template base image detection module, and the cloning module constitute the creation of a new template base image and the function of dynamically changing the template. The entire process is not provided in the prior art. The algorithm technology specifically required by the sub-image editing and exporting module is any one of snapshot technology and backup technology.
[0026] The virtual machine comprises a disk file and a configuration file. The virtual machine sub-image is cloned by copying the disk file. The configuration file defines the file location of the virtual machine, the network configuration in the virtual machine, and the hardware configuration information.
[0027] All operations of the present application are performed in a windows / Liunx desktop system.
[0028] As Figure 2 The embodiment provides a system and method for dynamically changing templates in a VDI scenario, and specifically comprises the following steps:
[0029] Step 101, creating a cloud desktop system through a cloud desktop creating module, first making a template base image in a cloud server, then quickly generating n sub-images in a virtual machine through a linked cloning mode, thereby creating cloud desktop systems in batches, each sub-image corresponding to a user, and each user's modification to an operating system and an application program being retained in the sub-image;
[0030] Step 102, editing and exporting the sub-image, in the sub-image created in step 101, editing the sub-image for modification of an operating system or an application program, exporting the edited sub-image through a snapshot technology, storing the sub-image in the cloud server, and obtaining a new template base image, and a specific operation process of the snapshot creation being as follows: first starting the virtual machine, expanding a snapshot menu in a menu, and clicking to create a snapshot from a current state; filling in a snapshot name and a comment in a snapshot creation window, and performing a snapshot operation;
[0031] Step 103, detecting whether there is a new template base image through a template base image detecting module, after the new template base image is exported, closing the virtual machine installed with the sub-image, disconnecting the sub-image from the template base image, and after rebooting, the virtual machine detecting whether there is a new template base image, and if detecting that there is a new template base image, transmitting the detection result to a cloning module;
[0032] Step 104, through the cloning module, quickly generating a sub-image in a virtual machine through a linked cloning mode according to the detection result;
[0033] Step 105, deleting the template base image through a deleting module, when all the sub-images are powered off once, the original template base image is not connected with any sub-image, at this time, the system automatically deletes the original template base image.
[0034] Further, the sub-mirror editing export module involves snapshot technology in the sub-mirror export process, which includes the following steps: first, the user selects to create a snapshot at a certain time point, and the data files generated in the creation process are copied through the snapshot technology; after the snapshot is created, the snapshot file is stored in the cloud server; a template base image is created according to the snapshot file, and a tag is added in the new template base image; finally, the sub-mirror is detected, the snapshot file and the new template base image generated are separate files, the snapshot file records the complete state of the system at a certain time point, and the tag records the parameters, such as the description information of the submission, the specified image author, the image IP, the specified target image name to be created, and the creation time point, and whether the base image is a new template base image is determined according to the time point.
[0035] Further, the template base image detection module includes the following detection process: after the virtual machine is restarted, the template base image is disconnected, and it is automatically detected whether there is a new template base image in the file system; whether the template base image is a new template base image is determined through the image tag, and then the image IP of the template base image is obtained.
[0036] Further, the cloning module replaces the template image through link cloning according to the image IP obtained by detection.
[0037] Further, the deletion module includes the following specific steps of the identification unit:
[0038] A1, first, the template base image not connected to the sub-mirror is identified in the cloud server, and it is inquired whether the current virtual machine uses the image;
[0039] A2, the creation time of the template base image is determined according to the image tag, and it is detected whether there is a new template base image in the same file system in the cloud server;
[0040] A3, if there is no new template base image in the same file system, and the current virtual machine does not use the image, the image is deleted through the rm command.
[0041] Further, the operation process of the link cloning is as follows: the link cloning depends on the creation of the template base image, and the file format of the template base image is determined before cloning; then, the disk file of the template base image is cloned, the configuration file of the template is cloned, the MAC of the network card is deleted, the UUID of the template virtual machine is cleared, and the disk name is modified; if the template base image is moved, the position of the template base image needs to be specified again, and the link cloning sub-mirror is started.
[0042] Further, the snapshot technology in the step 102 can be replaced by any of the following backup technologies, including: Host, LAN, LAN-free, Server-free and Server-less backup, and the backup data is obtained after backup, and the data after backup is transmitted to the same file system as the original template base image through the interaction unit in the cloud server.
[0043] Embodiment 2
[0044] Different from embodiment 1, the embodiment provides a method for dynamically replacing a template in a VDI scenario, which specifically includes the following steps:
[0045] Step 101, creating a cloud desktop system through a cloud desktop creation module, first making a template base image in a cloud server, then quickly generating n sub-images in a virtual machine through a linked clone manner, thereby batch creating cloud desktop systems, each sub-image corresponding to a user, and each user's modification of an operating system and an application program being retained in the sub-image;
[0046] Step 102, editing and exporting the sub-image, in the sub-image created in step 101, editing the sub-image for modification of an operating system or an application program, exporting the edited sub-image through a backup technology, and storing the sub-image in the cloud server to obtain a new template base image, and the backup creation specific operation process is as follows: first starting the virtual machine, expanding the snapshot menu in the menu, and clicking to create a snapshot from the current state; filling in the name and annotation of the snapshot in the snapshot creation window, and performing a backup operation;
[0047] Step 103, detecting whether there is a new template base image through a template base image detection module, after the new template base image is exported, closing the virtual machine installed with the sub-image, disconnecting the sub-image from the template base image, and after rebooting, the virtual machine detects whether there is a new template base image, and if a new template base image is detected, the detection result is transmitted to the clone module;
[0048] Step 104, through the clone module, generating a sub-image in a virtual machine through a linked clone manner according to the detection result;
[0049] Step 105, deleting the template base image through a deletion module, when all the sub-images are powered off once, the original template base image is not connected with any sub-image, at this time, the system automatically deletes the original template base image.
[0050] Further, the backup technology is any one of Host, LAN, LAN-free, Server-free and Server-less backup technologies.
[0051] Finally: the above only for the preferred embodiments of the present application, and not for limiting the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application, should be included in the scope of protection of the present application.
Claims
1. A system for dynamically changing templates in a VDI scenario, the system comprising: The cloud desktop creation module is used for creating a VDI scene, the VDI scene comprising a cloud server, a virtual machine and an interaction unit, the cloud server storing an operating system and an application program, and the cloud server installing a template base image, the interaction unit being used for connecting the cloud server and the virtual machine and completing communication connection between the cloud server and the virtual machine; The sub-image editing and exporting module is used for editing a sub-image and exporting the edited sub-image to the cloud server, the exported sub-image existing in the form of a template base image; the template base image detection module is used for automatically detecting whether a new template base image exists in the cloud server when the virtual machine is started and transmitting the detection result to the cloning module; the cloning module is used for quickly generating a sub-image in a linked clone manner after receiving an instruction that a new template base image exists, and completing updating of the sub-image in the virtual machine; and the deleting module is used for deleting a template base image not connected with a sub-image. The sub-image exporting process in the sub-image editing and exporting module involves snapshot technology, and comprises the following steps: firstly, a user selects to create a snapshot at a certain time point, and data files generated in a creation process are copied through the snapshot technology; The snapshot file is stored in the cloud server after the snapshot is created; A template base image is created according to the snapshot file, and a label is added in the new template base image, and finally, the sub-image is detected, the snapshot file and the new template base image generated are both single files, the snapshot file records a complete state of a system at a certain time point, and the label records various parameter descriptions, such as submitted description information, specified image author, image IP, specified target image name to be created, and creation time point, and whether the base image is a new template base image is judged according to the time point; The detection process in the template base image detection module: after the virtual machine is restarted, the virtual machine is disconnected with the template base image, and whether a new template base image exists in a file system is automatically detected, whether the template base image is a new template base image is judged through the image label, and then the image IP of the template base image is obtained; The specific steps of the deleting module comprising an identification unit are as follows: A1, firstly, a template base image not connected with a sub-image is identified in the cloud server, and whether the image is used by a virtual machine at present is inquired; A2, the creation time of the template base image is judged according to the image label, and whether a new template base image exists in the same file system in the cloud server is detected; A3, if the new template base image exists in the same file system, and the template base image not connected with the sub-image is not used by the virtual machine at present, the template base image not connected with the sub-image is deleted through an rm command.
2. The system for dynamically changing templates in a VDI scenario of claim 1, wherein: The cloning module replaces the template image by link cloning according to the mirror IP of the detected mirror image.
3. The method of claim 1 or 2, wherein the method further comprises: Specifically, the method comprises the following steps: Step 101, creating a cloud desktop system by a cloud desktop creating module, first making a template base image in a cloud server, then quickly generating n sub-images in a virtual machine by link cloning, thereby creating a cloud desktop system in batches, each sub-image corresponding to a user, and each user's modification to the operating system and application program being retained in the sub-image; Step 102, editing and exporting the sub-image, in the sub-image created in step 101, editing the operating system or application program of the sub-image, exporting the edited sub-image by snapshot technology, storing it in the cloud server, obtaining a new template base image, and the snapshot creating specific operation steps being: first starting the virtual machine, expanding the snapshot menu in the menu, and clicking to create a snapshot from the current state; filling in the name and annotation of the snapshot in the snapshot creation window, and performing the snapshot operation; Step 103, detecting whether there is a new template base image by a template base image detecting module, after the new template base image is exported, closing the virtual machine installed with the sub-image, disconnecting the sub-image from the template base image, and after rebooting, the virtual machine detects whether there is a new template base image, and if a new template base image is detected, the detection result is transmitted to the cloning module; Step 104, generating a sub-image in the virtual machine by link cloning according to the detection result by the cloning module; Step 105, deleting the template base image by a deleting module, when all the sub-images are powered off once, the original template base image is not connected with any sub-image, at this time, the system automatically deletes the original template base image.
4. The method of claim 3, wherein: The operation process of link cloning is as follows: link cloning depends on the creation of the template base image, and the file format of the template base image is determined before cloning; then the disk file of the template base image is cloned, the configuration file of the template is cloned, the MAC of the network card is deleted, the UUID of the template virtual machine is cleared, and the disk name is modified; if the template base image is moved, the position of the template base image needs to be specified again, and then the link cloning sub-image is started.
5. The method of claim 3, wherein: The snapshot technology in step 102 can be replaced by any one of the following backup technologies, which include Host, LAN, LAN-free, Server-free and Server-less backup, and after backup, backup data is obtained, and the data after backup is transmitted to the same file system as the original template base image by an interactive unit in the cloud server.
Citation Information
Patent Citations
Batch creation method and device for virtual machines
CN106155759A
Operation system mirror image manufacturing method and device
CN106445563A