Zero2Hero - Using Aria Automation to Deploy Multiple Machines with Multiple Disks - Part 2



VMware Aria VMware Aria Automation

Published on 5 March 2024 by Christopher Lewis. Words: 651. Reading Time: 4 mins.

In the second post of this five post blog series, we can continue our journey from #Zero2Hero in authoring VMware Cloud Templates. We will be increment the functionality in the VMware Cloud Template as continue to work on the use case for deploy multiple virtual machines (with additional on-demand disk configurations).

The series will cover the following high level use cases:

  • Creating a Single Virtual Machine Cloud Template (boot disk only) - Part 1
  • Creating a Single Virtual Machine Cloud Template (with additional static disk configuration) - Part 2
  • Creating a Multiple Virtual Machine Cloud Template (with additional static disk configuration) - Part 3
  • Creating a Single Virtual Machine Cloud Template (with additional on-demand disk configurations) - Part 4
  • Creating a Multiple Virtual Machine Cloud Template (with additional on-demand disk configurations) - Part 5


The Requirements (Recap)

We will use the following high level requirements when developing this cloud template:

  1. The consumer must be able to deploy one or more Virtual Machines.
  2. The consumer must be able to choose the operating system (image) for the Virtual Machine.
  3. The consumer must be able to choose the Virtual Machine size (flavor) at request time.
  4. The consumer Must be able to choose to which cloud the Virtual Machine is deployed to (i.e. VMware Cloud or Private Cloud).
  5. Each Virtual Machine must have identical disk configuration.
  6. The disk configuration must support one to five additional disks.
  7. The disk configuration must be chosen at request time.

The Development Process

The next phase of development would be to add a static external disk configuration this would meet requirement #5 listed above. This type of template can be valid for certain types of standardized workloads, such as a Database Server, where the disk allocation is known and agreed upfront and, most importantly, always consistent.

So let’s get started.

Creating a Single Virtual Machine Cloud Template (with additional static disks configuration)

Inputs

Here we are going to add just two additional disks into the Cloud Template. Whilst the majority of the configuration will be static, we are going to add the capability to allow the end user to choose the size of the two additional disks using the disk1_Size and disk2_Size inputs. When adding disks, it is important to note that the only property that is required for the Cloud.vSphere.Disk resource object is the capacityGb property. However, because we want to have a little more control how the disk is configured on the Virtual Machine, we are also going to include the SCSIController and unitNumber properties.

Resources

If we just added two Cloud.vSphere.Disk objects the canvas (or in code), they wouldn’t actually get attached to the Virtual Machine. We need to declare that we want this to happen and therefore we also to update the Cloud.vSphere.Machine object to include the attachedDisks property. As you will see in the example Cloud Template below, the attachedDisks property is a YAML array of the disks (denoted by the relative resource Ids) of the two (or more) disks.

Template Code

Here is the VMware Cloud Template YAML code:


Wrapping It All Up

In this second post of the series, we updated our previous VMware Cloud Template to include additional static disk configuration (with the option to choose how big the disk was) to provide support for additional use cases. Looking back at the requirements we had for this series of posts, we essentially have crossed off #2, #3, #4 and #5.

Published on 5 March 2024 by Christopher Lewis. Words: 651. Reading Time: 4 mins.