Hi,
vCloud director version 8.10
Use case:
I am trying to detach a VirtualDisk from VM and attach it to same or another(which can be in same or another vApp in samd VDC) VM. I am using Java SDK for that. I used references from sample programs given with SDK, but not able to do it.
Approach:
For creating a new disk, I am using VirtualDisk class.
For attaching disk to VM, I am getting list of existing disks using VM.getdisks() methos and then add newly created/detached disk in this list and call VM.updateDisks method by passing updated disk list.
For detaching disk to VM, I am getting list of existing disks using VM.getdisks() methos and then remove a disk from this list and call VM.updateDisks method by passing updated disk list.
Observations.
1) Detach/Attach disk to same VM
- Filesystem on disk did NOT get persisted.
2) Detach disk from one VM and attach it to another VM
- After detaching disk from one VM. I had to change attributes of disk, controller and unit number(parent and addressonparent in RASDType)
- After that, using the updated attributes, I have to initialise disk object again and attach it another VM.
- Filesystem on disk did NOT get persisted.
Can someone help me over here?