Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kclinden/f47981e7ce9f03b3fd425b52b61d18a9 to your computer and use it in GitHub Desktop.

Select an option

Save kclinden/f47981e7ce9f03b3fd425b52b61d18a9 to your computer and use it in GitHub Desktop.
vRO Action to create a ParaVirtual SCSI Controller Config Spec
//Description Used by vRO to create a ParaVirtual SCSI Controller Config Spec
//Inputs: [string] type, [number] nextBusNumber
//Return Type: Any
// Create SCSI controller
var controller = null;
if ( type != null && "LSI".equalsIgnoreCase( type.toUpperCase() ) == true ) {
controller = new VcVirtualLsiLogicController();
}else if(type != null && "PARA".equalsIgnoreCase( type.toUpperCase() ) == true){
controller = new VcParaVirtualSCSIController();
}else if(type != null && "SAS".equalsIgnoreCase( type.toUpperCase() ) == true){
controller = new VcVirtualLsiLogicSASController();
}
else {
controller = new VcVirtualBusLogicController();
}
controller.key = nextBusNumber;
controller.device = new Array(0);
controller.busNumber = nextBusNumber;
controller.sharedBus = VcVirtualSCSISharing.noSharing;
// Create SCSI controller ConfigSpec
var deviceConfigSpec = new VcVirtualDeviceConfigSpec();
deviceConfigSpec.device = controller;
deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.add;
return deviceConfigSpec;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment