As an administrator you want to make it easier for the tenants workloads to be provisioned with appropriate networks and pre-defined configurations based on, say the workload type, like Dev vs Test vs Production. All the tenant needs to say is, for example: I like to provision a Test VM or a Dev VM.
VConnect Features Involved:
- VConnect offers various customization and extensible mechanisms that enables fine grained control for provisioning. Here we will use
- VM Templates Custom Parameters Feature (which allows an admin to define any parameter to get as an input from the tenant)
- Operation Templates Custom Steps (which allows an admin to add or modify the default configurations, as well as ability to inject any scripts and REST calls)
How its done?:
Here are the steps involved in customizing the NICs Settings for the VM based on a user-defined parameter:
1. From the admin portal-->Connections-->Select a Connection-->VM Templates-->Select and Edit a VM Template --> Create a Parameter --> Parameter Type: 'Select Box', Name: 'VMType'
2. Add options to this parameter by clicking on the Edit Options button. Options: '1=DevVM, 2=TestNM'. These values will be selectable by the tenant user and available for all the provisioning steps and scripts, so you can use these values to customize the provisioning configuration in your scripts in the next steps.
3. Edit the 'VCenterStandAloneVMCreateTemplate.json' file in the VConnect install directory (such as 'C:\inetpub\MgmtSvc-CloudAssert-VConnect\bin\Templates'). Add a new step 'VMScriptOp' for the customization of the NICs Settings after the step 'GetNetworkSettingsOp', with below details:
4. In the called script 'AfterNetworkSettingScript.ps1', include the logic for updating the NICs Settings based on the parameter $VMType (remember the value for this parameter is automatically injected by VConnect, based on the value selected by the tenant user in the tenant portal)
After all the above changes are saved, you can proceed to test your work from the tenant portal.
5. in the tenant portal while creating a virtual machine choose the appropriate option for VMType parameter. Tenant Portal-->Create New VM-->Select the VM Type.
6. Once the VM is provisioned you can validate that the new VM is created with the appropriate network and settings as you have customized via custom script 'AfterNetworkSettingScript.ps1'.
Examples of such customized VM configurations:
Option1: Configuring Single Network Adapter
Option2: Configuring 2 Network Adapters