zoukankan      html  css  js  c++  java
  • 【OpenStack】源码级深入了解删除虚拟机操作

    首先看一下虚拟机有多少种状态:(/nova/compute/vmstates.py)

     1 ACTIVE = 'active'  # VM is running
     2 BUILDING = 'building'  # VM only exists in DB
     3 PAUSED = 'paused'
     4 SUSPENDED = 'suspended'  # VM is suspended to disk.
     5 STOPPED = 'stopped'  # VM is powered off, the disk image is still there.
     6 RESCUED = 'rescued'  # A rescue image is running with the original VM image
     7 # attached.
     8 RESIZED = 'resized'  # a VM with the new size is active. The user is expected
     9 # to manually confirm or revert.
    10 
    11 SOFT_DELETED = 'soft-delete'  # VM is marked as deleted but the disk images are
    12 # still available to restore.
    13 DELETED = 'deleted'  # VM is permanently deleted.
    14 
    15 ERROR = 'error'
    16 
    17 SHELVED = 'shelved'  # VM is powered off, resources still on hypervisor
    18 SHELVED_OFFLOADED = 'shelved_offloaded'  # VM and associated resources are
    19 # not on hypervisor
    20 
    21 ALLOW_SOFT_REBOOT = [ACTIVE]  # states we can soft reboot from
    22 ALLOW_HARD_REBOOT = ALLOW_SOFT_REBOOT + [STOPPED, PAUSED, SUSPENDED, ERROR]
    23 # states we allow hard reboot from
    24 
    25 ALLOW_TRIGGER_CRASH_DUMP = [ACTIVE, PAUSED, RESCUED, RESIZED, ERROR]
    26 # states we allow to trigger crash dump
    27 
    28 ALLOW_RESOURCE_REMOVAL = [DELETED, SHELVED_OFFLOADED]
    29 # states we allow resources to be freed in

    在删除虚拟机时,会根据虚拟机状态来进行不同的操作。可以看出deleted和shelved_offloaded两种状态下虚拟机资源完全释放,而shelved

  • 相关阅读:
    Deltix Round, Summer 2021
    CF1558F Strange Sort 题解
    将文本复制到粘贴板上
    Mac安装2021ps
    腾讯云TDSQL-C云原生数据库技术
    腾讯云分布式数据库TDSQL再获认可
    T-TDSQL的核心技术
    TDSQL原创技术的出发点
    拓路前行-TDSQL追求极致体验的这一路
    TDSQL多集群下的自动化和交付
  • 原文地址:https://www.cnblogs.com/puyangsky/p/5527441.html
Copyright © 2011-2022 走看看