powerscale_quota (Data Source)
This datasource is used to query the existing quotas from PowerScale array. The information fetched from this datasource can be used for getting the details or for further processing in resource block. Quota module monitors and enforces administrator-defined storage limits
Example Usage
/*
Copyright (c) 2023-2024 Dell Inc., or its subsidiaries. All Rights Reserved.
Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://mozilla.org/MPL/2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
# The SmartQuotas module is an optional quota-management tool that monitors and enforces administrator-defined storage limits.
# Returns a list of PowerScale quotas based on filter block
data "powerscale_quota" "example_quotas" {
filter {
# Used for query parameter, supported by PowerScale Platform API
# Only list quotas with this enforcement (non-accounting).
# enforced = false
# Set to true to only list quotas which have exceeded one or more of their thresholds.
# exceeded = false
# Only list quotas with this setting for include_snapshots.
# include_snapshots = true
# Only list quotas with this setting for include_snapshots.
# path = "/ifs/tfacc_file_system_test"
# Only list user or group quotas matching this persona (must be used with the corresponding type argument).
# Format is <PERSONA_TYPE>:<string/integer>, where PERSONA_TYPE is one of USER, GROUP, SID, ID, or GID.
# persona= "SID:0"
# If used with the path argument, match all quotas at that path or any descendent sub-directory.
# recurse_path_children = true
# If used with the path argument, match all quotas at that path or any parent directory.
# recurse_path_parents = true
# Use the named report as a source rather than the live quotas. See the /quota/reports resource for a list of valid reports.
# report_id = "id"
# Only list quotas matching this type.
# Allowed values: directory, user, group, default-directory, default-user, default-group
# type = "directory"
# Optional named zone to use for user and group resolution.
# zone = "System"
}
}
# Output value of above block by executing 'terraform output' command
# The user can use the fetched information by the variable data.powerscale_quota.example_quotas
output "powerscale_quota" {
value = data.powerscale_quota.example_quotas
}
# Returns all of the PowerScale Quotas in default zone
data "powerscale_quota" "all" {
}
# Output value of above block by executing 'terraform output' command
# The user can use the fetched information by the variable data.powerscale_quota.all
output "powerscale_quota_all" {
value = data.powerscale_quota.all
}
Schema
Optional
filter
(Block, Optional) (see below for nested schema)
Read-Only
id
(String) Identifierquotas
(Attributes List) List of Quotas (see below for nested schema)
Nested Schema for filter
Optional:
enforced
(Boolean) Only list quotas with this enforcement (non-accounting).exceeded
(Boolean) Set to true to only list quotas which have exceeded one or more of their thresholds.include_snapshots
(Boolean) Only list quotas with this setting for include_snapshots.path
(String) Only list quotas matching this path (see also recurse_path_*).persona
(String) Only list user or group quotas matching this persona (must be used with the corresponding type argument).recurse_path_children
(Boolean) If used with the path argument, match all quotas at that path or any descendent sub-directory.recurse_path_parents
(Boolean) If used with the path argument, match all quotas at that path or any parent directory.report_id
(String) Use the named report as a source rather than the live quotas.type
(String) Only list quotas matching this type.zone
(String) Optional named zone to use for user and group resolution.
Nested Schema for quotas
Read-Only:
container
(Boolean) If true, SMB shares using the quota directory see the quota thresholds as share size.efficiency_ratio
(Number) Represents the ratio of logical space provided to physical space used. This accounts for protection overhead, metadata, and compression ratios for the data.enforced
(Boolean) True if the quota provides enforcement, otherwise an accounting quota.id
(String) The system ID given to the quota.include_snapshots
(Boolean) If true, quota governs snapshot data as well as head data.linked
(Boolean) For user, group and directory quotas, true if the quota is linked and controlled by a parent default-* quota. Linked quotas cannot be modified until they are unlinked.notifications
(String) Summary of notifications: ‘custom’ indicates one or more notification rules available from the notifications sub-resource; ‘default’ indicates system default rules are used; ‘disabled’ indicates that no notifications will be used for this quota.; ‘badmap’ indicates that notification rule has problem in rule map.path
(String) The ifs path governed.persona
(Attributes) Specifies the persona of the file group. (see below for nested schema)ready
(Boolean) True if the default resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.reduction_ratio
(Number) Represents the ratio of logical space provided to physical data space used. This accounts for compression and data deduplication effects.thresholds
(Attributes) The thresholds of quota (see below for nested schema)thresholds_on
(String) Thresholds apply on quota accounting metric.type
(String) The type of quota.usage
(Attributes) The usage of quota (see below for nested schema)
Nested Schema for quotas.persona
Read-Only:
id
(String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.name
(String) Specifies the persona name, which must be combined with a type.type
(String) Specifies the type of persona, which must be combined with a name.
Nested Schema for quotas.thresholds
Read-Only:
advisory
(Number) Usage bytes at which notifications will be sent but writes will not be denied.advisory_exceeded
(Boolean) True if the advisory threshold has been hit.advisory_last_exceeded
(Number) Time at which advisory threshold was hit.hard
(Number) Usage bytes at which further writes will be denied.hard_exceeded
(Boolean) True if the hard threshold has been hit.hard_last_exceeded
(Number) Time at which hard threshold was hit.percent_advisory
(Number) Advisory threshold as percent of hard threshold. Usage bytes at which notifications will be sent but writes will not be denied.percent_soft
(Number) Soft threshold as percent of hard threshold. Usage bytes at which notifications will be sent and soft grace time will be started.soft
(Number) Usage bytes at which notifications will be sent and soft grace time will be started.soft_exceeded
(Boolean) True if the soft threshold has been hit.soft_grace
(Number) Time in seconds after which the soft threshold has been hit before writes will be denied.soft_last_exceeded
(Number) Time at which soft threshold was hit
Nested Schema for quotas.usage
Read-Only:
applogical
(Number) Bytes used by governed data apparent to application.applogical_ready
(Boolean) True if applogical resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.fslogical
(Number) Bytes used by governed data apparent to filesystem.fslogical_ready
(Boolean) True if fslogical resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.fsphysical
(Number) Physical data usage adjusted to account for shadow store efficiencyfsphysical_ready
(Boolean) True if fsphysical resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.inodes
(Number) Number of inodes (filesystem entities) used by governed data.inodes_ready
(Boolean) True if inodes resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.physical
(Number) Bytes used for governed data and filesystem overhead.physical_data
(Number) Number of physical blocks for file dataphysical_data_ready
(Boolean) True if physical_data resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.physical_protection
(Number) Number of physical blocks for file protectionphysical_protection_ready
(Boolean) True if physical_protection resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.physical_ready
(Boolean) True if physical resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.shadow_refs
(Number) Number of shadow references (cloned, deduplicated or packed filesystem blocks) used by governed data.shadow_refs_ready
(Boolean) True if shadow_refs resource accounting is accurate on the quota. If false, this quota is waiting on completion of a QuotaScan job.