Make LVM snapshots read-only.
This commit is contained in:
parent
2ce09dbf82
commit
4b18c0bc81
@ -89,6 +89,8 @@ def snapshot_logical_volume(
|
||||
'--snapshot',
|
||||
('--extents' if '%' in snapshot_size else '--size'),
|
||||
snapshot_size,
|
||||
'--permission',
|
||||
'r', # Read-only.
|
||||
'--name',
|
||||
snapshot_name,
|
||||
logical_volume_device,
|
||||
|
@ -9,6 +9,7 @@ def parse_arguments(*unparsed_arguments):
|
||||
parser.add_argument('--snapshot', action='store_true', required=True)
|
||||
parser.add_argument('--extents')
|
||||
parser.add_argument('--size')
|
||||
parser.add_argument('--permission', required=True)
|
||||
parser.add_argument('--name', dest='snapshot_name', required=True)
|
||||
parser.add_argument('logical_volume_device')
|
||||
|
||||
|
@ -99,6 +99,8 @@ def test_snapshot_logical_volume_with_percentage_snapshot_name_uses_lvcreate_ext
|
||||
'--snapshot',
|
||||
'--extents',
|
||||
'10%ORIGIN',
|
||||
'--permission',
|
||||
'r',
|
||||
'--name',
|
||||
'snap',
|
||||
'/dev/snap',
|
||||
@ -116,6 +118,8 @@ def test_snapshot_logical_volume_with_non_percentage_snapshot_name_uses_lvcreate
|
||||
'--snapshot',
|
||||
'--size',
|
||||
'10TB',
|
||||
'--permission',
|
||||
'r',
|
||||
'--name',
|
||||
'snap',
|
||||
'/dev/snap',
|
||||
|
Loading…
x
Reference in New Issue
Block a user