[Libvir] API confusion...

Since I am kind of an idiot and don't know what I am doing...I am having trouble with getting network stats to work in Python. I have everything correct...but I am just not sure exactly what it is looking for. I get this error: libvir: Xen error : invalid argument in xenHypervisorDomainInterfaceStats: invalid path, should be vif<domid>.<n>. I guess I just need some kind of example to work from on this. -- Spencer Parker _______________________________________________________ "if you can't go to heaven, may you at least die in Ireland." _______________________________________________________

On Tue, Apr 08, 2008 at 03:47:05PM -0600, Spencer Parker wrote:
Since I am kind of an idiot and don't know what I am doing...I am having trouble with getting network stats to work in Python. I have everything correct...but I am just not sure exactly what it is looking for. I get this error:
libvir: Xen error : invalid argument in xenHypervisorDomainInterfaceStats: invalid path, should be vif<domid>.<n>.
I guess I just need some kind of example to work from on this.
As described in the error message, try setting the path to something like "vif1.0" where 1 is the domain ID and 0 is the interface number. You can enumerate interfaces available by dumping the domain XML. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

When I pull out network stats...it just gives me a tuple. Is there any documentation on what this is actually displaying so I can format accordingly? On Wed, Apr 9, 2008 at 12:12 AM, Richard W.M. Jones <rjones@redhat.com> wrote:
Since I am kind of an idiot and don't know what I am doing...I am having trouble with getting network stats to work in Python. I have everything correct...but I am just not sure exactly what it is looking for. I get
On Tue, Apr 08, 2008 at 03:47:05PM -0600, Spencer Parker wrote: this
error:
libvir: Xen error : invalid argument in xenHypervisorDomainInterfaceStats: invalid path, should be vif<domid>.<n>.
I guess I just need some kind of example to work from on this.
As described in the error message, try setting the path to something like "vif1.0" where 1 is the domain ID and 0 is the interface number. You can enumerate interfaces available by dumping the domain XML.
Rich.
-- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v <http://et.redhat.com/%7Erjonesvirt-p2v> converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v<http://et.redhat.com/%7Erjones/virt-p2v>
-- Spencer Parker _______________________________________________________ "if you can't go to heaven, may you at least die in Ireland." _______________________________________________________

On Thu, Apr 10, 2008 at 02:58:26PM -0600, Spencer Parker wrote:
When I pull out network stats...it just gives me a tuple. Is there any documentation on what this is actually displaying so I can format accordingly?
I'm assuming this is the python bindings, in which case the tuple has these fields: http://libvir.org/html/libvirt-libvirt.html#virDomainInterfaceStatsStruct rx = receive, tx = transmit A value of -1 in any field means no data is available. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
participants (2)
-
Richard W.M. Jones
-
Spencer Parker