Manage VM extensions on Azure Stack HCI virtual machines (preview)

Applies to: Azure Stack HCI, versions 22H2 and 21H2

This article describes how to install and manage VM extensions on your Azure Stack HCI via the Azure portal.

The VM extensions on your Azure Arc-enabled VMs on Azure Stack HCI are useful for post-deployment configuration, software installation, or other management tasks. To install VM extensions, you must enable Azure guest management on your Arc-enabled VMs.

Important

This feature is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.

Supported VM extensions on Windows

The following VM extensions are supported on Azure Stack HCI VMs.

Extension Publisher Type
Custom Script Extension Microsoft.Compute CustomScriptExtension

Prerequisites

Before you install and manage VM extensions, make sure that:

Verify guest management is enabled

To perform guest OS operations on the Arc-enabled VMs on Azure Stack HCI, you must enable guest management on the VMs. When you enable guest management, an agent is installed on the VM.

You must verify that guest management is enabled on your VMs before you install VM extensions.

Follow these steps to verify that guest management is enabled using the Azure portal.

  1. In the Azure portal of your Azure Stack HCI cluster resource, go to Resources (Preview) > Virtual machines.

  2. From the list of the VMs displayed in the right-pane, select the VM where you’ll install the extension.

  3. In the Overview blade, under Properties > Configuration, verify that the Guest management shows as Enabled.

    Screenshot showing guest management as enabled in the selected Arc-enabled VM.

Add VM extension

After the guest management enablement is verified, you can now add the VM extension.

Follow these steps in Azure portal to add a VM extension.

  1. In the Azure portal of your Azure Stack HCI cluster resource, go to Resources (Preview) > Virtual machines.

  2. Select your VM and go to Settings > Extensions.

  3. From the top of the command bar in the right-pane, select + Add.

    Screenshot showing + Add selected to add an extension in the chosen Arc-enabled VM.

  4. In the Install extension, choose from the available extensions. In this example, we'll deploy the Custom Script Extension for Windows - Azure arc.

    Screenshot showing the Custom Script Extension selected in the chosen Arc-enabled VM.

  5. Provide the parameters to configure the selected VM extension. For example, if you choose Custom Script Extension, on the Create tab, input the script file and the arguments that you want to execute at runtime.

    Make sure that the script to execute is uploaded in an Azure Storage account and the VM can reach the storage account.

    Screenshot showing configuration of Custom Script Extension installation in the chosen Arc-enabled VM.

  6. Select Review + Create.

The extension may take a few minutes to install. After the extension is installed, the list refreshes to display the newly installed extension.

List installed extensions

You can get a list of all the VM extensions installed on your Azure Stack HCI cluster.

Follow these steps in Azure portal to list the installed VM extensions.

  1. In the Azure portal of your Azure Stack HCI cluster resource, go to Resources (Preview) > Virtual machines.

  2. Select your VM and select Extensions.

  3. In the right pane, you can view the list of extensions on your VM.

    Screenshot showing the list of installed extensions for the chosen Arc-enabled VM.

Delete VM extension

You may want to delete a VM extension if the installation fails for some reason or if the extension is no longer needed.

Follow these steps in Azure portal to remove a VM extension.

  1. In the Azure portal of your Azure Stack HCI cluster resource, go to Resources (Preview) > Virtual machines.

  2. Select your VM and select Extensions.

  3. From the list of extensions on your VM, choose the extension you wish to remove. From the top command bar, select Uninstall to remove the extension.

    In this example, Custom Script Extension for Windows - Azure arc is selected.

    Screenshot showing Uninstall selected for the chosen Arc-enabled VM.

The extension should take a couple minutes for removal.

Next steps

Learn how to: