Enable user storage quotas

Enable user storage quotas

This section will enable user storage quotas.

Note

It will take approximately 10 minutes to complete this section.

  1. Copy the script below into your favorite text editor.

    $WindowsRemotePowerShellEndpoint = "windows_remote_powershell_endpoint" # e.g. "fs-0123456789abcdef.example.com"
    enter-pssession -ComputerName ${WindowsRemotePowerShellEndpoint} -ConfigurationName FsxRemoteAdmin
    
  2. From the Amazon FSx console, click the link to the STG326 - SAZ file system and select the Network & security tab. Copy the Windows Remote PowerShell Endpoint of the file system to the clipboard (e.g. fs-0123456789abcdef.example.com).

  3. Return to your favorite text editor and replace “windows_remote_powershell_endpoint” with the Windows Remote PowerShell Endpoint of STG326 - SAZ. Copy the updated script.

  4. Go to the remote desktop session for your Windows Instance 0.

  5. Click Start >> Windows PowerShell.

  6. Run the updated script in the Windows PowerShell window.

NOTE: Complete the next few steps using the remote PowerShell session to the FSx file server.

  1. Review the PowerShell function commands for managing user quotas available using the Amazon FSx CLI for remote management on PowerShell.

    • Run the command in the Remote Windows PowerShell Session.
    Get-Command *-FSxUserQuota*
    
  2. What commands are available?

  3. Enable user storage quotas for the entire FSx file system and set the default track limit to 200 GB and the default track warning limit to 100 GB.

    • Run the command in the Remote Windows PowerShell Session.
    Enable-FSxUserQuotas -Track -DefaultLimit 200000000000 -DefaultWarningLimit 100000000000
    
  4. Open a new local Windows PowerShell session (NOT a Remote Windows PowerShell Session).

    • Click Start >> Windows PowerShell.
  5. Create a 201 GB sparse file.

    • Run the command in the new local Windows PowerShell Session.
    $random = $(Get-Random)
    fsutil file createnew Z:\${env:computername}-$random.dat 201000000000
    
  6. Determin which users are exceeding their user storage quota limit.

    • Run the command in the Remote Windows PowerShell Session.
    Get-FSxUserQuotaEntries
    
  7. Set user storage quotas for the admin@example.com.

    • Run the command in the Remote Windows PowerShell Session.
    Set-FSxUserQuotas -Domain example.com -Name admin -Limit 250000000000 -WarningLimit 100000000000
    
  8. Change the user storage quotas setting from track to enforce.

    • Run the command in the Remote Windows PowerShell Session.
    Enable-FSxUserQuotas -Enforce -DefaultLimit 200000000000 -DefaultWarningLimit 100000000000
    
  9. Create a 1 KB sparse file.

    • Run the command in the local Windows PowerShell Session.
    $random = $(Get-Random)
    fsutil file createnew Z:\${env:computername}-$random.dat 1000
    
    • What error do you get?

    • How much total disk space is being used?

    • Why are you getting this error?

Disable user storage quotas

  1. Disable user storage quotas for the entire FSx file system.

    • Run the command in the Remote Windows PowerShell Session.
    Disable-FSxUserQuotas
    
  2. Create a 1 KB sparse file.

    • Run the command in the local Windows PowerShell Session.
    $random = $(Get-Random)
    fsutil file createnew Z:\${env:computername}-$random.dat 1000
    
  3. End the remote PowerShell session. Run Exit-PSSession.

  4. Close the PowerShell window. Run exit.