Overview
In this lab, you will explore the Virtual Machine instance options and create several VMs with different characteristics.
Objectives
In this lab, you explore the available options for VMs and see the differences between locations.
In this lab, you learn how to perform the following tasks:
- Create several standard VMs
- Create advanced VMs
Setup and Requirements
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
-
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.
Note: To view a menu with a list of Google Cloud products and services, click the Navigation menu at the top-left, or type the service or product name in the Search field.
Task 1. Create a utility virtual machine
Create a VM
- In the Google Cloud console, in the Navigation menu (
), click Compute Engine > VM instances.
- Click Create Instance.
- For Name, type a name for your instance.
Hover over the question mark icon for advice about what constitutes a properly formed name.
- For Region and Zone select and respectively.
- For Series, select E2.
- For Machine type, examine the options.
Note: Notice that the menu lists the number of vCPUs, the amount of memory, and a symbolic name such as e2-medium. The symbolic name is the parameter you would use to select the machine type if you were creating a VM using the gcloud command. Notice to the right of the zone and machine type that there is a per-month estimated breakdown of costs for the selected machine type.
- For Machine type, select standard > e2-standard-4 (4 vCPUs, 16 GB memory).
How did the cost change?
- For Machine type, select Shared-core > e2-medium (2 vCPUs, 4 GB memory).
- Click Networking.
- For Network interfaces, click the dropdown icon.
- For External IPv4 address, select None.
- Click Done.
- Leave the remaining settings as their defaults, and click Create.
Wait until the new VM is created.
Note: External IP addresses that don’t fall under the Free Tier of the Google Cloud Free Program will incur a small cost. Learn more about the pricing in the External IP address pricing section of the Virtual Private Cloud Guide.
Explore the VM details
- On the VM instances page, click on the name of your VM.
- Locate CPU platform and note the value. Click Edit.
Note: Notice that you cannot change the machine type, the CPU platform, or the zone.
You can add network tags and allow specific network traffic from the internet through firewalls.
Some properties of a VM are integral to the VM, are established when the VM is created, and cannot be changed. Other properties can be edited.
You can add additional disks and you can also determine whether the boot disk is deleted when the instance is deleted.
Normally the boot disk defaults to being deleted automatically when the instance is deleted. But sometimes you will want to override this behavior. This feature is very important because you cannot create an image from a boot disk when it is attached to a running instance.
So you would need to disable Delete boot disk when instance is deleted to enable creating a system image from the boot disk.
-
Click Cancel.
-
Examine Availability policies.
Note: You cannot convert a non-preemptible instance into a preemptible one. This choice must be made at VM creation. A preemptible instance can be interrupted at any time and is available at a lower cost.
If a VM is stopped for any reason, (for example an outage or a hardware failure) the automatic restart feature will start it back up. Is this the behavior you want? Are your applications idempotent (written to handle a second startup properly)?
During host maintenance, the VM is set for live migration. However, you can have the VM terminated instead of migrated.
If you make changes, they can sometimes take several minutes to be implemented, especially if they involve networking changes like adding firewalls or changing the external IP.
Explore the VM logs
- On the VM instance details page for your VM, click Logging.
Note: Notice that you have now navigated to the Logging page.
This is a structured log view. At the top you can filter by using the pull-down menus, and there is a search box for searching based on labels or text.
- Click the Expand this log entry icon to the left of one of the lines to see the kind of information it contains.
Click Check my progress to verify the objective.
Create a utility virtual machine
Task 2. Create a Windows virtual machine
Create a VM
- In the Google Cloud console, in the Navigation menu (
), click Compute Engine > VM instances.
- Click Create instance.
- Specify the following:
Property |
Value (type value or select option as specified) |
Name |
Type a name for your Windows VM |
Region |
|
Zone |
|
- For Series, select E2.
- For Machine type, select standard > e2-standard-2 (2 vCPUs, 8 GB memory).
- Click OS and storage, and then click Change.
- For Operating system, select Windows Server.
- For Version, select Windows Server 2016 Datacenter Core.
- For Boot disk type, select SSD persistent disk.
- For Size (GB), enter 64.
- Click Select.
- Click Networking.
- For Firewall, enable Allow HTTP traffic and Allow HTTPS traffic.
- Click Create.
Note: When the VM is running, notice that the connection option in the far right column is RDP, not SSH. RDP is the Remote Desktop Protocol. You would need the RDP client installed on your local machine to connect to the Windows desktop.
Note: Installing an RDP client on your local machine is outside the scope of this lab and of the class. For this reason, you will not be connecting to the Windows VM during this lab. However, you will step through the usual procedures up to the point of requiring the RDP client.
Instructions for connecting to Windows VMs are in the
Connecting to Windows VMs Guide.
Set the password for the VM
- Click on the name of your Windows VM to access the VM instance details.
- You don't have a valid password for this Windows VM: you cannot log in to the Windows VM without a password. Click Set Windows password.
- Click Set.
- Copy the provided password, and click CLOSE.
Note: You will not connect to the Windows VM during this lab. However, the process would look something like the following (depending on the RDP client you installed). The RDP client shown can be installed for Chrome from the
Chrome webstore.
On the VM instances page, you would click RDP for your Windows VM and connect with the password copied earlier.
Click Check my progress to verify the objective.
Create a Windows virtual machine
Task 3. Create a custom virtual machine
Create a VM
- In the Google Cloud console, in the Navigation menu (
), click Compute Engine > VM instances.
- Click Create instance.
- Specify the following:
Property |
Value (type value or select option as specified) |
Name |
Type a name for your VM |
Region |
|
Zone |
|
- For Series, select E2.
- For Machine type, click Custom.
- For Cores, enter 2.
- For Memory, enter 4 GB.
- Click OS and storage.
- If the Image shown is not Debian GNU/Linux 12 (bookworm), click Change and select Debian GNU/Linux 12 (bookworm), and then click Select.
- Click Create.
Connect via SSH to your custom VM
- For the custom VM you just created, click SSH.
- To see information about unused and used memory and swap space on your custom VM, run the following command:
free
- To see details about the RAM installed on your VM, run the following command:
sudo dmidecode -t 17
- To verify the number of processors, run the following command:
nproc
- To see details about the CPUs installed on your VM, run the following command:
lscpu
- To exit the SSH terminal, run the following command:
exit
Click Check my progress to verify the objective.
Create a custom virtual machine
Task 4. Review
In this lab, you created several virtual machine instances of different types with different characteristics. One was a small utility VM for administration purposes. You also created a standard VM and a custom VM. You launched both Windows and Linux VMs and deleted VMs.
End your lab
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
- 1 star = Very dissatisfied
- 2 stars = Dissatisfied
- 3 stars = Neutral
- 4 stars = Satisfied
- 5 stars = Very satisfied
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 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.