NetApp / trident

Storage orchestrator for containers
Apache License 2.0
762 stars 222 forks source link

When using "snapshotReserve", snapshot deletion and trigger are not set #882

Open simonpie opened 10 months ago

simonpie commented 10 months ago

Describe the solution you'd like When using snapshotReserve, the following parameters should be set ( or options to set them should exist ) :

auto-delete: true
trigger: snap_reserve

The behaviour right now is not very user friendly (k8s users friendly). K8s users dont understand that they dont have space anymore in their volume because of snapshot overspilling.

When using snapshotReserve to 50% for exemple, with the two parameters above, user are garantied 10 GB of space if they asked 10 GB. Snapshot will not spill in the user's space.

Describe alternatives you've considered We created a script to fix those parameters on volume on which it is incorrect. We shall run this script daily to make sure new volumes created by trident are standard.

Additional context

Here is a volume created by trident and the snapshot autodelete parameters :

SuperNAS::> snapshot autodelete show -volume dev_vert_pvc_6004add8_e8a2_42db_8e63_8ee4c5e68876
Vserver    Volume          Option Name         Option Value
--------- --------------  ------------------  ---------------------
SuperVServer dev_vert_pvc_6004add8_e8a2_42db_8e63_8ee4c5e68876
                                     Enabled  false
                                  Commitment  try
                                     Trigger  volume
                           Target Free Space  20%
                                Delete Order  oldest_first
                                Defer Delete  user_created
                         Defer Delete Prefix  (not specified)
                                Destroy List  none

SuperNAS::> volume show -vserver SuperVServer   -fields percent-snapshot-space -volume
    -volume                -volume-style          -volume-style-extended
SuperNAS::> volume show -vserver *Dev*   -fields percent-snapshot-space -volume dev_vert_pvc_6004add8_e8a2_42db_8e63_8ee4c5e68876
vserver                volume                                            percent-snapshot-space
---------------------- ------------------------------------------------- ----------------------
SuperVServer dev_vert_pvc_6004add8_e8a2_42db_8e63_8ee4c5e68876 50%

SuperNAS::>
bert-jan commented 10 months ago

+1 for this enhancement. We're also running into the same issue.