-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: rename template to snapshot and add initial files for classic LVM snapshot support #2
Conversation
7dbaedc
to
e1a4406
Compare
3a1f3b9
to
364cbae
Compare
c1f7a4e
to
2d3181d
Compare
87238d3
to
c34c167
Compare
[citest] |
tasks/files/snapshot.py
Outdated
"{0:d} is not a positive integer".format(value) | ||
) | ||
except ValueError as error: | ||
raise Exception("{0:04x} is not an integer".format(value)) from error |
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've never seen this before - raise ... from ex
- but python 2 on EL7 does not like it
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.
or - if it is valid for python3, and you want the script to only work with python3, then we'll need to have the role install python3 on EL7 systems
Just a couple of changes to snapshot.py to make it work with python2 on el7. ---
__snapshot_python: /usr/bin/python With these changes, all of the EL7 tests pass |
Signed-off-by: Todd Gill <[email protected]>
302db46
to
56881cb
Compare
The script is implemented as a command line. The following commands are supported: positional arguments: {snapshot,check,clean} Available operations snapshot Snapshot given VG/LVs check Check space for given VG/LV clean Cleanup snapshots The script supports the following parameters: options for snapshot: -h, --help show this help message and exit -a, --all snapshot all VGs and LVs -vg VOLUME_GROUP, --volumegroup VOLUME_GROUP volume group to snapshot -lv LOGICAL_VOLUME, --logicalvolume LOGICAL_VOLUME logical volume to snapshot -r REQUIRED_SPACE, --requiredspace REQUIRED_SPACE percent of required space in the volume group to be reserved for snapshot -s SUFFIX, --suffix SUFFIX suffix to add to volume name for snapshot -p PREFIX, --prefix PREFIX prefix to add to volume name for snapshot options for check: -h, --help show this help message and exit -a, --all check all VGs and LVs -v, --verify verify VGs and LVs have snapshots -vg VOLUME_GROUP, --volumegroup VOLUME_GROUP volume group to check -lv LOGICAL_VOLUME, --logicalvolume LOGICAL_VOLUME logical volume to check -r REQUIRED_SPACE, --requiredspace REQUIRED_SPACE percent of required space in the volume group to be reserved for check -s SUFFIX, --suffix SUFFIX suffix to add to volume name for check - will verify no name conflicts -p PREFIX, --prefix PREFIX prefix to add to volume name for check - will verify no name conflicts options for clean: -h, --help show this help message and exit -a, --all clean all VGs and LVs -v, --verify verify clean completed for VGs and LVs -vg VOLUME_GROUP, --volumegroup VOLUME_GROUP volume group to cleanup/remove -lv LOGICAL_VOLUME, --logicalvolume LOGICAL_VOLUME logical volume to cleanup/remove -s SUFFIX, --suffix SUFFIX suffix to add to volume name for cleanup/remove -p PREFIX, --prefix PREFIX prefix to add to volume name for cleanup/remove Signed-off-by: Todd Gill <[email protected]> Co-authored-by: Richard Megginson <[email protected]>
Signed-off-by: Todd Gill <[email protected]> Co-authored-by: Richard Megginson <[email protected]>
Signed-off-by: Todd Gill <[email protected]> Co-authored-by: Sergei Petrosian <[email protected]> Co-authored-by: Richard Megginson <[email protected]>
Each .yml file maps to a command supported by the snapshot CLI. Signed-off-by: Todd Gill <[email protected]> Co-authored-by: Richard Megginson <[email protected]>
Future testing to be added with preallocated LVM VGs/LVs for testing different setups. Signed-off-by: Todd Gill <[email protected]>
Change from template to snapshot. Signed-off-by: Todd Gill <[email protected]>
for reuse The qemu tests create a VM with scratch block devices to be used to create VGs/LVs to be used as the soruce for testing snapshots. The find_unused_disk function returns a list of disk that have no contents inside the VM. Signed-off-by: Todd Gill <[email protected]>
Signed-off-by: Todd Gill <[email protected]>
copied from the storage role Signed-off-by: Todd Gill <[email protected]>
56881cb
to
80d5d32
Compare
[citest] |
Well, the el7 tests pass locally for me :-( |
Looks like an issue with the test framework. |
Enhancement:
Adding initial files for snapshot role. Currently supports only LVM classic (thick) snapshots.
Reason:
A role to support simple automated snapshot generation for LVM. Future support for LVM Thin, Stratis, BTRFS etc to be considered.
Result:
Basic support for creating added
Issue Tracker Tickets (Jira or BZ if any):
[RHELBU-1993]