Need to put a check in heketi to ensure that only 14 snapshots are allowed on a volume.
This cannot be done in Heketi. It does not have a snapshot API.
I think this is instead going to be done with Documentation. But are you asking for Heketi not to check, but instead send the following command: gluster snapshot config [vol-name] [<snap-max-limit> <count>] [<snap-max-soft-limit> <percentage>] [force] Which sets the limit?
https://github.com/heketi/heketi/issues/419
Restricted the snapshots limit to 14 on a particular volume using the following command gluster snapshot config [vol-name] [<snap-max-limit> <count>] [<snap-max-soft-limit> <percentage>] [force] [root@dhcp37-163 ~]# heketi-cli --version heketi-cli 2.0.6 Once the soft limit reached throws the warning message like in the below sh-4.2# gluster snapshot create snaplimit_13 vol_e7d26963ac1d4ecaa02f76b2c13ae> snapshot create: success: Snap snaplimit_13_GMT-2016.07.22-00.41.07 created successfully Warning: Soft-limit of volume (vol_e7d26963ac1d4ecaa02f76b2c13ae23a) is reached. Snapshot creation is not possible once hard-limit is reached. sh-4.2# gluster snapshot create snaplimit_14 vol_e7d26963ac1d4ecaa02f76b2c13ae> snapshot create: success: Snap snaplimit_14_GMT-2016.07.22-00.41.27 created successfully Warning: Soft-limit of volume (vol_e7d26963ac1d4ecaa02f76b2c13ae23a) is reached. Snapshot creation is not possible once hard-limit is reached. After 14 snapshots, tried to create another snapshot then it throws the following error sh-4.2# gluster snapshot create snaplimit_15 vol_e7d26963ac1d4ecaa02f76b2c13ae> snapshot create: failed: The number of existing snaps has reached the effective maximum limit of 14, for the volume (vol_e7d26963ac1d4ecaa02f76b2c13ae23a). Please delete few snapshots before taking further snapshots. Snapshot command failed Hence Marking it as Verfied
How to set the snapshot limit from heketi
It is set by Heketi automatically. Issue is that the deploy-heketi template does not have the environment variable setting as the heketi template. Heketi template: https://github.com/heketi/heketi/blob/master/extras/openshift/templates/heketi-template.json#L116 Deploy-heketi needs this setting also because it will allow the initial nodes added to the system to have 14 max snapshots.
1.heketi-cli topology load --json=topology.json 2.Created a volume 3.To check the snapshot limit [root@dhcp37-163 ~]# oc rsh glusterfs-dc-dhcp37-191.lab.eng.blr.redhat.com-1-br4fq sh-4.2# sh-4.2# gluster snapshot config Snapshot System Configuration: snap-max-hard-limit : 256 snap-max-soft-limit : 90% auto-delete : disable activate-on-create : disable Snapshot Volume Configuration: Volume : heketidbstorage snap-max-hard-limit : 256 Effective snap-max-hard-limit : 256 Effective snap-max-soft-limit : 230 (90%) Volume : vol_8ee1cf4949dee37252dd9e88e99fa2a8 snap-max-hard-limit : 256 Effective snap-max-hard-limit : 256 Effective snap-max-soft-limit : 230 (90%) sh-4.2# exit Actual : SNAPSHOT LIMIT is set in heketi template but it is not taking the configuration while loading the topology and still able to take more than 14 snapshots for a particular volume . In deploy-heketi template No snapshot limit is not set to 14. Expected : Snapshots limit should 14 per volume in aplo. After 14 snapshot it should throw error like the limit is 14 only.
Solved by https://github.com/heketi/heketi/issues/446
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2017-0148.html