博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【OpenStack】源码级深入了解删除虚拟机操作
阅读量:7153 次
发布时间:2019-06-29

本文共 1383 字,大约阅读时间需要 4 分钟。

首先看一下虚拟机有多少种状态:(/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 are12 # 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 hypervisor18 SHELVED_OFFLOADED = 'shelved_offloaded'  # VM and associated resources are19 # not on hypervisor20 21 ALLOW_SOFT_REBOOT = [ACTIVE]  # states we can soft reboot from22 ALLOW_HARD_REBOOT = ALLOW_SOFT_REBOOT + [STOPPED, PAUSED, SUSPENDED, ERROR]23 # states we allow hard reboot from24 25 ALLOW_TRIGGER_CRASH_DUMP = [ACTIVE, PAUSED, RESCUED, RESIZED, ERROR]26 # states we allow to trigger crash dump27 28 ALLOW_RESOURCE_REMOVAL = [DELETED, SHELVED_OFFLOADED]29 # states we allow resources to be freed in

 

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

转载于:https://www.cnblogs.com/puyangsky/p/5527441.html

你可能感兴趣的文章
ASP.NET中注册客户端脚本的三种方式
查看>>
JS拖动层的实现原理
查看>>
nodejs中加入mysql插件
查看>>
Java 性能优化实战记录(2)---句柄泄漏和监控
查看>>
sql server 之函数小技巧 && 整数类型为空是用空字符串替代实现
查看>>
利用积分图进行均值滤波
查看>>
(原創) 如何使用Verilog將YCbCr轉RGB? (SOC) (Verilog) (DE2-70)
查看>>
Centos搭建Samba
查看>>
初次体验用mootools开发插件
查看>>
C#九九乘法表的算法
查看>>
开篇:解决IE9字体模糊的问题(又称无法关闭ClearType)
查看>>
Oracle知识补充
查看>>
Javascript截取字符串方法集合
查看>>
软件项目质量保证——编码规范
查看>>
import static和import的区别
查看>>
android中Invalidate和postInvalidate的区别
查看>>
hive load from hdfs出错
查看>>
IOS开发:xcode5版本引发的问题
查看>>
亿级数据时,内存性能低于IO性能
查看>>
asp.net 负载均衡下session存储的解决方法
查看>>