A method and device for implementing a stateless virtual machine
An implementation method and virtual machine technology, applied in the field of stateless virtual machine implementation methods and devices, can solve problems such as resource occupation, data leakage, and data retention, and achieve the effects of reducing operating costs, improving effective utilization, and fast and efficient processes
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0038] Such as figure 1 As shown, the present invention provides a method for realizing a stateless virtual machine, comprising the following steps:
[0039] S1. Create a virtual disk, create several first snapshots according to the virtual disk, and mark each of the first snapshots as a first restore point;
[0040] S2. Obtain user information, the virtual disk information, and first restore point information, and create a second snapshot;
[0041] S3. Create a virtual machine configuration file according to the second snapshot, and create and run a virtual machine according to the virtual machine configuration file;
[0042] S4, delete the first snapshot created based on the virtual disk to be restored, create a third snapshot based on the virtual disk, mark the third snapshot as a second restore point, and point the second restore point to the pre-running snapshot to be restored first restore point.
[0043] In step S2, the acquisition of user information, virtual disk i...
Embodiment 2
[0049] Such as figure 2 As shown, step S1 in a method for implementing a stateless virtual machine in the technical solution of the present invention specifically includes:
[0050] S11, use the qemu-img command provided by qemu-kvm to create a virtual disk of type qcow2;
[0051] S12, mount the virtual disk created under the virtual machine, allocate memory and CPU for the virtual machine, and mount the operating system iso image file to be installed;
[0052] S13, using the operating system iso image file to install the operating system on the created virtual disk, and run the virtual machine;
[0053] S14. Create several first snapshots by using the snapshot function of qemu-img, and mark each of the first snapshots as a first restore point.
[0054] In step S13, use the operating system iso image file to install the operating system on the virtual disk created. After the operating system is installed, you can install the required application software and make correspond...
Embodiment 3
[0059] Such as image 3 As shown, the technical solution of the present invention also provides a device for implementing a stateless virtual machine, including:
[0060] The first creation module 101, creates a virtual disk, creates several first snapshots according to the virtual disk, and marks each of the first snapshots as a first restore point;
[0061] The obtaining module 102 obtains user information, the virtual disk information and first restore point information, and creates a second snapshot;
[0062] The second creation module 103 creates a configuration file of the virtual machine according to the second snapshot, and creates and runs a virtual machine according to the configuration file of the virtual machine;
[0063] The delete and restore module 104 deletes the first snapshot created according to the virtual disk to be restored, creates a third snapshot according to the virtual disk, marks the third snapshot as a second restore point, and sets the second res...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


