WO2015035798A1 - 一种虚拟机管理方法和装置 - Google Patents

一种虚拟机管理方法和装置 Download PDF

Info

Publication number
WO2015035798A1
WO2015035798A1 PCT/CN2014/078130 CN2014078130W WO2015035798A1 WO 2015035798 A1 WO2015035798 A1 WO 2015035798A1 CN 2014078130 W CN2014078130 W CN 2014078130W WO 2015035798 A1 WO2015035798 A1 WO 2015035798A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
deletion
instruction
state
marked
Prior art date
Application number
PCT/CN2014/078130
Other languages
English (en)
French (fr)
Inventor
刘锦涛
薄海
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015035798A1 publication Critical patent/WO2015035798A1/zh

Links

Classifications

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

Definitions

  • Virtualization technology is one of the key technologies of cloud computing. It is mainly used to virtualize the physical resources of a physical machine into multiple virtual machines (VMs), so that each virtual machine can realize the functions of physical machines.
  • Virtual machines are abstract representatives of real-life physical computer systems. In real-world applications, such as corporate offices, call centers, and school education, they often require extensive deployment. In some cases, virtual machines need to be deleted due to various reasons such as student leaving school, employee turnover, and business migration.
  • the first type is to permanently delete a virtual machine directly. When deleting, it permanently releases resources such as computing, storage, and network that the virtual machine occupies. The other is to permanently delete the virtual machine directly, but you can choose to keep the storage resources of the virtual machine when deleting. In this way, only the computing and network resources are released, and the storage resources are not released. The system administrator can then find the disk corresponding to the original virtual machine and use the disk to recover the virtual machine.
  • the first type of deletion does not protect the user from misoperation. In the event of accidental deletion, the data in the virtual machine and the virtual machine cannot be recovered, which may cause huge losses to the user.
  • the second type of deletion can recover the data of the virtual machine from the virtual machine disk.
  • the disk ID used by the virtual machine disk identifier is not related to the virtual machine name, it is difficult to find the disk corresponding to the virtual machine;
  • the reserved disk consumes a large amount of storage resources and needs to be manually deleted by the system administrator.
  • the system is large in size. When the number of virtual machines is large, it is difficult for the administrator to find the disk corresponding to the virtual machine.
  • the embodiment of the present invention provides a virtual machine management method and device, which performs status marking on a virtual machine during a deletion operation, and permanently deletes a virtual machine by a preset condition or operation, thereby solving the problem that the user deletion operation is poor in security and low in work efficiency. The problem.
  • a virtual machine management method including:
  • deletion instruction indicates the first deletion mode, shutting down the virtual machine, marking the virtual machine as a mark deletion state, obtaining a mark deletion state virtual machine; acquiring an operation instruction, and according to the operation instruction
  • the mark deletion state virtual machine performs corresponding operations.
  • the virtual machine is shut down, and the virtual machine is marked as a mark deletion state, and the mark deletion state virtual machine includes:
  • the virtual machine is shut down, the computing resources of the virtual machine are released, the storage resources and network resources of the virtual machine are reserved, and the virtual machine is marked as a mark deletion state, and the mark deletion state virtual machine is obtained.
  • the operation instruction is a retrieval instruction or a permanent deletion instruction
  • the permanent deletion instruction is generated according to a preset condition or generated by a user operation.
  • the permanently deleting the command is triggered according to a preset condition, including:
  • the triggering system If the preset condition is met, the triggering system generates a user reminder message to generate the permanent delete command by a user operation; or
  • the system is triggered to generate the permanent deletion instruction; the preset condition includes: a degree; and/or, the remaining storage resource of the system is smaller than a preset storage resource threshold of the system.
  • the marking is performed according to the operation instruction Deleting a state virtual machine for the corresponding operations includes:
  • the operation instruction is a permanent deletion instruction
  • the mark deletion state virtual machine is permanently deleted, and all resources of the mark deletion state virtual machine are released;
  • the operation instruction is a retrieval instruction
  • the mark deletion state virtual machine is restored to a normal state, and the required resources are reallocated for the virtual machine that restores the normal state.
  • the method further includes: if the deletion instruction indicates a second deletion mode, directly deleting the virtual machine, and releasing the virtual machine All resources.
  • An instruction obtaining unit configured to acquire a deletion instruction that the user performs a delete operation on the virtual machine
  • an operation unit configured to acquire an operation instruction, and perform corresponding operations on the mark deletion state virtual machine according to the operation instruction.
  • the tag deletion unit is specifically configured to:
  • the virtual machine is shut down, the computing resources of the virtual machine are released, the storage resources and network resources of the virtual machine are reserved, and the virtual machine is marked as a mark deletion state, and the mark deletion state virtual machine is obtained.
  • the operation instruction is a retrieval instruction or a permanent deletion instruction
  • the permanent deletion instruction is generated according to a preset condition or generated by a user operation.
  • the operating unit is specifically configured to:
  • Generating the permanent deletion instruction according to a preset condition including:
  • the triggering system If the preset condition is met, the triggering system generates a user reminder message to generate the permanent delete command by a user operation; or If the preset condition is met, the system is triggered to generate the permanent deletion instruction; the preset condition includes: a degree; and/or, the remaining storage resource of the system is smaller than a preset storage resource threshold of the system.
  • the operating unit is specifically configured to:
  • the operation instruction is a permanent deletion instruction
  • the mark deletion state virtual machine is permanently deleted, and all resources of the mark deletion state virtual machine are released;
  • the operation instruction is a retrieval instruction
  • the mark deletion state virtual machine is restored to a normal state, and the required resources are reallocated for the virtual machine that restores the normal state.
  • the tag deletion unit is further configured to:
  • the deletion instruction indicates the second deletion mode
  • the virtual machine is directly deleted, and all resources of the virtual machine are released.
  • Embodiments of the present invention provide a virtual machine management method and apparatus for performing status marking on a virtual machine during a delete operation by receiving a user delete command.
  • the system can perform the retrieval operation by receiving the user operation instruction to restore the mark deletion state virtual machine to a normal state, or perform a permanent deletion operation to permanently delete and release all resources of the mark deletion state virtual machine; or directly execute or remind the user according to preset conditions. Perform a permanent delete operation. In this way, the security of the user deletion operation is improved, the efficiency of the deletion operation is improved, and the user is provided with convenience.
  • FIG. 1 is a schematic flowchart of a virtual machine management method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another virtual machine management method according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a virtual machine management apparatus according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a virtual machine management apparatus according to an embodiment of the present invention.
  • An embodiment of the present invention provides a virtual machine management method. As shown in FIG. 1, the method includes:
  • the delete instruction indicates the first deletion mode
  • the virtual machine is shut down, and the virtual machine is marked as a mark deletion state, and the mark deletion state virtual machine is obtained.
  • Embodiments of the present invention provide a virtual machine management method for performing status marking on a virtual machine during a delete operation by receiving a user deletion instruction.
  • the system can perform the retrieval operation by receiving the user operation instruction to restore the mark deletion state virtual machine to a normal state, or perform a permanent deletion operation to permanently delete and release all resources of the mark deletion state virtual machine; or directly execute or remind the user according to preset conditions. Perform a permanent delete operation. In this way, the security of the user deletion operation is improved, the efficiency of the deletion operation is improved, and the user is provided with convenience.
  • the method includes:
  • the deletion instruction that the user performs the delete operation on the virtual machine may be a delete instruction of the mark deletion operation, or may be a delete instruction of the permanent delete operation.
  • the delete instruction of the mark deletion operation indicates the first deletion mode; permanent deletion The delete instruction of the operation is indicated as the second delete mode.
  • deletion instruction is in the first deletion mode, S203 is performed; if the deletion instruction is in the second deletion mode, S206 is directly executed.
  • a mark deletion operation on the virtual machine to obtain a mark deletion state virtual machine.
  • the virtual machine is shut down, the computing resources of the virtual machine are released, the storage resources and network resources of the virtual machine are reserved, and the virtual machine is marked as a mark deletion state, and the virtual machine of the mark deletion state is obtained.
  • the virtual machine cannot perform various normal virtual machine operations such as start and stop, and can only perform the recovery operation or the permanent deletion operation.
  • the operation instruction is a retrieval instruction or a permanent deletion instruction
  • the retrieval instruction is generated by a user operation, and the user can perform a retrieval operation on the mark deletion state virtual machine as needed, and execute a retrieval instruction; the permanent deletion instruction may be triggered according to a preset condition, or operated by a user. Generated.
  • the generating a permanent deletion instruction according to the preset condition may include: if the preset condition is met, the triggering system generates a user reminding message to remind the user to permanently delete the virtual machine with the marked deletion status, and the user may manually correct the Mark delete state virtual machine to perform permanent delete operation, execute permanent delete instruction; or,
  • the trigger system If the preset condition is met, the trigger system generates a permanent delete instruction, and the system directly performs a permanent delete operation on the mark deletion state virtual machine, and executes a permanent delete instruction.
  • the preset condition includes: the length of the virtual machine in the mark deletion state is greater than the preset time length; and/or, the remaining storage resource of the system is smaller than the preset storage resource threshold of the system.
  • the user is prompted to permanently delete the virtual machine in the mark deletion state, and the manner in which the system directly performs the permanent deletion operation on the virtual machine of the mark deletion state after the preset condition is met. You can choose either one or both.
  • the exemplary ones may be set as follows: Taking a storage resource as an example, it is assumed that a first threshold and a second threshold are set in advance for the remaining storage resources, and when the remaining storage resources of the system are smaller than the first When a value is high, the user can be reminded to permanently delete the virtual machine with the mark deletion status, and then the user confirms to delete the mark.
  • the state VM After the state VM is deleted, it is permanently deleted. If the user does not permanently delete the VM with the flag deletion status, when the remaining storage resources of the system are less than the second threshold, the user is no longer reminded and the tag is deleted. The state virtual machine is permanently deleted.
  • the virtual machine is permanently deleted and all resources of the virtual machine are released.
  • all resources include computing, storage, and network resources occupied by virtual machines.
  • Embodiments of the present invention provide a virtual machine management method for performing status marking on a virtual machine during a delete operation by receiving a user deletion instruction.
  • the system can perform the retrieval operation by receiving the user operation instruction to restore the mark deletion state virtual machine to a normal state, or perform a permanent deletion operation to permanently delete and release all resources of the mark deletion state virtual machine; or directly execute or remind the user according to preset conditions. Perform a permanent delete operation. In this way, the security of the user deletion operation is improved, the efficiency of the deletion operation is improved, and the user is provided with convenience.
  • the embodiment of the present invention further provides a virtual machine management apparatus 00.
  • the virtual machine management apparatus 00 includes:
  • the instruction obtaining unit 001 is configured to acquire a delete instruction that the user performs a delete operation on the virtual machine
  • the mark deletion unit 002 is configured to: when the delete instruction indicates the first deletion mode, close the virtual machine, mark the virtual machine as a mark deletion state, and obtain a mark deletion state virtual machine;
  • the operation unit 003 is configured to acquire an operation instruction, and perform corresponding operations on the mark deletion state virtual machine according to the operation instruction.
  • the tag deletion unit 002 is specifically configured to:
  • the virtual machine is shut down, the computing resources of the virtual machine are released, the storage resources and network resources of the virtual machine are reserved, and the virtual machine is marked as a mark deletion state, and the virtual machine is marked and deleted.
  • the operation instruction is a retrieval instruction or a permanent deletion instruction
  • the permanent deletion instruction is generated according to a preset condition or generated by a user operation.
  • the operating unit 003 is specifically configured to:
  • Generate a permanent delete command based on preset conditions including:
  • the trigger system If the preset condition is met, the trigger system generates a user reminder message to generate a permanent delete command by the user operation; or,
  • the trigger system If the preset condition is met, the trigger system generates a permanent delete command.
  • Preset conditions include:
  • the length of time that the virtual machine is in the mark deletion state is greater than the preset time length; and/or, the remaining storage resources of the system are smaller than the system default storage resource threshold.
  • the operation instruction is a permanent deletion instruction
  • the mark deletion state virtual machine is permanently deleted, and all resources of the mark deletion state virtual machine are released;
  • the operation instruction is a retrieval instruction
  • the flag deletion state virtual machine is restored to the normal state, and the required resources are reallocated for the virtual machine that restores the normal state.
  • the tag deletion unit 002 can also be used to:
  • the delete instruction indicates the second delete mode
  • the virtual machine is directly deleted and all resources of the virtual machine are released.
  • Bus 01 1 and a processor 012, a memory 013, and an interface 014 connected to the bus 011, wherein the interface 014 is used to communicate with an external device;
  • the memory 013 is used to store instructions, and the processor 012 is configured to execute the instructions for Obtaining a delete instruction that the user performs a delete operation on the virtual machine;
  • the processor 012 executes the instruction, and when the delete instruction indicates the first deletion mode, the virtual machine is turned off, and the virtual machine is marked as a mark deletion state, and the mark deletion state virtual machine is obtained;
  • the executing the instruction by the processor 012 may be specifically used to: shut down the virtual machine, release the computing resources of the virtual machine, reserve the storage resources and network resources of the virtual machine, and mark the virtual machine. To mark the deletion status, get the flag to delete the state virtual machine.
  • the trigger system If the preset condition is met, the trigger system generates a user reminder message to generate a permanent delete command by the user operation; or, directly triggers the system to generate a permanent delete command.
  • processor 012 executing the instruction may also be used to:
  • the operation instruction is a permanent deletion instruction
  • the mark deletion state virtual machine is permanently deleted, and all resources of the mark deletion state virtual machine are released;
  • the operation instruction is a retrieval instruction
  • the flag deletion state virtual machine is restored to the normal state, and the required resources are reallocated for the virtual machine that restores the normal state.
  • processor 012 executing the instruction may also be used to:
  • Embodiments of the present invention provide a virtual machine management apparatus that performs a status flag on a virtual machine during a delete operation by receiving a user delete instruction.
  • the system can perform the retrieval operation by receiving the user operation instruction to restore the mark deletion state virtual machine to a normal state, or perform a permanent deletion operation to permanently delete and release all resources of the mark deletion state virtual machine; or directly execute or remind the user according to preset conditions. Perform a permanent delete operation. In this way, the security of the user deletion operation is improved, the efficiency of the deletion operation is improved, and the user is provided with convenience.
  • the disclosed apparatus and methods can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules is only a logical function division, and the actual implementation may have another division manner.
  • the modules shown or discussed may be connected to each other through some interface, and may be in electrical, mechanical or other form.
  • the individual modules may or may not be physically separate and may or may not be physical units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may be physically included separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.
  • the above-described integrated modules implemented in the form of software functional units can be stored in a computer readable storage medium.
  • the above software function modules are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform part of the steps of the method of the various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and the like, and the program code can be stored. Medium.

Abstract

本发明的实施例提供一种虚拟机管理方法和装置,涉及计算机领域,提供了一种带保护的虚拟机删除方式,避免了误删除操作带来的损失并为用户提供了便利。其方法为:通过接收用户删除指令,在删除操作时对虚拟机进行状态标记。系统可通过接收用户操作指令执行找回操作将标记删除状态虚拟机恢复正常状态、或执行永久删除操作将标记删除状态虚拟机永久删除并释放所有资源;也可以根据预设条件直接执行或提醒用户执行永久删除操作。本发明的实施例用于对虚拟机的操作管理。

Description

一种虚拟机管理方法和装置 本申请要求于 2013 年 09 月 11 日提交中国专利局、 申请号为 201310412362.7、 发明名称为 "一种虚拟机管理方法和装置" 的中国 专利申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机领域, 尤其涉及一种虚拟机管理方法和装置。 背景技术
虚拟化技术是云计算的关键技术之一,主要是用于将一台物理机 的物理资源虚拟成多个虚拟机 ( Virtual Machine , VM ) , 使得每个 虚拟机都可以实现物理机的功能。虚拟机是真实存在的物理计算机系 统的抽象代表, 在现实应用中, 如企业办公, 呼叫中心, 学校教育等, 经常需要大量部署使用。 某些情况下, 由于学生离校, 员工离职、 业 务迁移等各种原因, 需要对虚拟机进行删除。
目前, 现有技术中对虚拟机的删除操作主要分为两类:
第一类是将虚拟机直接永久删除, 在删除时, 永久释放虚拟机所 占有的计算、存储、 网络等资源。另一种也是将虚拟机直接永久删除, 但是删除时可以选择保留虚拟机的存储资源, 这样在删除时, 只释放 计算、 网络资源, 不释放存储资源。 系统管理员后续可以找到原来虚 拟机对应的磁盘, 使用该磁盘重新恢复虚拟机。
在实现上述虚拟机删除的过程中,发明人发现现有技术中至少存 在如下问题:
第一类删除对用户误操作的保护不足, 一旦发生误删除, 虚拟机 和虚拟机中的数据都无法恢复, 可能会给用户造成巨大损失。 第二类 删除虽然可以从虚拟机磁盘中恢复虚拟机的数据,但是由于虚拟机磁 盘标识使用的磁盘 ID与虚拟机名称不相关, 要找到和虚拟机对应的 磁盘比较困难;且删除虚拟机时保留下来的磁盘会占用大量的存储资 源, 需要系统管理员手动删除, 而且系统规模较大, 虚拟机数量较多 时, 管理员很难找到与虚拟机对应的磁盘。
发明内容 本发明的实施例提供一种虚拟机管理方法和装置,在删除操作时 对虚拟机进行状态标记, 通过预设条件或操作对虚拟机进行永久删 除, 解决了用户删除操作安全性差、 工作效率低的问题。
为达到上述目的, 本发明的实施例釆用如下技术方案: 第一方面, 提供一种虚拟机管理方法, 包括:
获取用户对虚拟机执行删除操作的删除指令;
若所述删除指令指示为第一删除模式, 则将所述虚拟机关闭, 并 将所述虚拟机标记为标记删除状态, 得到标记删除状态虚拟机; 获取操作指令,并根据所述操作指令对所述标记删除状态虚拟机 进行相应的操作。
结合第一方面, 在第一种可能的实现方式中, 所述将所述虚拟机 关闭, 并将所述虚拟机标记为标记删除状态, 得到标记删除状态虚拟 机包括:
将所述虚拟机关闭,释放所述虚拟机的计算资源, 保留所述虚拟 机的存储资源、 网络资源, 并将所述虚拟机标记为标记删除状态, 得 到标记删除状态虚拟机。
结合第一方面, 在第二种可能的实现方式中, 所述操作指令为找 回指令或永久删除指令;
所述永久删除指令是根据预设条件触发生成的,或者是由用户操 作生成的。
结合第一方面的第二种可能的实现方式,在第三种可能的实现方 式中, 所述永久删除指令是根据预设条件触发生成的包括:
若满足所述预设条件, 触发系统生成用户提醒消息, 以便由用户 操作生成所述永久删除指令; 或,
若满足所述预设条件, 触发所述系统生成所述永久删除指令; 所述预设条件包括: 度; 和 /或, 系统剩余存储资源小于系统的预设存储资源阔值。
结合第一方面的第二种可能的实现方式或第三种可能的实现方 式, 在第四种可能的实现方式中, 所述根据所述操作指令对所述标记 删除状态虚拟机进行相应的操作包括:
若所述操作指令为永久删除指令,则将所述标记删除状态虚拟机 永久删除, 并释放所述标记删除状态虚拟机的所有资源;
若所述操作指令为找回指令,则将所述标记删除状态虚拟机恢复 为正常状态, 并为恢复正常状态的虚拟机重新分配所需的资源。
结合第一方面, 在第五种可能的实现方式中, 所述方法还包括: 若所述删除指令指示为第二删除模式,则直接将所述虚拟机永久 删除, 并释放所述虚拟机的所有资源。
第二方面, 提供一种虚拟机管理装置, 包括:
指令获取单元, 用于获取用户对虚拟机执行删除操作的删除指 令;
标记删除单元, 用于当所述删除指令指示为第一删除模式时, 将 所述虚拟机关闭, 并将所述虚拟机标记为标记删除状态, 得到标记删 除状态虚拟机;
操作单元, 用于获取操作指令,根据所述操作指令对所述标记删 除状态虚拟机进行相应的操作。
结合第二方面, 在第一种可能的实现方式中, 所述标记删除单元 具体用于:
将所述虚拟机关闭,释放所述虚拟机的计算资源, 保留所述虚拟 机的存储资源、 网络资源, 并将所述虚拟机标记为标记删除状态, 得 到标记删除状态虚拟机。
结合第二方面, 在第二种可能的实现方式中, 所述操作指令为找 回指令或永久删除指令;
所述永久删除指令是根据预设条件触发生成的,或者是由用户操 作生成的。
结合第二方面的第二种可能的实现方式,在第三种可能的实现方 式中, 所述操作单元具体用于:
根据预设条件触发生成所述永久删除指令, 包括:
若满足所述预设条件, 触发系统生成用户提醒消息, 以便由用户 操作生成所述永久删除指令; 或, 若满足所述预设条件, 触发所述系统生成所述永久删除指令; 所述预设条件包括: 度; 和 /或, 系统剩余存储资源小于系统的预设存储资源阔值。
结合第二方面的第二种可能的实现方式或第三种可能的实现方 式, 在第四种可能的实现方式中, 所述操作单元具体用于:
若所述操作指令为永久删除指令,则将所述标记删除状态虚拟机 永久删除, 并释放所述标记删除状态虚拟机的所有资源;
若所述操作指令为找回指令,则将所述标记删除状态虚拟机恢复 为正常状态, 并为恢复正常状态的虚拟机重新分配所需的资源。
结合第二方面, 在第五种可能的实现方式中, 所述标记删除单元 还用于:
当所述删除指令指示为第二删除模式时,直接将所述虚拟机永久 删除, 并释放所述虚拟机的所有资源。
本发明的实施例提供一种虚拟机管理方法和装置,通过接收用户 删除指令, 在删除操作时对虚拟机进行状态标记。 系统可通过接收用 户操作指令执行找回操作将标记删除状态虚拟机恢复正常状态、或执 行永久删除操作将标记删除状态虚拟机永久删除并释放所有资源;也 可以根据预设条件直接执行或提醒用户执行永久删除操作。 这样, 改 善了用户删除操作的安全性, 提高了删除操作工作效率, 为用户提供 了便利。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对 实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员 来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附 图。
图 1为本发明实施例提供的一种虚拟机管理方法的流程示意图; 图 2 为本发明实施例提供的另一种虚拟机管理方法的流程示意 图 3 为本发明实施例提供的一种虚拟机管理装置的结构示意图 图 4 为本发明实施例提供的一种虚拟机管理装置的结构示意图 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进 行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没 有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的 范围。
本发明的实施例提供了一种虚拟机管理方法, 如图 1所示, 该方 法包括:
5101、 获取用户对虚拟机执行删除操作的删除指令。
5102、 若删除指令指示为第一删除模式, 则将虚拟机关闭, 并 将虚拟机标记为标记删除状态 , 得到标记删除状态虚拟机。
5103、 获取操作指令, 并根据操作指令对标记删除状态虚拟机 进行相应的操作。
本发明的实施例提供一种虚拟机管理方法,通过接收用户删除指 令, 在删除操作时对虚拟机进行状态标记。 系统可通过接收用户操作 指令执行找回操作将标记删除状态虚拟机恢复正常状态、或执行永久 删除操作将标记删除状态虚拟机永久删除并释放所有资源;也可以根 据预设条件直接执行或提醒用户执行永久删除操作。 这样, 改善了用 户删除操作的安全性,提高了删除操作工作效率,为用户提供了便利。
为了使本领域技术人员能够更清楚地理解本发明实施例提供的 技术方案, 下面通过具体的实施例, 对本发明实施例提供的另一种虚 拟机管理方法进行详细说明, 如图 2所示, 该方法包括:
S201、 获取用户对虚拟机执行删除操作的删除指令。
具体的,用户对虚拟机执行删除操作的删除指令可以为标记删除 操作的删除指令, 也可以为永久删除操作的删除指令。
其中, 标记删除操作的删除指令指示为第一删除模式; 永久删除 操作的删除指令指示为第二删除模式。
S202、 对删除指令进行判断。
具体的, 若删除指令指示为第一删除模式, 则执行 S203 ; 若删 除指令指示为第二删除模式, 则直接执行 S206。
5203、 对虚拟机进行标记删除操作, 得到标记删除状态虚拟机。 具体的, 将虚拟机关闭, 释放虚拟机的计算资源, 保留虚拟机的 存储资源、 网络资源, 并将虚拟机标记为标记删除状态, 得到标记删 除状态虚拟机。 对标记删除状态虚拟机不能进行如启动、停止等各种 常规虚拟机操作, 只能进行找回操作或永久删除操作。
5204、 获取对标记删除状态虚拟机的操作指令。
具体的, 操作指令为找回指令或永久删除指令;
其中, 找回指令是由用户操作生成的, 用户可以根据需要对标记 删除状态虚拟机进行找回操作, 执行找回指令; 永久删除指令可以是 根据预设条件触发生成的, 或者是由用户操作生成的。
示例性的, 根据预设条件触发生成永久删除指令可以包括: 若满足预设条件, 触发系统生成用户提醒消息,提醒用户对标记 删除状态虚拟机进行永久删除, 用户可以在确认无误后, 手工对标记 删除状态虚拟机进行永久删除操作, 执行永久删除指令; 或,
若满足预设条件, 触发系统生成永久删除指令, 由系统直接对标 记删除状态虚拟机执行永久删除操作, 执行永久删除指令。
其中,预设条件包括: 虚拟机处于标记删除状态的时间长度大于 预设时间长度; 和 /或, 系统剩余存储资源小于系统的预设存储资源 阔值。
另外,值得一提的是, 上述满足预设条件后提醒用户对标记删除 状态虚拟机进行永久删除的方式,以及满足预设条件后由系统直接对 标记删除状态虚拟机执行永久删除操作的方式,可以选择其中任意一 种, 也可以同时釆用。 在同时釆用上述两种方式时, 示例性的, 可以 设置为: 以存储资源为例, 假设预先设置有关于剩余存储资源的第一 阔值和第二阔值, 当系统剩余存储资源小于第一阔值时, 可以先提醒 用户对标记删除状态虚拟机进行永久删除,再由用户确认删除该标记 删除状态虚拟机后才对其进行永久删除,若用户没有对标记删除状态 虚拟机进行永久删除, 则当系统剩余存储资源小于第二阔值时, 不再 对用户进行提醒, 直接将该标记删除状态虚拟机永久删除。
5205、 根据操作指令, 对标记删除状态虚拟机进行相应的操作。 若操作指令为永久删除指令, 则执行 S206; 若操作指令为找回 指令, 则执行 S207。
5206、 对虚拟机进行永久删除操作。
具体的, 将虚拟机永久删除, 并释放虚拟机的所有资源。 其中, 所有资源包括虚拟机所占有的计算、 存储、 网络资源。
5207、 将标记删除状态虚拟机恢复为正常状态, 并为恢复正常 状态的虚拟机重新分配所需的资源。
本发明的实施例提供一种虚拟机管理方法,通过接收用户删除指 令, 在删除操作时对虚拟机进行状态标记。 系统可通过接收用户操作 指令执行找回操作将标记删除状态虚拟机恢复正常状态、或执行永久 删除操作将标记删除状态虚拟机永久删除并释放所有资源;也可以根 据预设条件直接执行或提醒用户执行永久删除操作。 这样, 改善了用 户删除操作的安全性,提高了删除操作工作效率,为用户提供了便利。
本发明实施例还提供一种虚拟机管理装置 00 , 如图 3 , 该虚拟机 管理装置 00包括:
指令获取单元 001 , 用于获取用户对虚拟机执行删除操作的删除 指令;
标记删除单元 002 , 用于当删除指令指示为第一删除模式时, 将 虚拟机关闭, 并将虚拟机标记为标记删除状态, 得到标记删除状态虚 拟机;
操作单元 003 , 用于获取操作指令, 根据操作指令对标记删除状 态虚拟机进行相应的操作。
可选的, 标记删除单元 002具体用于:
将虚拟机关闭 ,释放虚拟机的计算资源 ,保留虚拟机的存储资源、 网络资源, 并将虚拟机标记为标记删除状态, 得到标记删除状态虚拟 机。 可选的, 操作指令为找回指令或永久删除指令;
其中, 永久删除指令是根据预设条件触发生成的, 或者是由用户 操作生成的。
可选的, 操作单元 003具体用于:
根据预设条件触发生成永久删除指令, 包括:
若满足预设条件, 触发系统生成用户提醒消息, 以便由用户操作 生成永久删除指令; 或,
若满足预设条件, 触发系统生成永久删除指令。
预设条件包括:
虚拟机处于标记删除状态的时间长度大于预设时间长度; 和 /或, 系统剩余存储资源小于系统的预设存储资源阔值。
可选的, 操作单元 003还可以用于:
若操作指令为永久删除指令, 则将标记删除状态虚拟机永久删 除, 并释放标记删除状态虚拟机的所有资源;
若操作指令为找回指令,则将标记删除状态虚拟机恢复为正常状 态, 并为恢复正常状态的虚拟机重新分配所需的资源。
可选的, 标记删除单元 002还可以用于:
当删除指令指示为第二删除模式时, 直接将虚拟机永久删除, 并 释放虚拟机的所有资源。
本发明的实施例提供一种虚拟机管理装置,通过接收用户删除指 令, 在删除操作时对虚拟机进行状态标记。 系统可通过接收用户操作 指令执行找回操作将标记删除状态虚拟机恢复正常状态、或执行永久 删除操作将标记删除状态虚拟机永久删除并释放所有资源;也可以根 据预设条件直接执行或提醒用户执行永久删除操作。 这样, 改善了用 户删除操作的安全性,提高了删除操作工作效率,为用户提供了便利。
本发明实施例还提供了一种虚拟机管理装置 01 , 如图 4所示, 该虚拟机管理装置 01 包括:
总线 01 1、 以及连接到总线 011的处理器 012、 存储器 013和接 口 014 , 其中接口 014用于与外部设备进行通信;
该存储器 013用于存储指令,该处理器 012用于执行该指令用于 获取用户对虚拟机执行删除操作的删除指令;
该处理器 012 执行该指令还用于当删除指令指示为第一删除模 式时, 将虚拟机关闭, 并将虚拟机标记为标记删除状态, 得到标记删 除状态虚拟机;
该处理器 012执行该指令还用于获取操作指令,根据操作指令对 标记删除状态虚拟机进行相应的操作。
在本发明实施例中, 可选的, 该处理器 012执行该指令可以具体 用于: 将虚拟机关闭, 释放虚拟机的计算资源, 保留虚拟机的存储资 源、 网络资源, 并将虚拟机标记为标记删除状态, 得到标记删除状态 虚拟机。
在本发明实施例中, 可选的, 上述操作指令可以为找回指令或永 久删除指令, 其中, 永久删除指令是根据预设条件触发生成的, 或者 是由用户操作生成的。
在本发明实施例中, 可选的, 该处理器 012执行该指令用于根据 预设条件触发生成永久删除指令包括:
若满足预设条件, 触发系统生成用户提醒消息, 以便由用户操作 生成永久删除指令; 或, 直接触发系统生成永久删除指令。
其中,预设条件包括: 虚拟机处于标记删除状态的时间长度大于 预设时间长度; 和 /或, 系统剩余存储资源小于系统的预设存储资源 阔值。
在本发明实施例中, 可选的, 该处理器 012执行该指令还可以用 于:
若操作指令为永久删除指令, 则将标记删除状态虚拟机永久删 除, 并释放标记删除状态虚拟机的所有资源;
若操作指令为找回指令,则将标记删除状态虚拟机恢复为正常状 态, 并为恢复正常状态的虚拟机重新分配所需的资源。
在本发明实施例中, 可选的, 该处理器 012执行该指令还可以用 于:
当删除指令指示为第二删除模式时, 直接将虚拟机永久删除, 并 释放虚拟机的所有资源。 本发明的实施例提供一种虚拟机管理装置,通过接收用户删除指 令, 在删除操作时对虚拟机进行状态标记。 系统可通过接收用户操作 指令执行找回操作将标记删除状态虚拟机恢复正常状态、或执行永久 删除操作将标记删除状态虚拟机永久删除并释放所有资源;也可以根 据预设条件直接执行或提醒用户执行永久删除操作。 这样, 改善了用 户删除操作的安全性,提高了删除操作工作效率,为用户提供了便利。
在本申请所提供的几个实施例中,应该理解到, 所揭露装置和方 法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅 是示意性的, 例如, 所述模块的划分, 仅仅为一种逻辑功能划分, 实 际实现时可以有另外的划分方式。 另一点, 所显示或讨论的模块相互 之间的连接可以是通过一些接口, 可以是电性, 机械或其它的形式。
所述各个模块可以是或者也可以不是物理上分开的,可以是或者 也可以不是物理单元。可以根据实际的需要选择其中的部分或者全部 模块来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能模块可以集成在一个处理 模块中, 也可以是各个模块单独物理包括, 也可以两个或两个以上模 块集成在一个模块中。 上述集成的模块既可以釆用硬件的形式实现, 也可以釆用硬件加软件功能模块的形式实现。
上述以软件功能单元的形式实现的集成的模块,可以存储在一个 计算机可读取存储介质中。 上述软件功能模块存储在一个存储介质 中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服 务器,或者网络设备等)执行本发明各个实施例所述方法的部分步骤。 而前述的存储介质包括: U 盘、 移动硬盘、 只读存储器 (Read-Only Memory, 简称 ROM ) 、 随机存取存储器 ( Random Access Memory, 简称 RAM ) 、 磁碟或者光盘等各种可以存储程序代码的介质。 以上 所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于 此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本 发明的保护范围应以所述权利要求的保护范围为准。

Claims

权利要求
1、 一种虚拟机管理方法, 其特征在于, 所述方法包括: 获取用户对虚拟机执行删除操作的删除指令;
若所述删除指令指示为第一删除模式, 则将所述虚拟机关闭, 并 将所述虚拟机标记为标记删除状态, 得到标记删除状态虚拟机;
获取操作指令,并根据所述操作指令对所述标记删除状态虚拟机 进行相应的操作。
2、 根据权利要求 1所述的方法, 其特征在于, 所述将所述虚拟 机关闭, 并将所述虚拟机标记为标记删除状态, 得到标记删除状态虚 拟机包括:
将所述虚拟机关闭, 释放所述虚拟机的计算资源, 保留所述虚拟 机的存储资源、 网络资源, 并将所述虚拟机标记为标记删除状态, 得 到标记删除状态虚拟机。
3、 根据权利要求 1所述的方法, 其特征在于, 所述操作指令为 找回指令或永久删除指令;
所述永久删除指令是根据预设条件触发生成的,或者是由用户操 作生成的。
4、 根据权利要求 3所述的方法, 其特征在于, 所述永久删除指 令是根据预设条件触发生成的包括:
若满足所述预设条件, 触发系统生成用户提醒消息, 以便由用户 操作生成所述永久删除指令; 或,
若满足所述预设条件, 触发所述系统生成所述永久删除指令; 所述预设条件包括: 度; 和 /或, 系统剩余存储资源小于系统的预设存储资源阔值。
5、 根据权利要求 3或 4所述的方法, 其特征在于, 所述根据所 述操作指令对所述标记删除状态虚拟机进行相应的操作包括:
若所述操作指令为永久删除指令,则将所述标记删除状态虚拟机 永久删除, 并释放所述标记删除状态虚拟机的所有资源;
若所述操作指令为找回指令,则将所述标记删除状态虚拟机恢复 为正常状态, 并为恢复正常状态的虚拟机重新分配所需的资源。
6、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 若所述删除指令指示为第二删除模式,则直接将所述虚拟机永久 删除, 并释放所述虚拟机的所有资源。
7、 一种虚拟机管理装置, 其特征在于, 所述装置包括: 指令获取单元, 用于获取用户对虚拟机执行删除操作的删除指 令;
标记删除单元, 用于当所述删除指令指示为第一删除模式时, 将 所述虚拟机关闭, 并将所述虚拟机标记为标记删除状态, 得到标记删 除状态虚拟机;
操作单元, 用于获取操作指令, 根据所述操作指令对所述标记删 除状态虚拟机进行相应的操作。
8、 根据权利要求 7所述的装置, 其特征在于, 所述标记删除单 元具体用于:
将所述虚拟机关闭, 释放所述虚拟机的计算资源, 保留所述虚拟 机的存储资源、 网络资源, 并将所述虚拟机标记为标记删除状态, 得 到标记删除状态虚拟机。
9、 根据权利要求 7所述的装置, 其特征在于, 所述操作指令为 找回指令或永久删除指令;
所述永久删除指令是根据预设条件触发生成的,或者是由用户操 作生成的。
10、 根据权利要求 9所述的装置, 其特征在于, 所述操作单元具 体用于:
根据预设条件触发生成所述永久删除指令, 包括:
若满足所述预设条件, 触发系统生成用户提醒消息, 以便由用户 操作生成所述永久删除指令; 或,
若满足所述预设条件, 触发所述系统生成所述永久删除指令; 所述预设条件包括: 度; 和 /或, 系统剩余存储资源小于系统的预设存储资源阔值。
11、 根据权利要求 9或 10 所述的装置, 其特征在于, 所述操作 单元具体用于:
若所述操作指令为永久删除指令,则将所述标记删除状态虚拟机 永久删除, 并释放所述标记删除状态虚拟机的所有资源; 若所述操作指令为找回指令,则将所述标记删除状态虚拟机恢复 为正常状态, 并为恢复正常状态的虚拟机重新分配所需的资源。
12、 根据权利要求 7所述的装置, 其特征在于, 所述标记删除单 元还用于:
当所述删除指令指示为第二删除模式时,直接将所述虚拟机永久 删除, 并释放所述虚拟机的所有资源。
PCT/CN2014/078130 2013-09-11 2014-05-22 一种虚拟机管理方法和装置 WO2015035798A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310412362.7A CN104424015B (zh) 2013-09-11 2013-09-11 一种虚拟机管理方法和装置
CN201310412362.7 2013-09-11

Publications (1)

Publication Number Publication Date
WO2015035798A1 true WO2015035798A1 (zh) 2015-03-19

Family

ID=52665020

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/078130 WO2015035798A1 (zh) 2013-09-11 2014-05-22 一种虚拟机管理方法和装置

Country Status (2)

Country Link
CN (1) CN104424015B (zh)
WO (1) WO2015035798A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341058A (zh) * 2017-07-13 2017-11-10 郑州云海信息技术有限公司 一种资源回收方法及装置
CN109308232B (zh) * 2017-07-28 2022-09-06 阿里巴巴集团控股有限公司 虚拟机热迁移故障后回滚的方法、装置以及系统
CN109324867A (zh) * 2017-07-31 2019-02-12 郑州云海信息技术有限公司 一种虚拟机暂存方法、恢复方法及装置
CN107395429A (zh) * 2017-08-15 2017-11-24 郑州云海信息技术有限公司 云数据中心中管理虚拟机的方法和装置
CN109669757A (zh) * 2017-10-16 2019-04-23 中兴通讯股份有限公司 虚拟机删除方法及装置
CN108984266B (zh) * 2018-06-15 2021-09-03 华为技术有限公司 一种虚拟机的管理方法、装置及系统
CN109379412A (zh) * 2018-09-27 2019-02-22 郑州云海信息技术有限公司 一种删除云主机的方法和装置
CN110018883A (zh) * 2019-04-11 2019-07-16 苏州浪潮智能科技有限公司 一种虚拟机删除方法、装置、设备及存储介质
CN110377616A (zh) * 2019-07-30 2019-10-25 北京金山云网络技术有限公司 一种数据删除方法、装置、电子设备及存储介质
CN112732406B (zh) * 2021-01-12 2021-12-24 华云数据控股集团有限公司 一种云平台虚拟机回收方法及计算机设备
CN113296956A (zh) * 2021-06-17 2021-08-24 银清科技有限公司 云计算平台中资源回收装置及方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103518A (zh) * 2011-02-23 2011-06-22 运软网络科技(上海)有限公司 一种在虚拟化环境中管理资源的系统及其实现方法
US20110225582A1 (en) * 2010-03-09 2011-09-15 Fujitsu Limited Snapshot management method, snapshot management apparatus, and computer-readable, non-transitory medium
CN102214117A (zh) * 2010-04-07 2011-10-12 中兴通讯股份有限公司 虚拟机管理方法、系统及虚拟机管理服务器
CN102651729A (zh) * 2011-02-23 2012-08-29 中国移动通信集团公司 一种资源配置方法和装置
CN103473296A (zh) * 2013-09-04 2013-12-25 国云科技股份有限公司 一种适用于云计算的回收站机制及其系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110225582A1 (en) * 2010-03-09 2011-09-15 Fujitsu Limited Snapshot management method, snapshot management apparatus, and computer-readable, non-transitory medium
CN102214117A (zh) * 2010-04-07 2011-10-12 中兴通讯股份有限公司 虚拟机管理方法、系统及虚拟机管理服务器
CN102103518A (zh) * 2011-02-23 2011-06-22 运软网络科技(上海)有限公司 一种在虚拟化环境中管理资源的系统及其实现方法
CN102651729A (zh) * 2011-02-23 2012-08-29 中国移动通信集团公司 一种资源配置方法和装置
CN103473296A (zh) * 2013-09-04 2013-12-25 国云科技股份有限公司 一种适用于云计算的回收站机制及其系统

Also Published As

Publication number Publication date
CN104424015A (zh) 2015-03-18
CN104424015B (zh) 2018-10-09

Similar Documents

Publication Publication Date Title
WO2015035798A1 (zh) 一种虚拟机管理方法和装置
US10884870B2 (en) Method and system for implementing consistency groups with virtual machines
CN105556478B (zh) 用于保护虚拟机数据的系统和方法
JP5981845B2 (ja) 仮想計算機システム、仮想計算機制御方法、仮想計算機制御プログラム、及び半導体集積回路
US9116846B2 (en) Virtual machine backup from storage snapshot
CN110622138B (zh) 一种数据迁移方法及装置
CN104598294B (zh) 用于移动设备的高效安全的虚拟化方法及其设备
US9430332B1 (en) Systems and methods for enabling efficient access to incremental backups
US10884645B2 (en) Virtual machine hot migration method, host machine and storage medium
JP6186374B2 (ja) 仮想化されたプラットフォームへ安全に移行するためのシステム及び方法
US8881144B1 (en) Systems and methods for reclaiming storage space from virtual machine disk images
CN105022955B (zh) 一种应用程序的锁定方法及移动终端
CN106777394B (zh) 一种集群文件系统
EP3022647B1 (en) Systems and methods for instantly restoring virtual machines in high input/output load environments
US10007785B2 (en) Method and apparatus for implementing virtual machine introspection
US9275240B2 (en) Synchronized virtual trusted platform modules (VTPM) and virtual machine (VM) rollbacks
BR112014031586B1 (pt) Sistema para emular um ambiente de execução confiável e midia de armazenamento de computador
US10191817B2 (en) Systems and methods for backing up large distributed scale-out data systems
CN109814946A (zh) 一种在XenServer中实现分布式存储的方法和装置
US9003139B1 (en) Systems and methods for recovering virtual machines after disaster scenarios
WO2015176359A1 (zh) 基于安卓系统的多用户管理方法、装置及计算机存储介质
KR20180122593A (ko) 클라우드 컴퓨팅 환경에서 클라우드 호스트를 삭제하는 방법, 장치, 서버 및 저장 매체
CN106250274A (zh) 一种虚拟机的备份方法及装置
US11216559B1 (en) Systems and methods for automatically recovering from malware attacks
CN104461767B (zh) 一种信息处理方法及第一电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14843730

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14843730

Country of ref document: EP

Kind code of ref document: A1