Hi can anybody very kindly help me.
I have a new script to try and add a serial port to a VM. The workflow completes no errors but within vCenter I get the message ' Reconfigure virtual machine - Incompatible device backing specified for device '0'.
Any help will be very grateful. My code is as follows:
var configSpec = new VcVirtualMachineConfigSpec();
var deviceConfigSpecs = new Array();
var deviceConfigSpec;
// Connectable info for Serial Port
var connectInfo = new VcVirtualDeviceConnectInfo();
connectInfo.connected = true;
connectInfo.startConnected = true;
// Create Serial BackingInfo
var backingInfo = new VcVirtualSerialPortPipeBackingInfo();
backingInfo.endpoint = "server";
backingInfo.pipeName = '"\\.\pipe\"';
// Create New Serial Device
var serial = new VcVirtualSerialPort();
serial.key = -1;
// Create Serial ConfigSpec
var deviceConfigSpec = new VcVirtualDeviceConfigSpec();
deviceConfigSpec.device = serial;
deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.add;
deviceConfigSpecs[0] = deviceConfigSpec;
// List of devices
configSpec.deviceChange = deviceConfigSpecs;
// Launch the reconfigVM task
task = vm.reconfigVM_Task( configSpec );