Create a Filestore instance by using the Google Cloud console

This quickstart shows you how to perform basic operations in Filestore using this Google Cloud console. In the quickstart, you will:

  • Create a Filestore instance.
  • Mount the file share from that instance on a client VM instance.
  • Create a file on the mounted file share.
  • Delete the Filestore instance.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  5. Make sure that billing is enabled for your Google Cloud project.

When you finish the tasks that are described in this document, you can avoid continued billing by deleting the resources that you created. For more information, see Clean up.

Create a Compute Engine VM instance to be the client

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

    Go to the Compute Engine instances page

  2. Click Create Instance and configure the instance as follows.

    • Set Name to nfs-client.
    • Set Zone to us-central1-c.
    • Keep the default boot disk.
    • In the Firewall section, select the Allow HTTP traffic checkbox.
    • Keep the network as default.
  3. Click Create to create the instance.

Create a Filestore instance

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

    Go to the Filestore instances page

  2. Click Create Instance and configure the instance as follows:

    • Set Instance ID to nfs-server.
    • Set Instance type to Basic.
    • Set Storage type to HDD.
    • Set Allocate capacity to 1TB.
    • Set Region to us-central1 and Zone to us-central1-c.
    • Set VPC network to default.
    • Set File share name to vol1.
    • Set Allocated IP range to Use an automatically allocated IP range.
    • Set Access controls to Grant access to all clients.
  3. Click Create.

Mount the Filestore file share on the client

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

    Go to the VM instances page

  2. In the list of VM instances, click the SSH button for nfs-client to open a terminal window connected to that instance.

  3. Install NFS by running the following commands:

    sudo apt-get -y update &&
    sudo apt-get -y install nfs-common
    
  4. Make a mount directory for the Filestore file share by running the following command:

    sudo mkdir -p /mnt/test
    
  5. Mount the file share by running the mount command and specifying the Filestore instance IP address and file share name:

    sudo mount 10.0.0.2:/vol1 /mnt/test
    
  6. Make the file share accessible by changing the permissions:

    sudo chmod go+rw /mnt/test
    

Create a file on the file share

  1. In the terminal window that is connected to the nfs-client instance, create a file named testfile by running the following command:

    echo 'This is a test' > /mnt/test/testfile
    
  2. Confirm that the file was created by running the following command:

    ls /mnt/test
    

    and verifying that testfile is listed.

Clean up

To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.

Delete the Google Cloud project

  1. In the Google Cloud console, go to the Manage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then click Delete.
  3. In the dialog, type the project ID, and then click Shut down to delete the project.

Delete the Filestore instance

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

    Go to the Filestore instances page

  2. Click the nfs-server instance ID to open the instance details page.

  3. Click Delete .

  4. When prompted, type the instance ID.

  5. Click Delete.

Delete the Compute Engine instance

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

    Go to the VM instances page

  2. Select the checkbox next to the nfs-client instance name.

  3. Click Delete .

  4. When prompted, click Delete again.

What's next