Lifecycle Management of Azure VMware Solution with Pure Storage Cloud

Automating AVS host lifecycle management using native Azure monitoring services

Posted by Adam Mazouz on Monday, November 27, 2023
Reading Time: 5 minutes

This post was originally published on the Pure Storage Blog.

In the third installment in a series on Azure VMware Solution and Pure Cloud Block Store, we look at how to provide an automated and simplified storage operation by continuously monitoring the lifecycle management of an AVS instance.


Introduction

In our previous blog about Azure VMware Solution (AVS) and Pure Storage Cloud™, we covered how to initialize the integration between an AVS private cloud cluster and Pure Storage Cloud array. This blog focuses on the integration lifecycle management of AVS hosts, by leveraging Azure native resources to continuously monitor and automate the configured state of the storage provisioned.

Key to any AVS deployment is the lifecycle management of ESXi hosts, involving replacement, addition, or removal of ESXi hosts. The following are a couple of scenarios where AVS lifecycle management is triggered:

  • Host replacement — AVS host gets replaced automatically if it encounters a hardware failure or undergoes a planned ESXi version upgrade.
  • Host scaling — AVS host gets added (scale up) or removed (scale down) manually to an existing cluster.
  • Cluster creation — AVS cluster with a number of hosts gets created to an existing AVS private cloud instance.

Once the AVS host population is updated for any of the reasons above, the Build-PCBSCluster run command needs to be executed against the AVS cluster to enable the software iSCSI adapter, and the Pure Storage Cloud array can be updated with the appropriate host IQNs. Therefore, it was required to automate this process in order to prevent unpredictable updates, leading to storage configuration mismatch.


Introducing the Deploy-PCBSMonitor Command

AVS host lifecycle management can be completely automated by leveraging the Deploy-PCBSMonitor PowerShell command. This command utilises native Azure components to poll a specific AVS cluster (or a set of clusters inside the same AVS private cloud instance). When a host-level change is detected — adding, removing, and/or replacing a failed host — it will automatically kick off the Build-PCBSCluster command to update AVS and Pure Storage Cloud to the latest configuration.

Figure 1: Visualization of the VMFS datastore lifecycle management for manually adding a host to a cluster. Figure 1: Visualization of the VMFS datastore lifecycle management for manually adding a host to a cluster.


Deploy-PCBSMonitor Command Example

Executing the Deploy-PCBSMonitor command comes next in the list of commands after initialising the cluster using the Build-PCBSCluster command. It is invoked per AVS SDDC instance and will poll for updates from all the AVS clusters inside that AVS instance as long as the cluster has been initialised. Here is an example of the command syntax:

Deploy-PCBSAVSMonitor `
  -AVSCloudName         "my-avs" `
  -AVSResourceGroup     "avs-resourcegroup" `
  -MonitorResourceGroup "NewResourceGroup" `
  -MonitorResourceGroupRegion "westus2" `
  -vNetName             "avs-vnet" `
  -VNetResourceGroup    "vnet-resourcegroup" `
  -vNEtSubnetAddress    "192.168.10.0/29" `
  -PureCloudBlockStoreEndpoint   "192.168.1.10" `
  -PureCloudBlockStoreCredential (Get-Credential)

The below arguments were passed to the above command:

Parameter Description
-AVSCloudName The name given to your AVS instance when it was created.
-AVSResourceGroup The Azure Resource Group (RG) in which your AVS instance is located.
-MonitorResourceGroup The RG where the AVS monitoring infrastructure will be deployed. A new RG is created if it does not already exist.
-MonitorResourceGroupRegion The region where the Azure Monitor RG and components are deployed. Recommended to match your AVS instance region.
-vNETName / -vNETResourceGroup The Azure vNET where Pure Storage Cloud is deployed and connected to AVS via ExpressRoute Gateway.
-vNETSubnetAddress CIDR block (e.g., /29) within the Pure Storage Cloud vNET — a small subnet is sufficient for the monitoring infrastructure.
-MonitorIntervalInMinute (Optional) How often the Azure Function polls AVS for host changes. Default: 10 minutes. Allowable range: 10–60 minutes.

Upon completion of the AVS monitoring infrastructure deployment, you should see a successful output message. To verify the resources deployed, navigate to the Azure console and search for the Azure resource group name.

The resource group contains several native Azure resources:

  • App Service
  • Application Insights
  • Key Vault
  • Azure Function App (the core resource)

The Azure Function App is where the Build-PCBSCluster PowerShell function is invoked against AVS instance clusters whenever an ESXi host change is detected, using Application Insights for event monitoring.

To learn more about all the deployed components, refer to the Implementation Guide.

By navigating into the Azure Function, you can check the number of times the function was triggered. To validate the workflow without waiting for AVS to perform maintenance and replace a failed host, you can follow these steps:

  1. Add a new host to the cluster.
  2. Monitor the Azure Function trigger count in Application Insights.
  3. Confirm that Build-PCBSCluster was automatically executed and the Pure Storage Cloud array updated accordingly.

Additional AVS Monitoring Commands

At this stage, both AVS instance clusters and the Pure Storage Cloud storage configuration are under continuous monitoring, automatically responding to any detected host changes.

Add another Pure Storage Cloud array to the monitor

If you’ve set up datastores from multiple arrays to the same AVS instance, you can include them using Add-PCBSAVSMonitorArray:

Add-PCBSAVSMonitorArray `
  -MonitorResourceGroup          "myMonitorGroup" `
  -PureCloudBlockStoreEndpoint   "myArray" `
  -PureCloudBlockStoreCredential (Get-Credential)

List monitored arrays

List the Pure Storage Cloud arrays registered against an AVS polling infrastructure:

Get-PCBSAVSMonitorArray -MonitorResourceGroup "myMonitor"

Remove an array from monitoring

Stop the AVS polling infrastructure from updating changes against a specific array:

Remove-PCBSAVSMonitorArray `
  -MonitorResourceGroup        "myMonitorGroup" `
  -PureCloudBlockStoreEndpoint "myArray"

Remove the entire monitoring infrastructure

When it is required to remove the monitoring resource group and all of its resources:

Remove-PCBSAVSMonitor -MonitorResourceGroup "myAVSMonitorResourceGroup"

Conclusion

In this blog, we showcased how the integration of AVS and Pure Storage utilises Azure Functions with PowerShell, along with other native Azure monitoring services. This setup enables continuous monitoring and polling of AVS infrastructure to detect any changes in hosts.

The outcome not only ensures the prevention of storage configuration drift but also streamlines the entire solution, thereby reducing operational overhead.

Upcoming blogs in the AVS and Pure Storage Cloud series will cover additional PowerShell Run Command functions, including:

  • Provisioning a new datastore
  • Removing a datastore
  • Setting the capacity
  • Restoring a datastore from local and replication snapshots

Stay tuned!


Learn more:


comments powered by Disqus