Skip to content

Conversation

@djs55
Copy link
Collaborator

@djs55 djs55 commented Jul 15, 2015

If Volume.stat returns multiple URIs, we will prefer to use a datapath plugin that exposes the NONPERSISTENT feature. Otherwise we will fall back to using Volume.clone.

Note that we use the new Volume.set and Volume.unset to store the key of the temporary clone-on-boot volume. We dereference this pointer before Datapath.attach etc. We omit these temporary volumes from SR.ls and we guarantee to clean them up on VDI.epoch_end, VDI.destroy, or VDI.attach (in the case where one leaked over a crashed and the VM restarted).

David Scott added 10 commits July 14, 2015 15:32
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>
@djs55
Copy link
Collaborator Author

djs55 commented Jul 15, 2015

travis is failing with

# File "main.ml", line 660, characters 47-57:
# Error: Unbound record field Args.VDI.Epoch_begin.persistent
# Command exited with code 2.

because I haven't released the xcp-idl changes yet.

djs55 added a commit that referenced this pull request Jul 15, 2015
@djs55 djs55 merged commit d7d293b into xapi-project:master Jul 15, 2015
@djs55 djs55 deleted the epoch-open branch July 15, 2015 15:06
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.

1 participant