CN117806767A - Method and device for improving virtual machine creation time, storage medium and electronic equipment - Google Patents
Method and device for improving virtual machine creation time, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN117806767A CN117806767A CN202211176711.5A CN202211176711A CN117806767A CN 117806767 A CN117806767 A CN 117806767A CN 202211176711 A CN202211176711 A CN 202211176711A CN 117806767 A CN117806767 A CN 117806767A
- Authority
- CN
- China
- Prior art keywords
- disk
- image
- data
- storage area
- area network
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000004590 computer program Methods 0.000 claims description 12
- 230000002708 enhancing effect Effects 0.000 claims description 9
- 238000004891 communication Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 5
- 239000000835 fiber Substances 0.000 description 5
- 239000003818 cinder Substances 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method and a device for improving virtual machine creation time, a storage medium and electronic equipment. The method comprises the following steps: under the condition that a first creation request is received, determining a first image corresponding to the first creation request, wherein the first creation request is used for requesting to download the first image in the distributed storage space into a storage area network, and creating a virtual machine by using the first image in the storage area network; searching a first disk where a first mirror image is located in a storage area network; and under the condition that the first disk is found, creating a virtual machine by using the first snapshot of the first disk. The method solves the technical problem that the time consumption is too long due to complicated steps for creating the virtual machine in the prior art.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a method and apparatus for improving virtual machine creation time, a storage medium, and an electronic device.
Background
Openstack is an open-source cloud computing management platform project, and is a combination of a series of software open-source projects. Glance is one of the components of Openstack for managing one service of an image. SAN (Storage Area Network) storage area network, which adopts Fibre Channel (Fibre Channel) technology, connects the storage array and the server host through a Fibre Channel switch, and establishes an area network dedicated for data storage. An image is a type of image that has an operating system installed for creating virtual machine templates. Cinder is one of the Openstack components that is used to manage one service of the cloud disk. Yun Cipan (volume) is a hard disk device that provides storage space for virtual machines. In the prior art, the Galaxy Yun Jingxiang Glance service uses KS3 storage, and each time a user uploads a mirror Glance, the mirror will be stored in KS3. When a user creates a virtual machine, a system disk belongs to a Cinder component for management, storage of the Cinder uses an IPSAN (Internet protocol security access) storage, a mirror image is selected when the virtual machine is created, because different types of storage are used at the rear end of the Glance and the Cinder, the mirror image needs to be pulled from a KS3 storage when the virtual machine is created, mirror image data is written into the storage (the IPSAN storage) used by the system disk of the virtual machine, the operations are repeated each time when the virtual machine is created, the time for creating the virtual machines in batches is too long, and the user experience is poor.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a storage medium and electronic equipment for improving virtual machine creation time, which at least solve the technical problem that the time consumption is too long due to complicated steps of a virtual machine creation method in the prior art.
According to an aspect of an embodiment of the present invention, there is provided a method for improving virtual machine creation time, including: under the condition that a first creation request is received, determining a first image corresponding to the first creation request, wherein the first creation request is used for requesting to download the first image in a distributed storage space into a storage area network, and creating a virtual machine by using the first image in the storage area network; searching a first disk where the first mirror image is located in the storage area network; and under the condition that the first disk is found, creating the virtual machine by using the first snapshot of the first disk.
According to another aspect of the embodiment of the present invention, there is provided an apparatus for enhancing virtual machine creation time, including: the device comprises a determining module, a first creating module and a virtual machine creating module, wherein the determining module is used for determining a first image corresponding to a first creating request under the condition of receiving the first creating request, wherein the first creating request is used for requesting to download the first image in a distributed storage space into a storage area network and creating the virtual machine by using the first image in the storage area network; the first searching module is used for searching a first disk where the first mirror image is located in the storage area network; the first creating module is configured to create the virtual machine using a first snapshot of the first disk when the first disk is found.
As an alternative example, the above apparatus further includes: the second creating module is used for creating the first disk with the same size in the storage area network according to the mirror image size of the first mirror image under the condition that the first disk is not found after the first disk where the first mirror image is located is found in the storage area network; the writing module is used for acquiring the first mirror image from the distributed storage space and writing the first mirror image into the first disk, wherein the distributed storage space is used for storing the first mirror image; and a third creating module, configured to create the first snapshot of the first disk, where the first snapshot is an image file of the first disk.
As an optional example, the above-mentioned search module includes: a first obtaining unit, configured to obtain mirror image data in each disk in the storage area network; the first comparison unit is used for comparing each piece of mirror image data with the first mirror image data; a first determining unit configured to determine that the first disk is stored in the storage area network when the same image data as the first image data exists in all the image data; and a second determining unit configured to determine that the first disk does not exist in the storage area network when the same image data as the first image data does not exist in all the image data.
As an optional example, the second creation module includes: and the creation unit is used for creating the first disk in the public access area of the storage area network.
As an alternative example, the above apparatus further includes: the second searching module is configured to search, after the first snapshot of the first disk is created, for the first disk corresponding to a second creation request in a public access area of the storage area network when receiving the second creation request, where the second creation request is a request for creating the virtual machine through the first image again; the first acquisition module is used for acquiring the first snapshot of the first disk; and the fourth creation module is used for creating the virtual machine by using the first snapshot.
As an alternative example, the above apparatus further includes: the second obtaining module is used for obtaining the first image from the distributed storage space, writing the first image into the first disk, and obtaining the second disk when the first disk is updated to the second disk; and the updating module is used for updating the first snapshot according to the second disk to obtain an updated second snapshot.
As an optional example, the update module includes: a second obtaining unit, configured to obtain data of the first disk once every one time period; the second comparison unit is used for comparing the first disk data of the first disk in the last time period with the second disk data of the first disk in the current time period; a third determining unit configured to determine that the first disk is not updated when the first disk data and the second disk data are the same; and a fourth determining unit configured to determine that the first disk is updated to the second disk when the first disk data and the second disk data are different, where the second disk data are the second disk data.
According to still another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program, when executed by a processor, performs the above-described method of enhancing virtual machine creation time.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device including a memory, in which a computer program is stored, and a processor configured to execute the method for enhancing virtual machine creation time described above by the computer program.
In the embodiment of the invention, under the condition that a first creation request is received, determining a first image corresponding to the first creation request, wherein the first creation request is used for requesting to download the first image in a distributed storage space into a storage area network, and creating a virtual machine by using the first image in the storage area network; searching a first disk where the first mirror image is located in the storage area network; in the method, when a request for creating the virtual machine according to the first mirror image is received, the first disk stored with the first mirror image is searched in the storage area space, if the first disk exists, the virtual machine is directly created by using the first mirror image of the first disk, the first mirror image is not required to be acquired from the distributed storage space, the first mirror image is downloaded to the storage area space, and then the virtual machine is created by using the first mirror image in the storage area space, so that the purpose of simplifying the operation steps of creating the virtual machine is achieved, and the technical problem that the time consumption is too long due to the complicated steps of creating the virtual machine in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flow chart of an alternative method of enhancing virtual machine creation time in accordance with an embodiment of the present invention;
FIG. 2 is a flowchart of an alternative implementation of a method of enhancing virtual machine creation time, according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an alternative mechanism for enhancing virtual machine creation time, according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to a first aspect of an embodiment of the present invention, there is provided a method for improving creation time of a virtual machine, optionally, as shown in fig. 1, the method includes:
s102, under the condition that a first creation request is received, determining a first mirror image corresponding to the first creation request, wherein the first creation request is used for requesting to download the first mirror image in the distributed storage space into a storage area network, and creating a virtual machine by using the first mirror image in the storage area network;
s104, searching a first disk where the first mirror image is located in the storage area network;
s106, under the condition that the first disk is found, creating a virtual machine by using the first snapshot of the first disk.
Optionally, in this embodiment, the mirror image and a file form may be made into a mirror image file, and after the mirror image file and a program such as a ghest (hard disk backup and restore tool) are opened in a disk by using software such as ghest, the mirror image is a redundant type, and the data on one disk has an identical copy on another disk, that is, the mirror image. Magnetic disks refer to memory devices that store data using magnetic recording technology. The magnetic disk is a main storage medium of a computer, can store a large amount of binary data, and can keep the data from losing after power is cut off. The storage area network (IPSAN) is generated after the SAN, the SAN defaults to FCSAN, the storage network is built by using the fiber channel, the IPSAN builds the storage network by using the IP network, and compared with the FCSAN, the storage area network has the characteristics of more economy, free expansion and the like. The definition of the snapshot by the storage snapshot technique is: with respect to a fully available copy of a given data set, the copy includes an image of the corresponding data at some point in time (the point in time at which the copy began). The snapshot may be a copy of the data it represents, or may be a copy of the data. A virtual machine is an emulator of a computer system that emulates, by software, a complete computer system having the functionality of a complete hardware system, operating in a completely isolated environment.
Optionally, in this embodiment, when the user creates the virtual machine according to the first image, it is detected whether a first disk storing the first image data exists in the storage area network, and if the first disk exists, the user directly calls a first snapshot of the first disk to create the virtual machine. Since creating disks from snapshots can be done on the order of seconds, virtual machine systems can be created very quickly.
Optionally, in this embodiment, when a request for creating a virtual machine according to a first image is received, a first disk storing the first image is searched in a storage area space, if the first disk exists, the virtual machine is created by directly using the first image of the first disk, and after the first image is downloaded to the storage area space without obtaining the first image from a distributed storage space, the virtual machine is created by using the first image in the storage area space, thereby achieving the purpose of simplifying an operation step of creating the virtual machine, and further solving a technical problem that a time consuming process is too long due to a complicated step of creating the virtual machine in the prior art.
As an optional example, after searching the storage area network for the first disk where the first mirror is located, the method further includes:
under the condition that the first disk is not found, creating the first disk with the same size in the storage area network according to the mirror image size of the first mirror image;
acquiring a first mirror image from a distributed storage space, and writing the first mirror image into a first disk, wherein the distributed storage space is used for storing the first mirror image;
a first snapshot of the first disk is created, wherein the first snapshot is an image file of the first disk.
Optionally, in this embodiment, when the first disk does not exist in the storage area network, the first virtual machine is created according to the first image, the first image is acquired from the distributed storage space first, the first disk with the same size as the first image is created in the storage area network, meanwhile, the first image data is written into the first disk, a first snapshot of the first disk is created according to a snapshot technology, and when the virtual machine is created according to the first image later, the first disk in which the first image is stored is directly acquired in the storage area network, and the creation of the virtual machine can be quickly completed by calling the first snapshot of the first disk.
As an alternative example, searching for the first disk on which the first image is located in the storage area network includes:
obtaining mirror image data in each disk in a storage area network;
comparing each mirror image data with the first mirror image data;
determining that a first disk exists in the storage area network when the same mirror data as the first mirror data exists in all the mirror data;
in the case where the same mirror data as the first mirror data does not exist in all the mirror data, it is determined that the first disk does not exist in the storage area network.
Optionally, in this embodiment, when a first disk storing a first mirror image is searched in the storage area network, data of each disk in the storage area network is obtained, each data is compared with the data of the first mirror image, when a disk with the same data is searched, the corresponding disk is determined to be the first disk, and if the data in each disk is different from the data of the first mirror image, the first disk does not exist in the storage area network.
As an alternative example, creating a first disk of the same size within the storage area network according to the mirror size of the first mirror without finding the first disk includes:
a first disk is created within a common access area of a storage area network.
Optionally, in this embodiment, when the first disk is created, the first disk is created in the public access area of the storage area network, so that when the user creates the virtual machine according to the first image for the second time and later, only the virtual machine needs to be created according to the first disk in the storage area network, and also when other users create the virtual machine according to the first image for the first time and each time, only the virtual machine needs to be created according to the first disk in the storage area network.
As an alternative example, after creating the first snapshot of the first disk, the method further includes:
under the condition that a second creation request is received, searching a first disk corresponding to the second creation request in a public access area of a storage area network, wherein the second creation request is a request for creating a virtual machine through the first mirror image again;
acquiring a first snapshot of a first disk;
a virtual machine is created using the first snapshot.
Optionally, in this embodiment, when the virtual machine is created according to the first image again, or when other users have created the virtual machine according to the ground, the first disk storing the first image is acquired in the public access area of the storage area network, the first snapshot of the first disk is called to create a system disk, and the virtual machine is created according to the system disk.
As an alternative example, after the first image is obtained from the distributed storage space and written to the first disk, the method further includes:
acquiring a second disk under the condition that the first disk is updated to the second disk;
and updating the first snapshot according to the second disk to obtain an updated second snapshot.
Optionally, in this embodiment, after the first disk is updated, the first snapshot may be updated synchronously in real time. And acquiring a second disk after the first disk is updated, and updating the first snapshot according to the second disk to obtain an updated second snapshot.
As an alternative example, in the case where the first disk is updated to the second disk, acquiring the second disk includes:
acquiring data of a first magnetic disk every time in a time period, wherein the duration of the time period is a first duration;
comparing the first disk data of the first disk in the previous time period with the second disk data of the first disk in the current time period;
under the condition that the first disk data and the second disk data are the same, determining that the first disk is not updated;
and under the condition that the first disk data and the second disk data are different, determining that the first disk is updated to the second disk, wherein the data of the second disk are the second disk data.
Optionally, in this embodiment, a time period of a first duration is set, the first disk is continuously monitored, and whether the first disk is updated is detected every first duration. The first duration may be 1S,2S, for example, a time period of 1S is set, data of the first disk is acquired once every 1S, and first disk data of the first time period and second disk data of the second time period are acquired, where the second time period is a period next to the first time period. And comparing the first disk data with the second disk data, if the first disk data and the second disk data are the same, determining that the first disk is not updated, and if the first disk data and the second disk data are different, determining that the first disk is updated to the second disk data, wherein the data of the second disk are the second disk data.
Alternatively, in the present embodiment, a method for improving virtual machine creation time is related to creating a disk function from a snapshot by using storage, as shown in fig. 2.
A. When a user creates a virtual machine by using the first mirror image for the first time, a first disk with the same size as the first mirror image is created in the storage area network, the first mirror image is pulled from the distributed storage space, then first mirror image data is written into the first disk, a first snapshot is created for the first disk, a system disk of the virtual machine is created by calling the first snapshot in the storage area network, and the disk creating function from the snapshot is used.
B. And when the user creates the virtual machine by using the same first mirror image for the second time, judging that the first disk of the first mirror image exists in the storage area network, directly calling the first mirror image of the first disk, and completing the second creation of the virtual machine.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
According to another aspect of the embodiments of the present application, there is further provided an apparatus for enhancing creation time of a virtual machine, as shown in fig. 3, including:
a determining module 302, configured to determine, when a first creation request is received, a first image corresponding to the first creation request, where the first creation request is used to request downloading of the first image in the distributed storage space into the storage area network, and create a virtual machine using the first image in the storage area network;
a first searching module 304, configured to search a storage area network for a first disk where the first mirror image is located;
the first creating module 306 is configured to create a virtual machine using a first snapshot of the first disk if the first disk is found.
Optionally, in this embodiment, the mirror image and a file form may be made into a mirror image file, and after the mirror image file and a program such as a ghest (hard disk backup and restore tool) are opened in a disk by using software such as ghest, the mirror image is a redundant type, and the data on one disk has an identical copy on another disk, that is, the mirror image. Magnetic disks refer to memory devices that store data using magnetic recording technology. The magnetic disk is a main storage medium of a computer, can store a large amount of binary data, and can keep the data from losing after power is cut off. The storage area network (IPSAN) is generated after the SAN, the SAN defaults to FCSAN, the storage network is built by using the fiber channel, the IPSAN builds the storage network by using the IP network, and compared with the FCSAN, the storage area network has the characteristics of more economy, free expansion and the like. The definition of the snapshot by the storage snapshot technique is: with respect to a fully available copy of a given data set, the copy includes an image of the corresponding data at some point in time (the point in time at which the copy began). The snapshot may be a copy of the data it represents, or may be a copy of the data. A virtual machine is an emulator of a computer system that emulates, by software, a complete computer system having the functionality of a complete hardware system, operating in a completely isolated environment.
Optionally, in this embodiment, when the user creates the virtual machine according to the first image, it is detected whether a first disk storing the first image data exists in the storage area network, and if the first disk exists, the user directly calls a first snapshot of the first disk to create the virtual machine. Since creating disks from snapshots can be done on the order of seconds, virtual machine systems can be created very quickly.
Optionally, in this embodiment, when a request for creating a virtual machine according to a first image is received, a first disk storing the first image is searched in a storage area space, if the first disk exists, the virtual machine is created by directly using the first image of the first disk, and after the first image is downloaded to the storage area space without obtaining the first image from a distributed storage space, the virtual machine is created by using the first image in the storage area space, thereby achieving the purpose of simplifying an operation step of creating the virtual machine, and further solving a technical problem that a time consuming process is too long due to a complicated step of creating the virtual machine in the prior art.
As an alternative example, the above apparatus further includes:
the second creating module is used for creating the first disk with the same size in the storage area network according to the mirror image size of the first mirror image under the condition that the first disk is not found after the first disk where the first mirror image is located is found in the storage area network;
the writing module is used for acquiring a first mirror image from the distributed storage space and writing the first mirror image into the first disk, wherein the distributed storage space is used for storing the first mirror image;
and the third creating module is used for creating a first snapshot of the first disk, wherein the first snapshot is an image file of the first disk.
Optionally, in this embodiment, when the first disk does not exist in the storage area network, the first virtual machine is created according to the first image, the first image is acquired from the distributed storage space first, the first disk with the same size as the first image is created in the storage area network, meanwhile, the first image data is written into the first disk, a first snapshot of the first disk is created according to a snapshot technology, and when the virtual machine is created according to the first image later, the first disk in which the first image is stored is directly acquired in the storage area network, and the creation of the virtual machine can be quickly completed by calling the first snapshot of the first disk.
As an alternative example, the lookup module includes:
the first acquisition unit is used for acquiring mirror image data in each disk in the storage area network;
the first comparison unit is used for comparing each piece of mirror image data with the first mirror image data;
a first determining unit configured to determine that a first disk exists in the storage area network in a case where the same mirror data as the first mirror data exists in all the mirror data;
and a second determining unit configured to determine that the first disk does not exist in the storage area network in a case where the same mirror data as the first mirror data does not exist in all the mirror data.
Optionally, in this embodiment, when a first disk storing a first mirror image is searched in the storage area network, data of each disk in the storage area network is obtained, each data is compared with the data of the first mirror image, when a disk with the same data is searched, the corresponding disk is determined to be the first disk, and if the data in each disk is different from the data of the first mirror image, the first disk does not exist in the storage area network.
As an alternative example, the second creation module includes:
and the creating unit is used for creating the first disk in the public access area of the storage area network.
Optionally, in this embodiment, when the first disk is created, the first disk is created in the public access area of the storage area network, so that when the user creates the virtual machine according to the first image for the second time and later, only the virtual machine needs to be created according to the first disk in the storage area network, and also when other users create the virtual machine according to the first image for the first time and each time, only the virtual machine needs to be created according to the first disk in the storage area network.
As an alternative example, the above apparatus further includes:
the second searching module is used for searching the first disk corresponding to the second creating request in the public access area of the storage area network under the condition that the second creating request is received after the first snapshot of the first disk is created, wherein the second creating request is a request for creating the virtual machine through the first mirror image again;
the first acquisition module is used for acquiring a first snapshot of the first disk;
and the fourth creating module is used for creating the virtual machine by using the first snapshot.
Optionally, in this embodiment, when the virtual machine is created according to the first image again, or when other users have created the virtual machine according to the ground, the first disk storing the first image is acquired in the public access area of the storage area network, the first snapshot of the first disk is called to create a system disk, and the virtual machine is created according to the system disk.
As an alternative example, the above apparatus further includes:
the second acquisition module is used for acquiring a first image from the distributed storage space and writing the first image into the first disk, and acquiring a second disk under the condition that the first disk is updated to the second disk;
and the updating module is used for updating the first snapshot according to the second disk to obtain an updated second snapshot.
Optionally, in this embodiment, after the first disk is updated, the first snapshot may be updated synchronously in real time. And acquiring a second disk after the first disk is updated, and updating the first snapshot according to the second disk to obtain an updated second snapshot.
As an alternative example, the update module includes:
the second acquisition unit is used for acquiring the data of the first magnetic disk once every one time period, wherein the duration of the time period is the first duration;
the second comparison unit is used for comparing the first disk data of the first disk in the previous time period with the second disk data of the first disk in the current time period;
a third determining unit configured to determine that the first disk is not updated if the first disk data and the second disk data are the same;
and a fourth determining unit configured to determine that the first disk is updated to the second disk if the first disk data and the second disk data are different, where the data of the second disk is the second disk data.
Optionally, in this embodiment, a time period of a first duration is set, the first disk is continuously monitored, and whether the first disk is updated is detected every first duration. The first duration may be 1S,2S, for example, a time period of 1S is set, data of the first disk is acquired once every 1S, and first disk data of the first time period and second disk data of the second time period are acquired, where the second time period is a period next to the first time period. And comparing the first disk data with the second disk data, if the first disk data and the second disk data are the same, determining that the first disk is not updated, and if the first disk data and the second disk data are different, determining that the first disk is updated to the second disk data, wherein the data of the second disk are the second disk data.
For other examples of this embodiment, please refer to the above examples, and are not described herein.
Fig. 4 is a block diagram of an alternative electronic device, according to an embodiment of the present application, including a processor 402, a communication interface 404, a memory 406, and a communication bus 408, as shown in fig. 4, wherein the processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408, wherein,
a memory 406 for storing a computer program;
processor 402, when executing a computer program stored on memory 406, performs the following steps:
under the condition that a first creation request is received, determining a first image corresponding to the first creation request, wherein the first creation request is used for requesting to download the first image in the distributed storage space into a storage area network, and creating a virtual machine by using the first image in the storage area network;
searching a first disk where a first mirror image is located in a storage area network;
and under the condition that the first disk is found, creating a virtual machine by using the first snapshot of the first disk.
Alternatively, in the present embodiment, the above-described communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus. The communication interface is used for communication between the electronic device and other devices.
The memory may include RAM or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
As an example, the memory 406 may include, but is not limited to, the determination module 302, the first lookup module 304, and the first creation module 306 in the promotion virtual machine creation time device described above. In addition, other module units in the processing apparatus of the above request may be included, but are not limited to, and are not described in detail in this example.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is only schematic, and the device implementing the method for improving the creation time of the virtual machine may be a terminal device, where the terminal device may be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palmtop computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 4 is not limited to the structure of the electronic device described above. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, etc.
According to yet another aspect of embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by a processor, performs the steps in the method for enhancing virtual machine creation time described above.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.
Claims (10)
1. A method for improving virtual machine creation time, comprising:
under the condition that a first creation request is received, determining a first image corresponding to the first creation request, wherein the first creation request is used for requesting to download the first image in a distributed storage space into a storage area network and creating a virtual machine by using the first image in the storage area network;
searching a first disk where the first mirror image is located in the storage area network;
and under the condition that the first disk is found, creating the virtual machine by using a first snapshot of the first disk.
2. The method of claim 1, wherein after locating the first disk on which the first image resides within the storage area network, the method further comprises:
under the condition that the first disk is not found, the first disk with the same size is created in the storage area network according to the mirror image size of the first mirror image;
acquiring the first image from the distributed storage space and writing the first image into the first disk, wherein the distributed storage space is used for storing the first image;
and creating the first snapshot of the first disk, wherein the first snapshot is an image file of the first disk.
3. The method of claim 1, wherein the locating the first disk on which the first image is located in the storage area network comprises:
obtaining mirror image data in each disk in the storage area network;
comparing each of the mirrored data with the first mirrored data;
determining that the first disk exists in the storage area network when the mirror data which is the same as the first mirror data exists in all the mirror data;
and if the mirror data which is the same as the first mirror data does not exist in all the mirror data, determining that the first disk does not exist in the storage area network.
4. The method of claim 2, wherein creating the first disk of the same size within the storage area network according to the mirror size of the first mirror without the first disk being found comprises:
the first disk is created within a common access area of the storage area network.
5. The method of claim 2, wherein after creating the first snapshot of the first disk, the method further comprises:
under the condition that a second creation request is received, searching the first disk corresponding to the second creation request in a public access area of the storage area network, wherein the second creation request is a request for creating the virtual machine through the first mirror image again;
acquiring the first snapshot of the first disk;
the virtual machine is created using the first snapshot.
6. The method of claim 2, wherein after retrieving the first image from the distributed storage space and writing the first image to the first disk, the method further comprises:
acquiring a second disk under the condition that the first disk is updated to the second disk;
and updating the first snapshot according to the second disk to obtain an updated second snapshot.
7. The method of claim 6, wherein, in the event that the first disk is updated to a second disk, the obtaining the second disk comprises:
acquiring data of the first disk once every time period;
comparing the first disk data of the first disk in the last time period with the second disk data of the first disk in the current time period;
determining that the first disk is not updated when the first disk data and the second disk data are the same;
and under the condition that the first disk data and the second disk data are not identical, determining that the first disk is updated to the second disk, wherein the data of the second disk are the second disk data.
8. An apparatus for enhancing virtual machine creation time, comprising:
the device comprises a determining module, a first creating module and a virtual machine creating module, wherein the determining module is used for determining a first image corresponding to a first creating request under the condition of receiving the first creating request, wherein the first creating request is used for requesting to download the first image in a distributed storage space into a storage area network and creating the virtual machine by using the first image in the storage area network;
the first searching module is used for searching a first disk where the first mirror image is located in the storage area network;
and the first creating module is used for creating the virtual machine by using the first snapshot of the first disk under the condition that the first disk is found.
9. A computer-readable storage medium, having stored thereon a computer program, characterized in that the computer program, when executed by a processor, performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211176711.5A CN117806767A (en) | 2022-09-26 | 2022-09-26 | Method and device for improving virtual machine creation time, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211176711.5A CN117806767A (en) | 2022-09-26 | 2022-09-26 | Method and device for improving virtual machine creation time, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117806767A true CN117806767A (en) | 2024-04-02 |
Family
ID=90420489
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211176711.5A Pending CN117806767A (en) | 2022-09-26 | 2022-09-26 | Method and device for improving virtual machine creation time, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117806767A (en) |
-
2022
- 2022-09-26 CN CN202211176711.5A patent/CN117806767A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106528224B (en) | Content updating method, server and system for Docker container | |
CN105763602B (en) | A kind of method of data request processing, server and system | |
CN111897564B (en) | Application updating method and system | |
CN110765023A (en) | Distributed system testing method and system based on chaos experiment | |
US9942087B2 (en) | Application resiliency using APIs | |
JP7397094B2 (en) | Resource configuration method, resource configuration device, computer equipment, and computer program | |
US20170168807A1 (en) | Method and electronic device for updating application program | |
CN108769153B (en) | Data processing method and system for network application | |
US11150981B2 (en) | Fast recovery from failures in a chronologically ordered log-structured key-value storage system | |
CN110162429A (en) | System repair, server and storage medium | |
CN108984339B (en) | Data recovery method and related product | |
CN112134908B (en) | Application adaptation method, server, medium and vehicle-mounted multimedia system | |
CN112650689A (en) | Test method, test device, electronic equipment and storage medium | |
US10503430B2 (en) | Method and device for clearing data and electronic device | |
CN109324931B (en) | Method for realizing vmware mount recovery in data de-duplication system | |
CN111722994A (en) | A method and device for responding to a task request | |
CN117806767A (en) | Method and device for improving virtual machine creation time, storage medium and electronic equipment | |
CN114218191B (en) | System function migration method, device, computer equipment and storage medium | |
CN112565472A (en) | Static resource processing method and device | |
CN111880996B (en) | Bare metal data acquisition method, device, equipment and readable storage medium | |
CN113656378A (en) | Server management method, device and medium | |
US11163636B2 (en) | Chronologically ordered log-structured key-value store from failures during garbage collection | |
CN115314376A (en) | Method and device for deploying network plug-ins in cluster, electronic equipment and storage medium | |
CN113590033A (en) | Information synchronization method and device of super-fusion system | |
CN115485677A (en) | Secure data replication in a distributed data storage environment |
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 |