- Google Cloud Platform for Architects
- Vitthal Srinivasan Janani Ravi Judy Raj
- 631字
- 2021-06-25 20:48:27
Using the Cloud Shell
Before we jump into the compute options on GCP and create our first VM instance, let's understand the Cloud Shell. A Cloud Shell is a machine instance that runs on the Google Cloud which serves as your command line. All GCP accounts have a Cloud Shell that they can use to access resources on the Google Cloud Platform. You can access the Cloud Shell by clicking on a button to the top right of the navigation ribbon:

The great thing about the Cloud Shell is that it provides a complete environment for you to connect to various resources in the Cloud. Also, it is worth noting that the Cloud Shell is completely free for usage. The cool thing about it is that you can directly use the gcloud command-line tools to connect to resources in the cloud, create resources, provision it, and so on. You don't need to install and set up anything. The Cloud Shell is what you would use if, say, your organization does not allow you to download software on your local machine. It is a great alternative in that case, which just works. When you first connect to the Cloud Shell or gshell, Google has to spin up an active instance to use for this. It might take a little while, so be patient:

The figure that follows is our provisioned Cloud Shell and you will notice that it is associated with the same project which we mentioned earlier. Let's take the gcloud command-line tool for a test run. Remember that the Cloud Shell is just a terminal session on an ephemeral VM. This session will get disconnected after 30 minutes of inactivity. Also, when you are in the Cloud Shell, you are in a home directory with 5 GB of space, and this home directory will remain constant across all Cloud Shell sessions in the project and will be deleted after 120 days of inactivity:

Let’s explore the Cloud Shell further. The gcloud is Google's main command-line tool that allows you to work with resources and to a whole bunch of operations. It's especially useful if you want to script operations and just run a script rather than perform it manually over and over again.
You can view what the current default project is by typing out the gcloud config list command:

You can see that loonycorn-project08 is the default. If you need help with what commands are available with gcloud, simply type gcloud -h, and you will see a whole bunch of information. The gcloud config list command shows you what properties have been set so far in the configuration. This will only display those properties that are different from the defaults. For example, you can see here that the account has been set to vitthal@loonycorn.com and the project is loonycorn-project08:

If you need help for a particular command, let's say it's the compute command, you can simply say gcloud compute --help:

This essentially throws up the main page for that particular command. In other words, gcloud has context-sensitive help, and that is a great way to go about building the commands you need:

Everything you need is right there on the screen.
In a nutshell, the Google Cloud Shell is a great tool for quick work on the console. Remember, again, though, that it is a short, time-limited session on an ephemeral VM. So, if you are going to be intensely developing on the Google Cloud and you can download software, it's better to download the Google Cloud SDK and use that instead. This offers a permanent connection to your instances on the cloud instead of a temporary VM instance that has to be spun up in order to use Cloud Shell.
- PyTorch深度學習實戰:從新手小白到數據科學家
- Hands-On Data Structures and Algorithms with Rust
- 數據之巔:數據的本質與未來
- Architects of Intelligence
- 達夢數據庫性能優化
- 圖數據實戰:用圖思維和圖技術解決復雜問題
- 達夢數據庫運維實戰
- 計算機視覺
- 標簽類目體系:面向業務的數據資產設計方法論
- Practical Convolutional Neural Networks
- 推薦系統全鏈路設計:原理解讀與業務實踐
- Creating Mobile Apps with Appcelerator Titanium
- Hadoop大數據技術開發實戰
- MATLAB基礎及其應用教程
- SQL必知必會(第四版)