VMware Cloud Community
RonPSSC
Enthusiast
Enthusiast
Jump to solution

Add a 2nd vNIC to a VM using vRA/vRO 7.X

I am in the process of trying to deploy a Windows VM with 2 vNICs but cannot get past the Windows Setup following the initial vSphere Guest Customization. It basically hangs at this point because Windows appears to be unable to detect all component settings (I'm thinking here the 2nd Adapter is causing grief during the device setup phase??)...I am receiving errors similar to the following..("Windows could not parse or process unattend answer file [C:\windows\Panther\unattend.xml].......A component or setting specified in the answer file does not exist"). My guess is sysprep'ing a Windows machine with 2 vNICs cannot be done in vCenter 5.5 but only speculating right now??  Just for info, we even modified the vSphere Guest Customization XML file by adding a 2nd Adapter but no luck there either.

Was wondering if anyone has a vRO Workflow they could share or suggest a method we could use in vRA/vRO 7 to add a 2nd vNIC to a VM either during or immediately following vRA Machine Provisioning?? Including this function during machine provisioning is required/preferred because we allocate IP addresses to network adapters using pre-configured vRA Network Profiles.

I realize this can be done using PowerCLI but was hoping to perhaps use a "Scriptable Task" in vRO as opposed to having to invoke an external script from a PowerShell host. The PowerCli method simply introduces additional routines, such as, connecting to vCenter using elevated User Accounts, Passwords...etc. and also makes IP allocation using predetermine Network Profiles a little more difficult or perhaps impractical afterwards.

Thanks. Ron

0 Kudos
1 Solution

Accepted Solutions
RonPSSC
Enthusiast
Enthusiast
Jump to solution

As promised, attached, is a copy of a Custom Workflow created to support the requirement for adding a 2nd vNic to a VM provisioned through vRA. It may not be pretty and concise, but it works. Smiley Happy

Ron

View solution in original post

0 Kudos
3 Replies
filosmith
Enthusiast
Enthusiast
Jump to solution

You can use Onyx  to sniff your vsphere client while you add a nic to a vm. It will print out the javascript you need to put into a scriptable item. Then, you can create an event subscription to run your workflow when the machine is done provisioning. There's also a version for the web client.

RonPSSC
Enthusiast
Enthusiast
Jump to solution

Appreciate the reference to Onyx!! I used it to obtain required output (javascript). This was extremely helpful in isolating and validating legitimate properties from vCenter. The only one drawback to using Onyx in vRO is that it is dependent on having access to its own set of vRO Library functions, i.e. Modules need to be created and tagged with the name "com.vmware.onyx".

I also recently discovered another source with actual vRO/vSphere native code that will allow me to perform the same routine. The link is pasted below for info. Although there were a few obstacles in compiling the code and navigating the process, the info was deemed excellent in allowing me to complete my task.

Adding a vNIC to a virtual machine in vRealize Automation Center | virtual devops 

I'll update this post later with a copy of the vRO Workflow I created based on the input in the above link as a form of paying it forward to the Community. Smiley Wink  I'm guessing others may find it useful when performing similar automation routines.

Ron

RonPSSC
Enthusiast
Enthusiast
Jump to solution

As promised, attached, is a copy of a Custom Workflow created to support the requirement for adding a 2nd vNic to a VM provisioned through vRA. It may not be pretty and concise, but it works. Smiley Happy

Ron

0 Kudos