简体   繁体   中英

Marking VM as Template and cloning VM using VI SDK

I'm writing application using VI SDK in java. My current problem is that, when i try to mark a certain virtual machine as Template (using the method markAsTemmplate()), i get an error "com.vmware.vim25.NotSupported" and i VClient error that says:"the operation is not supported on the object". The same error occurs when trying to clone a virtual machine.

I know that this may have something to do with whether you are running on ESX or VC.

I'm running on ESXi, but from VClient, i am able to do the clone task(even mark as Template), but from my application, i simply cannot...

Any advice would be appreciated.

Ps If someone needs to see my code, i can include that also in this post. But the main thing is to see if this is at all possible.

This will fail if you are connecting directly to a ESX or ESXi host and not a vCenter instance. The requirements to mark a VM as a template are the same programmatically as they are from the vSphere Client.

You're getting a NotSupported fault from the VI SDK, which from the VMware documentation states clearly:

http://pubs.vmware.com/vsphere-51/topic/com.vmware.wssdk.apiref.doc/vmodl.fault.NotSupported.html

"Thrown if the method is not supported on the server. Not all methods are supported on all servers (for example, an ESX Server host supports less functionality than a VirtualCenter server). A feature might also be disabled due to missing liceneses."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM