4

When I try to launch an instance with OpenStack, I get the following error in nova-compute.log:

(nova.rpc): TRACE: libvirtError: operation failed: domain 'instance-0000000a' already exists with uuid 5f81a7d2-1b0f-8c72-4e1e-377c275e9289

However, virsh doesn't show any domains:

$ sudo virsh list
 Id Name                 State
----------------------------------

Why isn't that domain showing up in virsh if it's there?

Lorin Hochstein
  • 4,868
  • 15
  • 54
  • 72

5 Answers5

7

Your domain may be shut down. Run virsh list --all to see all domains.

daff
  • 4,729
  • 2
  • 26
  • 27
  • 1
    In case `virsh list --all` is empty but the problem persists you may want to try restarting the service `service libvirtd restart`. – Attila Fulop Feb 29 '16 at 13:28
4

Not yet familiar with OpenStack, but in regular old libvirt, that error usually implies not that there's a RUNNING instance, but that there's a DEFINED instance. "virsh list" only shows currently active VM's, not every defined VM. Try:

virsh edit instance-0000000a

If that pops open vim and has a bunch of XML in there, there's already a defined 'instance-0000000a' VM. If you are 100% sure you don't want it, quit out of the editor and use:

virsh undefine instance-0000000a

And then have OpenStack try whatever you were doing again, and it should work.

By the way, if you DO want what's there, you can start it with:

virsh start instance-0000000a

But again, not familiar with OpenStack, it may not like you doing that, no idea.

Nex7
  • 1,925
  • 11
  • 14
  • I don't know how I forgot "virsh list --all".. thanks to daff for reminding me. Use that instead of "virsh edit" to determine if the domain exists. – Nex7 Feb 22 '12 at 23:25
  • Thanks, 'virsh undefine' is exactly what I needed in the same situation. – jkff Mar 23 '12 at 10:42
1

Scenario 1:

Are you certain that virsh on the command line is talking to the same hypervisor as your OpenStack controller? This would be the simplest explanation as two why virsh is not showing the running instance.

Scenario 2:

If you use ps, do you see any qemu-kvm instances running? Try:

ps -fe | grep qemu-kvm

If there are qemu-kvm instances running, they'll have a -name parameter that should match the name used in virsh. You can just kill -9 these processes if they're supposed to be dead anyway.

larsks
  • 41,276
  • 13
  • 117
  • 170
0

Check if you have installed qemu-system-x86-xen if not - install apt install qemu-system-x86-xen that helped me

Mike
  • 1
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://serverfault.com/help/whats-reputation) you will be able to [comment on any post](https://serverfault.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/500526) – bjoster Oct 26 '21 at 13:56
0

My issue was name resolution. The service libvirtd was not starting properly because the hostname wasn't resolving to the system's IP.
Added an entry to /etc/hosts for local system name and IP, then I could connect to VM guest.

Thomas
  • 4,155
  • 5
  • 21
  • 28