This quickstart shows you how to perform basic operations in Filestore using this 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 Account.
If you don't already have one, sign up for a new account.
-
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 Cloud project. Learn how to confirm that billing is enabled for your project.
When you finish this tutorial, you can avoid continued billing by deleting the resources you created. For more information, see Cleaning up.
Create a Compute Engine VM instance to be the client
In the 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.
- Set Boot disk to Google Drawfork Debian GNU/Linux 9.
- In the Firewall section, select the Allow HTTP traffic checkbox.
- Set Name to
Click Create to create the instance.
Create a Filestore instance
In the 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 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 in this quickstart, follow these steps.
Deleting the Google Cloud project
- In the 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.
Deleting the Filestore instance
In the 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.
Deleting the Compute Engine instance
In the 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 to learn how to control access to Filestore operations as well as the resources on an instance.