diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-10-18 17:32:15 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-10-18 17:32:15 +0200 |
commit | 23afd9679247431bbb20fc2257af746b34b10273 (patch) | |
tree | eb618fcdd10bff4d522ce48c41b01ff5da2050fb | |
parent | 5997aca7ceeb25b5434afd164e11a4b7d01d222e (diff) |
targets: make sure LV snapshot names start with a letter
Seems to be required for LVM to accept them.
-rw-r--r-- | lbup/targets.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lbup/targets.py b/lbup/targets.py index e7e161e..ebcfa33 100644 --- a/lbup/targets.py +++ b/lbup/targets.py @@ -288,7 +288,8 @@ class TargetSSHLVM(TargetSSH): vg_name = lv_fullname.split('/')[0] # create a read-only snapshot with a random name - snapshot_name = secrets.token_urlsafe() + # make sure snapshot name starts with a letter + snapshot_name = 'a' + secrets.token_urlsafe() snapshot_fullname = '%s/%s' % (vg_name, snapshot_name) self._paramiko_exec_cmd(ssh, 'lvcreate --permission r --snapshot -L {size} -n {name} {origin}' |