This module defines a file-system that already exists (i.e. it does not create a new file system) in a way that can be shared with other modules. This allows a compute VM to mount a filesystem that is not part of the current deployment group.
The pre-existing network storage can be referenced in the same way as any HPC Toolkit supported file-system such as filestore.
For more information on network storage options in the Cloud HPC Toolkit, see the extended Network Storage documentation.
- id: homefs
source: modules/file-system/pre-existing-network-storage
settings:
server_ip: ## Set server IP here ##
remote_mount: nfsshare
local_mount: /home
fs_type: nfs
This creates a pre-existing-network-storage module in terraform at the
provided IP in server_ip
of type nfs that will be mounted at /home
. Note
that the server_ip
must be known before deployment.
The following is an example of using pre-existing-network-storage
with a GCS
bucket:
- id: data-bucket
source: modules/file-system/pre-existing-network-storage
settings:
remote_mount: my-bucket-name
local_mount: /data
fs_type: gcsfuse
mount_options: defaults,_netdev,implicit_dirs
The implicit_dirs
mount option allows object paths to be treated as if they
were directories. This is important when working with files that were created by
another source, but there may have performance impacts. The _netdev
mount option
denotes that the storage device requires network access.
For the fs_type
listed below, this module will provide client_install_runner
and mount_runner
outputs. These can be used to create a startup script to
mount the network storage system.
Supported fs_type
:
- nfs
- lustre (DDN)
- gcsfuse
scripts/mount.sh is used as the contents of
mount_runner
. This script will update /etc/fstab
and mount the network
storage. This script will fail if the specified local_mount
is already being
used by another entry in /etc/fstab
.
Both of these steps are automatically handled with the use of the use
command
in a selection of HPC Toolkit modules. See the compatibility matrix in
the network storage doc for a complete list of supported modules.
Name | Version |
---|---|
terraform | >= 0.14.0 |
No providers.
No modules.
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
fs_type | Type of file system to be mounted (e.g., nfs, lustre) | string |
"nfs" |
no |
local_mount | The mount point where the contents of the device may be accessed after mounting. | string |
"/mnt" |
no |
mount_options | Options describing various aspects of the file system. Consider adding setting to 'defaults,_netdev,implicit_dirs' when using gcsfuse. | string |
"defaults,_netdev" |
no |
remote_mount | Remote FS name or export. This is the exported directory for nfs, fs name for lustre, and bucket name (without gs://) for gcsfuse. | string |
n/a | yes |
server_ip | The device name as supplied to fs-tab, excluding remote fs-name(for nfs, that is the server IP, for lustre [:]). This can be omitted for gcsfuse. | string |
"" |
no |
Name | Description |
---|---|
client_install_runner | Runner that performs client installation needed to use file system. |
mount_runner | Runner that mounts the file system. |
network_storage | Describes a remote network storage to be mounted by fs-tab. |