From eb2543b8cc65e6023c8869ae493feb20990930e4 Mon Sep 17 00:00:00 2001 From: kegregoi <53018919+kegregoi@users.noreply.github.com> Date: Fri, 26 Sep 2025 13:09:17 -0500 Subject: [PATCH] Update removing-extensions-netapp-cvo.md --- .../linux/removing-extensions-netapp-cvo.md | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/support/azure/virtual-machines/linux/removing-extensions-netapp-cvo.md b/support/azure/virtual-machines/linux/removing-extensions-netapp-cvo.md index b408b605455..29c704483ce 100644 --- a/support/azure/virtual-machines/linux/removing-extensions-netapp-cvo.md +++ b/support/azure/virtual-machines/linux/removing-extensions-netapp-cvo.md @@ -43,21 +43,40 @@ Cloud Volumes ONTAP doesn't support Azure VM extensions because extensions affec > Starting in BlueXP 3.9.54, NetApp enforces this pre-existing limitation as a notification in BlueXP. ## Resolution -To resolve this issue, run the following script against any affected NetApp CVO VMs in PowerShell: +To resolve this issue, run the following script against any affected NetApp CVO VMs: + +### [PowerShell](#tab/powershell) ```powershell - $subscriptionId = (Get-AzContext).Subscription.Id - $resourceGroup = "RGname" - $vmName = "VMName" - $apiVersion = "2025-04-01" - $uri = "https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.Compute/virtualMachines/${vmName}?api-version=${apiVersion}" - $response = Invoke-AzRestMethod -Method GET -Uri $uri - $vmModel = $response.Content | ConvertFrom-Json - $vmModel.resources = @() - $body = $vmModel | ConvertTo-Json -Depth 10 -Compress - Invoke-AzRestMethod -Method PUT -Uri $uri -Payload $body +$subscriptionId = (Get-AzContext).Subscription.Id +$resourceGroup = "RGname" +$vmName = "VMName" +$apiVersion = "2025-04-01" +$uri = "https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.Compute/virtualMachines/${vmName}?api-version=${apiVersion}" + +$response = Invoke-AzRestMethod -Method GET -Uri $uri +$vmModel = $response.Content | ConvertFrom-Json +$vmModel.resources = @() +$body = $vmModel | ConvertTo-Json -Depth 10 -Compress +Invoke-AzRestMethod -Method PUT -Uri $uri -Payload $body ``` +### [CLI](#tab/cli) + +```cmd +subscriptionId=$(az account show --query id -o tsv) +resourceGroup="RGName" +vmName="VMName" +apiVersion="2025-04-01" +uri="https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.Compute/virtualMachines/${vmName}?api-version=${apiVersion}" + +response=$(az rest --method get --uri "$uri") +vmModel=$(echo "$response" | jq '.resources = []') +az rest --method put --uri "$uri" --body "$vmModel" +``` + +--- + > [!NOTE] > 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.