|
| 1 | +--- |
| 2 | +title: Removing Extensions NetApp CVO Image |
| 3 | +description: This article guides you through removing extensions from Azure VMs created from NetApp CVO images. |
| 4 | +services: virtual-machines |
| 5 | +ms.collection: linux |
| 6 | +ms.service: azure-virtual-machines |
| 7 | +author: GabstaMSFT |
| 8 | +ms.topic: troubleshooting |
| 9 | +ms.tgt_pltfrm: vm-linux |
| 10 | +ms.custom: linux-related-content |
| 11 | +ms.workload: infrastructure |
| 12 | +ms.date: 08/25/2025 |
| 13 | +ms.author: Gabsta |
| 14 | +--- |
| 15 | + |
| 16 | +# Removing extensions from VMs created from NetApp CVO images |
| 17 | +**Applies to:** :heavy_check_mark: NetApp CVO Linux VMs |
| 18 | + |
| 19 | +This article discusses how to remove extensions that are installed on Microsoft Azure virtual machines (VMs) that are created from NetApp Cloud Volumes ONTAP (CVO) images. This article also discusses how to prevent extensions from being installed. |
| 20 | + |
| 21 | +## Prerequisites |
| 22 | +- The NetApp CVO resource group has a "delete" lock feature that might prevent the script from uninstalling VM extensions. You might have to remove the lock and restore it after you run the scripts in the "Resolution" section. The lock properties are as follows: |
| 23 | + |
| 24 | + - Name: (matches the CVO resource group name) |
| 25 | + - Type: **Delete** |
| 26 | + - Scope: **CVO resource group** |
| 27 | + |
| 28 | + :::image type="content" source="media/netapp-cvo-issue/netapp-cloud-volumes-ontap-lock.png" alt-text="The NetApp Cloud Volumes ONTAP Locks screen might list a delete lock that must be removed before you run a script to uninstall extensions.png."::: |
| 29 | + |
| 30 | +- Download and install the latest version of the Windows Installer (MSI) agent from the [GitHub page for Azure Windows VM Agent releases](https://github.com/Azure/WindowsVMAgent/releases). You must have administrator rights to complete the installation. |
| 31 | + |
| 32 | +## Symptoms |
| 33 | +You receive the following error message: |
| 34 | + |
| 35 | +_Cloud Volumes ONTAP is not compatible with Azure VM extensions. VM extensions are currently installed on your Azure VM. Contact Microsoft Azure support to remove those extensions._ |
| 36 | + |
| 37 | +:::image type="content" source="media/netapp-cvo-issue/cloud-volumes-ontap-error.png" alt-text="You receive an error message that states that Cloud Volumes ONTAP isn't compatible with Azure VM Extensions."::: |
| 38 | + |
| 39 | +## Cause |
| 40 | +Cloud Volumes ONTAP doesn't support Azure VM extensions because extensions affect BlueXP management operations. Although CVO VM appears as Linux (ONTAP version) in the Azure portal, it's actually a highly customized derivative of the FreeBSD operating system that ONTAP uses. |
| 41 | + |
| 42 | +> [!NOTE] |
| 43 | +> Starting in BlueXP 3.9.54, NetApp enforces this pre-existing limitation as a notification in BlueXP. |
| 44 | +
|
| 45 | +## Resolution |
| 46 | +To resolve this issue, run the following script on every VM: |
| 47 | + |
| 48 | +```powershell |
| 49 | + $subscriptionId = (Get-AzContext).Subscription.Id |
| 50 | + $resourceGroup = "RGname" |
| 51 | + $vmName = "VMName" |
| 52 | + $apiVersion = "2025-04-01" |
| 53 | + $uri = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroup/providers/Microsoft.Compute/virtualMachines/$vmName`?api-version=$apiVersion" |
| 54 | + $response = Invoke-AzRestMethod -Method GET -Uri $uri |
| 55 | + $vmModel = $response.Content | ConvertFrom-Json |
| 56 | + $vmModel.resources = @() |
| 57 | + $body = $vmModel | ConvertTo-Json -Depth 10 -Compress |
| 58 | + Invoke-AzRestMethod -Method PUT -Uri $uri -Payload $body |
| 59 | +``` |
| 60 | + |
| 61 | +> [!NOTE] |
| 62 | +> This operation might take 20-30 minutes to finish if the guest agent doesn't exist. This condition occurs because Azure CRP polls for the agent status first. The script removes all extensions from a VM model. |
| 63 | +
|
| 64 | +## More information |
| 65 | + |
| 66 | +To prevent extensions from installing in VMs without a guest agent or extensions, disable extensions. You can disable extensions either through a policy definition or by setting `AllowExtensionOperations` to `false`. |
| 67 | + |
| 68 | +### Option 1: Set a policy definition |
| 69 | + |
| 70 | +```json |
| 71 | +{ |
| 72 | + "if": { |
| 73 | + "allOf": [ |
| 74 | + { |
| 75 | + "field": "type", |
| 76 | + "equals": "Microsoft.Compute/virtualMachines/extensions" |
| 77 | + } |
| 78 | + ] |
| 79 | + }, |
| 80 | + "then": { |
| 81 | + "effect": "deny" |
| 82 | + } |
| 83 | +} |
| 84 | +``` |
| 85 | + |
| 86 | +### Option 2: Set AllowExtensionOperations to false |
| 87 | + |
| 88 | +```powershell |
| 89 | +$vm = Get-AzVM -Name <VMName> -ResourceGroupName <ResourceGroupName> |
| 90 | +$vm.OSProfile.AllowExtensionOperations = $false |
| 91 | +$vm | Update-AzVM |
| 92 | +``` |
| 93 | + |
| 94 | +## References |
| 95 | + |
| 96 | +[Installing Azure VM management extensions into Cloud Volume ONTAP](https://kb.netapp.com/Cloud/Cloud_Volumes_ONTAP/Can_Azure_VM_Management_Extensions_be_installed_into_Cloud_Volume_ONTAP) |
| 97 | + |
| 98 | +[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)] |
| 99 | + |
| 100 | +[!INCLUDE [third-party-disclaimer](../../../includes/third-party-disclaimer.md)] |
| 101 | + |
| 102 | +[!INCLUDE [Third-party disclaimer](../../../includes/third-party-contact-disclaimer.md)] |
0 commit comments