Provisioning Additional Disks with vRA8 with Ordered MountPoints or Drive Letters

Background

 

Provisioning Additional Disks with vRA8 is an article on Confluence internal to Vmware's Professional Services Center of Engineering site.  Here's an extract from that page that summarizes the deficiency in vRA 8.

 

When creating blueprints containing multiple attached disks to one or more compute resources, vRA8 automates the provisioning and attachment of those disks.  ... However,  vRA does not guarantee  that the  order of disk requests  matches the  order of the disks attached to the VM

 

For VMware employees:

https://confluence.pscoe.vmware.com/display/KB/2020/04/10/Provisioning+Additional+Disks+with+vRA8

 

This workflow is the realization of the proposed design to mitigate the issue as described from this excerpt of the design proposed in the Confluence article.

 

In order to mitigate the effect, the following sequence will be implemented as part of extensibility workflow attached to the "compute.provision.post" event of the compute deployment lifecycle:
 
  1. Obtain reference to a VC:VirtualMachine  object from the vCenter plugin in vRO and using the element contained in the externalIds  property of the inputProperties  object.
  2. Iterate over the device configuration of the VirtualMachine  object (vm.config.hardware.device ) and extract only the items that contain the string "Hard Disk" in their label. This will result in an ordered list of disk devices.
  3. Preserving the order of the list, for each disk device extract the last segment of the file from the VMDK path without the .vmdkextension, e.g. [Datastore01] Compute-mcm709-134979764077/Disk2-mcm707-134979759940.vmdk. This will result in an ordered list of Disk names.
  4. Get the deployment resources of the deployment using the Deployment Service API in vRA.
  5. Find the provisioned compute resource from the list of all compute resources (having type Cloud.vSphere.Machine) by comparing the resource IDs with the one contained in the inputProperties  object.
  6. Extract the attached disks from the found compute resource using the attachedDisks property.
  7. Find the provisioned disk resources from the list of all disk resources (having type Cloud.vSphere.Disk) by comparing their IDs with the IDs of the attached disks of the provisioned compute resource.
  8. Sort the provisioned disk resources using the ordered list of disk names obtained from step (3) by comparing the values of the disk names (from step (3)) and the values of the resourceName  property of the disks (from step (7)).

 

Zip Manifest

com.vmware.pso.OrderedMountPoints.package

blueprint.yaml

diskmount.sh

diskmount.ps1

License.txt

 

How to configure the Workflow

  1. Import the vRO package and vRA Blueprint
  2. Run the Guest Script Manager Script Management workflow to "Add script configuration".  
  3. Give the Resource Configuration a name, such as diskmount.sh
  4. Copy and paste the Linux Bash script from the attached file into the Script content
  5. Set the script parameters accordingly, such as timeout, and refresh settings, in seconds.
  6. Do the same for the Powershell script, diskmount.ps1
  7. Populate these Variables on the Workflow
    1. linuxScriptResource & windowsScriptResource
    2. linuxUsername, linuxPassword, windowsUsername, & windowsPassword
    3. vraUsername & vraPassword
    4. vraRestHost
  8. Create a subscription in vRA that invokes this workflow on a compute post provision event.

 

Notes and Assumptions:

* This workflow has a dependency on the Guest Script Manager and Guest Operations "Run Script in Guest" workflow.  Install that package if you do not already have it.

* This workflow assumes that the blueprint contains a "disks" input array that contains a "size" and a "mountpoint" sub property.  Also, the 'isWindows' logic assumes an "image" property exists on the vSphere Machine compute resource that is either "Linux" or "Windows".  

* This workflow used a custom naming template like this: ${resource.Prefix}${##}

 

Modify the workflow or blueprint to match your environment.  For example, matching constraint tags; or using static or dynamic networking; etc.

 

Troubleshooting

I have seen an issue where th evCenter disk names take the form of the VM resource name + "_" + indexNumber.  It is ignoring the Disk's resource name assigned by the custom naming template.  This may happen if a compute resource does not have a storage constraint tag specified.


Sign in to be able to add comments.

Comments 3


sadlekj 9 months ago
Fixed issue with drive labels out of synch with drive letters in Windows machines.
5301451795 5 months ago
In my environment, this blueprint was working fine in 8.2, but not after upgrading to 8.3. Interestingly, it deploys as expected from the design canvas in 8.3 but when attempting to deploy from the catalog item, all inputs have been removed (instanceCount, cpu, memory, disk).
1641455585 4 months ago
Update the inputs schema to

disks:
type: array
title: Disks
description: Data disk mount points and sizes
maxItems: 5
items:
type: object
properties:
size:
type: number
title: Size GB
minimum: 1
maximum: 1024
mountpoint:
type: string
title: Mountpoint/Drive Letter