-
Notifications
You must be signed in to change notification settings - Fork 15
Clone on boot #27
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
Merged
Merged
Clone on boot #27
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This allows datapath plugins to be clever, creating temporary linked clones on local storage or enabling caching. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
This creates the foundation for watching the datapath plugins. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
We keep a table of the known datapath plugins so we can choose the most appropriate one to use. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Upon VDI.epoch_begin with persistent = false, we call `Volume.stat` to discover the possible URIs. We look first for a datapath plugin which can perform clone-on-boot natively (e.g. by truncating vhd leaves) and delegate to that. If a datapath plugin doesn't exist then we will fall back to the Volume.clone / Volume.destroy API. This will be done in a later patch. We expose the VDI_RESET_ON_BOOT/2 capability if the volume plugin supports VDI_CLONE. This isn't ideal as it won't cover the case where a LUN-per-VDI SR which doesn't support VDI.CLONE nevertheless can support clone-on-boot if the tapdisk datapath is used. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
When the toolstack calls VDI.epoch_begin we query the volume and choose the datapath. If the datapath doesn't expose the NONPERSISTENT capability then we use Volume.clone to make a temporary volume. The key of the volume is added to the metadata of the original volume. In subsequent functions we call `Volume.stat` on the original volume, discover the _clone_on_boot_key and follow the link to the temporary volume. The temporary volume is destroyed on VDI.epoch_end and on Volume.destroy of the original volume. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
We do all clone-on-boot actions during the VDI.epoch_begin and VDI.epoch_end, so we can ignore this one. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
This avoids tripping up if Uri.(to_string (of_string x)) <> x from the point-of-view of the backend. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Collaborator
Author
|
travis is failing with because I haven't released the xcp-idl changes yet. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If
Volume.statreturns multiple URIs, we will prefer to use a datapath plugin that exposes theNONPERSISTENTfeature. Otherwise we will fall back to usingVolume.clone.Note that we use the new
Volume.setandVolume.unsetto store the key of the temporary clone-on-boot volume. We dereference this pointer beforeDatapath.attachetc. We omit these temporary volumes fromSR.lsand we guarantee to clean them up onVDI.epoch_end,VDI.destroy, orVDI.attach(in the case where one leaked over a crashed and the VM restarted).