WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

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

To: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-API] No able to extract Citrix Xen 'VCPU Priority' weight and 'CPU Cap ' using python API
From: George Shuklin <george.shuklin@xxxxxxxxx>
Date: Mon, 11 Oct 2010 17:40:55 +0400
Delivery-date: Mon, 11 Oct 2010 06:41:12 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=khAcwmpnEAlRWvnIRi9DaDg7P7kwMTcw/r5icgerse0=; b=gI2DBow1gnS2Z8wovN/WfIdkciLeLyNa62reUTptjJh2eeLdM1fBCu5jA6k4yv+a6U BY5yVVNzRnyLOsLn9KyfuXCaZug50EHVCnStB+3Rah6GFwK/7vNQIk1OTfm81YXK+YZB 6h3FURmvdpDthPjcQ+DID/YwRpOGo1Q8gLAuY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=pcntibtqXTbqKlcM60CyP2pHy+lq2cyBoVb8Ly0Vo5B5N1yhfWXANEFYHGRFyGoYpz ZkwFbDB+tCoxN6YS8tgNsuCebFfgQW/jiJr2/SvwpEirVtvw8d+M4QVba6fuM8qQg0oC DZOlOu3Najn0jmIM0GE9Q/1wRRa4j3Pap7Z8U=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CACE9D90AB02DA4F8DE4C45DB43BA3451321F0B85B@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <CACE9D90AB02DA4F8DE4C45DB43BA3451321F0B85B@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
I think all VCPUs_param (hash) is a single field, not list.

Try to 'print hash' and look what happens.


В Пнд, 11/10/2010 в 08:30 -0500, Sane, Abhijeet пишет:
> 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

<Prev in Thread] Current Thread [Next in Thread>