Nutanix Files: Notify users of approaching quota limits

  • 8 October 2019
  • 0 replies
  • 168 views

Userlevel 2
Badge +3
  • Nutanix Employee
  • 29 replies

You can set up automatic notifications to be sent out to users whenever they reach configured quota limits on Nutanix Files (also known as AFS). This can be achieved by either using Web GUI or nCLI.
GUI method is described in Nutanix File Guide.

To configured automatic email notifications from nCLI follow the steps below:

  1. Determine uuid of the three components: file server, quota policy and share.
  2. Configure email notifications using the command below:
ncli fs update-quota-policy notification-recipients='email-address' quota-enforcement-type='soft/hard' quota-policy-uuid='quota-uuid' quota-size-gib='size' send-quota-notifications-to-user='true/false' share-uuid='share-uuid' uuid='fileserver-uuid' 


TIP: Copy and past values from the nCLI to nCLI directly to ensure no character is altered — saves time for troubleshooting of command errors.

See example below.
Retrieve file server UUID:

ncli fs ls 
Uuid : db890abcs-fbcd-abcd-0000-c6240654bbbb
Name : MD-FS
Version : 3.5.2
Container ID : 0005922b-abcd-abcd-0000-002590c84bb8::81306
Container Uuid : 714c4d88-955a-48df-94a7-508b29c4a6d8


Retrieve share UUID:

ncli fs list-shares uuid=db890ac6-f1be-47fb-9e41-c6240654b029
Uuid : db890ac6-ffff-abcd-0000-c6240654b029
Share UUID : 91f57b34-ffff-abcd-0000-50ed14be9359
Name : TEST
Share Description : File Server
Name : MD-FS


Retrieve quota policy UUID (notice "true" value for Send Quota Notifications in the example, if yours is set to "false" you would have change the flat to true in the following step):

ncli fs list-quota-policies uuid=db890ac6-ffff-abcd-0000-c6240654b029 share-uuid=91f57b34-ffff-abcd-0000-50ed14be9359 
Quota Policy UUID : 2090e879-ffff-abcd-0000-8e2e85656bee
Share UUID : 91f57b34-ffff-abcd-0000-50ed14be9359
Principal Type : user
Principal Value : _default Quota Size In GiB : 10
Quota Enforcement Type : SOFT
Send Quota Notificatio... : true Notification Recipients : []


Enable notifications (if not enabled), define recipients' email addresses and optionally quota size:

ncli fs update-quota-policy uuid=db890ac6-ffff-abcd-0000-c6240654b029 share-uuid=91f57b34-ffff-abcd-0000-50ed14be9359 quota-policy-uuid=2090e879-ffff-abcd-0000-8e2e85656bee notification-recipients=user@company.com quota-size-gib=2 send-quota-notifications-to-user=true 


Verify:

ncli fs list-quota-policies uuid=db890ac6-ffff-abcd-0000-c6240654b029 share-uuid=91f57b34-ffff-abcd-0000-50ed14be9359 quota-policy-uuid=2090e879-ffff-abcd-0000-8e2e85656bee 
Quota Policy UUID : 2090e879-ffff-abcd-0000-8e2e85656bee
Share UUID : 91f57b34-ffff-abcd-0000-50ed14be9359
Principal Type : user
Principal Value : _default
Quota Size In GiB : 2
Quota Enforcement Type. : SOFT
Send Quota Notificatio...: true
Notification Recipients : [user@company.com]


Should you wish to refresh your memory on the concept of quotas with Nutanix AFS please refer to this KB6842


0 replies

Be the first to reply!

Reply