første endring registrert
[virt-orchestrator.git] / vFLOWER / content / Actions / com.vmware.library.vc.vm.spec.config.device / createVirtualScsiControllerConfigSpec.action.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <dunes-script-module name="createVirtualScsiControllerConfigSpec" result-type="Any" api-version="3.1.0" id="35a5af26-2afb-484e-a107-b2cbcd8b3984" version="0.2.0" allowed-operations="fv">
3     <description>
4 Create a new VimVirtualDeviceConfigSpec for a VimVirtualSCSIController
5 The VirtualSCSIController data object type represents a SCSI controller in a virtual machine.
6     </description>
7
8     <param n="type" t="string">Controller type ("LSI" ,"PARA","SAS"or "BUS")</param>
9
10     <script encoded="false">
11 // Create SCSI controller
12 var controller = null;
13 if ( type != null  &amp;&amp;  "LSI".equalsIgnoreCase( type.toUpperCase() ) == true )  {
14         controller = new VcVirtualLsiLogicController();
15 }else if(type != null  &amp;&amp;  "PARA".equalsIgnoreCase( type.toUpperCase() ) == true){
16         controller = new VcParaVirtualSCSIController();
17 }else if(type != null  &amp;&amp;  "SAS".equalsIgnoreCase( type.toUpperCase() ) == true){
18         controller = new VcVirtualLsiLogicSASController();
19 }
20 else  {
21         controller = new VcVirtualBusLogicController();
22 }
23 controller.key = 0;
24 controller.device = new Array(0);
25 controller.busNumber = 0;
26 controller.sharedBus = VcVirtualSCSISharing.noSharing;
27 // Create SCSI controller ConfigSpec
28 var deviceConfigSpec = new VcVirtualDeviceConfigSpec();
29 deviceConfigSpec.device = controller;
30 deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.add;
31
32 return deviceConfigSpec;
33     </script>
34 </dunes-script-module>