Hi All,
I have added disk to Virtual Machine using "Add Disk" workflow. but i couldn't find workflow to remove the added disk. Can anyone help me to figure out?
Thanks in advance.
Hi
Welcome to the communities.
If you you wan to remove completely on setting you will find number of /p>
Hard drive attached to this vm , so make vm offline & remove HDD .
Thanks for the response.
I want to remove one disk out of 3 disk attached to VM. Can you share script if you have? or share API?
I tried looking into API guide but i could not find any method to remove particular virtual disk attached to Virtual Machine.
Thanks again.
Hello,
At first you need to power off Virtual machine
and then remove virtual disk.
Hope will help.
Take a look at action 'com.vmware.library.vc.vm.spec.config.device.createVirtualDiskFlatVer2ConfigSpec()', used in 'Add Disk' workflow.
Within it, we prepare an instance of 'VcVirtualDeviceConfigSpec' class. In 'Add Disk' workflow, operation and fileOperation properties are initialized to add/create. According to the API docs listed below, there are also values for remove/destroy operations.
Should be a good starting point for experiments.
Thanks IIian, i already tried that. I'm able to remove virtual Hard disk from VM, but i'm not able to delete .vmdk file, which resides in datastore. I tried with VcVirtualDeviceConfigSpecFileOperation object but no luck.
Maybe that's the time you want to try VMware Onyx?! Onyx – VMware Labs
Connect to your vCenter using Onyx and you can record what happens if you manually delete a Disk from VM. Here tje project page: VMware Project Onyx
Regards,
Chris
Could you please share the script to remove virtual hard disk from VM