13

I created a VM using vmbuilder but I realize that I had set some of the flags incorrectly. Now when I do a virsh list -all it still appears, laughing at my novicity. How do I delete this? (I've already deleted the corresponding xml and qcow2 files).

Son of the Wai-Pan
  • 727
  • 4
  • 11
  • 25
  • 1
    Possible duplicate of [how to delete a guest after creating it with virt-install](http://serverfault.com/questions/299632/how-to-delete-a-guest-after-creating-it-with-virt-install) – imz -- Ivan Zakharyaschev Jan 24 '17 at 15:02

1 Answers1

18

If you have already removed the disk image file, you can completely get rid of the VM with virsh undefine <domain-id>. You can also specify --managed-save to delete any managed save images and --snapshots-metadata to remove snapshots for the specified VM.

If the VM is in inactive state you should use its name or UUID instead of domain-id.

Vladimir Blaskov
  • 6,073
  • 1
  • 26
  • 22