Cannot restore VM (code 2045)

Situation

A Hyper-V restore plan fails with the following error: Cannot restore VM. Restoring virtual machines to Hyper-V requires deletion of target Hyper-V VM. Failed to delete Hyper-V machine: test-restore-VM

Cause

This error occurs on Hyper-V cluster VMs restore attempts to the original location while VM on the target location is in running state.

Solution

To restore clustered VMs to the original location, running VM must be deleted manually. To do this, proceed as follows:

  1. Open Failover Cluster Manager.
  2. Find the required cluster, expand it, then select Roles.
  3. Select the VM listed in the error, right-click on it, then select Remove.

  1. As the running VM is deleted, run the restore plan again.
https://git.cloudberrylab.com/egor.m/doc-help-kb.git