> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gcore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring file shares

export const MethodSection = ({children}) => children ?? null;

export const MethodSwitch = ({children}) => {
  const tabs = React.Children.toArray(children).map(c => {
    if (!c || !c.props) return null;
    if (c.props.id) return c;
    const inner = c.props.children;
    if (inner && inner.props && inner.props.id) return inner;
    return null;
  }).filter(Boolean);
  const firstId = tabs.length > 0 ? tabs[0].props.id : "";
  const [active, setActive] = React.useState(firstId);
  React.useEffect(() => {
    try {
      const saved = localStorage.getItem("gcore_docs_method");
      if (saved && tabs.find(t => t.props.id === saved)) {
        setActive(saved);
      }
    } catch (_) {}
  }, []);
  React.useEffect(() => {
    try {
      document.querySelectorAll("h2[id], h3[id]").forEach(heading => {
        const visible = heading.offsetParent !== null;
        document.querySelectorAll(`a[href="#${heading.id}"]`).forEach(link => {
          if (link.closest("h1,h2,h3,h4,h5,h6")) return;
          const li = link.closest("li");
          if (li) li.style.display = visible ? "" : "none";
        });
      });
    } catch (_) {}
    window.dispatchEvent(new Event("scroll"));
  }, [active]);
  const handleClick = id => {
    setActive(id);
    try {
      localStorage.setItem("gcore_docs_method", id);
    } catch (_) {}
  };
  return <div>
      <div className="not-prose flex gap-0 border-b border-zinc-200 dark:border-zinc-800 mb-8 mt-2" role="tablist">
        {tabs.map(tab => {
    const isActive = active === tab.props.id;
    return <button key={tab.props.id} role="tab" aria-selected={isActive} onClick={() => handleClick(tab.props.id)} className={["px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer", isActive ? "border-primary text-primary" : "border-transparent text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"].join(" ")}>
              {tab.props.label}
            </button>;
  })}
      </div>

      {tabs.map(tab => <div key={tab.props.id} style={{
    display: active === tab.props.id ? "" : "none"
  }}>
          {tab.props.children}
        </div>)}
    </div>;
};

<MethodSwitch>
  <MethodSection id="portal" label="Customer Portal">
    <p>Create NFS-based file shares and mount them to Linux virtual machines, bare metal servers, or GPU clusters.</p>

    <p>Two types of file shares are available:</p>

    * **Standard** are general-purpose file shares using a Ceph-based backend.
    * **VAST** are high-performance file shares, available in selected GPU-enabled regions only.

    <Info>
      File share types are mutually exclusive — each region has either Standard or VAST file shares, but not both.
    </Info>

    <Tip>
      Create VAST shares when creating [GPU clusters](/edge-ai/ai-infrastructure/create-a-bare-metal-gpu-cluster) or before provisioning [compute resources](/cloud/virtual-instances/types-of-virtual-machines) — VMs, Bare Metal servers, and GPU clusters.
    </Tip>

    <p>The creation flow for both types starts the same. Follow the instructions for the selected file share type.</p>

    <Info>
      Verify that quotas are sufficient for the file share. The quotas for File Shares are in the **Storage** section under **Cloud Management** > **Quotas Viewer** and include **Number of File Shares** and **Total File Share Storage**. To increase quotas, contact Gcore support.
    </Info>

    <Frame>
      <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/1.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=eb3c06473ed09d12bf730df893a21eef" alt="Account Quotas Storage section showing file share limits" width="1400" height="900" data-path="images/docs/cloud/file-shares/configure-file-shares/1.png" />
    </Frame>

    ## Prepare the network for Bare Metal

    <p>To mount the file share on a Bare Metal server, the network must support Bare Metal, and these servers require a dedicated VLAN.</p>

    <p>If needed, create a new network and enable the **Bare Metal Network** toggle during configuration.</p>

    <Frame>
      <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/2-1.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=04ae3dac55952265ab458d9eb37ce080" alt="Bare Metal Network toggle" width="811" height="700" data-path="images/docs/cloud/file-shares/configure-file-shares/2-1.png" />
    </Frame>

    <Info>
      Manually change the OS settings' existing Bare Metal network interface.
    </Info>

    ## Configure file shares for Linux VMs and Bare Metal

    <p>A Standard NFS file share connects to a private network and can be mounted on Linux Virtual Machines or Bare Metal servers.</p>

    <Steps>
      <Step title="Create a file share">
        1. In the **Cloud** menu, click **Storage**, select **File Shares**, and click **Create File Share** on the right.

        <Frame>
          <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/3-1.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=cebe54e5bd42064e007a384f90f1ceb3" alt="File Shares list page" width="1332" height="625" data-path="images/docs/cloud/file-shares/configure-file-shares/3-1.png" />
        </Frame>

        2. In the **Basic settings** panel, enter the **File Share name**, specify **Size**, and select **Standard** as the **File Share type**.

        <Frame>
          <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/4.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=3c095a0260ecc173fef87560428a77a5" alt="Create File Share form with Standard type selected" width="1400" height="900" data-path="images/docs/cloud/file-shares/configure-file-shares/4.png" />
        </Frame>

        3. In the **Network settings** panel, select the **Network** and **Subnet** to use for the file share.
        4. In the **Access** panel, the default **Accessible for the selected subnet** option grants read/write access to all addresses on the allocated network. To restrict access by IP address, select **Custom access rules**, click **+ Add rule**, enter the **Source IP or subnet address**, and select the **Access rule mode**.
        5. Set **Additional options**, if required.
      </Step>

      <Step title="Set up NFS client support">
        <p>Connect to the server via the [Gcore Customer Portal](/cloud/virtual-instances/connect/connect-to-your-instance-via-control-panel) or SSH and set up NFS client support.</p>

        <p>For Ubuntu and Debian:</p>

        ```bash theme={null}
        sudo apt -y install nfs-common
        ```

        <p>For CentOS:</p>

        ```bash theme={null}
        sudo yum install nfs-utils
        ```
      </Step>

      <Step title="Mount the file share">
        1. Use an existing directory for mounting the share, or create a new one:

           ```bash theme={null}
           sudo mkdir -p /mount/path
           ```

        2. Copy the mount command from the file share **Overview** tab.

        <Frame>
          <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/4-1.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=9952d87eaf667c71bd2ce5de0ad6513f" alt="File share Overview tab with mount command" width="1400" height="900" data-path="images/docs/cloud/file-shares/configure-file-shares/4-1.png" />
        </Frame>

        <p>Mount the file share:</p>

        ```bash theme={null}
        mount 0.0.0.0:/shares/share-d54589b8-132f-4de4-ae99-af5c6cdfdb9c /mount/path
        ```

        <p>Replace `/mount/path` with the absolute local directory path where the file share should be mounted.</p>
      </Step>
    </Steps>

    ## VAST file shares

    <p>VAST file shares attach to compute resources (VMs, Bare Metal servers, and GPU clusters) using a dedicated network that is assigned automatically at creation.</p>

    <Info>
      VAST-based file shares are only available in regions with GPU support.
    </Info>

    <Steps>
      <Step title="Create a VAST share">
        1. In the **Cloud** menu, click **Storage**, select **File Shares**, and click **Create File Share** on the right.
        2. In the **Basic settings** panel, enter the **File Share name**, specify **Size**, and select **VAST** as the **File Share type**.
        3. Set **Additional options**, if required.

        <Frame>
          <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/vast-create.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=a8d9123ae3c282e8982a23ce9e9f3567" alt="Create VAST file share form" width="1400" height="900" data-path="images/docs/cloud/file-shares/configure-file-shares/vast-create.png" />
        </Frame>

        <p>When VAST share type is selected, controls in **Network settings** and **Access** panels are disabled, and the network is assigned automatically.</p>

        <p>The access rules cannot be configured manually — the VAST share is always available in read/write mode within its assigned network only. This network is not visible in the general **Network** tab. It is only available when attaching interfaces to a resource (VM, Bare Metal, or GPU cluster).</p>

        <p>VAST file shares always use read/write access; access rules are not supported.</p>
      </Step>

      <Step title="Add VAST network interface to a compute resource">
        <p>Once the VAST file share is created, it is best to add the VAST network interface while provisioning the compute resource.</p>

        **Adding VAST interface while creating a compute resource**

        <p>While provisioning a compute resource:</p>

        1. Scroll down to the **Network settings** panel.
        2. Click **Add interface**.
        3. Click the interface to configure, and select the **VAST network**.
        4. Continue with provisioning the compute resource.

        <p>The VAST network only becomes available after the file share has been created. It is a third, dedicated network, separate and distinct from public and private networks.</p>

        <Frame>
          <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/vast-details.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=de2bad28a58b0fb211541233a7f61637" alt="VAST network interface added to compute resource" width="1400" height="900" data-path="images/docs/cloud/file-shares/configure-file-shares/vast-details.png" />
        </Frame>

        **Adding VAST interface to an existing compute resource**

        <p>While the VAST interface can be attached to an already-provisioned compute resource, this requires additional manual network configuration and is not the standard workflow.</p>

        **Attach VAST network interface**

        1. Go to server **Resource** settings ([VM](/cloud/virtual-instances/create-an-instance), [Bare Metal](/cloud/bare-metal-servers/create-a-bare-metal-server), or [GPU cluster](/edge-ai/ai-infrastructure/create-a-bare-metal-gpu-cluster)).
        2. Select the **Networking** tab and click **Add interface**.
        3. Click the **Network** drop-down and select the **VAST network**, then click **Add**.
        4. Once the interface is added, note the following details for use in subsequent steps:
           * **IP** address — `198.51.100.25`
           * **MAC** address — `fa:16:3e:12:34:56`
           * **CIDR** range — `198.51.102.0/22`

        **Configure attached VAST network interface**

        <Info>
          This configuration is required only when adding an interface to an existing, already provisioned resource; for interfaces added during resource creation and provisioning, this configuration is performed automatically.
        </Info>

        **Automatic configuration with DHCP (recommended)**

        <Info>
          DHCP is now enabled on VAST subnets. This automatically provides IP address, CIDR, gateway, and route information when attaching a VAST subnet to a compute resource.
        </Info>

        <p>When attaching a VAST subnet to an existing compute resource, use DHCP to automatically configure the network interface. This is the recommended method as it eliminates the need for manual network configuration.</p>

        **DHCP configuration for VMs and GPU clusters**

        <p>Run the DHCP client on the VAST interface. Replace `enp8s0` with the actual interface name:</p>

        ```bash theme={null}
        sudo dhclient enp8s0
        ```

        **DHCP configuration for Bare Metal servers**

        <AccordionGroup>
          <Accordion title="Bluefield DPU">
            Run the DHCP client on the VAST interface. Replace `ens10f0v0` with the actual interface name:

            ```bash theme={null}
            sudo dhclient ens10f0v0
            ```
          </Accordion>

          <Accordion title="Standard (bond interface)">
            Create the VLAN interface and run the DHCP client. Replace `bond0.2998` with the actual VLAN interface name and VLAN ID:

            ```bash theme={null}
            ip link add link bond0 name bond0.2998 type vlan id 2998
            dhcpcd bond0.2998
            ```
          </Accordion>
        </AccordionGroup>

        <p>The DHCP client automatically configures the IP address, subnet mask, gateway, and routing information, following the same [network configuration](/cloud/networking/ip-address/create-and-configure-a-reserved-ip-address) approach used across Gcore Cloud.</p>

        **Manual configuration (alternative method)**

        <p>For custom network settings, configure the interface manually instead.</p>

        <p>Connect to the server via the Customer Portal or SSH and configure the attached VAST network interface.</p>

        1. Use `ip addr` to list all available interfaces.
        2. Identify the VAST interface using the MAC address from the previous step.
        3. Note the **interface name** for use in the following steps. Interface names follow the format `enp8s0` or `enp4s0`.
        4. Configure the interface as described below for the relevant instance type.

        <p>In all commands below, replace `198.51.100.25` with the IP address from step 2, and replace `198.51.100.1` with the gateway IP — take the first three octets of the CIDR range from step 2 and append `.1`.</p>

        **Configuring VAST interface for VMs and GPU clusters**

        <p>Replace `enp8s0` with the interface name from step 3.</p>

        <p>Set interface MTU:</p>

        ```bash theme={null}
        sudo ip link set enp8s0 mtu 9000
        ```

        <p>Activate the interface:</p>

        ```bash theme={null}
        sudo ip link set enp8s0 up
        ```

        <p>Set interface CIDR:</p>

        ```bash theme={null}
        sudo ip addr add 198.51.100.25/22 dev enp8s0
        ```

        <p>Add static route to the VAST network:</p>

        ```bash theme={null}
        sudo ip route add 172.19.252.0/22 via 198.51.100.1 dev enp8s0
        ```

        **Configuring VAST interface for Bare Metal servers**

        <p>Bare Metal servers require different configuration depending on the network hardware.</p>

        <AccordionGroup>
          <Accordion title="Bluefield DPU">
            Replace `ens10f0v0` with the interface name from step 3.

            Set interface MTU:

            ```bash theme={null}
            sudo ip link set ens10f0v0 mtu 9000
            ```

            Activate the interface:

            ```bash theme={null}
            sudo ip link set ens10f0v0 up
            ```

            Set interface CIDR:

            ```bash theme={null}
            sudo ip addr add 198.51.100.25/22 dev ens10f0v0
            ```

            Add static route to the VAST network:

            ```bash theme={null}
            sudo ip route add 172.19.252.0/22 via 198.51.100.1 dev ens10f0v0
            ```
          </Accordion>

          <Accordion title="Arista (Trunks)">
            For Bare Metal servers with Arista switches (Trunks), create a VLAN interface on the bond. A bond (link aggregation) combines multiple physical network interfaces into a single logical interface, providing higher throughput and redundancy.

            Replace `100` with the VLAN ID shown in the **Networking** tab of the server details page.

            Create VLAN interface on a bond:

            ```bash theme={null}
            sudo ip link add link bond0 name bond0.100 type vlan id 100
            ```

            Activate the interface:

            ```bash theme={null}
            sudo ip link set bond0.100 up
            ```

            Set interface CIDR:

            ```bash theme={null}
            sudo ip addr add 198.51.100.25/22 dev bond0.100
            ```

            Add static route to the VAST network:

            ```bash theme={null}
            sudo ip route add 172.19.252.0/22 via 198.51.100.1 dev bond0.100
            ```
          </Accordion>
        </AccordionGroup>
      </Step>

      <Step title="Set up VAST NFS client support">
        <Info>
          This step is always required for VAST file shares, regardless of whether they are added during or after resource provisioning.
        </Info>

        <p>Connect to the server via the Customer Portal or SSH and set up VAST NFS client support.</p>

        1. Install NFS client tools:

           ```bash theme={null}
           sudo apt-get update && sudo apt-get install nfs-common -y
           ```

        2. Install build tools and headers for kernel modules:

           ```bash theme={null}
           sudo apt install dkms debhelper dh-dkms build-essential linux-headers-$(uname -r) -y
           ```

        3. Install VAST NFS package:

           ```bash theme={null}
           curl -sSf https://vast-nfs.s3.amazonaws.com/download.sh | bash -s --
           ```
      </Step>

      <Step title="Mount the file share">
        <p>Use an existing directory for mounting the share, or create a new one:</p>

        ```bash theme={null}
        sudo mkdir -p /mount/path
        ```

        <p>Mount the VAST file share:</p>

        * Replace `ndp1-2-vast.cloud.gc.onl:/manila/manila-01234567-89ab-cdef-0123-456789abcdef` with the connection point from the VAST file share overview tab.
        * Replace `/mount/path` with the absolute local directory path where the file share should be mounted.

        ```bash theme={null}
        sudo mount -o vers=3,nconnect=56,remoteports=dns,spread_reads,spread_writes,noextend ndp1-2-vast.cloud.gc.onl:/manila/manila-01234567-89ab-cdef-0123-456789abcdef /mount/path
        ```

        <p>The contents of the VAST file share are now accessible in the specified directory.</p>

        <Info>
          Always use NFS version 3 (vers=3) when mounting VAST file shares. If the system does not support the `nconnect` option, install the [VAST Enhanced NFS Client](https://vastnfs.vastdata.com/docs/4.0/download.html).
        </Info>

        <Frame>
          <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/vast-mount.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=9319cfbff8e87b35c7769c17f720c343" alt="VAST file share Overview tab with mount command" width="1400" height="900" data-path="images/docs/cloud/file-shares/configure-file-shares/vast-mount.png" />
        </Frame>
      </Step>
    </Steps>

    ## Resizing file shares

    <Info>
      * **VAST** shares can be resized directly, without being unmounted.
      * **Standard** shares must be unmounted before resizing:

        ```bash theme={null}
        umount -lf /mount/path
        ```

        Once resized, file shares can be remounted as described above for each share type.
    </Info>

    ### Resize file share

    <p>This process is the same for both Standard and VAST-based file shares:</p>

    <Steps>
      <Step title="Open the file share">
        In the **Cloud** menu, go to **Storage**, select **File Shares**, and click the file share to be resized.
      </Step>

      <Step title="Resize">
        In the **Overview** tab, click **Resize** and enter the new share size:

        <Frame>
          <img src="https://mintcdn.com/gcore/oxS_nLcLtEBfgfBM/images/docs/cloud/file-shares/configure-file-shares/5-1.png?fit=max&auto=format&n=oxS_nLcLtEBfgfBM&q=85&s=57223adadb0a39c46639b41d0920d8a1" alt="File share Overview tab with Resize button active" width="1400" height="900" data-path="images/docs/cloud/file-shares/configure-file-shares/5-1.png" />
        </Frame>
      </Step>
    </Steps>
  </MethodSection>

  <MethodSection id="api" label="REST API">
    <p>NFS file shares provide shared persistent storage accessible from any VM on the same private subnet. Each step below creates one resource — network, subnet, file share — and ends with the connection point used in the mount command.</p>

    <p>Before picking a region, check that file shares are available there — look for `has_sfs: true` in the regions response:</p>

    ```bash theme={null}
    curl "https://api.gcore.com/cloud/v1/regions" \
      -H "Authorization: APIKey $GCORE_API_KEY"
    ```

    <Info>
      An [API token](/account-settings/api-tokens) is required, along with a [project ID](/api-reference/cloud/projects/list-projects) and [region ID](/api-reference/cloud/regions/list-regions).
    </Info>

    Open a bash terminal and set these as environment variables before running the examples:

    ```bash theme={null}
    export GCORE_API_KEY="{YOUR_API_KEY}"
    export GCORE_CLOUD_PROJECT_ID="{YOUR_PROJECT_ID}"
    export GCORE_CLOUD_REGION_ID="{YOUR_REGION_ID}"
    ```

    ## Quickstart

    The scripts below create a private network, subnet, and 5 GiB NFS file share, then print the connection point for mounting.

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        import os
        from gcore import Gcore

        client = Gcore()

        # Step 1. Create a private network
        network = client.cloud.networks.create_and_poll(name="my-network", create_router=True)
        print(f"Network ID: {network.id}")

        # Step 2. Create a subnet
        subnet = client.cloud.networks.subnets.create_and_poll(
            network_id=network.id,
            name="my-subnet",
            cidr="192.168.100.0/24",
        )
        print(f"Subnet ID: {subnet.id}")

        # Step 3. Create the file share
        task_id_list = client.cloud.file_shares.create(
            name="my-share",
            protocol="NFS",
            size=5,
            network={"network_id": network.id, "subnet_id": subnet.id},
            access=[{"access_mode": "rw", "ip_address": "192.168.100.0/24"}],
        )
        task = client.cloud.tasks.poll(task_id_list.tasks[0])
        share_id = task.created_resources.file_shares[0]
        print(f"File share ID: {share_id}")

        # Step 4. Retrieve the connection point
        share = client.cloud.file_shares.get(file_share_id=share_id)
        print(f"Connection point: {share.connection_point}")
        print(f"Mount with: sudo mount -t nfs {share.connection_point} /mnt/share")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        package main

        import (
            "context"
            "fmt"
            "log"

            gcore "github.com/G-Core/gcore-go"
            "github.com/G-Core/gcore-go/cloud"
            "github.com/G-Core/gcore-go/packages/param"
            "github.com/G-Core/gcore-go/shared/constant"
        )

        func main() {
            client := gcore.NewClient()
            ctx := context.Background()

            // Step 1. Create a private network
            network, err := client.Cloud.Networks.NewAndPoll(ctx, cloud.NetworkNewParams{
                Name:         "my-network",
                CreateRouter: param.NewOpt(true),
            })
            if err != nil {
                log.Fatal(err)
            }
            fmt.Printf("Network ID: %s\n", network.ID)

            // Step 2. Create a subnet
            subnet, err := client.Cloud.Networks.Subnets.NewAndPoll(ctx, cloud.NetworkSubnetNewParams{
                Name:      "my-subnet",
                Cidr:      "192.168.100.0/24",
                NetworkID: network.ID,
            })
            if err != nil {
                log.Fatal(err)
            }
            fmt.Printf("Subnet ID: %s\n", subnet.ID)

            // Step 3. Create the file share
            share, err := client.Cloud.FileShares.NewAndPoll(ctx, cloud.FileShareNewParams{
                OfCreateStandardFileShareSerializer: &cloud.FileShareNewParamsBodyCreateStandardFileShareSerializer{
                    Name: "my-share",
                    Network: cloud.FileShareNewParamsBodyCreateStandardFileShareSerializerNetwork{
                        NetworkID: network.ID,
                        SubnetID:  param.NewOpt(subnet.ID),
                    },
                    Size:     5,
                    Protocol: constant.ValueOf[constant.Nfs](),
                    Access: []cloud.FileShareNewParamsBodyCreateStandardFileShareSerializerAccess{
                        {AccessMode: "rw", IPAddress: "192.168.100.0/24"},
                    },
                },
            })
            if err != nil {
                log.Fatal(err)
            }
            fmt.Printf("File share ID: %s\n", share.ID)

            // Step 4. Retrieve the connection point
            details, err := client.Cloud.FileShares.Get(ctx, share.ID, cloud.FileShareGetParams{})
            if err != nil {
                log.Fatal(err)
            }
            fmt.Printf("Connection point: %s\n", details.ConnectionPoint)
            fmt.Printf("Mount with: sudo mount -t nfs %s /mnt/share\n", details.ConnectionPoint)
        }
        ```
      </Tab>
    </Tabs>

    ## Resize the file share

    Standard file shares must be unmounted before resizing. The new size must be larger than the current size — downsizing is not supported.

    Unmount the share first:

    ```bash theme={null}
    sudo umount /mnt/share
    ```

    Then extend the share:

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        # client initialized in Step 1
        resize_tasks = client.cloud.file_shares.resize(file_share_id="{FILE_SHARE_ID}", size=10)
        client.cloud.tasks.poll(resize_tasks.tasks[0])
        resized = client.cloud.file_shares.get(file_share_id="{FILE_SHARE_ID}")
        print(resized.size)  # 10
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        // client and ctx initialized in Step 1
        resized, err := client.Cloud.FileShares.ResizeAndPoll(ctx, "{FILE_SHARE_ID}", cloud.FileShareResizeParams{
            Size: 10,
        })
        if err != nil {
            log.Fatal(err)
        }
        fmt.Printf("New size: %d GiB\n", resized.Size)
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        curl -s -X POST "https://api.gcore.com/cloud/v1/file_shares/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID/{FILE_SHARE_ID}/extend" \
          -H "Authorization: APIKey $GCORE_API_KEY" \
          -H "Content-Type: application/json" \
          -d '{"size": 10}'
        ```

        Response:

        ```json theme={null}
        {
          "tasks": ["bd7e55a5-..."]
        }
        ```
      </Tab>
    </Tabs>

    Poll the task every 5 seconds until `FINISHED`, then retrieve the connection point and remount the share:

    ```bash theme={null}
    curl -s "https://api.gcore.com/cloud/v1/file_shares/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID/{FILE_SHARE_ID}" \
      -H "Authorization: APIKey $GCORE_API_KEY" | grep connection_point
    ```

    ```bash theme={null}
    sudo mount -t nfs {CONNECTION_POINT} /mnt/share
    df -h /mnt/share
    ```

    ```
    Filesystem                                                         Size  Used Avail Use% Mounted on
    192.168.100.58:/shares/share-416d581b-1784-454c-adf8-d2dc75886625  9.8G     0  9.3G   0% /mnt/share
    ```

    ## Clean up

    Delete the file share when it is no longer needed:

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        # client initialized in the Quickstart
        del_tasks = client.cloud.file_shares.delete(file_share_id="{FILE_SHARE_ID}")
        client.cloud.tasks.poll(del_tasks.tasks[0])
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        // client and ctx initialized in the Quickstart
        if err := client.Cloud.FileShares.DeleteAndPoll(ctx, "{FILE_SHARE_ID}", cloud.FileShareDeleteParams{}); err != nil {
            log.Fatal(err)
        }
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        curl -s -X DELETE "https://api.gcore.com/cloud/v1/file_shares/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID/{FILE_SHARE_ID}" \
          -H "Authorization: APIKey $GCORE_API_KEY"
        ```
      </Tab>
    </Tabs>
  </MethodSection>

  <MethodSection id="terraform" label="Terraform">
    <p>Provision an NFS file share with per-CIDR access rules. The [`gcore_cloud_file_share`](https://registry.terraform.io/providers/G-Core/gcore/latest/docs/resources/cloud_file_share) resource and its access rule companion are declared in a single configuration.</p>

    ## Create a file share

    <p>Declare the file share and access rule using an existing network and subnet.</p>

    ```hcl theme={null}
    resource "gcore_cloud_file_share" "example" {
      project_id = var.project_id
      region_id  = var.region_id
      name       = "my-share"
      protocol   = "NFS"
      size       = 5  # GiB; minimum is 1

      network = {
        network_id = var.network_id
        subnet_id  = var.subnet_id
      }

      # terraform import gcore_cloud_file_share.example '<project_id>/<region_id>/<file_share_id>'
    }

    resource "gcore_cloud_file_share_access_rule" "example" {
      project_id    = var.project_id
      region_id     = var.region_id
      file_share_id = gcore_cloud_file_share.example.id
      access_mode   = "rw"  # "rw" or "ro"
      ip_address    = var.allowed_cidr
    }

    output "connection_point" {
      value = gcore_cloud_file_share.example.connection_point
    }
    ```

    <p>After `terraform apply`, `connection_point` holds the NFS server address and share path for the mount command, in the format `<nfs-ip>:/shares/<share-uuid>`. File share creation takes 60–90 seconds.</p>

    ## Resize a file share

    <p>Edit the `size` field and run `terraform apply` — size can only be increased. Standard shares must be unmounted before resizing.</p>

    ```hcl theme={null}
    resource "gcore_cloud_file_share" "example" {
      # ... (unchanged fields)
      size = 10  # increased from 5
    }
    ```

    ```bash theme={null}
    terraform apply
    ```

    ## Delete a file share

    <p>Remove the resource blocks — Terraform deletes the access rule first, then the file share on the next `terraform apply`.</p>

    ```hcl theme={null}
    # Remove or comment out both blocks:
    # resource "gcore_cloud_file_share_access_rule" "example" { ... }
    # resource "gcore_cloud_file_share" "example" { ... }
    ```

    ```bash theme={null}
    terraform apply
    ```
  </MethodSection>
</MethodSwitch>
