Checkpoint
Create a Compute Engine instance, allow HTTP traffic.
/ 50
Create a Cloud Filestore instance
/ 50
Cloud Filestore: Qwik Start
GSP244
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).
- Time to complete the lab---remember, once you start, you cannot pause a lab.
How to start your lab and sign in to the Google Cloud console
-
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
-
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. -
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.
-
Click Next.
-
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.
-
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. -
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.
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
-
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.
-
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.
-
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
-
In the Cloud console, on the Navigation menu (), click Compute Engine > VM Instances and click +CREATE INSTANCE.
-
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 |
- Click Create.
Click Check my progress to verify the objective.
Task 2. Create a Cloud Filestore instance
-
In the Cloud console, on the Navigation menu (), click APIs and Services > Library.
-
Search for
Cloud Filestore API
and click Enable if it is not already enabled. -
In the Cloud console, on the Navigation menu (), click View All Products > Storage > Filestore.
If you get an error message be sure you navigated to Filestore and not Firestore.
-
Click +CREATE INSTANCE at the top of the page.
-
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 |
- Click Create.
Click Check my progress to verify the objective.
This will take a couple of minutes to create.
Task 3. Mount the Cloud Filestore fileshare on a Compute Engine VM
-
In the Cloud console, on the Navigation menu (), click Compute Engine > VM Instances.
-
In the list of VM instances, click the SSH button for nfs-client to open a terminal window connected to that instance.
If prompted, click Authorize.
-
In SSH shell install NFS by running the following commands:
- Make a mount directory for the Cloud Filestore fileshare by running the following command:
- Mount the fileshare by running the
mount
command and specifying the Cloud Filestore instance IP address and fileshare name:
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.
- Make the fileshare accessible by changing the permissions:
Task 4. Create a file on the fileshare
- In the terminal window that is connected to the nfs-client instance, run the following to create a file named testfile:
- Confirm the file was created by running the following command:
You'll see that testfile
is in the directory.
- You can see the content of the file by running the following command:
You should see that the file contains the following text:
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 November 6, 2024
Lab Last Tested November 6, 2024
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.