This project is read-only.

VHD.DynamicHeader.BlockSize question.

Apr 3, 2009 at 4:36 PM
Edited Apr 3, 2009 at 5:33 PM
Hello Festive_Ken, I'm seeing an issue with two different VHDs.  I have two VHDs, one created with a blocksize of  #1: 2097152 and another with #2: 524288. or 2M vs 512K. When I read/copy the #1 between different virtualization platforms it works just fine, but when I try with #2 it always becomes a non-bootable device and appears to be an empy disk. Now if I just copy the files they both work and are bootable.  Is there an issue reading a vhd with 512K block size in a dynamic vhd?

Thank you

-Thomas

To add some more information:

Disk #1 Info below:

 File Format Version: 1.0
         Creation Time: 3/27/2009 5:32:40 PM (UTC)
         Creator App: CTXS
         Creator Version: 5.0
         Creator Host OS: Wi2k
         Original Size: 1074790400 bytes
         Current Size: 1074790400 bytes
    Geometry (C/H/S): (2082/16/63)
          Disk Type: Dynamic
          Checksum: fffff08e
          Unique Id: 852c3e10-2fda-6247-803f-2fb2f8aa0edc
          Saved State: 0

Dynamic Disk Info
-----------------
         Cookie: cxsparse
         Header Version: 1.0
         Block Count: 513
         Block Size: 2097152 bytes
         Checksum: fffff474
         Parent Unique Id: 00000000-0000-0000-0000-000000000000
         Parent Write Time: 1/1/2000 12:00:00 AM (UTC)
         Parent Name:
    Parent Locations:


Disk #2 Info:

File Format Version: 1.0
      Creation Time: 8/25/2008 9:25:03 AM (UTC)
      Creator App: wsv
      Creator Version: 1.0
      Creator Host OS: Wi2k
      Original Size: 1073741824 bytes
      Current Size: 1073741824 bytes
      Geometry (C/H/S): (2080/16/63)
      Disk Type: Dynamic
      Checksum: fffff044
      Unique Id: c0d3aa55-8d1a-1f40-9381-0a07e00dc29b
      Saved State: 0

Dynamic Disk Info
-----------------
     Cookie: cxsparse
     Header Version: 1.0
     Block Count: 2048
     Block Size: 524288 bytes
     Checksum: fffff487
     Parent Unique Id: 00000000-0000-0000-0000-000000000000
     Parent Write Time: 1/1/2000 12:00:00 AM (UTC)
     Parent Name:
     Parent Locations:


 

Apr 3, 2009 at 10:21 PM
Hi Thomas,

As I understand it, Microsoft products always used to generate Dynamic disks with a 2MB chunk size.  However, Hyper-V tends to create disks with a 512KB chunk size.  Judging from the Creator App's for your disks, one's created by a non-Microsoft product (Citrix XenServer?) and the other Hyper-V.  512KB chunk sizes are perfectly legitimate, but it's quite possible that non-Microsoft VHD code hasn't been fully tested with 512KB chunk sizes since, until Hyper-V was available, they haven't been seen much in the wild.

It's not clear from your post what the difference is between your usage that works and doesn't work on the Hyper-V disk:
When I read/copy the #1 between different virtualization platforms it works just fine, but when I try with #2 it always becomes a non-bootable device and appears to be an empy disk. Now if I just copy the files they both work and are bootable.

Are you seeing problems using either disk with DiscUtil's VHD support?

I'm not sure which virtualization product the 512KB disk is failing on, but it would be interesting to hear.

Regards,

Ken
Apr 3, 2009 at 10:37 PM
Here's a few scenerios:  ( and yes the non-Microsoft VHD is from XenServer).

#1.  VHD created in Hyper-V (512KB)
#2.  VHD created in XenServer (2MB)

I can "copy" the vhd file to and from XenServer and have both work.

Since XenServer can have RAW disks I need to be able import just the content.
So...

I have two streaming tools, one Citrix's vhdStream (C++ native library) and DiscUtils.
If I use DiscUtils.Vhd.Disk.Content
    1. vhd#2 stream it to the xenserver import mechanism the VM will work fine.
    2. vhd#1 stream it to the xenserver import mechanism the VM is non-bootable, disk not bootable.
        The disk if copied out has the VHD structure but NO data, doesn't even see partition table.
If I use vhdStream
    1. vhd#2 stream it to the xenserver import mechanism the VM will work fine.
    2. vhd#1 stream it to the xenserver import mechanism the VM will work fine..

Since I would rather use managed code, I was giving DiscUtils a shot.

So I was wondering if there may be an issue in DiscUtils in the handling of the 512kb block sizes? 

-Thomas





Apr 3, 2009 at 11:47 PM
Thanks Thomas - I've just checked in a fix to the VHD code in discutils which I hope fixes this.

Cheers,

Ken
Apr 4, 2009 at 12:25 AM
That appeared to have worked.

Thanks Ken for the quick response.

-Thomas