Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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:

  1. Stop libvirtd (your VMs will continue running).

    service libvirtd stop
    
  2. 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
    
  3. Rename the offending file.

    # mv /etc/libvirt/qemu/Git\ Server.xml /etc/libvirt/qemu/Git_Server.xml
    
  4. Edit the name in the offending file.

    # vi /etc/libvirt/qemu/Git_Server.xml
    
    <domain type='kvm'>
      <name>Git_Server</name>
    ...
    
  5. Restart libvirtd.

    service libvirtd start
    
share|improve this answer
    
Thank 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. –  SprintCycle Jun 30 at 16:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.