Some applications have licensing requirements which are bound to the MAC address of the installation VM. When this is the case a vCommander® Completion Workflow must be run to update the MAC address to the desired value, following the procedure detailed below. This is because vCommander dynamically assigns MAC addresses. This solution is not compatible for use with fenced VMs, as a change to the MAC will impact communications with the deployed vRouter.
Requirements
- vCommander 5.6.4 or later
- PowerShell v3 installed on vCommander application server
- VMware PowerCLI
- Embotics REST API PowerShell libraries
- Set MAC script
Creating the Completion Workflow
This solution requires that the script to set the MAC address be available on the vCommander server, where it will be called by the workflow.
- Download the Set MAC script package to the vCommander application server.
- Extract the script to C:\Scripts\networks\.
- Edit the script to provide the address the vCenter to which the VMs will be deployed and location of your encrypted credentials file.
- Browse to Configuration > Service Request Configuration and switch to the Completion Workflow tab.
- Click Add.
- Provide a Name and choose to Apply this workflow: after a VM is deployed. Click Next.
- On the Steps page, click Add and choose Wait for Event. Configure as follows then click Next:
- Step Name: Wait for 10s
- Step Execution: Always Execute (or conditional as appropriate)
- Wait For: Time to Elapse
- Wait Time: 10 seconds
- Click Add and choose Perform Power Action. Configure as follows then click Next:
- Step Name: Perform Power Action
- Step Execution: Execute when conditions are met
- Action: Stop
- Click Edit and enter the condition #{target.state} -ne “Not Running” and click OK.
- Click Add and choose Execute Script. Configure as follows then click Next:
- Step Name: Execute Script
- Step Execution: Always Execute
- Timeout: 300 seconds
- Script Output: Capture script output as comment
- When Step Fails: Mark workflow step as failed: do not proceed
- Command Line:
c:\windows\system32\WindowsPowershell\v1.0\powershell.exe & c:\Scripts\networks\Set_MacAddress.ps1 #{target.remoteId} "00:50:56:33:d7:1d"
Replace the MAC address listed in the command line above with the one you want to use.
- Click Add and choose Perform Power Action. Configure as follows then click Next:
- Step Name: Perform Power Action (1)
- Step Execution: Always Execute
- Action: Start
- Complete the wizard as appropriate and click Finish.