CN109542588B - Method and device for managing virtual equipment in cloud environment - Google Patents

Method and device for managing virtual equipment in cloud environment Download PDF

Info

Publication number
CN109542588B
CN109542588B CN201811427576.0A CN201811427576A CN109542588B CN 109542588 B CN109542588 B CN 109542588B CN 201811427576 A CN201811427576 A CN 201811427576A CN 109542588 B CN109542588 B CN 109542588B
Authority
CN
China
Prior art keywords
virtual
virtual machine
state data
data file
node
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.)
Active
Application number
CN201811427576.0A
Other languages
Chinese (zh)
Other versions
CN109542588A (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201811427576.0A priority Critical patent/CN109542588B/en
Publication of CN109542588A publication Critical patent/CN109542588A/en
Application granted granted Critical
Publication of CN109542588B publication Critical patent/CN109542588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for managing virtual equipment in a cloud environment. The method comprises the following steps: when an operation request for deleting the first virtual machine is received, saving a state data file of the virtual equipment of the first virtual machine to be deleted in the block equipment node; when a second virtual machine is created on a computing node, configuring virtual equipment of the created second virtual machine by adopting a state data file of the virtual equipment of a first virtual machine, which is stored in a block equipment node; and the virtual equipment of the second virtual machine is the virtual equipment of the first virtual machine. Since the state data file of the virtual device of the first virtual machine is saved when the first virtual machine is deleted, after the first virtual machine is deleted, when a new virtual machine needs to be created and the virtual device of the new virtual machine is the virtual device of the first virtual machine, the virtual device of the deleted virtual machine can be provided for the newly created virtual machine to use, and the new virtual device does not need to be created.

Description

Method and device for managing virtual equipment in cloud environment
Technical Field
The present application relates to the field of virtualization, and in particular, to a method and apparatus for managing virtual devices in a cloud environment.
Background
With the rise of cloud computing, many users select resources such as computing, storage, network and the like in the cloud to construct a computing environment at the present stage. As a support technology of cloud computing, a virtualization technology has implemented functions of most physical devices, such as a video card, a network card, a sound card, and the like, so that a user can apply functions that are comparable to those of a physical environment in a cloud environment.
At present, some virtual devices (e.g., vTPM devices) of a virtual machine need to store state data in a state data file in a disk, a virtual machine simulator reads the state data for the virtual device to use each time the virtual machine is started, and the virtual device stores the data in the file to store the data when the virtual device runs under certain conditions (e.g., when the state data during running changes). In a cloud environment, all disk files of a virtual machine have the same life cycle as the virtual machine, that is, when the cloud management platform creates the virtual machine, required state data files are simultaneously distributed, and when the cloud management platform deletes the virtual machine, the state data files are simultaneously deleted. Therefore, the use scenes of users are limited, so that the virtual equipment is tightly coupled with the virtual machine, the virtual machine cannot be transferred to other virtual machines to continue using the equipment after being destroyed, and only new virtual equipment can be created again.
Disclosure of Invention
In order to solve the technical problem, the present application provides a method and an apparatus for managing virtual devices in a cloud environment, which can provide virtual devices of deleted virtual machines for new virtual machines to use, without creating new virtual devices.
In order to achieve the purpose of the present application, an embodiment of the present invention provides a method for managing virtual devices in a cloud environment, where the method includes:
when an operation request for deleting the first virtual machine is received, saving a state data file of the virtual equipment of the first virtual machine to be deleted in the block equipment node;
when a second virtual machine is created on a computing node, configuring virtual equipment of the created second virtual machine by adopting a state data file of the virtual equipment of a first virtual machine, which is stored in a block equipment node; and the virtual equipment of the second virtual machine is the virtual equipment of the first virtual machine.
Further, in an optional embodiment, when creating the second virtual machine on the computing node, before the step of configuring the virtual device of the created second virtual machine with the state data file of the virtual device of the first virtual machine saved in the block device node, the method further includes:
when receiving an operation request for creating a second virtual machine, judging whether to use an existing state data file in a block device node as a state data file of a virtual device of the second virtual machine:
if one state data file already saved in the block device node is used as the state data file of the virtual device of the second virtual machine, the created virtual device of the second virtual machine is configured with the state data file of the virtual device of the first virtual machine saved in the block device node.
Further, in an optional embodiment, the method further comprises:
if it is determined that the state data file saved in the block device node is not used as the state data file of the virtual device of the second virtual machine, the state data file of the virtual device of the second virtual machine is created in the block device node.
Further, in an optional embodiment, the step of saving, in the block device node, the state data file of the virtual device of the first virtual machine to be deleted includes:
judging whether to create a snapshot file for the state data file of the virtual equipment of the first virtual machine to be deleted:
if the snapshot file is created, after creating the snapshot file for the state data file of the virtual device of the virtual machine to be deleted, merging the created snapshot file with the state data file of the virtual device of the first virtual machine to be deleted, and saving the merged state data file in the block device node.
To achieve the objective of the present application, an embodiment of the present invention provides an apparatus for managing virtual devices in a cloud environment, the apparatus including a memory and a processor,
a memory for storing computer readable instructions;
a processor for executing computer readable instructions to perform operations comprising:
when an operation request for deleting the first virtual machine is received, saving a state data file of the virtual equipment of the first virtual machine to be deleted in the block equipment node;
when a second virtual machine is created on a computing node, configuring virtual equipment of the created second virtual machine by adopting a state data file of the virtual equipment of a first virtual machine, which is stored in a block equipment node; and the virtual equipment of the second virtual machine is the virtual equipment of the first virtual machine.
Further, in an alternative embodiment, the processor is further configured to:
when a second virtual machine is created on a computing node, before the operation of the virtual device of the created second virtual machine is configured by adopting the state data file of the virtual device of the first virtual machine saved in the block device node, when an operation request for creating the second virtual machine is received, whether to use the state data file existing in the block device node as the state data file of the virtual device of the second virtual machine is judged:
if one state data file already saved in the block device node is used as the state data file of the virtual device of the second virtual machine, the created virtual device of the second virtual machine is configured with the state data file of the virtual device of the first virtual machine saved in the block device node.
Further, in an alternative embodiment, the processor is further configured to:
if it is determined that the state data file saved in the block device node is not used as the state data file of the virtual device of the second virtual machine, the state data file of the virtual device of the second virtual machine is created in the block device node.
Further, in an optional embodiment, the operation of saving the state data file of the virtual device of the first virtual machine to be deleted in the block device node includes:
judging whether to create a snapshot file for the state data file of the virtual equipment of the first virtual machine to be deleted:
if the snapshot file is created, after creating the snapshot file for the state data file of the virtual device of the virtual machine to be deleted, merging the created snapshot file with the state data file of the virtual device of the first virtual machine to be deleted, and saving the merged state data file in the block device node.
The embodiment of the invention has the advantages that the state data file of the virtual equipment of the first virtual machine is saved when the first virtual machine is deleted, so that after the first virtual machine is deleted, when a new virtual machine needs to be created and the virtual equipment of the new virtual machine is the virtual equipment of the first virtual machine, the virtual equipment of the first virtual machine can be recycled for a virtual machine user to transfer the virtual equipment to a second virtual machine for use.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a flowchart of a method for managing virtual devices in a cloud environment according to an embodiment of the present invention;
fig. 2 is a block diagram of an apparatus for managing virtual devices in a cloud environment according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
In order to solve the above problem, in one aspect, an embodiment of the present invention provides a method for managing virtual devices in a cloud environment, where, as shown in fig. 1, the method includes steps S101 to S103.
Step S101, when receiving an operation request for deleting the first virtual machine, saving a state data file of the virtual device of the first virtual machine to be deleted in the block device node.
The scheme provided by the embodiment of the invention is applied to a cloud environment, for example, the scheme can be applied to an OpenStack platform environment. When receiving an operation request for deleting a first virtual machine in the OpenStack platform, which is input by a user through, for example, a Horizon component of the OpenStack platform, first saving a state data file of a virtual device of the first virtual machine to be deleted in a block device node in the OpenStack platform, for example, saving the state data file of the virtual device in the block device node by using a shader component in the OpenStack platform. After saving the state data file of the virtual device, deleting other files of the first virtual machine. When a plurality of virtual machines are deleted, the state data file of the virtual device of each of the deleted virtual machines may be saved, that is, a plurality of state data files are saved in the block device node.
Step S103, when a second virtual machine is created on the computing node, configuring the virtual equipment of the created second virtual machine by adopting the state data file of the virtual equipment of the first virtual machine stored in the block equipment node; and the virtual equipment of the second virtual machine is the virtual equipment of the first virtual machine.
When a new virtual machine (second virtual machine) is created on the computing node and the virtual device applied by the second virtual machine is the virtual device of the first virtual machine, the virtual device of the second virtual machine can be configured by using the state data file of the virtual device of the first virtual machine saved in the block computing node as the state data file of the virtual device of the second virtual machine. In this way, reinitializing a new virtual device for use by the second virtual machine may be avoided.
The embodiment of the invention has the advantages that the state data file of the virtual equipment of the first virtual machine is saved when the first virtual machine is deleted, so that after the first virtual machine is deleted, when a new virtual machine needs to be created and the virtual equipment of the new virtual machine is the virtual equipment of the first virtual machine, the virtual equipment of the first virtual machine can be recycled for a virtual machine user to transfer the virtual equipment to a second virtual machine for use.
In an optional embodiment, in order to provide the option of saving the state data file of the virtual device to the user, the solution of the embodiment of the present invention further sets a step of determining whether to use the saved state data file before step S103:
when receiving an operation request for creating the second virtual machine, firstly judging whether to use the saved state data file as the state data file of the second virtual machine:
in an optional embodiment, if it is determined that the second virtual machine is not modified by using the saved state data file as the state data file of the virtual device of the second virtual machine when the operation request for creating the second virtual machine is received, a new state data file of the virtual device of the second virtual machine is created in the block device node to be used by the virtual device of the second virtual machine.
After the virtual machines are created in the compute node, the state data file for the virtual devices of the first virtual machine (i.e., the state data file for the virtual devices of the second virtual machine) is assigned to the virtual devices of the second virtual machine to configure the virtual devices of the second virtual machine. After this, the virtual machine may be started.
In order to restore the state data file to a normal state when the state data file of the virtual device is in error, in an alternative embodiment, the step S101 includes:
judging whether to create a snapshot file for the state data file of the virtual equipment of the first virtual machine to be deleted:
if the snapshot file is created, after the snapshot file is created for the state data file of the virtual device of the virtual machine to be deleted, the created snapshot file is merged with the state data file of the virtual device of the first virtual machine to be deleted, so that the merged state data file stores the latest state data of the virtual device of the first virtual machine to be deleted, and the virtual device can be smoothly configured by using the state data file when other virtual machines reuse the virtual device; and after merging the state data files, saving the merged state data files in the block device nodes;
if the snapshot file is not created, the state data file is saved directly in the block device node.
After saving the state data file, other resources of the virtual machine are deleted.
In order to solve the above technical problem, an embodiment of the present invention provides an apparatus for managing virtual devices in a cloud environment, as shown in fig. 2, the apparatus includes a memory 10 and a processor 20.
A memory 10 for storing computer readable instructions;
a processor 20 for executing computer readable instructions to perform the following operations:
when an operation request for deleting the first virtual machine is received, saving a state data file of the virtual equipment of the first virtual machine to be deleted in the block equipment node;
when a second virtual machine is created on a computing node, configuring virtual equipment of the created second virtual machine by adopting a state data file of the virtual equipment of a first virtual machine, which is stored in a block equipment node; and the virtual equipment of the second virtual machine is the virtual equipment of the first virtual machine.
The embodiment of the invention has the advantages that the state data file of the virtual equipment of the first virtual machine is saved when the first virtual machine is deleted, so that after the first virtual machine is deleted, when a new virtual machine needs to be created and the virtual equipment of the new virtual machine is the virtual equipment of the first virtual machine, the virtual equipment of the first virtual machine can be recycled for a virtual machine user to transfer the virtual equipment to a second virtual machine for use.
Further, in an alternative embodiment, processor 20 is further configured to perform the following operations:
when a second virtual machine is created on a computing node, before the operation of the virtual device of the created second virtual machine is configured by adopting the state data file of the virtual device of the first virtual machine saved in the block device node, when an operation request for creating the second virtual machine is received, whether to use the state data file existing in the block device node as the state data file of the virtual device of the second virtual machine is judged:
if one state data file already saved in the block device node is used as the state data file of the virtual device of the second virtual machine, the created virtual device of the second virtual machine is configured with the state data file of the virtual device of the first virtual machine saved in the block device node.
Further, in an alternative embodiment, processor 20 is further configured to perform the following operations:
if it is determined that the state data file saved in the block device node is not used as the state data file of the virtual device of the second virtual machine, the state data file of the virtual device of the second virtual machine is created in the block device node.
Further, in an optional embodiment, the operation of saving the state data file of the virtual device of the first virtual machine to be deleted in the block device node includes:
judging whether to create a snapshot file for the state data file of the virtual equipment of the first virtual machine to be deleted:
if the snapshot file is created, after creating the snapshot file for the state data file of the virtual device of the virtual machine to be deleted, merging the created snapshot file with the state data file of the virtual device of the first virtual machine to be deleted, and saving the merged state data file in the block device node.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (6)

1. A method for managing virtual appliances in a cloud environment, the method comprising:
when an operation request for deleting the first virtual machine is received, saving a state data file of the virtual equipment of the first virtual machine to be deleted in the block equipment node;
when a second virtual machine is created on a computing node, configuring virtual equipment of the created second virtual machine by adopting a state data file of the virtual equipment of a first virtual machine, which is stored in a block equipment node; the virtual device of the second virtual machine is the virtual device of the first virtual machine;
wherein the step of saving the state data file of the virtual device of the first virtual machine to be deleted in the block device node comprises:
judging whether to create a snapshot file for the state data file of the virtual equipment of the first virtual machine to be deleted:
if the snapshot file is created, after creating the snapshot file for the state data file of the virtual device of the virtual machine to be deleted, merging the created snapshot file with the state data file of the virtual device of the first virtual machine to be deleted, and saving the merged state data file in the block device node.
2. The method of claim 1, wherein prior to the step of configuring the virtual appliance of the created second virtual machine with the state data file of the virtual appliance of the first virtual machine saved in the block appliance node when the second virtual machine is created on the compute node, the method further comprises:
when receiving an operation request for creating a second virtual machine, judging whether to use an existing state data file in the block device node as a state data file of a virtual device of the second virtual machine:
and if one state data file saved in the block device node is used as the state data file of the virtual device of the second virtual machine, configuring the created virtual device of the second virtual machine by using the state data file of the virtual device of the first virtual machine saved in the block device node.
3. The method of claim 2, further comprising:
creating a state data file of a virtual device of the second virtual machine in the block device node if it is determined not to use the state data file saved in the block device node as the state data file of the virtual device of the second virtual machine.
4. An apparatus for managing virtual devices in a cloud environment, comprising a memory and a processor,
the memory to store computer readable instructions;
the processor to execute the computer-readable instructions to perform operations comprising:
when an operation request for deleting the first virtual machine is received, saving a state data file of the virtual equipment of the first virtual machine to be deleted in the block equipment node;
when a second virtual machine is created on a computing node, configuring virtual equipment of the created second virtual machine by adopting a state data file of the virtual equipment of a first virtual machine, which is stored in a block equipment node; the virtual device of the second virtual machine is the virtual device of the first virtual machine;
wherein the operation of saving the state data file of the virtual device of the first virtual machine to be deleted in the block device node comprises:
judging whether to create a snapshot file for the state data file of the virtual equipment of the first virtual machine to be deleted:
and if the snapshot file is created, merging the created snapshot file with the state data file of the virtual device of the first virtual machine to be deleted after the snapshot file is created for the state data file of the virtual device of the virtual machine to be deleted, and saving the merged state data text in the block device node.
5. The apparatus of claim 4, wherein the processor is further configured to:
when an operation request for creating a second virtual machine is received before configuring the operation of the virtual device of the created second virtual machine by using the state data file of the virtual device of the first virtual machine, which is stored in the block device node, when the second virtual machine is created on the computing node, whether to use the state data file existing in the block device node as the state data file of the virtual device of the second virtual machine is judged:
and if one state data file saved in the block device node is used as the state data file of the virtual device of the second virtual machine, configuring the created virtual device of the second virtual machine by using the state data file of the virtual device of the first virtual machine saved in the block device node.
6. The apparatus of claim 5, wherein the processor is further configured to:
creating a state data file of a virtual device of the second virtual machine in the block device node if it is determined not to use the state data file saved in the block device node as the state data file of the virtual device of the second virtual machine.
CN201811427576.0A 2018-11-27 2018-11-27 Method and device for managing virtual equipment in cloud environment Active CN109542588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811427576.0A CN109542588B (en) 2018-11-27 2018-11-27 Method and device for managing virtual equipment in cloud environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811427576.0A CN109542588B (en) 2018-11-27 2018-11-27 Method and device for managing virtual equipment in cloud environment

Publications (2)

Publication Number Publication Date
CN109542588A CN109542588A (en) 2019-03-29
CN109542588B true CN109542588B (en) 2021-02-05

Family

ID=65850718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811427576.0A Active CN109542588B (en) 2018-11-27 2018-11-27 Method and device for managing virtual equipment in cloud environment

Country Status (1)

Country Link
CN (1) CN109542588B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140007087A1 (en) * 2012-06-29 2014-01-02 Mark Scott-Nash Virtual trusted platform module
US20150178108A1 (en) * 2013-12-20 2015-06-25 Vmware, Inc. Fast Instantiation of Virtual Machines
US9588799B1 (en) * 2015-09-29 2017-03-07 Amazon Technologies, Inc. Managing test services in a distributed production service environment
CN105808320B (en) * 2016-03-11 2018-12-04 四川安嵌科技有限公司 Equipment virtualization system and method based on L inux container
CN106775946B (en) * 2016-12-16 2019-05-24 无锡华云数据技术服务有限公司 A kind of virtual machine Method of Creation Process
CN107943557B (en) * 2017-11-18 2020-07-17 浙江网新恒天软件有限公司 Virtual machine disk incremental snapshot method based on cloud platform
CN108170516A (en) * 2018-01-03 2018-06-15 浪潮(北京)电子信息产业有限公司 Create method, apparatus, equipment and the computer readable storage medium of vTPM
CN108733453A (en) * 2018-05-11 2018-11-02 国网信息通信产业集团有限公司 The operating method and system of credible cloud platform virtual credible root example

Also Published As

Publication number Publication date
CN109542588A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
US10496503B2 (en) Healing cloud services during upgrades
US10445186B1 (en) Associating a guest application within a virtual machine to create dependencies in backup/restore policy
CN111641515B (en) VNF life cycle management method and device
CN104461744A (en) Resource allocation method and device
CN111124475A (en) Method for storage management, electronic device and computer-readable storage medium
US10860375B1 (en) Singleton coordination in an actor-based system
CN105450759A (en) System mirror image management method and device
CN110520844A (en) Cloud management platform, virtual machine management method and its system
CN108319492B (en) Method, device and system for resetting physical machine
JP5780377B2 (en) Information processing system and application transfer method
US10318343B2 (en) Migration methods and apparatuses for migrating virtual machine including locally stored and shared data
KR20180122593A (en) How to delete a cloud host in a cloud computing environment, devices, servers, and storage media
CN104793981A (en) Online snapshot managing method and device for virtual machine cluster
US20220206836A1 (en) Method and Apparatus for Processing Virtual Machine Migration, Method and Apparatus for Generating Virtual Machine Migration Strategy, Device and Storage Medium
CN112631994A (en) Data migration method and system
CN113296891A (en) Multi-scene knowledge graph processing method and device based on platform
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
US10761940B2 (en) Method, device and program product for reducing data recovery time of storage system
US20220229689A1 (en) Virtualization platform control device, virtualization platform control method, and virtualization platform control program
CN109542588B (en) Method and device for managing virtual equipment in cloud environment
CN110782040A (en) Method, device, equipment and medium for training tasks of pitorch
CN113590033A (en) Information synchronization method and device of super-fusion system
CN111431951B (en) Data processing method, node equipment, system and storage medium
CN112889247B (en) VNF service instantiation method and device
US10972343B2 (en) System and method for device configuration update

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210106

Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: Room 1601, floor 16, 278 Xinyi Road, Zhengdong New District, Zhengzhou City, Henan Province

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant