arrow_back

Cloud Filestore: Qwik Start

Join Sign in
Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

Cloud Filestore: Qwik Start

Lab 45 minutes universal_currency_alt 1 Credit show_chart Introductory
Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

GSP244

Google Cloud self-paced labs logo

Overview

Cloud Filestore is a managed file storage service for applications that require a file system interface and a shared filesystem for data. Filestore gives users a simple, native experience for standing up managed Network Attached Storage (NAS) with their Compute Engine and Google Kubernetes Engine instances. The ability to fine-tune Filestore’s performance and capacity independently leads to predictably fast performance for your file-based workloads.

What you'll do

In this lab you'll learn how to perform basic operations in Cloud Filestore using the Google Cloud console. You will:

  • Create a Cloud Filestore instance.
  • Mount the fileshare from that instance on a client VM instance.
  • Create a file on the mounted fileshare.

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.

This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito or private browser window to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab---remember, once you start, you cannot pause a lab.
Note: If you already have your own personal Google Cloud account or project, do not use it for this lab to avoid extra charges to your account.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).

    The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details panel.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details panel.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To view a menu with a list of Google Cloud products and services, click the Navigation menu at the top-left. Navigation menu icon

Cloud Filestore architecture

Cloud Filestore architectural choices that affect your Cloud Filestore instances:

Permissions

A Cloud Filestore instance consists of a single NFS fileshare with fixed export settings and default Unix permissions.

Networking

  1. You must create a Cloud Filestore instance in the same Google Cloud project and VPC network as any clients that connect to it. All internal IP addresses in the selected VPC network can connect to the Cloud Filestore instance.

  2. If you are using a VPC network other than the default network, you might need to create firewall rules to enable communication with Cloud Filestore instances.

  3. You can't use a legacy network with Cloud Filestore instances.

IP address range

Each Cloud Filestore instance must have an IP address range associated with it. The IP address range must be from within the internal IP address ranges (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) and have a block size of 29. Examples of valid Cloud Filestore instance IP address ranges are 10.0.3.0/29 and 172.31.0.0/29.

You can assign the IP address range if there's a specific one you want to use, otherwise Cloud Filestore picks a random range to use from within the internal IP address ranges. If the range is already in use, the service tries again until it finds one that is free. If you assign an IP address range, make sure it doesn't overlap with any existing subnets in the VPC network that the Cloud Filestore instance uses, or with the IP address ranges assigned to any other existing Cloud Filestore instances in that network.

Cloud Filestore network peering

The first time you create a Cloud Filestore instance, Cloud Filestore also creates a peered network to enable network connectivity between clients in your project and the Cloud Filestore instance. The peered network has a machine-generated name similar to r-1abc2d3e-45fg-6789-hf12-3456i78j9k1-0000000a-peer, and appears in the VPC Network Peering page.

Don't delete the peered network, because this will cause you to lose connectivity with your Cloud Filestore instances. If you accidentally delete the peered network, the easiest thing to do to recreate it is to create another Cloud Filestore instance. Cloud Filestore will recognize that there is no connectivity between your project and the new instance, and will re-create the peered network. you can delete the new Cloud Filestore instance after that if you don't need it for anything else.

Storage size units

Cloud Filestore defines 1 gigabyte (GB) as 1024^3 bytes, also known as a gibibyte (GiB). Cloud Filestore also defines 1 terabyte (TB) as 1024^4 bytes, also known as a tebibyte (TiB).

Task 1. Create a Compute Engine instance

  1. Navigate to VM Instances by going to Navigation Menu > Compute Engine > VM Instances and click +CREATE INSTANCE.

  2. Set up your VM with the following information:

Configuration Value
Name nfs-client
Region
Zone
Series E2
Machine Type e2-medium
Boot Disk Debian GNU/Linux 11 (bullseye)
Firewall Allow HTTP traffic

The Create an instance page

  1. Click Create.

Click Check my progress to verify the objective.

Create a Compute Engine instance, allow HTTP traffic.

Task 2. Create a Cloud Filestore instance

  1. Go to Navigation menu > APIs and Services > Library.

  2. Search for Cloud Filestore API and click Enable if it is not already enabled.

  3. Navigate to Navigation Menu > Filestore.

If you get an error message be sure you navigated to Filestore and not Firestore.

  1. Click +CREATE INSTANCE at the top of the page.

  2. Create your Cloud Filestore instance with the following information:

Configuration Value
Instance ID nfs-server
Instance type Basic
Storage type HDD
Allocate capacity 1 TB
Region
Zone
Network default
File share name vol1
Access control Grant access to all clients on the VPC network
  1. Click Create.

Click Check my progress to verify the objective.

Create a Cloud Filestore instance

This will take a couple of minutes to create.

Task 3. Mount the Cloud Filestore fileshare on a Compute Engine VM

  1. Navigate Navigation Menu > Compute Engine > VM Instances.
  2. In the list of VM instances, click the SSH button for nfs-client to open a terminal window connected to that instance.
  3. In SSH shell install NFS by running the following commands:
sudo apt-get -y update && sudo apt-get -y install nfs-common
  1. Make a mount directory for the Cloud Filestore fileshare by running the following command:
sudo mkdir /mnt/test
  1. Mount the fileshare by running the mount command and specifying the Cloud Filestore instance IP address and fileshare name:
sudo mount YOUR_INSTANCE_IP:/vol1 /mnt/test

If the above command hangs up or returns an "access denied" error that resembles:

  • mount.nfs: access denied by server while mounting 10.0.0.2:/vol1
  • mount.nfs: mount to NFS server '10.0.0.2:/vol1' failed: RPC Error: Unable to receive try running the command again.

Most likely it means that your Filestore instance hasn't been created yet. Return to the Cloud Console, and from the Navigation Menu select Filestore. This will take you to the instances page. When your instance has a green check next to it you can return to your SSH session and try the sudo mount command again.

The instances page displaying the nfs-server instance

  1. Make the fileshare accessible by changing the permissions:
sudo chmod go+rw /mnt/test Note: You should set more specific permissions in a production environment. For more information, refer to Configuring access on a fileshare.

Task 4. Create a file on the fileshare

  1. In the terminal window that is connected to the nfs-client instance, run the following to create a file named testfile:
echo 'This is a test' > /mnt/test/testfile
  1. Confirm the file was created by running the following command:
ls /mnt/test

You'll see that testfile is in the directory.

  1. You can see the content of the file by running the following command:
nano /mnt/test/testfile

You should see that the file contains the following text:

This is a test

Congratulations!

Next steps / Learn more

You can read more about Cloud Filestore on the Filestore page.

This lab is also part of a series of labs called Qwik Starts. These labs are designed to give you a little taste of the many features available with Google Cloud. Search for "Qwik Starts" in the lab catalog to find the next lab you'd like to take!

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated: October 16, 2023

Lab Last Tested: October 17, 2023

Copyright 2024 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.