Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dunkelstern
Copy link

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
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

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
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

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