删除kvm虚拟机

1,查看kvm虚机:

 ~]# virsh list
 Id    Name                           State
----------------------------------------------------
 7     chefworkstation                running
 9     chefcompute                    running
 18    chefserver                     running
 21    test_vm                        running

2,destroy 虚拟机

~]# virsh destroy test_vm
Domain test_vm destroyed

3,undefine 虚拟机

~]# virsh undefine test_vm
Domain test_vm has been undefined

4,如果发现下面文件,删除;

/var/lib/libvirt/images/test_vm

/etc/libvirt/qemu/test_vm

5,验证结果,test_vm已经被删除了:

~]# virsh list
 Id    Name                           State
----------------------------------------------------
 7     chefworkstation                running
 9     chefcompute                    running
 18    chefserver                     running

你可能感兴趣的:(虚拟机)