Skip to content

Latest commit

 

History

History
203 lines (156 loc) · 10.1 KB

File metadata and controls

203 lines (156 loc) · 10.1 KB

Description

This module creates a filestore instance. Filestore is a high performance network file system that can be mounted to one or more compute VMs.

For more information on this and other network storage options in the Cluster Toolkit, see the extended Network Storage documentation.

Filestore tiers

At the time of writing, Filestore supports 5 tiers of service that are specified in the Toolkit using the following names:

  • Basic HDD: "BASIC_HDD" (preferred) or "STANDARD" (deprecated)
  • Basic SSD: "BASIC_SSD" (preferred) or "PREMIUM" (deprecated)
  • Zonal With Higher Capacity Band or High Scale SSD: "HIGH_SCALE_SSD"
  • Enterprise: "ENTERPRISE"
  • Zonal With Lower Capacity Band: "ZONAL"

Please review the minimum storage requirements for each tier. The Terraform module can only enforce the minimum value of the size_gb parameter for the lowest tier of service. If you supply a value that is too low, Filestore creation will fail when you run terraform apply.

Filestore mount options

After Filestore instance is created, you can mount this to the compute node using different mount options. Toolkit uses default mount options for all tier services. Filestore has recommended mount options for different service tiers which may overall improve performance. These can be found here: recommended mount options. While creating filestore module, you can overwrite these mount options as mentioned below.

- id: homefs
  source: modules/file-system/filestore
  use: [network1]
  settings:
    local_mount: /homefs
    mount_options: defaults,hard,timeo=600,retrans=3,_netdev

Filestore quota

Your project must have unused quota for Cloud Filestore in the region you will provision the storage. This can be found by browsing to the Quota tab within IAM & Admin in the Cloud Console. Please note that there are separate quota limits for HDD and SSD storage.

All projects begin with 0 available quota for High Scale SSD tier. To use this tier, make a request and wait for it to be approved.

Example - Basic HDD

The Filestore instance defined below will have the following attributes:

  • (default) BASIC_HDD tier
  • (default) 1TiB capacity
  • homefs module ID
  • mount point at /home
  • connected to the network defined in the network1 module
- id: homefs
  source: modules/file-system/filestore
  use: [network1]
  settings:
    local_mount: /home

Example - High Scale SSD

The Filestore instance defined below will have the following attributes:

  • HIGH_SCALE_SSD tier
  • 10TiB capacity
  • highscale module ID
  • mount point at /projects
  • connected to the VPC network defined in the network1 module
- id: highscale
  source: modules/file-system/filestore
  use: [network1]
  settings:
    filestore_tier: HIGH_SCALE_SSD
    size_gb: 10240
    local_mount: /projects

Mounting

To mount the Filestore instance you must first ensure that the NFS client has been installed and then call the proper mount command.

Both of these steps are automatically handled with the use of the use command in a selection of Cluster Toolkit modules. See the compatibility matrix in the network storage doc for a complete list of supported modules. See the hpc-slurm for an example of using this module with Slurm.

If mounting is not automatically handled as described above, the filestore module outputs runners that can be used with the startup-script module to install the client and mount the file system. See the following example:

  - id: filestore
    source: modules/file-system/filestore
    use: [network1]
    settings: {local_mount: /scratch}

  - id: mount-at-startup
    source: modules/scripts/startup-script
    settings:
      runners:
      - $(filestore.install_nfs_client_runner)
      - $(filestore.mount_runner)

License

Copyright 2022 Google LLC

Licensed under the Apache 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://www.apache.org/licenses/LICENSE-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.

Requirements

Name Version
terraform >= 0.14.0
google >= 4.19
random ~> 3.0

Providers

Name Version
google >= 4.19
random ~> 3.0

Modules

No modules.

Resources

Name Type
google_filestore_instance.filestore_instance resource
random_id.resource_name_suffix resource

Inputs

Name Description Type Default Required
connect_mode Used to select mode - supported values DIRECT_PEERING and PRIVATE_SERVICE_ACCESS. string "DIRECT_PEERING" no
deployment_name Name of the HPC deployment, used as name of the filestore instance if no name is specified. string n/a yes
filestore_share_name Name of the file system share on the instance. string "nfsshare" no
filestore_tier The service tier of the instance. string "BASIC_HDD" no
labels Labels to add to the filestore instance. Key-value pairs. map(string) n/a yes
local_mount Mountpoint for this filestore instance. Note: If set to the same as the filestore_share_name, it will trigger a known Slurm bug (troubleshooting). string "/shared" no
mount_options NFS mount options to mount file system. string "defaults,_netdev" no
name The resource name of the instance. string null no
network_id The ID of the GCE VPC network to which the instance is connected given in the format:
projects/<project_id>/global/networks/<network_name>"
string n/a yes
nfs_export_options Define NFS export options.
list(object({
access_mode = optional(string)
ip_ranges = optional(list(string))
squash_mode = optional(string)
}))
[] no
project_id ID of project in which Filestore instance will be created. string n/a yes
region Location for Filestore instances at Enterprise tier. string n/a yes
reserved_ip_range Reserved IP range for Filestore instance. Users are encouraged to set to null
for automatic selection. If supplied, it must be:

CIDR format when var.connect_mode == "DIRECT_PEERING"
Named IP Range when var.connect_mode == "PRIVATE_SERVICE_ACCESS"

See Cloud documentation for more details:

https://cloud.google.com/filestore/docs/creating-instances#configure_a_reserved_ip_address_range
string null no
size_gb Storage size of the filestore instance in GB. number 1024 no
zone Location for Filestore instances below Enterprise tier. string n/a yes

Outputs

Name Description
capacity_gb File share capacity in GiB.
filestore_id An identifier for the resource with format projects/{{project}}/locations/{{location}}/instances/{{name}}
install_nfs_client Script for installing NFS client
install_nfs_client_runner Runner to install NFS client using the startup-script module
mount_runner Runner to mount the file-system using an ansible playbook. The startup-script
module will automatically handle installation of ansible.
- id: example-startup-script
source: modules/scripts/startup-script
settings:
runners:
- $(your-fs-id.mount_runner)
...
network_storage Describes a filestore instance.