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

Re: [Xen-API] No able to extract Citrix Xen 'VCPU Priority' weight and 'CPU Cap ' using python API


  • To: "Sane, Abhijeet" <Abhijeet_Sane@xxxxxxx>
  • From: Jonathan Ludlam <Jonathan.Ludlam@xxxxxxxxxxxxx>
  • Date: Tue, 12 Oct 2010 18:07:31 +0100
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 12 Oct 2010 10:10:29 -0700
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
  • Thread-index: ActqL/Vy9V+BESSkQ3uQbVm0dGHzbQ==
  • Thread-topic: [Xen-API] No able to extract Citrix Xen 'VCPU Priority' weight and 'CPU Cap ' using python API

Hi Abhijeet,

VCPUs_params is on the VM object, not the VM_metrics object.

HTH,

Jon

On 11 Oct 2010, at 14:30, Sane, Abhijeet wrote:

> Hi ,
> 
> I am trying to extract the 'VCPU Priority Weight' and 'CPU Cap' that are set 
> to a Citrix DomU (VM) using the python API.
> 
> The xe command line shows the following output 
> 
> ---------------------------------------------------------------------------------------------------------------------------
> 
> 
> -bash-3.2#  xe vm-param-get  uuid=f31d8439-96dc-3d5b-716e-319e6d7b0d1c 
> param-name=VCPUs-params
> cap: 80; mask: 5,6; weight: 1024
> 
> ---------------------------------------------------------------------------------------------------------------------------
> I am unable to get these values using the Citrix Xen Python API.
> 
> The python code snippet look like the following
> 
> <code snippet>
>                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"]:
>                                        vm_metrics = record["metrics"]
>                                        vm_metric = 
> session.xenapi.VM_metrics.get_record(vm_metrics)
>                                        try:
>                                                hash =  
> vm_metric["VCPUs_params"]
>                                                print "Weight " , 
> hash["weight"] , "CAP" ,  hash["cap"] , "Mask",  hash["mask"]
>                                        except Exception ,em:
>                                                print em
> 
> </code snippet>
> 
> Al I  get is a exception and absolutely no data.. 
> I think I am looking at the wrong class or doing something wrong.
> 
> Please guide.
> 
> 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


 


Rackspace

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