Archive for the ‘XenServer’ Category

Xen Server 5.0.0 SDK relative

March 29th, 2010 jmguilla No comments

A little post just because I ruined my day trying to get virtual machine’s mac addresses, ip addresses and heartbeat and because the right way to do it is not really enlightened in the SDK’s documentation:

Get the com.xensource.xenapi.VM you want to get information from. For ip addresses, getVMGuestMetrics method and getNetworks, it will give you all network related information, ip address included. For mac address, you have a public getter on com.xensource.xenapi.VIF object, that you can have from your virtual machine thanks to the method getVIFs ( ok, this one is the easier ). For the heartbeat, once you have the com.xensource.xenapi.VMGuestMetrics of the appropriate virtual machine, a getLive method will give you the virtual machine status ( true, the vm is running normally, false, it is experiencing troubles, probably with cpu charge )…