-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: Add zfs vol driver #11
Conversation
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
The clone method only accepts snapshot. Destroy does not fail if the volume has children. Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
…estroyed Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
This commit adds the following parameters during vdi creation: - mountpoint - compression - devices - mode Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
This commit adds promoting when a snapshot is taken together with the clone that is created. This allows to remove the main volume during revert-from-snapshot. This also allows to revert from any snapshot. Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
This commit improves how the driver destroys volumes and snapshots. The commit creates a tree structure in which snapshots are the parent of volumes and other snapshots. The root of this tree is the oldest snapshot. The button of the three is the latest snapshot. Snapshots can be destroy from top to button (from oldest to lastest) or from button to top (from latest to oldest). Those snapshots that have volumes cannot be destroyed until all volumes are destroyed. Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
This commit creates zfsutil.py library that contains the class ZFSUtil that instantiates the interface COWUtil. This interface contains common operations over volumes. The commit rewrites volume.py and sr.py by using this library. The commit also extends current COWUtil interface by adding three new operations: - promote - destroy - clone These operations are supported by zfs volumes. Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
|
||
ZFS_UTIL_BIN = 'zfs' | ||
|
||
class ZFSUtil(COWUtil): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is not implemented:
@staticmethod
def getImgFormat(dbg):
return 'raw'
I suppose we must return 'raw' like the RawUtil
helper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for is_empty
, I know it's used in epc_open
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented getImgFormat()
and is_empty()
. However, I am not sure what is the meaning of is_empty()
. I implemented like:
@staticmethod
def is_empty(dbg, vol_path):
raise NotImplementedError()
6676808
to
64f9178
Compare
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
64f9178
to
a940857
Compare
This commit deals with the case in which a snapshot with a single volume child is destroyed. To do so, the volume is first promoted, then the clone is destroyed and finally the snapshot can be destroyed. Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
0a5d2d0
to
eb08a8a
Compare
Trying to interpret the exit status of arbitrary called processes as an errno value, and disregard the stderr content we extract for a reason, had little chance to be useful. Signed-off-by: Yann Dirson <yann.dirson@vates.fr> (cherry picked from commit 2b6fb6c)
e09759f
to
1363a8c
Compare
And mount it under /var/run/sr-mount/ not / for consistency with other SRs. * characters valid in XAPI SR name is not the same as those valid for a ZFS pool name, so use UUID instead (would not be able to use under xcp-ng-tests otherwise) * ZFS requires the pool name to start with a letter, so use "sr-" as prefix Just enough for sr-create/destroy, but breaks all volume manipulation.
This part deals with the volume manipulation. Since the volume plugin does not use a "SR metadata" struct we have to introduce a separate helper function here - and since we mostly care about it when accessing a volume, simply handle creation of volume name in one place. This is unfortunately needed in other loosely-related code units, so hardcoding goes on...
1363a8c
to
b752c6c
Compare
Included-in/superceded-by #17, now merged! |
This PR adds a ZFS volume driver. The current work is a work-in-progress. The goal of this PR is only for reviewing. Note that both the architecture and the implementation shall be reviewed. The architecture is described in the design document.