Re: unable to get domain status from libvirt & KVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/12/2010 11:16 AM, Akemi Yagi wrote:

> In the case of virsh, you have a chance to add the -c qemu:///system
> option (which is required when running the command as non-root).  So,
> the question is if this option can be somehow added in python.

I posted this question on the libvirt-users list and here's the fix:
Instead of using:
conn = libvirt.openReadOnly(None)

I need to use:
conn = libvirt.openReadOnly("qemu:///system")

sh-3.2$ python
Python 2.4.3 (#1, Sep  3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
  >>> import libvirt
  >>> conn = libvirt.openReadOnly("qemu:///system")
  >>> domains = conn.listDomainsID()
  >>> print domains
[14, 8, 13]
  >>>

That wass the only change needed to make this work on the KVM server.

Thank you very much for your help with this, I appreciate it!

Tom
_______________________________________________
CentOS-virt mailing list
CentOS-virt@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos-virt

[Index of Archives]     [CentOS Users]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Xfree86]     [Linux USB]

  Powered by Linux