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

Re: [Xen-API] Problems in extracting VIF metrics



The unix domain socket and the tcp socket are more-or-less the same entry point 
as far as xapi is concerned, so you can do http requests such as getting the 
rrd updates on either. 

Jon

On 5 Mar 2010, at 12:25, Sane, Abhijeet wrote:

> Hi,
> 
> So does that mean that currently python API is not able to extract the  VIF 
> metrics on Citrix Xen 5.5 .
> Is there any hack to get the VIF metrics.?
> I really need the fast processing that the unix domain local socket gives  . 
> Going back to http/ tcp will slow down thing.
> 
> Let me know if some hack is possible.
> 
> 
> Regards
> Abhijeet
> 
> -----Original Message-----
> From: xen-api-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-api-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Alberto González 
> Rodríguez
> Sent: Friday, March 05, 2010 5:30 PM
> To: xen-api@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Xen-API] Problems in extracting VIF metrics
> 
> ups, i answer to you, not to list
> on 5.0:
> {'OpaqueRef:6c6d1550-aae4-0402-507a-2d78149f862a': {'io_read_kbs':
> 0.0, 'last_updated': <DateTime '19700101T00:00:00Z' at 9ff4f6c>,
> 'uuid': '70c88af0-1610-94d2-f4ea-f677ade7b8c9', 'other_config': {},
> 'io_write_kbs': 0.0},
> 'OpaqueRef:02c91dc1-ec09-3f1f-6a9d-52b5c08ec186': {'io_read_kbs': 0.0,
> 'last_updated': <DateTime '19700101T00:00:00Z' at a00342c>, 'uuid':
> '1f88014c-937c-41d0-3b64-41b75033193d', 'other_config': {},
> 'io_write_kbs': 0.0},
> 'OpaqueRef:e0f15221-0c60-8fa0-edaf-2618d5a3341a': {'io_read_kbs': 0.0,
> 'last_updated': <DateTime '19700101T00:00:00Z' at a00364c>, 'uuid':
> '9fdf3589-b2ca-7789-4139-35d94cc2c38b', 'other_config': {},
> 'io_write_kbs': 0.0},
> 'OpaqueRef:ff617072-c03e-7659-9e89-5da4f2c1e540': {'io_read_kbs': 0.0,
> 'last_updated': <DateTime '19700101T00:00:00Z' at 9ff9c8c>, 'uuid':
> '90a980e0-5d20-c377-e375-8f5361c57e0e', 'other_config': {},
> 'io_write_kbs': 0.0},
> 'OpaqueRef:51e8cfe2-e043-1743-3164-bea4263485d2': {'io_read_kbs': 0.0,
> 'last_updated': <DateTime '19700101T00:00:00Z' at 9fb04cc>, 'uuid':
> 'f93049d0-87b1-e649-0082-4815d6c641af', 'other_config': {},
> 'io_write_kbs': 0.0},
> 'OpaqueRef:a2ff5991-e1a9-a722-e5b9-793d5d3655d8': {'io_read_kbs': 0.0,
> 'last_updated': <DateTime '19700101T00:00:00Z' at a00348c>, 'uuid':
> 'd61da9b7-1de1-6e51-faac-0e5de5d3121b', 'other_config': {},
> 'io_write_kbs': 0.0},
> 'OpaqueRef:fc5f2b44-6924-6c51-e4d6-141c3c58883d': {'io_read_kbs': 0.0,
> 'last_updated': <DateTime '19700101T00:00:00Z' at a00362c>, 'uuid':
> '6156f111-0fd3-fc29-e023-440a014580f1', 'other_config': {},
> 'io_write_kbs': 0.0},
> 'OpaqueRef:98831461-318c-1dcb-23cb-6652af1a4d66': {'io_read_kbs': 0.0,
> 'last_updated': <DateTime '19700101T00:00:00Z' at a0038ac>, 'uuid':
> '7c3dc835-1c1c-89b7-209d-512618409ab7', 'other_config': {},
> 'io_write_kbs': 0.0}}
> 
> on 5.5 returns nothing
> 
> on openxenceter for vif_metrics i use http://host/rrd_updates for vif metrics
> 
> regards
> www.openxencenter.com
> 
> 2010/3/5 Sane, Abhijeet <Abhijeet_Sane@xxxxxxx>:
>> Hi ,
>> 
>> I am trying to extract VIF metrics data of all the VMs on a Citrix Xen host.
>> I wrote the code as follows to iterate the VIF sets in all VMs and from the 
>> VIF record of each VIF get the VIF metrics.
>> The VIF metrics like I/O read / write rates are not available.
>> 
>> Please guide whether I am doing something wrong.
>> 
>> 
>>        session = XenAPI.xapi_local(
>>        session.xenapi.login_with_password("root","")
>>        all = session.xenapi.VM.get_all()
>>        try:
>> 
>>                for vm in all:
>>                        try:
>>                                record = session.xenapi.VM.get_record(vm)
>>                                if  not record["is_control_domain"] and  not 
>> record["is_a_template"] and record["resident_on"]
>>  :
>>                                        domid = record["domid"]
>>                                        name = record["name_label"]
>>                                        vif_set = 
>> session.xenapi.VM.get_VIFs(vm)
>>                                        for vif in vif_set:
>>                                                                vif_metrics = 
>> session.xenapi.VIF.get_metrics(vif)
>>                                                vif_rec = 
>> session.xenapi.VIF.get_record(vif)
>>                                                mac_addr = vif_rec["MAC"]
>>                                                metrc =  
>> session.xenapi.VIF_metrics.get_record(vif_rec["metrics"])
>>                                                                # I have 
>> removed the code to extract io_read and io_write at this point of time .
>>                                        loca_str =  '%s,%s,%s,%s,%s\n' % 
>> (domid , name , mac_addr ,io_read ,io_write)
>>                                        csv_string = csv_string + loca_str
>> 
>>                                domid = ""
>>                                name = ""
>>                                mac_addr = ""
>>                                io_read = ""
>>                                io_write = ""
>> 
>>                        except Exception, e:
>>                                print "Exception 1",e
>>                                loca_str =  '%s,%s,%s,%s,%s\n' % (domid , 
>> name , mac_addr ,io_read ,io_write)
>>                                csv_string = csv_string + loca_str
>> 
>>        except Exception ,e:
>>                print "Exception 2",e
>>            loca_str =  '%s,%s,%s,%s,%s\n' % (domid , name , mac_addr 
>> ,io_read ,io_write)
>>            csv_string = csv_string + loca_str
>> 
>> 
>> 
>> 
>> 
>> Program output is as follows
>> -------------------------------
>> 
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:96f906d4-7826-97cc-c85e-9073a9271b02']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:6b85fae4-3e72-5f7a-7dab-2765ca9fb659']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:754f4f2e-566c-945b-7e60-479c8b19abde']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:fab22cb7-8cee-857f-ad11-77eb7a331717']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:80c3d61b-802f-a4a2-4bd7-dca9c7069766']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:09cd33b9-f1d3-f37c-37df-1e48ed029785']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:f8d0bc81-a695-a471-ac49-e70b2e23da99']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:7583302f-0e7b-8cf3-d1b3-4f661fad30cd']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:29fd1bbf-be28-5481-361d-639c3fcc79a2']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:bac40158-2bbe-7b19-fb9f-8d6435599f12']
>> Exception 1 ['HANDLE_INVALID', 'VIF_metrics', 
>> 'OpaqueRef:82db2114-6376-43ad-2f06-255841a1a3aa']
>> 2,xen-w2k3-v4,de:3a:0c:0e:b0:b2,,
>> 1861,xen-w2k3-v7,16:20:b6:0b:05:5c,,
>> 1866,win2k8x64,ee:4c:51:d4:d9:3f,,
>> 1864,xen-w2k3-v5,46:cf:2f:59:99:4d,,
>> 1863,xen-w2k3-v6,62:b6:09:53:aa:f4,,
>> 1867,xen-win2k-v3,8a:a7:b9:31:9e:42,,
>> 1,xen-winxp-v2,6e:19:cc:4c:73:9f,,
>> 4,xen-vm1,ea:6c:34:15:62:6f,,
>> 3,xen-vm2,12:4f:f3:2e:62:89,,
>> 2,RHEL_5.3_V11,a6:6d:78:97:ee:d3,,
>> 1,xen-rlnx53-v1,2a:f9:c4:18:3e:40,,
>> 
>> 
>> 
>> 
>> 
>> 
>> Regards
>> Abhijeet
>> 
>> 
>> _______________________________________________
>> xen-api mailing list
>> xen-api@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/mailman/listinfo/xen-api
>> 
> 
> _______________________________________________
> xen-api mailing list
> xen-api@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/mailman/listinfo/xen-api
> 
> 
> _______________________________________________
> xen-api mailing list
> xen-api@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/mailman/listinfo/xen-api


_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.