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
- 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.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
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
In the Google Cloud console, go to the VM Instances page.
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.
- Set Name to
Click Create to create the instance.
Create a Filestore instance
In the Google Cloud console, go to the Filestore Instances page.
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 1
TB
. - 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.
- Set Instance ID to
Click Create.
Mount the Filestore file share on the client
In the Google Cloud console, go to the VM Instances page.
In the list of VM instances, click the SSH button for nfs-client to open a terminal window connected to that instance.
Install NFS by running the following commands:
sudo apt-get -y update && sudo apt-get -y install nfs-common
Make a mount directory for the Filestore file share by running the following command:
sudo mkdir -p /mnt/test
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
Make the file share accessible by changing the permissions:
sudo chmod go+rw /mnt/test
Create a file on the file share
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
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
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
Delete the Filestore instance
In the Google Cloud console, go to the Filestore Instances page.
Click the
nfs-server
instance ID to open the instance details page.Click Delete delete.
When prompted, type the instance ID.
Click Delete.
Delete the Compute Engine instance
In the Google Cloud console, go to the Filestore Instances page.
Select the checkbox next to the
nfs-client
instance name.Click Delete delete.
When prompted, click Delete again.
What's next
- Read the Filestore Overview to learn more about the basics of Filestore.
- Set up a Filestore instance on your own by following the instructions at Creating Instances.
- Read the Access Control page to learn how to control access to Filestore operations and the resources on an instance.
- See how to copy data to or from a Filestore instance.
- See how to transfer large datasets from Cloud Storage to Filestore.