Skip to content

Implement split disk images and allow xhyve to create disk image files#82

Open
dunkelstern wants to merge 2 commits intomachyve:masterfrom
dunkelstern:split-disk-image
Open

Implement split disk images and allow xhyve to create disk image files#82
dunkelstern wants to merge 2 commits intomachyve:masterfrom
dunkelstern:split-disk-image

Conversation

@dunkelstern
Copy link
Copy Markdown

This implements disk image files that are split into multiple files, this is stage one of allowing sparse disk images where empty sectors will not be written to the image file, but it is usable on it's own.

preadv/pwritev can not be used anymore if the read spans two disk image segments as we access two file descriptors here. But as a performance boost we could allow more than one thread reading/writing if they work on different image segments.

Additionally the disk image files will be created if they don't exist which means if you're using a split disk image the disk image is growable (just add more files to the set) and possibly shrinkable (just delete a part from the end of the set), if the target os supports it.

@dunkelstern
Copy link
Copy Markdown
Author

I have implemented sparse disk images on a branch based on this patch, if this is merged i can send another pull request with that patch.

Sparse disk images will only write sectors that contain other things than zeroes actually to disk and skip over those zero blocks. This is implemented with a lookup table in a second file. If there's interest please tell me.

@johanneswuerbach
Copy link
Copy Markdown

In https://github.com/zchee/docker-machine-driver-xhyve I implemented sparse images (machine-drivers/docker-machine-driver-xhyve#44) using #80 and OS X sparsebundle. Is there an advantage using your approach?

@dunkelstern
Copy link
Copy Markdown
Author

See http://blog.dunkelstern.de/2016/01/16/xhyve-lightweight-vm-for-mac-os-x/

TL;DR: You can shrink the image after it has become bloated, by repeatedly writing and deleting data, with external tooling (which does not exist yet)

@WANG-lp
Copy link
Copy Markdown

WANG-lp commented May 20, 2016

vote for this feature 👍 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants