VMware {code} Community
iamtez
Contributor
Contributor

Is it possible to create a snapshot of a VM using the SDK without connecting to the VC?

Hi,

I already have implemented the capability to create a snapshot of a VM using the VI SDK to first authenticate with the VC and then issue the snapshot command using the ManagedObjectReference.

I wanted to know if I could avoid the connection to the VC and instead using the SDK to connect directly to the ESX and create a snapshot of a VM on the ESX?

If this is not the right place to ask this question, please do let me know which community do I post this question under?

Thanks.

0 Kudos
2 Replies
lamw
Community Manager
Community Manager

You're posting in the VMware VIX forum, if your question is not regarding VIX, then you're in the wrong forum. It sounds like you're asking a question regarding the general VI SDK, you'll want to post here:

If you're interested in other lanaguage bindings to the VI SDK/vSphere SDK, you can get a quick overview of the various forums here:

To answer your question, you don't need to connect to vCenter to initiate a snapshot, you just need to get a reference to a VM and that can be done either at vCenter OR to a individual ESX(i) host. Once you get a reference, then you'll be able to call CreateSnapshot_Task() as you would within vCenter. You would want to use vCenter if you're managing dozen or few hundred ESX(i) host and you don't want to connect to each one, vCenter will know exactly where your VM is at at a much higher level.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

If you find this information useful, please award points for "correct" or "helpful".

iamtez
Contributor
Contributor

I will use the other forum. Thanks a lot. I will mark the question as answered in here.

0 Kudos