Edit instances

This page shows you how to edit a Filestore instance using either the Google Cloud console or the gcloud CLI.

Once created, you can modify a Filestore instance in the following ways:

For details on scaling capacity, see Scale capacity.

Certain specifications, such as the instance's IP address, are immutable.

Instructions for editing an instance

Google Cloud console

To edit Filestore instances using the Google Cloud console, navigate to the Edit instance page, where you can edit the instance description, manage IP-based access control rules, and scale the file share performance:

  1. In the Google Cloud console, go to the Filestore Instances page.

    Go to the Filestore instances page

  2. Click the instance ID of the instance you want to edit.

  3. On the Instance details page, click Edit to go to the Edit instance page.

  4. Change the instance description, IP-based access control rules, and capacity as needed. For details, see Creating instances.

  5. Click Save.

gcloud

Before you begin

To use the gcloud CLI, you must either install the gcloud CLI or use the Cloud Shell that's built into the Google Cloud console:

Go to the Google Cloud console

gcloud command for editing an instance

You can edit a Filestore instance by running the instances update command. If you need to update the configuration rules for IP-based access control, you must use the --flags-file flag and specify a JSON configuration file. If you choose this method, you don't need to use the --file-share flag because it is already included in the JSON configuration file.

gcloud filestore instances update INSTANCE_ID
    --[project="PROJECT_ID"]
    --[location=LOCATION]
    --[performance=PERFORMANCE] \
    --[file-share=name="FILE_SHARE_NAME",CAPACITY=FILE_SHARE_SIZE]
    --[description="DESCRIPTION"]
    --[flags-file=FILE_NAME.json]

where:

  • INSTANCE_ID is the instance ID of the Filestore instance you want to edit.
  • PROJECT_ID is the project ID of the Google Cloud project that contains the Filestore instance. You can skip this flag if the Filestore instance is in the gcloud default project. You can set the default project by running:

    gcloud config set project project-id
    
  • LOCATION is the location where the Filestore instance resides. For regional and enterprise instances, specify a region. For all other instances, specify a zone. Run the gcloud filestore zones list command to get a list of supported zones. You can skip this flag if the Filestore instance is in the gcloud default zone. You can set the default zone by running:

    gcloud config set filestore/zone zone
    
  • PERFORMANCE is the performance configuration used to specify custom performance settings independently of the chosen capacity.

    You can use only one of the following options:

    • max-iops-per-tb specifies an IOPS-per-TiB rate that scales linearly with instance capacity.
    • max-iops specifies fixed IOPS rate that doesn't scale with instance capacity.

      The format looks as follows:

      --performance=max-iops-per-tb=17000
      
  • FILE_SHARE_NAME is the name of the file share that is served from the Filestore instance. File share names cannot be changed after instance creation.

  • FILE_SHARE_SIZE is the new size you want for the file share. You can specify the file share size in whole numbers using either GiB (default) or TiB.

    To see your available quota, go to the Quotas page in the Google Cloud console:

    Go to the Quotas page

  • DESCRIPTION is the optional Filestore instance description.

  • FILE_NAME is the name of the json configuration file for IP- based access control.

    Example json configuration file:

     {
    "--file-share":
      {
        "capacity": "4096",
        "name": "my_vol",
        "nfs-export-options": [
          {
            "access-mode": "READ_WRITE",
            "ip-ranges": [
              "10.0.0.0",
              "10.2.0.0"
            ],
            "squash-mode": "ROOT_SQUASH",
            "anon_uid": 1003,
            "anon_gid": 1003
          },
           {
            "access-mode": "READ_ONLY",
            "ip-ranges": [
              "10.0.1.0/28"
            ],
            "squash-mode": "NO_ROOT_SQUASH"
          }
        ],
      }
    }
    

    where:

    • ip-ranges is the IP address or range to grant access to. You can specify multiple IP addresses or ranges by separating them with a comma. Only the following service tiers support configuration settings for overlapping IP address ranges:
      • Zonal
      • Regional
      • Enterprise
    • access-mode is the access level to grant to clients whose IP address falls within ip-range. It can have the values of READ_WRITE or READ_ONLY. The default value is READ_WRITE.
    • squash-mode can have the values ROOT_SQUASH or NO_ROOT_SQUASH. ROOT_SQUASH removes root level access to the clients whose IP address falls within ip-range, while NO_ROOT_SQUASH enables root access. The default value is NO_ROOT_SQUASH.
    • anon_uid is the user ID value that you want to map to anon_uid. The default value is 65534.
    • anon_gid is the group ID value that you want to map to anon_gid. The default value is 65534.
Example

The following example updates the nfs-server instance by increasing the file share size to 3 TiB.

    gcloud filestore instances update nfs-server --zone=us-central1-c --file-share=name="vol1",capacity=3TiB
  ```

REST API

  1. Have gcloud CLI installed and initialized, which lets you generate an access token for the Authorization header.

  2. Use cURL to call the Filestore API:

    curl --request PATCH \
        'https://file.googleapis.com/v1/projects/PROJECT/locations/LOCATION/instances?instanceId=NAME?updateMask=performanceConfig%2CdeletionProtectionReason%2CdeletionProtectionEnabled&key=YOUR_API_KEY' \
        --header "Authorization: Bearer $(gcloud auth print-access-token)" \
        --header 'Accept: application/json' \
        --header 'Content-Type: application/json' \
        --data '{
                "tier":"TIER",
                "networks":[
                    {
                    "network":"NETWORK"
                    }
                  ],
                "performanceConfig": {"PERFORMANCE"}
                "fileShares":[
                  {"capacityGb":CAPACITY,"name":"SHARE_NAME"}
                  ],
                "deletionProtectionEnabled": true,
                "deletionProtectionReason": "PROTECTION_REASON"}' \
        --compressed
    
    

    Where:

    • PROJECT is the name of the project where your instance will reside. For example, my-genomics-project.
    • LOCATION is the location where the instance will reside. For example, us-east1 or us-central1-a.
    • NAME is the name of the instance you want to create. For example, my-genomics-instance.
    • PERFORMANCE is the performance configuration used to specify custom performance settings.

      You can use only one of the provided options.

      • iopsPerTB enables custom performance with a user-defined IOPS rate that scales with instance capacity. To define IOPS per TiB, use the maxIopsPerTb field.
      • fixedIops enables custo, performance with a fixed IOPS rate that doesn't scale with instance capacity. To define fixed IOPS value, use the maxIops field.

        The format is as follows:

        "performanceConfig": {
            "iopsPerTb" : {
                "maxIopsPerTb":17000
            }
          }
        
    • CAPACITY is the size, in GiB, you want to allocate for the instance. For example, 1024.

    • SHARE_NAME is the name of the file share. For example, vol1.

    • PROTECTION_REASON if you choose to use the deletionProtectionEnabled flag, you have the option of adding a note regarding the setting. To add the note, use the optional deletionProtectionReason flag and include a description of the justification for the setting you chose. For example, "All genomics data must adhere to current organization policies." For more information, see Deletion protection.

    Example

    The following example updates the nfs-server instance by decreasing the IOPS per TiB ratio to 12000.

    curl --request PATCH \
        'https://file.googleapis.com/v1/projects/my-project/locations/us-central1/instances?instanceId=nfs-server?updateMask=performanceConfig%2CdeletionProtectionReason&key=12334fr232' \
        --header "Authorization: Bearer $(gcloud auth print-access-token)" \
        --header 'Accept: application/json' \
        --header 'Content-Type: application/json' \
        --data '{
                  "performanceConfig":
                    {
                      "iopsPerTb":
                        {
                          "maxIopsPerTb":12000
                        }
                    },
                  "deletionProtectionReason":"Deletion+not+allowed"}' \
        --compressed
    
    

What's next