Kích hoạt hạn ngạch bộ nhớ của người dùng

Kích hoạt hạn ngạch bộ nhớ của người dùng

Phần này sẽ kích hoạt hạn ngạch bộ nhớ của người dùng.

Lưu ý

Sẽ mất khoảng 10 phút để hoàn thành phần này.

  1. Sao chép đoạn script bên dưới vào text editor yêu thích của bạn.

    $WindowsRemotePowerShellEndpoint = "windows_remote_powershell_endpoint" # ví dụ: "fs-0123456789abcdef.example.com"
    enter-pssession -ComputerName ${WindowsRemotePowerShellEndpoint} -ConfigurationName FsxRemoteAdmin
    
  2. Từ bảng điều khiển Amazon FSx, nhấp vào liên kết đến hệ thống file STG326 - SAZchọn tab Network & security. ***Sao chép Windows Remote PowerShell Endpoint của hệ thống file vào khay nhớ tạm (ví dụ: fs-0123456789abcdef.example.com).

  3. Quay lại trình soạn thảo văn bản yêu thích của bạn và thay thế “windows_remote_powershell_endpoint” với Windows Remote PowerShell Endpoint của STG326 - SAZ. ***Sao chép script được cập nhật.

  4. Chuyển đến Remote Desktop Session dành cho Windows Instance 0 của bạn.

  5. Nhấp vào Start >> Windows PowerShell.

  6. Run script đã cập nhật trong cửa sổ Windows PowerShell.

LƯU Ý: Hoàn thành các bước kế tiếp bằng Session PowerShell Remote đến file server FSx.

  1. Xem lại các lệnh chức năng (function commands) PowerShell để quản lý hạn ngạch người dùng có sẵn (user quotas available) bằng cách sử dụng Amazon FSx CLI để quản lý Remote trên PowerShell.

    • Run lệnh trong Remote Windows PowerShell Session.
    Get-Command *-FSxUserQuota*
    
  2. Những lệnh nào có sẵn?

  3. Bật hạn ngạch lưu trữ người dùng cho toàn bộ hệ thống file FSx và thiết lập track limit mặc định là 200 GB và track warning limit mặc định ở 100 GB.

    • Run lệnh trong Remote Windows PowerShell Session.
    Enable-FSxUserQuotas -Track -DefaultLimit 200000000000 -DefaultWarningLimit 100000000000
    
  4. Mở một Local Windows PowerShell Session mới (KHÔNG PHẢI là Remote Windows PowerShell Session).

    • ***Nhấp *** Start >> Windows PowerShell.
  5. Tạo một file sparse 201 GB.

    • Run lệnh trong  Local Windows PowerShell Session mới.
    $random = $(Get-Random)
    fsutil file createnew Z:\${env:computername}-$random.dat 201000000000
    
  6. Xác định người dùng nào đang vượt quá giới hạn dung lượng lưu trữ người dùng của họ.

    • Run lệnh trong Remote Windows PowerShell Session.
    Get-FSxUserQuotaEntries
    
  7. Đặt hạn ngạch dung lượng người dùng cho admin@example.com.

    • Run lệnh trong Remote Windows PowerShell Session.
    Set-FSxUserQuotas -Domain example.com -Name admin -Limit 250000000000 -WarningLimit 100000000000
    
  8. Thay đổi cài đặt hạn ngạch bộ nhớ người dùng từ theo dõi (track) thành thực thi (enforce).

    • Run lệnh trong Remote Windows PowerShell Session.
    Enable-FSxUserQuotas -Enforce -DefaultLimit 200000000000 -DefaultWarningLimit 100000000000
    
  9. Tạo một file sparse 1 KB.

    • Run lệnh trong  Local Windows PowerShell Session.
    $random = $(Get-Random)
    fsutil file createnew Z:\${env:computername}-$random.dat 1000
    
    • Bạn nhận được lỗi gì?

    • Tổng dung lượng đĩa đang được sử dụng là bao nhiêu?

    • Tại sao bạn nhận được lỗi này?

Vô hiệu hóa hạn ngạch bộ nhớ người dùng

  1. Vô hiệu hóa hạn ngạch bộ nhớ người dùng cho toàn bộ hệ thống file FSx.

    • Run lệnh trong Remote Windows PowerShell Session.
Disable-FSxUserQuotas
  1. Tạo một file sparse 1 KB.

    • Run lệnh trong Local Windows PowerShell Session.
    $random = $(Get-Random)
    fsutil file createnew Z:\${env:computername}-$random.dat 1000
    
  2. Kết thúc Session PowerShell Remote . Run Exit-PSSession.

  3. Đóng cửa sổ PowerShell. Run Exit.