VMware {code} Community
ts2231
Contributor
Contributor
Jump to solution

Full Clone using vSphere API

Hi All, 

 

I'm trying to use this method in the vSphere web services API to create a full clone. According to the API documentation, if you do not set the snapshot field in the spec parameter  of the CloneVM_Task method, then the clone is based off of the virtual machine's current configuration (full clone) as opposed to the current snapshot of the virtual machine (linked clone). After calling this method, without setting the snapshot parameter, I'm getting the error message A specified parameter was not correct: spec.snapshot. Based on the documentation, I was under the impression that spec.snapshot was an optional parameter. I also tried setting the spec.location.host.capability.cloneFromSnapshotSupported field to false, but still getting the same error. Is there anyway to make a full clone, without requiring a snapshot, using the CloneVM_Task method or any other method in the API? Also, is the spec.snapshot required, despite being listed as "Need not be set" in the docs? Thank you all 🙂

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
ts2231
Contributor
Contributor
Jump to solution

RESOLVED: The problem was that earlier in the code, the CloneSpec.location.disMoveType field was being set to createNewChildDiskBacking, which necessistates the CloneSpec.snapshot field be set. I was able to create a full clone without having to set the snapshot by not setting the diskMoveType field. 

View solution in original post

0 Kudos
1 Reply
ts2231
Contributor
Contributor
Jump to solution

RESOLVED: The problem was that earlier in the code, the CloneSpec.location.disMoveType field was being set to createNewChildDiskBacking, which necessistates the CloneSpec.snapshot field be set. I was able to create a full clone without having to set the snapshot by not setting the diskMoveType field. 

0 Kudos