Avatar of Sundeep V
Sundeep V
 asked on

File server not turning on after snapshot merge

Hi


We had multiple snapshots for one of our servers. So we just completed merge and all seemed ok. Once merge was completed. I deleted the checkpoint tree. 


Once deleted tried turning the Server on and it would not opening. Seems like its still pointing to the old AVHD. Is there something i need to do or missed?





Windows 10Windows Server 2016AzureHyper-V

Avatar of undefined
Last Comment
Lee W, MVP

8/22/2022 - Mon
David Johnson, CD

going into the vm settings what does it have for hard drive?  it is probably showing an avhdx.. change it to .vhd (.vhdx)
You will probably lose some data.. restore from backup
Sundeep V

ASKER
Its pointing to old AVHDX file, the snapshot.
I tried changing but its greyed out as shown below

I have checked and there is definitely no checkpoints. Either in settings or in the VM folders
David Johnson, CD

try running
get-vm | remove-vmsnapshot
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Sundeep V

ASKER
Do i just run that command? do i need to specify server name?
David Johnson, CD

you could specify the vmname

get-vm vmname | remove-vmsnapshot

but without a name it will remove all snapshots from all vm's
Sundeep V

ASKER
Tried both method. Seemed to go through without errors but on VM settings still showing the old avhdx file and unable to open the VM
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
David Johnson, CD

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jackie Man

Greyed out means that the vm is still online but it is hang.

Have you powered off / shutdown the vm?


Sundeep V

ASKER
Thanks currently copying the vhd files so have backup before i create new VM

And yes the VM is currently Off. There is no option to shutdown now, its showing off in console
Sundeep V

ASKER
Configured new virtual machine and noticed start menu desktop redirect and hone drive now not working.

Is this linked to me creating new vm? 


Your help has saved me hundreds of hours of internet surfing.
fblack61
David Johnson, CD

Redirected folders?  Machine not connected to domain?
Sundeep V

ASKER
All done - Noticed server IP was on DHCP so gave it the usual static IP and working again.

Will know mor once staff get in today but testing seems all ok

Thanks for your help David! much appreciated
Lee W, MVP

While I suspect David is correct in what will get you running again, I'd be curious to know if you tried the powershell commands to merge the AVHDX file into the VHDX.  Never tried it myself, but something one method works when another doesn't.  At the very least you might get a more descriptive, googlable error message.

The instructions below are found in the latter part of this document:https://documentation.n-able.com/backup/troubleshooting/Content/kb/Merge-differencing-disks-AVHD-AVHDX-to-boot-Hyper-V-machine-after-restoring-to-files-from-Hyper-V-datasource.htm

  • To merge files with PowerShell (requires Windows 10/Server 2016 and later):
    1. Open PowerShell and run command to navigate to directory where AVHDX and VHDX files are located:
      • Note: if files are on different disk than C:, first change to correct disk with disk letter in PowerShell prompt:
        • <disk letter>:
        • For example, if data is located on drive D:, command would be:
          • D:
      • To change to correct directory:
        • cd <directory path where files are located>
    2. Run following command on each AVHDX file:
      • Get-VHD .\<name of AVHDX file>.avhdx
    3. Note name of parent AVHDX file from ParentPath entry in output
    4. Repeat steps 2 and 3 until you have a list of all AVHDX files with their respective parent AVHDX files
    5. Beginning from newest AVHDX file (only AVHDX file with no child file), run following command:
      • Merge-VHD -Path '<path to AVHDX>' -DestinationPath '<path to parent AVHDX'
    6. Repeat step 5 on each AVHDX, always starting with newest available file
    7. Once all AVHDX files are consolidated, merge last AVHDX with main VHDX file:
      • Merge-VHD -Path '<path to AVHDX>' -DestinationPath '<path to main VHDX disk'
    8. Note: this method requires that the Merge-VHD and Get-VHD cmdlets be added to your PowerShell; if you do not have it added, you may receive the following error:
      • Merge-VHD : The term 'Merge-VHD' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
      • If you receive this error, run this command from an elevated PowerShell prompt to install the Merge-VHD cmdlet:
        • Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.