Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: API

XenAPI & DomU Memory Usage

 

 

Xen api RSS feed   Index | Next | Previous | View Threaded


frederik at cluttr

Apr 25, 2012, 6:10 AM

Post #1 of 3 (656 views)
Permalink
XenAPI & DomU Memory Usage

Hi,

I'm running XCP 1.5 Beta with xen-tools installed in the DomU.
Both XenCenter (6.0.2) as xsconsole show the actual memory usage of the VM.
However the memory record for the vm's guest_metrics is empty.

I was wondering whether that memory usage is retrievable through the API or
not?
I know it's in the RRD's, but if I can get it through the API that'd be so
much more consistent / convenient.

Any help / direction very much appreciated. Thank you.


Kind regards,
Frederik


Jonathan.Ludlam at eu

May 1, 2012, 5:57 AM

Post #2 of 3 (605 views)
Permalink
Re: XenAPI & DomU Memory Usage [In reply to]

You can use the API call 'VM.query_data_source' to query a single RRD data source through the API.

e.g.

[root [at] st2 ~]# python
Python 2.4.3 (#1, Sep 21 2011, 20:06:00)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> s=xmlrpclib.Server("http://localhost/")
>>> s.session.login_with_password("root","root")
{'Status': 'Success', 'Value': 'OpaqueRef:1d1f04f1-f01d-a585-6e27-30ee9da3da2f'}
>>> sess='OpaqueRef:1d1f04f1-f01d-a585-6e27-30ee9da3da2f'
>>> vm=s.VM.get_by_uuid(sess,'c4d25869-386d-4238-2bc4-851b021a14e2')['Value']
>>> s.VM.query_data_source(sess,vm,'memory')
{'Status': 'Success', 'Value': 268435456.0}

This is, of course, only recommended if it's all you want. Don't query all data sources on all VMs on all hosts every five seconds like this - use the RRDs :-)

Jon

On 25 Apr 2012, at 14:10, Frederik Van Hecke wrote:

> Hi,
>
> I'm running XCP 1.5 Beta with xen-tools installed in the DomU.
> Both XenCenter (6.0.2) as xsconsole show the actual memory usage of the VM.
> However the memory record for the vm's guest_metrics is empty.
>
> I was wondering whether that memory usage is retrievable through the API or not?
> I know it's in the RRD's, but if I can get it through the API that'd be so much more consistent / convenient.
>
> Any help / direction very much appreciated. Thank you.
>
>
> Kind regards,
> Frederik
> _______________________________________________
> Xen-api mailing list
> Xen-api [at] lists
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


_______________________________________________
Xen-api mailing list
Xen-api [at] lists
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


giuseppe.civitella at gmail

May 2, 2012, 3:54 AM

Post #3 of 3 (610 views)
Permalink
Re: XenAPI & DomU Memory Usage [In reply to]

Hi all,

I've got a similar problem trying to retrive xenapi's values. While
I'm able to fetch total and used memory using RRD's, I'm not yet able
to retrive disk's data using VM_guest_metrics.
I'm referring to this page:
http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/index.html?c=VM_guest_metrics
In "disks" field I was expecting to find "total disk / used disk"
values but I'm not.
Any idea about the missing value?

Thanks




2012/5/1 Jonathan Ludlam <Jonathan.Ludlam [at] eu>:
> You can use the API call 'VM.query_data_source' to query a single RRD data source through the API.
>
> e.g.
>
> [root [at] st2 ~]# python
> Python 2.4.3 (#1, Sep 21 2011, 20:06:00)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import xmlrpclib
>>>> s=xmlrpclib.Server("http://localhost/")
>>>> s.session.login_with_password("root","root")
> {'Status': 'Success', 'Value': 'OpaqueRef:1d1f04f1-f01d-a585-6e27-30ee9da3da2f'}
>>>> sess='OpaqueRef:1d1f04f1-f01d-a585-6e27-30ee9da3da2f'
>>>> vm=s.VM.get_by_uuid(sess,'c4d25869-386d-4238-2bc4-851b021a14e2')['Value']
>>>> s.VM.query_data_source(sess,vm,'memory')
> {'Status': 'Success', 'Value': 268435456.0}
>
> This is, of course, only recommended if it's all you want. Don't query all data sources on all VMs on all hosts every five seconds like this - use the RRDs :-)
>
> Jon
>
> On 25 Apr 2012, at 14:10, Frederik Van Hecke wrote:
>
>> Hi,
>>
>> I'm running XCP 1.5 Beta with xen-tools installed in the DomU.
>> Both XenCenter (6.0.2) as xsconsole show the actual memory usage of the VM.
>> However the memory record for the vm's guest_metrics is empty.
>>
>> I was wondering whether that memory usage is retrievable through the API or not?
>> I know it's in the RRD's, but if I can get it through the API that'd be so much more consistent / convenient.
>>
>> Any help / direction very much appreciated. Thank you.
>>
>>
>> Kind regards,
>> Frederik
>> _______________________________________________
>> Xen-api mailing list
>> Xen-api [at] lists
>> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
>
>
> _______________________________________________
> Xen-api mailing list
> Xen-api [at] lists
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

_______________________________________________
Xen-api mailing list
Xen-api [at] lists
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

Xen api RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.