commit bdae541ce544ae4351da99c3081c43843c7741f1 Author: Clement Verna Date: Tue Feb 11 15:58:14 2020 +0100 how to destroy a virt instance Signed-off-by: Clement Verna diff --git a/destroy_a_virt_instance.md b/destroy_a_virt_instance.md new file mode 100644 index 0000000..2a23c01 --- /dev/null +++ b/destroy_a_virt_instance.md @@ -0,0 +1,21 @@ +# How to destroy a virt instance + +A playbook is available to destroy a virtual instance. + +``` +sudo -i ansible-playbook -vvv /home/fedora/cverna/ansible/playbooks/destroy_virt_inst.yml -e target=osbs-master01.stg.phx2.fedoraproject.org +``` + +In some case the instance that you are trying to delete was not in a clean state. You then try to run the following: + +Undefined the instance + +``` +sudo -i ssh virthost04.stg.phx2.fedoraproject.org 'virsh undefine osbs-node02.stg.phx2.fedoraproject.org' +``` + +Remove the logical volume + +``` +sudo -i ssh virthost04.stg.phx2.fedoraproject.org 'lvremove /dev/vg_guests/bodhi-backend01.phx2.fedoraproject.org' +```