A typical scenario for Opalis in virtualization environments is to be the engine that orchestrates the provisioning of virtual machines. Process owners design change request forms and approval processes in System Center Service Manager and then virtualization IT specialists will create automation that will take those change requests and transform them into virtual machines.

The Integration Pack for System Center Virtual Machine Manager allows you to build workflows that will provision virtual machines and provide rich customization of the virtual hardware settings.

The following sample illustrates how you can build a workflow that will provision a virtual machine from any external system. Here is how the main workflow looks:

image

The workflow starts with a Custom Start activity that accepts the following parameters:

image

  • Additional Primary Disk Size – Enter the size, in Gb, that you want to add to the primary disk of the virtual machine.
  • Additional Disks – Enter a semicolon (;) delimited list of disk sizes for the disks that you want to add to the virtual machine.
  • Additional Network Adapters – Enter a semicolon (;) delimited list of virtual network names that you want to connect to.
  • VM Name – Enter the name of the new VM you want to create.
  • Template Name – Enter the name of the template that the VM will be based on.

The Create VM activity will take the VM Name and Template Name and create virtual machine in VMM to start the process. The Create VM activity is set up to join a domain and configure the OS through the Sysprep functions.

image

After the VM has been created the workflow then increases the primary disk of the VM. The 2. Update Primary Disk activity calls a subordinate workflow that performs this operation.The workflow takes the VM ID of the newly created VM and the Additional Primary Disk Size parameter from the custom start.

image

The subordinate workflow first uses the Increase Disk? activity to determine if the Additional Primary Disk Size parameter is empty or not. The link condition after the Increase Disk? activity is set such that when the Additional Primary Disk Size activity is left empty the rest of the workflow will not run and will return to the main workflow. The workflow then uses the Get Disk activity to retrieve the ID of the disk on Bus 0, Lun 0 on the VM that was created in the Create VM step and then the Increase Disk Size activity then adds the additional disk size.

image

image

After this workflow runs the main workflow continues with the 3. Add Disks activity which calls a subordinate workflow. The 3. Add Disks workflow is passed the VM ID from the Create VM activity and the Additional Disks property from the Custom Start activity.

image

This workflow first uses to the Additional Disks? activity to determine of the Additional Disks parameter is empty, if it is the link condition following it will not allow the workflow to continue and instead will return to the main workflow. The Get Sizes activity splits the Additional Disks parameter into a multi-valued data set of disk sizes. This will allow the pipeline workflow engine to run the Create New Disk activity for each disk that needs to be added. The Create New Disk creates a SCSI disk with the associated disk size for each parameter entered. The Create New Disk automatically sets all other properties.

image

After the additional disks have been added the main workflow then continues with the 4. Add Network Adapters activity. The 4. Add Network Adapters workflow follows a similar pattern to the 3. Add Disks by checking that the Additional Network Adapters parameter is empty and then splitting the Network Adapters according to the Virtual Network that they need to connect to. Then the workflow adds each Network Adapter and connects it to the Virtual Network.

image

image

After the Network Adapters have been added the main workflow finishes by creating a checkpoint of the VM so that it can always be restored to it’s original state.