pyvmomi-community-samples
pyvmomi-community-samples copied to clipboard
Sample request: Add existing disk to VM
Hello all. I'm having trouble trying to figure out how to automate the process of adding a hard disk from one VM to another.
I have a VM called A and a VM called B. VM B has some software installations on separate hard disks. I would like to add one of the disks on VM B as a new disk on VM A so I can use that software on VM A. I'd like to be able to do this even if VM B is powered off. VM B's disk needs to continue to exist; I'm not looking to move the disk from B to A, I'd like to share/copy it.
This seems possible in Vsphere's GUI ("Edit Settings", "Add", "Existing hard disk"), but can it be automated with pyvmomi?