Page 1 of 1

Linux KVM: Delete virtual machine client

Posted: Mon Mar 23, 2015 9:48 am
by peter_b
HowTo remove a VM-client from a libvirt KVM host, using "virsh"

1) Start the "virsh" shell:
As root (or using "sudo"), run the following command on the KVM host:

Code: Select all

$ virsh
2) Shutdown the client:
You can get a list of all clients on that KVM host:

Code: Select all

list --all
It'll return something like this:

Code: Select all

 Id    Name                           State
----------------------------------------------------
 2     my-kvmclient                   running
Use the "Name" to address the VM-client and shut it down:

Code: Select all

shutdown my-kvmclient
If successful, "list --all" will show the machine as "shut off":

Code: Select all

 Id    Name                           State
----------------------------------------------------
 -     my-kvmclient                   shut off

3) Undefine the client's domain:

Code: Select all

undefine my-kvmclient

That's it. :D


Links: