Hi All,
I have ESXi 4.0 server with vSphere 4.0 installed. I'm writing a web application in C# and I need to be able to display all the available vm machines and all snapshots, as well as their current state (shut down, started, etc.)
Can someone give me some same code to do this? I've tried reading the documentation on vmware site but found it very confusing.
Thanks to you all for your time.
A.
Hi A,
The best place to get your hands on vSphere SDK is : http://communities.vmware.com/docs/DOC-7270
Basically to retrieve all the VMs and their corresponding snapshots, you would need to use PropertyCollector managed object and fetch all the VMs. To retrieve the snapshots, you would need to retrieve the snapshot property of the VM managed object. There are sample codes available in C#, which will do help you to perform these mentioned things.
http://communities.vmware.com/docs/DOC-10028
http://communities.vmware.com/docs/DOC-10030
I hope this will help you to understand SDK better.
Angela.
Thanks very much Angela, this is what I was after. I'll download the SDK and update this post on my progress.
Your help is much appreciated.
A.
Update: I downloaded the SDK for Web Services and found that the sample simpleclient actually does what I want - connect to the ESXi server and return a list of all objects there. Thanks again.
John