How to delete a VM that is being protected by Azure Site Recovery

Share this:

In this Tutorial we are going over the process to force a deletion of a VM in System Center Virtual Machine Manager 2012 R2 when it has been protected with Azure Site Recovery protection. Most of the times, the administrator will remove the protection from the given VM before trying to delete, but in some LAB environment the subscription may not be even valid and the VM can be deleted right way. Note: Our recommendation is always to remove the protection and remove the VM afterwards when there is valid data on the VM.

A virtual machine that has Microsoft Azure Site Recovery protection enabled cannot be deleted.

Disable Microsoft Azure Site Recovery protection on the virtual machine and try the operation again.

Solution


When the administrator tries to delete the VM using the VMM console, the following error message will be displayed.

image

The administrator can always check the properties of the VM, and then on Hardware Configuration, click on Microsoft Azure Site Recovery on this section the information about the protection will be listed. In this specific case the VM is no longer required and the Azure subscription is no longer valid as well.

image

A simple way to remove the VM is using Virtual Machine Manager Command Shell, as follows:

Get-VM –VMHost <Hyper-V> | select name

Remove-VM –VM <VMName> –Force

image

After running the cmdlet above, the VM will be removed and it will be no longer available on VMM Console as well.

image

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).

Related Post

How to disconnect media on all VMs in SCVMM 2008 R... Hello folks, Today I had a requirement to disable configure all VMs of a SCVMM 2008 R2 to  No Media and I could’ve gone to each one of the VMs, ask P...
System Center Virtual Machine Manager – Solv... In some scenarios, a refresh host or configurations to be applied on a Hyper-V host can fail with error 2912 (NO_PARAM). In this Tutorial, we are goin...
How to use maintenance mode in SCVMM 2012 In this Tutorial we are going over the process to configure maintenance mode of a Hyper-V host using SCVMM 2012 R2. Let’s define a scenario to show t...
SCOM Alert: WinRM is not functional or not the rig... On System Center 2012 R2 Operations Manager (SCOM) (with UR2) starting to appear Critical Alerts coming from System Center Advisor (SCA) saying that m...