Hi,
I have a simple question : how can i retrieve the memory reservation for a virtual machine ?
I get the actual memory with "myvar = VirtualMachine.config.hardware.memoryMB; " but for reservation i don't know.
I've tested : "myvar2 = VirtualMachine.memoryAllocation.VcResourceAllocationInfo.reservation;" but it doesen't work.
Best regards
Using Managed object browser I figured out: You should be able to access the reservation settings for a VM object via the attribute path
resourceConfig.memoryAllocation.reservation
You can use Onyx (http://labs.vmware.com/flings/onyx) to figure out the proper API call...
Cheers,
Joerg
In fact, i want to display the reservation value.
I'm using onyx who help me to set the reservation, but i don't know to how to get the value.
If i'm right, Onyx only display something on change configuration ?
Regards
Good point. Onyx indeed helps mainly for changing configuration settings, not just to view them.
To view the attributes, you can use the managed object browser in vCenter. Maybe the onyx output at least might point you in the proper direction.
Cheers,
Joerg
Using Managed object browser I figured out: You should be able to access the reservation settings for a VM object via the attribute path
resourceConfig.memoryAllocation.reservation
Yes
I searched in the API explorer and the online documentation before posting but many things i don't understand
It works ! My real problem is to find and understand objects.
Thanks Joerg
Regards
Cool, thanks for the feedback!
IMHO there is no real way to "learn" the vCenter API and the data models, it's just experience. Use the managed object browser (MOB) extensively, and just "browse" around there. Try to align the attributes and values you see in the MOB with what you see in the vSphere Client.
And consider to buy this book: http://www.amazon.com/VMware-VI-vSphere-SDK-Infrastructure/dp/0137153635
It's written for vCenter 4, but all the content is still valid, it just misses some new things in version 5.
Cheers,
Joerg
Many thanks !
I will see that.
Regards