Subscribe
Accepted Solution

Restrict snapshot space on a volume

Hi,

I want to restrict space for snapshot on a volume to certain percentage. As I have seen in default, if a volume is of 100GB with 20% snapshot definition.

If user has used 60 GB of space and data changes in this drive very quickly, the snaphot size will be large and then it takes space more than allocated 20%. Thus if data is deleted to create space in volume, it does not become available as free space. Is there a way to restrict it to certain size and it should remove old snapshot if new has to be created as in First In First Out.

Thanks,

Yasir Irfat

Re: Restrict snapshot space on a volume

It is not possible to restrict space (meaning – prevent snapshot creation if it would exceed allocated space). It is possible to configure NetApp to autodelete snapshots in this case. See “snap autodelete” command.

Re: Restrict snapshot space on a volume

Hi aborzenkov,

From "snap autodelete" command details, I was asking for same thing as you mentioned. I am interested in removing old snapshot if space reserved for snapshot get full. So that Data space does not get used by snapshot. Currently I have set commands as follows, will revert back if any further help is needed.

filer> snap autodelete common_vol on

filer> snap autodelete common_vol trigger snap_reserve delete_order oldest_first

Regards,

Yasir Irfat

Re: Restrict snapshot space on a volume

Hi aborzenkov,

I suppose, when autodelete triggers on snap_reserve it removes all snapshots that exists for the volume. Because as soon as I configured autodelete it removed all 5 existing snaps.

Is it possible to remove only one snap or two as per new snapshot space requirement ?

Re: Restrict snapshot space on a volume

Hi,

Normally it should not delete all snapshots - the "target free space" parameter should come into play.

Have a look at this KB:

https://kb.netapp.com/support/index?page=content&id=3010204

and also the TR referred there:

http://media.netapp.com/documents/tr-3483.pdf

Regards,

Radek

Re: Restrict snapshot space on a volume

Yes I did had a look in the kb pointed by you. Just curious that default 20% value for "target_free_space" is for complete volume or snap_reserve ?

Re: Restrict snapshot space on a volume

It's the percentage of free space in the volume - as per the df output.

Re: Restrict snapshot space on a volume

Hi Radek,

Thanks for quick reply. As it is % of volume. That means if we define 20% reserve for snaps, and autodelete is set for "target_free_space" to 20%, so when autodelete activates it will remove all snaps to get 20% of snap_reserve free.

Now in my case I have set snap_reserve to 25% and target_free_space to 10%, I hope this will work. Will monitor it for 1 day and come back if face any issues.

Regards,

Yasir Irfat

Re: Restrict snapshot space on a volume

If you are increasing snap reserve, you are actually decreasing the amount of free space in a volume

Say a volume is 100GB big & snap reserve is set to 20% - the available space in a volume is shown as 80GB, so when you populate there 40GB of data, you have 50% of free space.

Now if you increase snap reserve to 25% - available space is 75GB, and with 40GB of data you have less than 50% of free space (not bothered to calculate the actual percentage )

It is a bit confusing, as the user data cannot overflow into snap reserve space, whilst the reverse is possible.

Re: Restrict snapshot space on a volume

It depends on target_free_space. If it set so high, that single snapshot exceeds it - yes, it will remove all snapshots. If you set target_free_space to 50% and last remaining snapshot consumes 60% of snap reserve, it will be removed.