Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

How to add parameter to Onyx created vCO Script (Add NIC to Guest)

$
0
0

Hi,

 

I have the following output from Onyx that I captured while adding an additional NIC to one of my Guests.

I found how to change the script to make it run in vCO, but I need help to understand how to set or find the following two parameters:

 

spec.deviceChange[0].device.backing.port.switchUuid = "27 21 1c 50 5d 02 8e 0c-08 a7 b4 37 f0 58 49 c0";
spec.deviceChange[0].device.backing.port.portgroupKey = "dvportgroup-8392";

 

How can I get vCO to ask me these two parameters from input?

 

I know that the portgroupKey corresponds to the Network I want to connect the Guest to. But I have no idea how to input my APP1-HSV Network and make vCO translate it into the portgroupKey.

 

The same is true for the switchUuid parameter.

 

Please somebody help!!

 

Here the complete script from Onyx which is already adapted to run in vCO but with switchUuid and portgroupKey not asked from input:

 

var managedObject = vm;
// ------- ReconfigVM_Task -------

var spec = new VcVirtualMachineConfigSpec();
//spec.changeVersion = "2012-09-14T13:58:04.147363Z";
spec.deviceChange = System.getModule("com.vmware.onyx").array(VcVirtualDeviceConfigSpec, 1);
spec.deviceChange[0] = new VcVirtualDeviceConfigSpec();
spec.deviceChange[0].operation = VcVirtualDeviceConfigSpecOperation.add;
spec.deviceChange[0].device = new VcVirtualVmxnet3();
spec.deviceChange[0].device.key = -100;
spec.deviceChange[0].device.backing = new VcVirtualEthernetCardDistributedVirtualPortBackingInfo();
spec.deviceChange[0].device.backing.port = new VcDistributedVirtualSwitchPortConnection();
spec.deviceChange[0].device.backing.port.switchUuid = "27 21 1c 50 5d 02 8e 0c-08 a7 b4 37 f0 58 49 c0";
spec.deviceChange[0].device.backing.port.portgroupKey = "dvportgroup-8392";
spec.deviceChange[0].device.connectable = new VcVirtualDeviceConnectInfo();
spec.deviceChange[0].device.connectable.startConnected = true;
spec.deviceChange[0].device.connectable.allowGuestControl = true;
spec.deviceChange[0].device.connectable.connected = true;
spec.deviceChange[0].device.controllerKey = 100;
spec.deviceChange[0].device.addressType = "generated";
spec.deviceChange[0].device.wakeOnLanEnabled = true;

task = managedObject.reconfigVM_Task(spec);  // VirtualMachine

 

Thanks in advance

Axel


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>