VMware Cloud Community
damascushill
Contributor
Contributor
Jump to solution

remove vmnic from DVS

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

Reply
0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

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

Reply
0 Kudos
4 Replies
Burke-
VMware Employee
VMware Employee
Jump to solution

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
Reply
0 Kudos
damascushill
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
Burke-
VMware Employee
VMware Employee
Jump to solution

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
Jump to solution

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
Reply
0 Kudos