If you have advanced users accessing their resources via the Service Portal, you may need to provide to them the ability to switch between networks. To do so, you will enable network zone selection via custom attributes on a change request form.


Configuring the Custom Attribute


You'll need a custom attribute so users can choose their network.


  1. Under Configuration choose Custom Attributes.
  2. Name it Network and choose Type: List. Set it to Applies to: Services and uncheck Edit in Service Portal.

  3. Click Next.
  4. Add names for the networks your users will understand and click Finish.



Setting the Network Zones


Next, you need to associate the actual networks to network zones. A network zone can contain one or many networks -- think of it as a network tag. Remember that this solution is setting the network zone, so if your users must specify the exact network, zones must be created on a 1:1 basis.


  1. Highlight the vCenter in the operational view and switch to the Networks tab.
  2. Select one or more networks and right click, choosing Select Network Zone.

    image

  3. On the dialog that appears, click Add Network Zone.
  4. Name the network zones to match what you set in the Custom Attributes.
  5. Click OK and then OK.


Creating the Form


Next, prepare a form to offer the network choice.


  1. Under Configuration choose Service Request Configuration and switch to the Form Designer tab. Click Add.
  2. Configure the form as follows, then click OK.

    Form Name: Network Change
    Display Name: Network Change
    Form Type: Change Request Form
    Completion Workflow: None
    Publish: Global (or as appropriate)

  3. From the Toolbox pane, click Custom Attribute. This adds a new section in the middle pane. From the Custom Attributes list, choose Network.


  4. Click Save.


Creating the Approval Workflow


Next, create an Approval Workflow for change requests to automatically process the network change. Alternatively, you can incorporate the step into your existing Approval Workflow, and have the step execute conditionally based on the form name/


  1. Under Configuration choose Service Request Configuration and switch to the Approval Workflow tab. Click Add.
  2. Enter the Name Network Change and choose to apply this workflow when a change request is created. Click Next.

     
  3. On the Assignment page, assign the workflow as appropriate and click Next.
  4. On the Steps page, use whatever existing steps are required for approval, adding a step to tell vCommander the choice for the network. Click Add and choose Execute Script. 
    Configure the Script step as follows, and then click Next:

    Step Name: Get Network
    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: powershell.exe {write-host '$NETWORK1=#{target.settings.customAttribute['Network']}$'}

  5. On the Automation Options page, set Network Change to Automatic / Immediate (or your preferred settings) and then click Next.
  6. Click Next and then Finish.


Creating the Completion Workflow


Finally, create a Completion Workflow to do the work.


  1. Under Configuration choose Service Request Configuration and switch to the Completion Workflow tab. Click Add.
  2. Enter the Name Network Change and choose to apply this workflow after a change request is fulfilled. Click Next.
  3. Click Add > Guest OS > Configure Virtual Networking and configure the step as follows, then click Next:

    Step Name: Configure Virtual Networking
    Step Execution: Always execute
    Action: Configure Existing Adapters
    Adapter: Leave at all Adapters or choose one specifically.
    Select Network: From Approver Comments
    Connected: Enabled
    Connect at Power On: Enabled

     
  4. On the Assigned Forms page, choose Apply this workflow to the selected forms and check Network Change. Click Next and then Finish.


Requesting a Change


With this configuration in place, Service Portal users who have permission to request service changes will now be able to update the VM's network.


  1. With a VM selected, click Request Service Change from the Commands pane.

  2. Depending on your configuration, one or more change requests will appear. Select Network Change and click OK.


  3. Select the appropriate Network and click OK.

The network will be changed immediately, or during scheduled maintenance, depending on your configuration.


See Also