Created
January 29, 2019 13:04
-
-
Save kclinden/f47981e7ce9f03b3fd425b52b61d18a9 to your computer and use it in GitHub Desktop.
vRO Action to create a ParaVirtual SCSI Controller Config Spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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