damascushill
Contributor
Contributor

remove vmnic from DVS

Jump to solution

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);

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee

I just created a workflow based on the Attach host system to distributed virtual switch library workflow...

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
4 Replies
Burke-
VMware Employee
VMware Employee

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);

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
damascushill
Contributor
Contributor

The call now works correctly. But returns an error.  The action is attempting to remove the port from the DVS not the vmnic.

0 Kudos
Burke-
VMware Employee
VMware Employee

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...

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Burke-
VMware Employee
VMware Employee

I just created a workflow based on the Attach host system to distributed virtual switch library workflow...

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos