Aria Automation Cloud Automation Tech Tips vCloud Automation Center

How to use Reservation Policy to place VMDKs across different datastores

Reservation policy is often unused feature and to some extend not fully understood. Primary reason could be that reservation policy creation process very simple and during policy creation we don’t glue pieces together.That being said there are very valid use cases for using reservation policy and comes very handy in VM Placement.

One of the core principles of Software Defined Datacenter (SDDC) suggests we need to have policy based automation and common management platform across the entire infrastructure. With reservation policy we address this requirement.

It is my personal belief that features in any products are aimed to solve some or other business problems. All we should attempt is to find those relevant business case or help someone find them. In this blog I aim for later.

Business Use Cases

  1. Customer wish to provision SQL Server database files, Log files and tempdbfiles on individual datastores
  2. Customer wish to protect VMs by placing datastore which is replicated using Array based technology or VM needs to be protected using SRM

Your first thought might be, it can done using template. It could be done that way but much better way would be to use reservation policy.

Let me define the reservation Policy.

A reservation policy is a set of reservations that can be selected in a machine blueprint to control provisioning to those reservations only.

A storage reservation policy is a set of virtual datastores that can be selected on a machine blueprint to control disk provisioning to only those datastores.

Below I have attempted to establish relationship between Reservation, Reservation Policy and how Blueprint will consuming reservations

Figure 1

Now that we understand the relationship, let me start gluing the pieces together.

Creating Reservation Policy

Firsst we create reservation policies. Process is straight forward. It is creating a label and optionally providing small description against it.

Figure 2

Similarly you can create storage reservation policy.  I have captured the screen after all policies are created.

Figure 3

 

Establish relationship between Reservation and Reservation Policy

Next step is to create reservation and associate it with respective reservation policy. Create reservation and select appropriate Compute resource group, Tenant and reservation policy.

Figure 4

Here you associate reservation policy with reservation. So if you wish to consume this reservation, all you have to do is select this reservation policy in blueprint.

In above screen (figure 4) I have selected “DB Cluster” reservation policy. Let’s go the Resources tab to reserve resources. Reservation is combination of memory and storage.

You can create reservation only on memory and storage. In figure 4 (above) relation between Reservation and Reservation Policy is established however actual reservation of resources happens via Resources tab. We are reserving Memory and Storage on DB Cluster as shown in Figure 5

Figure 5

Associating BluePrint with Reservation Policy

In below screen (figure 6) we are creating blue print and by using reservation policy we are establishing relationship between reservation and Blueprint

Figure 6

Now select the Build Information tab to establish relationship between storage and storage reservation policy. As shown below, edit the volume and from drop down select Storage reservation policy for the OS disk.

Figure 7

Similarly you can add new Volume, Drive letter and Label for the path as shown in figure 8 and associate reservation policies respectively. Please refer Figure 3 in case you missed the Storage Reservation Policy name. However I have left Drive Letter and Label empty. I will explain it in a short while. It is completely optional.

Figure 8

In figure 8, we are connecting Disk numbers with Storage Reservation Policy but actual placement of VMDKs on respective datastore needs to be defined by fabric administrator.

With Fabric Admin credentials, login and browse to Compute Resources and edit as shown below

Figure 9

 

Figure 10

In the configuration screen (figure 10), you will see all datastores (referred as Storage Paths) presented to the Compute resource (which we know is cluster object), all you have to do is edit and associate it with Storage Reservation Policy.

Now final piece is to create build profile. I have created build profile to reuse those property for other services. This the reason I have not mentioned Label and Drive letter in figure 8. Profile creation is optional.

Figure 11

Build profile screen above explains how relationship between custom property and Disk numbers, labels and associated policies is established.

Lower part of the figure 11 (also can be seen in Figure 13 below)  confirms that custom property is populating label, drive letter as per our requirement.

Now we have glued all the pieces in vCAC portal. If you provision VM at this stage, you will see three disk attached to the VM as seen in figure 14 below. But won’t create drives inside OS and format and label them as we defined in custom properties.

As drive letters, label properties needs to be executed inside the OS. In order to achieve or rather control operations inside OS, we are using a Guest Agent. Without guest agent there is no easy way to map Guest OS Drive letter and label with the datastores.

I won’t go into detail as to how to install Guest Agent. Installation procedure is straight forward and explained hereJust ensure you unblock the Gugentzip_x64.zip file after you download it.

After agent is installed inside the Guest OS, create a template of the VM.

Request VM

Now let’s go over and provision VM

Figure 12

Figure 13

Below when the VM (HR07) is provisioned, you see four separate datastores are mapped and their respective names.

Figure 14

Let’s see what we see in OS. Yeah, exactly as per the request.

If you have observed, with purpose I have kept disk size of Databasefiles, LogFiles and TempDB files of different size.

2014-10-04_22-09-22

Figure 15

Below I have mentioned steps at high level to achieve objective of placing VMs on different datastores

  1. Create reservation policy (figure 2) and storage reservation policy (figure 3)
  2. Create reservation and associate reservation policy with it (figure 4). Reserve memory and storage (figure 5)
  3. Create blueprint and associate with reservation policy (figure 6). Add volumes and add associate storage reservation policies (figure 7,8)
  4. Associate storage reservation policies with Datastore (figure 9, 10).
  5. Update or create template and Install Guest Agent inside OS
  6. Create build profile and match the label, drive letter with Volume numbers. (figure 11)
  7. Provision the VMs.

Happy Learning