Incus storage volume snapshot create does not use configured pattern for name

I wanted to set the pattern for custom volume as such :

config:
  snapshots.pattern: '{{ creation_date|date:''2006-01-02_15-04-05'' }}-%d'

However it seems to be ignored and use the default “snap-%d” pattern.

Also is there a way to configure the default pattern globally ?

I’m using incus 6.0.2 on debian 12

So you’ve set that through incus storage volume set and incus storage volume snapshot create didn’t respect it?

As for setting this more globally, you should be able to set volume.snapshots.pattern on the storage pool itself which would then apply to all volumes.

I used incus storage volume edit to add the configuration.

If I try using set (I wasn’t before) on the whole storage pool :

$ incus storage set zfast snapshots.pattern="{{ creation_date|date:'2006-01-02_15-04-05' }}-%d"
Error: Invalid option "snapshots.pattern"

On the volume, it works (no error), but the parameter is ignored.

On the other hand, the parameter snapshots.expiry is taken in account.

incus storage set would have to be volume.snapshots.pattern instead of snapshots.pattern.

Indeed, I can set volume.snapshots.pattern on a storage pool, thanks for pointing this out !
However it is still not taken in account when creating a snapshot. :frowning:

Could this depend on the kind of storage pool ? It is a ZFS block volume storage pool, in case of …

It’s unlikely to be backend specific, there must be a bug somewhere in the naming logic.

Can you file a bug at Issues · lxc/incus · GitHub?

Ok, I did. I guess we can close this subject.