Initiated a Delete of Instances in a Virtual Machine scale but instances not deleting.

Robert Pell 20 Reputation points
2025-09-18T23:01:55+00:00

Initiated a Delete of Instances in a Virtual Machine scale but instances not deleting.

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
{count} votes

Answer accepted by question author
  1. Ankit Yadav 6,345 Reputation points Microsoft External Staff Moderator
    2025-09-18T23:32:18.88+00:00

    Hello Robert Pell,

    Please try to delete the VM instance manually using below Azure CLI command and let us know if it fails/throws any error:

    First get the Instance ID of the VM which you want to delete using below command:

    az vmss list-instances --resource-group <your-resource-group> --name <your-vmss-name> --out table
    

    then try to delete the VM with the instance ID using below command:

    az vmss delete-instances --resource-group <your-resource-group> --name <your-vmss-name> --instance-ids <instance-id>
    

    Alternatively, you could use Powershell command too:

    Remove-AzVmss -ResourceGroupName "Group002" -VMScaleSetName "VMScaleSet002" -InstanceId "<instance-id>"
    

    Reference: https://learn.microsoft.com/en-us/powershell/module/az.compute/remove-azvmss?view=azps-14.4.0#example-2-remove-a-virtual-machine-from-within-a-vmss

    or if you are just looking to reduce the VM instance count from the VMSS, you could try scale-in operation on the VMSS.
    Sample Azure CLI command:

    az vmss scale --resource-group <your-resource-group> --name <your-vmss-name> --new-capacity <desired-instance-count>
    

    Let me know if it helps to delete the VM instance!!

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.