码迷,mamicode.com
首页 > 其他好文 > 详细

【OpenStack】源码级深入了解删除虚拟机操作

时间:2016-05-25 16:36:40      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:

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

【OpenStack】源码级深入了解删除虚拟机操作

标签:

原文地址:http://www.cnblogs.com/puyangsky/p/5527441.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!