fog / fog-vsphere

Fog for vSphere
MIT License
36 stars 63 forks source link

fix clone vm without datastore relocation #135

Closed timogoebel closed 6 years ago

timogoebel commented 6 years ago

Fixes #132.

This commit checks if the new_volume has a datastore attribute before trying to relocate it.

The error in the issue happens, because this is passed to vSphere (because new_volume.datastore is nil):

relocation_spec[:disk] -> [{:diskId=>nil, :datastore=>nil}]
timogoebel commented 6 years ago

@scambra: Do you mind taking a look? Does this still work with your use case?

chris1984 commented 6 years ago

Thanks @timogoebel tested and working

kartikaydw commented 5 years ago

Hey There,

I am getting below error while attaching the disk. Any Pointers?

**Required property id is missing from data object of type ID

while parsing serialized DataObject of type vim.vslm.ID at line 1, column 255

while parsing call information for method AttachDisk_Task at line 1, column 177

while parsing SOAP body at line 1, column 167

while parsing SOAP envelope at line 1, column 0

while parsing HTTP request for method attachDisk on object of type vim.VirtualMachine at line 1, column 0**

Code snippet.

 vm.AttachDisk_Task(
    diskId: did,
    datastore: vmdk_datastore,
    controllerKey: 1000,
    unitNumber: 14,

)