Setting volume snapshot expiration at pool level

Is there a way to set the expiration of volumes snapshot at the pool level, similar in what is possible to do with instance snapshots in profiles (snapshots.expiry)?

I see that the same property can be assigned in the volume, but not sure whether it is possible for pools, making all volume inheriting it.

Hi,

It should work if you set the configuration key with volume. prefix to the desired pool. This will apply the configuration (without the volume. prefix) to the new volumes within the pool.

For example:

lxc storage set my-pool volume.snapshots.expiry=1d

EDIT: Pool configuration with prefix volume. is applied only to newly created volumes. Existing volumes would need to be updated manually.

This will only apply to new volumes though right?

Yes, that is correct. It will only be applied to new volumes. Existing ones will remain unchanged. Do we have a way to enforce configuration over all existing volumes within a pool?

No not currently, that config key would need to be applied to existing volumes.

1 Like

It should work if you prefix the configuration key with with volume.. This will apply the configuration (without the volume. prefix) to the volumes within the pool.

For example:

lxc storage set my-pool volume.snapshots.expiry=1d

That works, perfect. Thanks @dinmusic! I searched this in the documentation, and didn’t find the option. Now I’m seeing that it is mentioned here. Is it mentioned anywhere else in the doc?

And regarding the enforcing over existing volumes, it would be great to have the option… Let me know if you want me to open an issue.

1 Like

I’m glad it helped.

Yes, this is described under Manage volumes - Configure default values for storage volumes.

1 Like