Follow me on LinkedIn Follow me on Spotify  

dae's weblog

there's no fiction like non-fiction!
  • Start
  • BlackBerry
  • iPhone
  • Prius
  • laptop
  • verlanglijstje
  • willekeurig wachtwoord
  • social networking
  • contact
  • iPad
nl en 
Start > biz, com > Hyper-V Guest (VHD file) corrupt after resize AND HOW TO FIX IT

Hyper-V Guest (VHD file) corrupt after resize AND HOW TO FIX IT

2 april 2009 Dae Punt Reageer Ga naar reacties

Tweet

I recently dealt with a virtual server, running on a Microsoft Hyper-V Server host (the free version), which needed a lot of TEMP disk space during backup. The VHD file that the guest was running in needed to be resized to make more space. The file was 94 GB. I tried to make it a big bigger and resize it to 104 GB.

The instructions for this proces are simple:

  1. Shut down the guest
  2. Edit the guest properties and
  3. enlarge the disk (enlarge the VHD file)
  4. Bring the guest back online

Sounds simple, right? Here’s what went wrong:
The disk resize operation took a few seconds and the Hyper-V Server reported that something went wrong. After the failed disk resize the VHD file had become corrupt and the guest could not be started again!

Strange fact was that I was able to mount the VHD with WinImage and I was even able to extract file from the VHD. Basically a VHD file is a big file that holds an image of a hard disk (like an ISO file. When you burn an ISO file to CD or DVD the raw content of the ISO file is written to the CD, so your computer can recognize the files). If WinImage can read the file, why couldn’t I get Hyper-V Server to read it? When trying to start the guest Hyper-V Server reported an error within a few seconds and I couldn’t imagine anything severe being wrong with the file (just the guest server had become unstartable). What was wrong?!?!

I spent a night trying to figure what had gone wrong and trying to solve this mystery. During this night I made lots of backups of the VHD file. I tried converting it from VHD to VHD (maybe that would repair the file or unfold the mystery of the VHD that had suddenly become corrupt). Be advised: copying a 100 GB file from SCSI to USB takes forever and you need to use this time to figure out different scenario’s.

Lots and lots of articles, tools, questions asked in forums and lots and lots of answers, more tools and lots of suggestions, testdisk, partition tools, but I was sure there was nothing wrong with my file, but Hyper-V was wrong!

I converted the VHD to a VDMK file (VMWare’s hard disk format), trying to make it accessible by VMWare ESXi (the free version). The problem with VMWare ESXi is that it’s impossible (believe me, I tried!) to locally transfer a VDMK file from a USB drive onto the ESXi server. I hacked into the ESXi console (type in unsupported at TTY1, hit Enter and log in as root and then, try connect the USB drive, try to find the right /dev/device to mount and try a local file transfer; nothing worked!). Uploading it from a laptop or other PC (or SCP/SSH) simply takes too long just to figure out if it works. I tried connecting my laptop to the host (which I reinstalled with ESXi, after backing up the backup file of the VHD) and I ran into all sorts of trouble with Gigabit Speed-and-Duplex-Autodetect. In the end I had an ESXi host with a gigabit NIC, a laptop with a gigabit NIC, a crossover cable, all settings to Manual, 1 Gbps Full Duplex and yet the connection between the two was only 100 Mbps. Uploading at this speed would take forever and I was forced to come up with another plan…

By this time I got rid of the ESXi and went to Hyper-V based on the “real” Windows 2008 Server, which allowed more direct interaction between the host and the guest. Having a Vista Management PC between the two simply “doesn’t make things easier”. Believe me, guys: The Full Featured Windows 2008 Server Standard has built-in Hyper-V functionality (you need to install the Role, though) and it is well worth the money!

As time went by the birds outside were waknig up and I ran into an online article that suggested to do the following:

  1. Create a new guest on the Hyper-V host
  2. Point to the VHD file that you’re trying to repair
  3. During this process you have an addition option that lets you Edit the VHD file
  4. and the $1M issue: The Edit button allows you to change the VHD type from Fixed to Dynamic!

Yes, people! When you create a VHD file, your instinct tells you that a Fixed VHD file gives you more performance and stability. The general opinion is that Dynamic VHD files should be avoided, as the file needs to grow when the guest that ‘lives’ in it grows and that takes performance of your host and guest.

After converting the VHD from Fixed to Dynamic the guest was suddenly not corrupt anymore (?!?!) and the guest was startable and worked like a charm! Don’t ask me why you need to Create a New VM for this, but it takes a Hyper-V (free or paid version) seconds to destroy a Fixed VHD file and it took me hours to find out that converting it from Fixed to Dynamic would make it mountable by Hyper-V!

I would call this a bug or an unwanted feature. Anyway: The server was up, the sun was, too and I went to bed.

I don’t wish anybody a corrupt VHD file, but in case you run into one: I hope my story is a life saver! Don’t be shy and leave a comment if it did :-) Happy hacking!

Categorieën:biz, com Tags:handig, hekwerk, hyper-v, Microsoft Windows, software, support, vmware
  • Stewart

    Thank you.  What didn’t work for me was using edit.  My corrupt file could not be opened to edit it.  What DID work was using WinImage.  As  with yours, the image opened fine and I was then able to use the converter in WinImage to convert the vhd file to what it already was but with a new name.  That new vhd was fine and is now happily serving its purpose.

Onveilige EPD-smartcard krijgt nieuwe chip | Nieuws | Security | Computable.nl Dimdim: Web conferencing that just works
RSS
HootSuite - Social Media Dashboard

willekeurig wachtwoord

z4pgTZoy

tweet!

  1. Dae Punt
    Dae Punt: @hsl +1 :-)
    1 dag geleden

  2. Harold Leewis
    Harold Leewis: @daepunt 't enige wat ik niet wil is mijn username/password in plaintext smssen om mijn nummer toe te voegen.
    1 dag geleden

  3. Harold Leewis
    Harold Leewis: @daepunt Volgens mij wil je juist authenticatie helemaal los van een partij als google hebben. SMS lijkt me helemaal prima :)
    1 dag geleden

tags

Apple beta BlackBerry cebit CleverInsert gezondheid Google gratis handig hekwerk iPhone jd09nl Joomla! kunst & cultuur leuk Linux Mac materie media Microsoft Microsoft Exchange Microsoft Office Microsoft Windows mobile mooi muziek onderweg ooklog open source over... politiek reizen RSS security social networking software support taal Twitter verhuizen VoIP web2.0 woorden WordPress xml

RSS dae’s leeslijst

  • Er is een fout opgetreden, wat waarschijnlijk betekent dat de feed uit de lucht is. Probeer later opnieuw.

RSS handig

  • Pirate Proxy
  • Google NCR - No Country Redirect
  • Apple - Support - iTunes - Contact Us
  • Adding Bookmarklets on iPad and iPhone
  • Chromium OS builds by Hexxeh
  • Microsoft Action Pack
  • Backup Exec updates, Service Packs and Drivers
  • Naming Conventions for Google Apps Resources
  • SocialOomph
  • Voeg jouw bedrijf toe als LinkedIn Company
  • Microsoft Exchange Server Remote Connectivity Analyzer
  • IP Subnet Calculator
  • Convert Dell Service Tag to Express Service Code
  • NK2-bestanden importeren naar Outlook 2010
  • AVM Fritz!Box 7340 en XS4ALL over IPv6
  • MS File Checksum Integrity Verifier FCIV
  • How to access/enter Motherboard BIOS
  • Are You Certifiable?
  • NFGDump
  • φ² project

RSS support

  • Monitor “HP Proliant Server health on “Citrix XenServer” with Nagios » Ingmar Verheij - The dutch IT guy
  • Install smartmontools on Citrix XenServer - Info
  • TFTP deamon activeren onder OS X | appletips
  • Soekris 6501 USB Flash installation - PFSenseDocs
  • Printers offline in windows 2008 R2 | Online IT Support
  • Google NCR - No Country Redirect
  • Dell Support Center | Dell
  • Update Dell Bios in Ubuntu « Thoughtsdaily
  • Apple - Support - iTunes - Contact Us
  • Backup Exec updates, Service Packs and Drivers

links

  • @vark
  • AAB
  • AAB CC
  • AMEX
  • Analytics
  • Apple Dev Center
  • bit.ly
  • Brightkite
  • Byte
  • cli.gs
  • del.icio.us
  • Dipity
  • Docs
  • Facebook
  • FeedBurner
  • Flickr
  • Fortis Bank
  • FriendFeed
  • gdgt
  • Google Wave
  • Hyves
  • Klout
  • LinkedIn
  • MailChimp
  • Mobypicture
  • MySkyStatus
  • MySpace
  • Orkut
  • OV-chip
  • ping.fm
  • Plaxo
  • PostPost
  • rss-en
  • rss-nl
  • Seesmic
  • Skype
  • threadsy
  • TwAnalyzer
  • TweetStats
  • Twitnest
  • Twitter
  • TwitterFeed
  • Woopra
  • WordPress
  • Y!M
  • Y!P
  • Youtube

RSS ooklog

  • Sara Lijftogt
  • Wegert & Sadocco Galerie
  • Willem Hendriks
  • Viktor Baltus
  • Rotary Anna Paulowna e.o.
  • Roelien Hendriks
  • Per van Duijn (under)
  • Nigel Prins
  • Martin Broerse
  • Maria Mink

archive

  • april 2013 (1)
  • maart 2013 (2)
  • februari 2013 (1)
  • december 2012 (2)
  • november 2012 (1)
  • oktober 2012 (3)
  • augustus 2012 (1)
  • juli 2012 (1)
  • maart 2012 (5)
  • december 2011 (1)
  • november 2011 (1)
  • juli 2011 (2)
  • juni 2011 (2)
  • maart 2011 (4)
  • februari 2011 (4)
  • november 2010 (2)
  • oktober 2010 (1)
  • augustus 2010 (2)
  • juli 2010 (3)
  • juni 2010 (1)
  • mei 2010 (6)
  • april 2010 (2)
  • maart 2010 (10)
  • februari 2010 (5)
  • januari 2010 (9)
  • december 2009 (10)
  • november 2009 (7)
  • oktober 2009 (4)
  • september 2009 (16)
  • augustus 2009 (7)
  • juli 2009 (32)
  • juni 2009 (45)
  • mei 2009 (37)
  • april 2009 (34)
  • maart 2009 (54)
  • februari 2009 (11)
  • januari 2009 (13)
  • december 2008 (8)
  • november 2008 (3)
  • oktober 2008 (6)
  • september 2008 (16)
  • augustus 2008 (3)
  • juli 2008 (3)
  • juni 2008 (10)
  • mei 2008 (15)
  • april 2008 (22)
  • maart 2008 (11)
  • februari 2008 (16)
  • januari 2008 (20)
  • december 2007 (13)
  • november 2007 (12)
  • oktober 2007 (5)
  • september 2007 (7)
  • augustus 2007 (7)
  • juli 2007 (4)
  • juni 2007 (7)
  • mei 2007 (11)
  • april 2007 (7)
  • maart 2007 (12)
  • februari 2007 (8)
  • januari 2007 (13)
  • december 2006 (30)
  • november 2006 (27)
  • oktober 2006 (22)
  • september 2006 (24)
  • augustus 2006 (15)
  • juli 2006 (16)
  • juni 2006 (26)
  • mei 2006 (26)
  • april 2006 (34)
  • maart 2006 (24)
  • februari 2006 (22)
  • januari 2006 (28)
  • december 2005 (37)
  • november 2005 (27)
  • oktober 2005 (16)
  • september 2005 (17)
  • augustus 2005 (31)
  • juli 2005 (35)
  • juni 2005 (41)
  • mei 2005 (47)
  • april 2005 (30)
  • maart 2005 (44)
  • februari 2005 (30)
  • januari 2005 (32)
  • december 2004 (22)
  • november 2004 (25)
  • oktober 2004 (29)
  • september 2004 (35)
  • augustus 2004 (43)
  • juli 2004 (18)
  • juni 2004 (27)
  • mei 2004 (7)
  • april 2004 (42)
  • maart 2004 (37)
  • februari 2004 (22)
  • januari 2004 (33)
  • december 2003 (47)
  • november 2003 (44)
  • oktober 2003 (4)
  • september 2003 (9)
Top WordPress
Copyright © 2003-2013 dae's weblog
Thema door NeoEase. Geldige XHTML 1.1 en CSS 3.