Skip to content

Commit 985ca4d

Browse files
trgillrichm
andcommitted
feat: add support for snapshot manager backing the role
Snapshot Manager is available on Centos 10, RHEL 9 and RHEL 10. Update to be compatiable with legacy code that is already deployed. Note that both the legacy code and snapm have minimum sizes for any snapshot of an origin. If the minimum size is used, an extend may not expand the size if the additional space is still below the minimum size. Currently the minimum size for snapm is 512 MiB. Future versions will decrease to 64 MiB. Some adjustment to the extend tests were made in this change to deal with failures of verify expecting expand to return true when the requested size was still below the minimum. Signed-off-by: trgill <tgill@redhat.com> Co-authored-by: Richard Megginson <richm@stanfordalumni.org>
1 parent 1c46546 commit 985ca4d

22 files changed

+3179
-2275
lines changed

library/snapshot.py

Lines changed: 71 additions & 2196 deletions
Large diffs are not rendered by default.

module_utils/snapshot_lsr/__init__.py

Whitespace-only changes.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
class SnapshotCommand:
2+
SNAPSHOT = "snapshot"
3+
CHECK = "check"
4+
REMOVE = "remove"
5+
REVERT = "revert"
6+
EXTEND = "extend"
7+
LIST = "list"
8+
MOUNT = "mount"
9+
UMOUNT = "umount"
10+
INVALID = "invalid"
11+
12+
13+
class SnapshotStatus:
14+
SNAPSHOT_OK = 0
15+
ERROR_INSUFFICIENT_SPACE = 1
16+
ERROR_ALREADY_DONE = 2
17+
ERROR_SNAPSHOT_FAILED = 3
18+
ERROR_REMOVE_FAILED = 4
19+
ERROR_REMOVE_FAILED_NOT_SNAPSHOT = 5
20+
ERROR_REMOVE_FAILED_INUSE = 6
21+
ERROR_REMOVE_FAILED_NOT_FOUND = 7
22+
ERROR_LVS_FAILED = 8
23+
ERROR_NAME_TOO_LONG = 9
24+
ERROR_ALREADY_EXISTS = 10
25+
ERROR_NAME_CONFLICT = 11
26+
ERROR_VG_NOTFOUND = 12
27+
ERROR_LV_NOTFOUND = 13
28+
ERROR_VERIFY_NOTSNAPSHOT = 14
29+
ERROR_VERIFY_COMMAND_FAILED = 15
30+
ERROR_VERIFY_NOT_FOUND = 16
31+
ERROR_CMD_INVALID = 17
32+
ERROR_VERIFY_REMOVE_FAILED = 18
33+
ERROR_VERIFY_REMOVE_SOURCE_SNAPSHOT = 19
34+
ERROR_SNAPSET_SOURCE_DOES_NOT_EXIST = 20
35+
ERROR_SNAPSET_CHECK_STATUS_FAILED = 21
36+
ERROR_SNAPSET_INSUFFICIENT_SPACE = 22
37+
ERROR_JSON_PARSER_ERROR = 23
38+
ERROR_INVALID_PERCENT_REQUESTED = 24
39+
ERROR_UNKNOWN_FAILURE = 25
40+
ERROR_REVERT_FAILED = 26
41+
ERROR_EXTEND_NOT_SNAPSHOT = 27
42+
ERROR_EXTEND_NOT_FOUND = 28
43+
ERROR_EXTEND_FAILED = 29
44+
ERROR_EXTEND_VERIFY_FAILED = 29
45+
ERROR_UMOUNT_FAILED = 30
46+
ERROR_MOUNT_FAILED = 31
47+
ERROR_MOUNT_POINT_NOT_EXISTING = 32
48+
ERROR_MOUNT_NOT_BLOCKDEV = 33
49+
ERROR_MOUNT_INVALID_PARAMS = 34
50+
ERROR_MOUNT_POINT_ALREADY_MOUNTED = 35
51+
ERROR_MOUNT_VERIFY_FAILED = 36
52+
ERROR_UMOUNT_VERIFY_FAILED = 37
53+
ERROR_UMOUNT_NOT_MOUNTED = 38
54+
ERROR_CREATE_FAILED = 39
55+
ERROR_SNAPM_INTERNAL_ERROR = 40

0 commit comments

Comments
 (0)