I'm trying to remove a vmnic from a dvUplink, so that I can add it to a VSS. I tried the below code and received an error:
Cannot convert com.vmware.vim.vi4.DVPortConfigSpec@ea858ec6 to com.vmware.vim.vi4.DVPortConfigSpec[] (Workflow:#VMK Master workflow / Delete vmnic DVS (item5)#5)
var DVPortConfigSpec = new VcDVPortConfigSpec;
DVPortConfigSpec.name = dvUplink;
DVPortConfigSpec.key = portKey;
DVPortConfigSpec.operation = "remove";
var task=DVS.reconfigureDVPort_Task(DVPortConfigSpec);
I just created a workflow based on the Attach host system to distributed virtual switch library workflow...
that says that the task is expecting an array ...
var specs = new Array(DVPortConfigSpec);
Put that right before last line, then in last line change the value inside () to specs
var DVPortConfigSpec = new VcDVPortConfigSpec;
DVPortConfigSpec.name = dvUplink;
DVPortConfigSpec.key = portKey;
DVPortConfigSpec.operation = "remove";
var specs = new Array(DVPortConfigSpec);
var task=DVS.reconfigureDVPort_Task(specs);
The call now works correctly. But returns an error. The action is attempting to remove the port from the DVS not the vmnic.
Have you tried using ONYX to figure this out? Since I don't have code in my back pocket that's the approach I would take to determine the code...
I just created a workflow based on the Attach host system to distributed virtual switch library workflow...