This project is read-only.

VHD disk sector merge

Feb 13, 2011 at 3:20 PM

Hi,

is it possible to merge a differential VHD disk into its parent? I mean not to fully clone, but to copy the changed sectors only.
I failed to find something which allows me to merge the sectors using the command line.

So if you have base.vhd <- diff1.vhd <- diff2.vhd, I want to allow two possible merges:
a) merge sectors of diff2.vhd into diff1.vhd, result: base.vhd <- diff1.vhd (diff2.vhd eleminated)
or
b) merge sectors of diff1.vhd into base.vhd, result: base.vhd <- diff2.vhd (diff1.vhd eleminated)

Thats the only feature missing to create a UI for managing disk snapshots.
I hope, some of you have an idea how to achieve this. 

Thanks,
Mike

Feb 25, 2011 at 9:17 AM

Hi Mike,

There's nothing in DiscUtils to do that today - I'll track it as a feature that could be added in future though.

Cheers,

Ken

Feb 25, 2011 at 9:17 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 18, 2011 at 8:54 PM

Couldn't this work today by opening the base disk layer for read/write, and opening the differential disk layer as read only.  Grabbing the differential disks extents and for each extent range reading from the differential and writing to the base disk?

Mar 19, 2011 at 11:14 AM

I was trying this using the public/protected interfaces of the library, but failed, because:

  1. I found no direct access to sector data (so i tried streams)
  2. Its very hard to create a stream directly operating on one layer
  3. I don't know the internal data structures as it appears to me that vhd meta data goes through the stream as well

So I still guess, the libraries need to be extended in some way (either implementing this feature or allowing some direct access to sector data in layers, or something else(?)).

Cheers,
Mike 

Mar 19, 2011 at 7:49 PM

Mike,

Your right, I missed that OpenLayer wants up calling DynamicStream and you can not set the parent to null.  If you could, I believe things would mostly work.  You'd grab the content stream from the layer, and the extents would be used blocks (no meta data).  I'd say what you want to do is 95% there, I thought it could be done today but those checks would need to be removed and any side affects dealt with.

Sorry,

Bill