[Feature Request] lxc snapshot [<remote>:]<instance>/<snapshot> --replace

As of now I have to run the following script to accomplish what could be built in:

#!/bin/bash

## Replace backup snapshots

echo 
echo "Container Name?"
read containername

sudo lxc storage volume delete ${containername}-pool mysql-volume/backup & \
sudo lxc delete ${containername}/backup

sleep 1

sudo lxc snapshot ${containername} backup & \
sudo lxc storage volume snapshot ${containername}-pool mysql-volume backup

I suggest that snapshots could be overwritten with:

lxc snapshot [<remote>:]<instance>/<snapshot> --replace

and

lxc storage volume snapshot [<remote>:]<pool> <volume>/<snapshot> --replace

Would this be possible?
Thank you very much for considering!

1 Like

Maybe more as a flag to lxc snapshot and lxc storage volume snapshot that would just have the client handle the delete and create of the snapshot.

1 Like

Changed it to a flag.

Implemented in LXD 4.8 has been released - News - Linux Containers Forum