jeep2004
Enthusiast
Enthusiast

detach vmdk

hi

need to detach (not delete) a specific vmdk  but not the 0:0 ( os system)

I have Variables with vmdk that I need to detach 

how can I fix that to detach  only my vmdk variables  ?

for each (device in newVM.config.hardware.device)

 

this is my script  , but is detach all vmdk on the vm

#########################################

{
    if (device instanceof VcVirtualDisk)
    {
        var spec = new VcVirtualMachineConfigSpec();
        var configSpec = new VcVirtualDeviceConfigSpec();
        configSpec.device = device;
        configSpec.operation = VcVirtualDeviceConfigSpecOperation.remove;
        spec.deviceChange = [configSpec];
        
        newVM.reconfigVM_Task(spec);
}
    }
##############################
0 Kudos
0 Replies