From 23afd9679247431bbb20fc2257af746b34b10273 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 18 Oct 2020 17:32:15 +0200 Subject: targets: make sure LV snapshot names start with a letter Seems to be required for LVM to accept them. --- lbup/targets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}' -- cgit v1.2.3