Hyper-V

Hyper-V – Can’t start Virtual Machine because it’s backing up

Working as a small business often brings you little tasks here and there. Today I've decided to shut down the Hyper-V machine to expand its disks. Unfortunately for me, while extending of HDD went great, I couldn't start Virtual Machine any longer.

I knew something was up when during day Status for almost all Hyper-V machines was showing Backing up… but I did try to start it up anyways. Unfortunately, the error made it apparent that I have more things to do before I can proceed with my day. 

The application encountered an error while attempting to change the state of AD1. AD1 failed to change state. The operation cannot be performed while the object is in its current state.

In such a case, there are two things you can do. Reboot your Hyper-V server which will most likely fix it but will leave you in a bad feeling as you shouldn't fix issues by rebooting servers, or fix it which often requires a bit of additional work.

How to fix Hyper-V when it's in backing up state

This problem can be fixed by restarting Hyper-V Virtual Machine Management service. It's fairly safe operation and I never had problems doing so. When you stop that service you will be unable to manage Hyper-V.

There are of course two ways to do it – standard and PowerShell way. I wouldn't be myself if I wouldn't try to fix it with PowerShell even thou I knew, in this case, it most likely took more time to type all commands but I do that to enhance my PowerShell memory.

PS C:\Windows\system32> Get-Process | Where-Object { $_.Name -like '*vm*' }

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    853      46    64920      26748   203 ...60,51   2236 vmms
    964      67    18488       5032   190 6 665,33   3600 vmwp
    847      62    11572       7160   153   438,58   4212 vmwp
    723      64    16884       5088   188   479,36   4224 vmwp
    903      65    16032       4840   172   286,20   4464 vmwp
    601      65    11756       7148   157   475,37   8828 vmwp


PS C:\Windows\system32> Get-Process | Where-Object { $_.ProcessName -eq 'vmms' } | Stop-Process

Confirm
Are you sure you want to perform the Stop-Process operation on the following item: vmms(2236)?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
PS C:\Windows\system32> Start-Service VMMS
PS C:\Windows\system32>

As you can notice above I've made a small mistake and instead of using Restart-Service I went ahead and killed the process. It's useful if you ever have a service which doesn't want to be stopped you can do so by killing its process. Usually, you would first try and restart service using graceful way.

Get-Service vmms | Restart-Service

Via GUI you would press Start, type services.msc and find Hyper-V Virtual Machine Management and restart it.

After that, all right click actions are back again, and I was able to start the machine.

Przemyslaw Klys

System Architect with over 14 years of experience in the IT field. Skilled, among others, in Active Directory, Microsoft Exchange and Office 365. Profoundly interested in PowerShell. Software geek.

Share
Published by
Przemyslaw Klys

Recent Posts

Upgrade Azure Active Directory Connect fails with unexpected error

Today, I made the decision to upgrade my test environment and update the version of…

1 miesiąc ago

Mastering Active Directory Hygiene: Automating Stale Computer Cleanup with CleanupMonster

Have you ever looked at your Active Directory and wondered, "Why do I still have…

2 miesiące ago

Active Directory Replication Summary to your Email or Microsoft Teams

Active Directory replication is a critical process that ensures the consistent and up-to-date state of…

7 miesięcy ago

Syncing Global Address List (GAL) to personal contacts and between Office 365 tenants with PowerShell

Hey there! Today, I wanted to introduce you to one of the small but excellent…

11 miesięcy ago

Active Directory Health Check using Microsoft Entra Connect Health Service

Active Directory (AD) is crucial in managing identities and resources within an organization. Ensuring its…

1 rok ago

Seamless HTML Report Creation: Harness the Power of Markdown with PSWriteHTML PowerShell Module

In today's digital age, the ability to create compelling and informative HTML reports and documents…

1 rok ago