篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何删除 OpenStack Nova 僵尸实例相关的知识,希望对你有一定的参考价值。
参考技术A#!/bin/bash for i in "$@" do mysql -uroot -pmygreatsecret << EOF use nova; DELETE FROM nova.virtual_interfaces where instance_uuid='$i'; DELETE FROM nova.fixed_ips where instance_uuid='$i'; DELETE FROM nova.block_device_mapping where instance_uuid='$i'; DELETE FROM nova.instance_system_metadata where instance_uuid='$i'; DELETE FROM nova.security_group_instance_association where instance_id='$i'; DELETE FROM nova.instance_info_caches WHERE instance_uuid='$i'; DELETE FROM nova.instances WHERE uuid='$i'; EOF done #echo "ok!,$# vm was deleted successfully!!" #exit 0