powerstore_filesystem (Resource)
This resource is used to manage the file system entity of PowerStore Array. We can Create, Update and Delete the file system using this resource. We can also import an existing file system from PowerStore array.
Example Usage
/*
Copyright (c) 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.
*/
# Commands to run this tf file : terraform init && terraform plan && terraform apply
# Create, Update, Delete and Import is supported for this resource
# get NAS server id by name of the NAS server
data "powerstore_nas_server" "nas_server_us_east" {
name = "nas_server_us_east"
lifecycle {
postcondition {
condition = length(self.nas_servers) == 1
error_message = "Expected a single NAS server, but got none"
}
}
}
# create filesystem on the NAS server
resource "powerstore_filesystem" "us_east_sales_catalog_fs" {
name = "us_east_sales_catalog_fs"
description = "File System for US East Sales Catalog"
size = 3
nas_server_id = data.powerstore_nas_server.nas_server_us_east.nas_servers[0].id
flr_attributes = {
mode = "Enterprise"
minimum_retention = "1D"
default_retention = "1D"
maximum_retention = "infinite"
}
config_type = "General"
access_policy = "UNIX"
locking_policy = "Advisory"
folder_rename_policy = "All_Allowed"
is_smb_sync_writes_enabled = true
is_smb_no_notify_enabled = true
is_smb_op_locks_enabled = false
is_smb_notify_on_access_enabled = true
is_smb_notify_on_write_enabled = false
smb_notify_on_change_dir_depth = 12
is_async_mtime_enabled = true
file_events_publishing_mode = "All"
}
After the execution of above resource block, filesystem would have been created on the PowerStore array. For more information, Please check the terraform state file.
Schema
Required
name
(String) Name of the file system.nas_server_id
(String) Unique identifier of the NAS Server on which the file system is mounted.size
(Number) Size that the file system presents to the host or end user.
Optional
access_policy
(String) File system security access policies.capacity_unit
(String) The Capacity Unit corresponding to the size.config_type
(String) File system security access policies.description
(String) File system description.file_events_publishing_mode
(String) State of the event notification services for all file systems of the NAS server.flr_attributes
(Attributes) Type of filesystem: normal or snapshot. (see below for nested schema)folder_rename_policy
(String) File system folder rename policies for the file system with multiprotocol access enabled.host_io_size
(String) Typical size of writes from the server or other computer using the VMware file system to the storage system.is_async_mtime_enabled
(Boolean) Indicates whether asynchronous MTIME is enabled on the file system or protocol snaps that are mounted writeable.is_smb_no_notify_enabled
(Boolean) Indicates whether notifications of changes to directory file structure are enabled.is_smb_notify_on_access_enabled
(Boolean) Indicates whether file access notifications are enabled on the file system.is_smb_notify_on_write_enabled
(Boolean) Indicates whether file writes notifications are enabled on the file system.is_smb_op_locks_enabled
(Boolean) Indicates whether opportunistic file locking is enabled on the file system.is_smb_sync_writes_enabled
(Boolean) Indicates whether the synchronous writes option is enabled on the file system.locking_policy
(String) File system locking policies.protection_policy_id
(String) Unique identifier of the protection policy applied to the file system.smb_notify_on_change_dir_depth
(Number) Lowest directory level to which the enabled notifications apply, if any.
Read-Only
file_system_type
(String) Type of filesystem: normal or snapshot.id
(String) Unique identifier of the file system.parent_id
(String) Unique identifier of the parent filesystem.
Nested Schema for flr_attributes
Optional:
auto_delete
(Boolean) Indicates whether locked files will be automatically delete from an FLR-enabled file system once their retention periods have expired.auto_lock
(Boolean) Indicates whether to automatically lock files in an FLR-enabled file system.default_retention
(String) The FLR type of the file system.maximum_retention
(String) The FLR type of the file system.minimum_retention
(String) The FLR type of the file system.mode
(String) The FLR type of the file system.policy_interval
(Number) Indicates how long to wait (in seconds) after files are modified before the files are automatically locked.
Import
Import is supported using the following syntax:
#Copyright (c) 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.
# Below are the steps to import file system :
# Step 1 - To import a file system , we need the id of that file system
# Step 2 - To check the id of the file system we can make use of file system datasource to read required/all file system ids. Alternatively, we can make GET request to file system endpoint. eg. https://10.0.0.1/api/rest/file_system which will return list of all file system ids.
# Step 3 - Add empty resource block in tf file.
# eg.
# resource "powerstore_filesystem" "resource_block_name" {
# (resource arguments)
# }
# Step 4 - Execute the command: terraform import "powerstore_filesystem.resource_block_name" "id_of_the_file_system" (resource_block_name must be taken from step 3 and id must be taken from step 2)
# Step 5 - After successful execution of the command , check the state file