Virsh domain has space in it, can not remove
Kids, don't try this at home:
Libvirt should have rejected the creation of a domain with a space in its name, so someone did something strange to create the domain to begin with. To recover from this is going to require some hand-editing of files you aren't normally supposed to touch manually.
So this is what I would do:
Stop libvirtd (your VMs will continue running).
service libvirtd stop
Find the offending XML file, which should be somewhere in
/etc/libvirt/qemu
.# ls /etc/libvirt/qemu autostart Centos_6.5_64.xml Git Server.xml networks pxe.xml
Rename the offending file.
# mv /etc/libvirt/qemu/Git\ Server.xml /etc/libvirt/qemu/Git_Server.xml
Edit the name in the offending file.
# vi /etc/libvirt/qemu/Git_Server.xml <domain type='kvm'> <name>Git_Server</name> ...
Restart libvirtd.
service libvirtd start
Related videos on Youtube
![DevOops](https://i.stack.imgur.com/vBD0o.jpg?s=256&g=1)
DevOops
Updated on September 18, 2022Comments
-
DevOops almost 2 years
I'm having trouble starting, or destroying a domain:
virsh # list --all Id Name State ---------------------------------------------------- 1 pxe running - Centos_6.5_64 shut off - Git Server shut off
I can't start the domain:
virsh # start Git error: failed to get domain 'Git' error: Domain not found: no domain with matching name 'Git' virsh # start Git Server error: unexpected data 'Server'
Because of this I'm not able to destroy the domain.
How can I assign an ID or otherwise remove this VM?
Because it has a space in it, I'm not able to manage it like I am other domains.
I know that they are not supposed to have spaces, but then again, end users don't always listen to what they're told :P
Thank you for any help you might provide.
-
DevOops almost 10 yearsThank you Michael, and amazing supporting documentation. I had forgotten that those xml files were how these are instantiated. Also, how did you hack my server and get my ls output?! Just kidding. I'm sure libvirt would have tried to stop me, but I'm working with a Python app that doesn't currently check for spaces, will have to rectify that.