Quantcast
Channel: VMware Communities : Discussion List - VMware vCloud Director
Viewing all articles
Browse latest Browse all 4515

Detach & Attatch virtual disk to VM

$
0
0

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

  1. Filesystem on disk did NOT get persisted.

2) Detach disk from one VM and attach it to another VM

  1. After detaching disk from one VM. I had to change attributes of disk, controller and unit number(parent and addressonparent in RASDType)
  2. After that, using the updated attributes, I have to initialise disk object again and attach it another VM.
  3. Filesystem on disk did NOT get persisted.

 

Can someone help me over here?


Viewing all articles
Browse latest Browse all 4515

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>