openstack使用

1.若虚机带磁盘,先卸载磁盘
for i in `cinder list --all-tenants |awk '{print $2}' |grep -v 'ID'|grep -v '^$'`;
do
  j=`cinder list --all |grep $i | awk '{print $16}' |grep -v 'Attached'|grep -v '^$'`
  nova volume-detach $j $i
done
2.删除磁盘
for i in `cinder list --all-tenants |awk '{print $2}' |grep -v 'ID'|grep -v '^$'`;do cinder delete $i;done
3.删除虚机
for i in `nova list --all-tenants |awk '{print $2}' |grep -v 'ID'|grep -v '^$'`;do nova delete $i;done
4.删除port
for i in `neutron port-list |awk '{print $2}' |grep -v 'id'|grep -v '^$'` ;do neutron port-delete $i;done
5.删除镜像
for i in `glance image-list | awk '{print $2}' |grep -v 'ID'|grep -v '^$'`;do glance image-delete $i;done
6.删除subnet
for i in `neutron subnet-list | awk '{print $2}' |grep -v 'id'|grep -v '^$'`;do neutron subnet-delete $i;done
7.删除net
for i in `neutron net-list |awk '{print $2}' |grep -v 'id'|grep -v '^$'`;do neutron net-delete $i;done
8.删除flavor
for i in `nova flavor-list | awk '{print $2}' |grep -v 'ID'|grep -v '^$'`;do nova flavor-delete $i;done

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值