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

[Xen-API] get 3 hosts real-time performing metrics and show them on the same page.


  • To: xen-api@xxxxxxxxxxxxx
  • From: Will Sun <willsun810@xxxxxxxxx>
  • Date: Mon, 24 Nov 2014 10:46:11 +0800
  • Delivery-date: Mon, 24 Nov 2014 02:46:29 +0000
  • List-id: User and development list for XCP and XAPI <xen-api.lists.xen.org>

Hi all,
I build a pool includes 3 hosts : vGate7, vGate8 and vGate9. vGate9 is the master, others are slaves.
I build a page to show the host and vm performing metrics(e.g.cpu_utilization) Âon it. It works fine for the mater (vGate9).But it cannot get the slave performing metrics.

As follows in picture 1 :



In python, I use the following codes to get the CPU Usage:

       import XenAPI
       url = "" href="https://host_ip">https://host_ip"
       username = "hostname"
       password = "self_password"

       session = XenAPI.session(url)
       session.xenapi.login_with_password(username,password)


       cpu_usage = session.xenapi.host.query_data_source("OpaqueRef:35ad218e-09e2-4117-e93d-0de371265448" , 'cpu_avg')
       # OpaqueRef:35ad218e-09e2-4117-e93d-0de371265448 Âis vGate7 (slave),
       # and it will show XenAPI.Failure:['HOST_OFFLINE']Â


I attempt to make an API call to a slave (even someting trivial like pool.get_all()),I get the ['HOST_IS_SLAVE'] exception,along with the master's IP address.


The main problem is to get 3 hosts real-time performing metrics and to show them on the same page.
Is there any workaround to solve this problem?Â
The attachment is picture1, incase you cannot see it Âin the message.
Thank you in advance!


Thanks and Regards,
Will

Attachment: 01.jpg
Description: JPEG image

_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

 


Rackspace

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