vRO Remove CD ROM Workflow

The following can be used to remove a CDROM drive from a powered on Virtual Machine using vRO, vRealize Orchestrator.

Paste the following into a Scriptable task and create an input Parameter of type VC:VirtualMachine called workflowVM

 


var configSpec = new VcVirtualMachineConfigSpec();
var deviceConfigSpecs = new Array();
var deviceConfigSpec = new VcVirtualDeviceConfigSpec();
var devices = workflowVM.config.hardware.device;

for ( var ii in devices) {
var device = devices[ii];
if ( device instanceof VcVirtualCdrom) {
deviceConfigSpec.device = device;
deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.remove;
deviceConfigSpecs.push (deviceConfigSpec);
configSpec.deviceChange = deviceConfigSpecs
}
}

workflowVM.reconfigVM_Task(configSpec);

Advertisement

One thought on “vRO Remove CD ROM Workflow

  1. Hi Daniel,
    Just wondering how much details you have looked into device configuration via vRO. I interested in seeing if I can use something like GEFMachineCustomizationStorage as I want to assign driveletter and label to a disk when it is created via vRO. Do you know how best to accomplish this , any suggestions would be greatly appreciated.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s