puyangsky

首先看一下虚拟机有多少种状态:(/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

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2021-12-01
  • 2021-07-08
  • 2022-01-06
  • 2021-07-18
猜你喜欢
  • 2022-02-19
  • 2021-06-08
  • 2021-05-25
  • 2021-10-15
  • 2021-12-28
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案