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

[Xen-API] Strange CPU utilization values of Dom0


  • To: xen-api@xxxxxxxxxxxxxxxxxxx
  • From: kushal waikar <kushalwaikar@xxxxxxxxxxx>
  • Date: Fri, 20 Feb 2009 00:03:10 +0530 (IST)
  • Delivery-date: Fri, 20 Feb 2009 05:54:25 -0800
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=A4+jyf+UkMG21vPdEmFEuLGQgzuD4PBA9MOkEERmzTvxS2cmYBmmmuNOaDW9pRSE5rbC0EgXKnrk9Z6Rp6gGCMRPk0Dd8jd6zEZjwr3UXQB+tOY6wERJMAggzdiB7liwxorO0i6IJYk8JdoCCDb1LBSpjkYEKf3QKea1FKq//mw=;
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

Hi,
    I am trying to fetch CPU utilization of Dom0 using XenAPI & Python...I am not getting any error in my code...But Whatever CPU utilization I am getting from my Dom0 is having value less than one... But actual CPU utilization seen under Virtual Machine Manager is in range of 1 to 100...It never exceeds 100 since it is percentage... If I multiply the values getting here by 100 then sometimes my CPU utilization is exceeding above 100, which is impossible practically (remember it is %age thts it should be <=100)...

 My questions are-->

1. What kind of manipulation should be carried out on the vales obtained  through  my code to get the correct CPU utilization of Dom0....? 

2. Any other way to get correct values ?
 
CODE AND ITS OUTPUT IS GIVEN BELOW-->

Test4.py-->
"
from xen.xm.XenAPI import Session
import time
session = None
#_________________________________________________________________________________
def print_cpu_utilization_Dom0():
    cpus = session.xenapi.host_cpu.get_all()
           for i in range(1,100):
             for cpu in cpus:
            load = session.xenapi.host_cpu.get_utilisation(cpu)
            print "HOST CPU USAGE :%s"% str(load)
        time.sleep(1)
#________________________________________________________________________________
################### MAIN ######################
session=Session('httpu:///var/run/xend/xen-api.sock')
session.xenapi.login_with_password('','')
print_cpu_utilization_Dom0()
"

Output-->
[root@localhost ~]# python Test4.py
HOST CPU USAGE :0.316815906659
HOST CPU USAGE :0.316815906659
HOST CPU USAGE :0.344911681094
HOST CPU USAGE :0.344911681094
HOST CPU USAGE :0.133510673285
HOST CPU USAGE :0.133510673285
HOST CPU USAGE :0.148574903296
HOST CPU USAGE :0.148574903296
HOST CPU USAGE :0.224662819565
HOST CPU USAGE :0.224662819565
HOST CPU USAGE :0.266612999348
HOST CPU USAGE :0.266612999348
HOST CPU USAGE :0.231213527902
HOST CPU USAGE :0.231213527902
HOST CPU USAGE :0.188630822236
HOST CPU USAGE :0.188630822236
HOST CPU USAGE :0.193651973968
HOST CPU USAGE :0.193651973968
HOST CPU USAGE :0.263178127917
HOST CPU USAGE :0.263178127917
HOST CPU USAGE :0.302399599513
HOST CPU USAGE :0.302399599513
HOST CPU USAGE :0.497252504981
HOST CPU USAGE :0.497252504981
HOST CPU USAGE :0.163378468208
HOST CPU USAGE :0.163378468208
HOST CPU USAGE :0.124162530626
HOST CPU USAGE :0.124162530626
HOST CPU USAGE :0.123246183129
HOST CPU USAGE :0.123246183129
HOST CPU USAGE :0.135026907489
HOST CPU USAGE :0.135026907489
HOST CPU USAGE :0.123061438383
HOST CPU USAGE :0.123061438383
HOST CPU USAGE :0.12078425723
HOST CPU USAGE :0.12078425723
HOST CPU USAGE :0.121356409397
HOST CPU USAGE :0.121356409397
HOST CPU USAGE :0.141611269574
HOST CPU USAGE :0.141611269574
HOST CPU USAGE :0.122894492713
HOST CPU USAGE :0.122894492713
HOST CPU USAGE :0.123339760286
HOST CPU USAGE :0.123339760286
HOST CPU USAGE :0.140426165452
HOST CPU USAGE :0.140426165452
HOST CPU USAGE :0.197982342116
HOST CPU USAGE :0.197982342116
HOST CPU USAGE :0.143604339704
HOST CPU USAGE :0.143604339704
HOST CPU USAGE :0.121329276765
HOST CPU USAGE :0.121329276765
HOST CPU USAGE :0.122262038529
HOST CPU USAGE :0.122262038529
HOST CPU USAGE :0.142657108504
HOST CPU USAGE :0.142657108504
HOST CPU USAGE :0.144221052165
HOST CPU USAGE :0.144221052165
HOST CPU USAGE :0.133349764081
HOST CPU USAGE :0.133349764081
HOST CPU USAGE :0.13905321165
HOST CPU USAGE :0.13905321165
HOST CPU USAGE :0.132959577854
HOST CPU USAGE :0.132959577854
HOST CPU USAGE :0.133520591036
HOST CPU USAGE :0.133520591036
HOST CPU USAGE :0.121967122681
HOST CPU USAGE :0.121967122681
HOST CPU USAGE :0.115512335477
HOST CPU USAGE :0.115512335477
HOST CPU USAGE :0.121247277861
HOST CPU USAGE :0.121247277861
HOST CPU USAGE :0.121162922075
HOST CPU USAGE :0.121162922075
HOST CPU USAGE :0.199625023418
HOST CPU USAGE :0.199625023418
HOST CPU USAGE :0.602277504726
HOST CPU USAGE :0.602277504726
HOST CPU USAGE :0.339684598183
HOST CPU USAGE :0.339684598183
HOST CPU USAGE :0.113853948091
HOST CPU USAGE :0.113853948091
HOST CPU USAGE :0.201450235716
HOST CPU USAGE :0.201450235716
HOST CPU USAGE :0.15538562802
HOST CPU USAGE :0.15538562802
HOST CPU USAGE :0.121653406955
HOST CPU USAGE :0.121653406955
HOST CPU USAGE :0.123282728145
HOST CPU USAGE :0.123282728145
HOST CPU USAGE :0.128334557817
HOST CPU USAGE :0.128334557817
HOST CPU USAGE :0.13890167314
HOST CPU USAGE :0.13890167314
HOST CPU USAGE :0.14179786135
HOST CPU USAGE :0.14179786135
HOST CPU USAGE :0.182375532671
HOST CPU USAGE :0.182375532671
HOST CPU USAGE :0.232512245232


Thanks,
Kushal Waikar
kushalwaikar@xxxxxxxxxxx



Add more friends to your messenger and enjoy! Invite them now.
_______________________________________________
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®.