Add --with-snapshots to vitastor-cli modify --rename #191

Merged
vitalif merged 2 commits from koolkhel/vitastor:cli-rename-snapshots into master 2026-11-27 18:46:47 +03:00

2 Commits

Author SHA1 Message Date
b049e0f054 Rename snapshots in vitastor-cli modify only with --with-snapshots
Keep the default rename as it was. With --with-snapshots, rename the
snapshots <name>@* to <new-name>@* one by one after the image, through
the usual single-image rename, instead of in one transaction. Still
refuse the rename if any <new-name>@* already exists.
2026-11-25 22:50:02 +03:00
d9401b0bd2 Rename snapshots together with the image in vitastor-cli modify
Snapshots are separate inodes named <image>@<snap>, tied to their image
only by that name. `modify --rename` renamed the image alone, so its
snapshots kept the old name: they no longer showed up as the image's
snapshots (the OpenStack driver looks them up as <volume>@<snap>), and a
new image created under the old name would look like their owner.

Rename every <old>@* inode to <new>@* in the same etcd transaction as
the image, and refuse the rename if any <new>@* already exists. As a
side effect, `--rename <same name>` together with another change no
longer fails with "duplicate key given in txn request".
2026-11-25 20:23:58 +03:00