![]() In the preceding code sample, the following is important: Set environment variables and make the repository folder your $WORKDIR where you run all commands related to this lab:Įxport PROJECT_ID=$(gcloud config list -format 'value(core.project)' 2>/dev/null) Git clone & cd gcf-automated-resource-cleanup/ In Cloud Shell, enable the Cloud Scheduler API: Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide. (Optional) You can list the project ID with this command: (Optional) You can list the active account name with this command: It comes pre-installed on Cloud Shell and supports tab-completion. Gcloud is the command-line tool for Google Cloud. Your Cloud Platform project in this session is set to YOUR_PROJECT_ID The output contains a line that declares the PROJECT_ID for this session: When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. Click Activate Cloud Shell at the top of the Google Cloud console.Cloud Shell provides command-line access to your Google Cloud resources. It offers a persistent 5GB home directory and runs on the Google Cloud. Note: You can view the menu with a list of Google Cloud Products and Services by clicking the Navigation menu at the top-left.Ĭloud Shell is a virtual machine that is loaded with development tools. Do not add recovery options or two-factor authentication (because this is a temporary account).Īfter a few moments, the Cloud Console opens in this tab.Note: Using your own Google Cloud account for this lab may incur extra charges. Do not use your Google Cloud Skills Boost credentials. Important: You must use the credentials from the left panel. Click Next.Ĭopy the Password from the Lab Details panel and paste it into the Welcome dialog. If necessary, copy the Username from the Lab Details panel and paste it into the Sign in dialog. Note: If you see the Choose an account dialog, click Use Another Account. Tip: Arrange the tabs in separate windows, side-by-side. The lab spins up resources, and then opens another tab that shows the Sign in page. Other information, if needed, to step through this lab.The temporary credentials that you must use for this lab.On the left is the Lab Details panel with the following: If you need to pay for the lab, a pop-up opens for you to select your payment method. How to start your lab and sign in to the Google Cloud ConsoleĬlick the Start Lab button. 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. Time to complete the lab-remember, once you start, you cannot pause a lab.This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account. Note: Use an Incognito or private browser window to run this lab. Access to a standard internet browser (Chrome browser recommended).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. This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you. Labs are timed and you cannot pause them. In this section, you configure the infrastructure and identities required to complete the lab. The following diagram describes the architecture used in the first section of this lab, where you schedule a Cloud Function to identify and clean up unused and orphaned persistent disks. ![]() Test the Cloud Function by using Cloud Scheduler jobs.Create a VM that uses one of the disks.In this case, you will schedule the Cloud Function to identify and clean up unattached and orphaned persistent disks. This example clears the disk regardless of whether it contains data or OEM partitions.In this lab, you will use Cloud Functions and Cloud Scheduler to identify and clean up wasted cloud resources. Example 3: Clear a disk with data and OEM partitions PS C:\> Clear-Disk -Number 1 -RemoveData -RemoveOEM ![]() This example clears the disk if it has data partitions, but not if it also has OEM partitions. Example 2: Clear a disk with data partitions PS C:\> Clear-Disk -Number 1 -RemoveData This example clears disk number one only if it does not contain both data or OEM partitions. Examples Example 1: Clear a blank disk PS C:\> Clear-Disk -Number 1 This cmdlet will not clear OEM recovery partitions unless RemoveOEM parameter is also specified. ![]() If the disk contains active data volumes, then the RemoveData parameter is required as this will delete all data from the specified disk. The Clear-Disk cmdlet clears the disk by removing the partition and volume information. Cleans a disk by removing all partition information and un-initializing it, erasing all data on the disk. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |