Background:
In a project, I need use reconfigVM_task
to delete all the virtualDisks of one virtualMachine, and then, I need continue to run the second reconfigVM_task
which using other configuration file to add multiple virtualDisks to this virtual machine.
Problem:
The firstTask(delete vm's all virtualDisk) works fine, but after that the secondTask(add multiple virtualDisks failed). VCENTER keep showing "Cannot complete operation, becuase the file or folder [xxxdatastore] vmName/virtualDiskName.vmdk is already exists"
.
I have checked, vcenterURL
/folder showing the virtualDisk has been deleted already. If I manually refresh vsphere web client, then redo the add virtualDisk, it works.
Question:
Anyone know how to solve the problem
"Add virtualDisks but has error 'Cannot complete operation because xxx.vmdk already exist"
?OR anyone know how to use
vijava
api to refresh datastore make the delete is able been recognize?