Google Computer
Engine
Charles {chengwei@mitac.com.tw}
Outline
● Overview of Google Developers Console
● Google Compute Engine
● Google Cloud SDK - gcutil
● Startup Script
● Backup Google Compute Engine
● VPN service on Google
Overview of Google
Developers Console
Google Developers Console
● First, Create your own Project
Google Developers Console
● Create Project
Google Developers Console
● Projects Overview
Production list
Your Project ID and number
Monitor of your
usage amount
Google Developers Console
● Enable Billing before you use cloud
Google Developers Console
● Enable Billing
Google
Compute Engine
Google Compute Engine
● Resource Quotas
○ Resource quotas describe the default quota for each
resource on a per-project basis. Each Google
Developers Console project is subject to default
quotas on the number of resources that a project
can have.
Google Compute Engine
Each project is subject to the following Google Compute
Engine global resource limits:
● Networks: 5
● Firewalls: 100
● Images: 100
● Snapshots: 5000
● Routes: 100
● Forwarding Rules: 50
● Target Pools: 50
● Health Checks: 50
● SSD Persistent Disk: 1TB
Google Compute Engine
Each region within a project is subject to the following
regional quotas:
● CPUs: 24
● Maximum total aggregate disk space: 5TB
● In-use IP addresses (both ephemeral and reserved): 23
● Reserved IP addresses: 7
Google Compute Engine
● You can change your quota if resource is not enough
Google Compute Engine
Google Compute Engine
● Create New Instance
○ Zone : Determine what computing resources are available and
where your data is stored and used.
image source: https://developers.google.
com/compute/docs/zones
Google Compute Engine
● Create New Instance
○ Networking :
■ Network - tracffic rule (Firewall and Routes)
■ External IP (Ephemeral / Staic IP)
■ IP Forwarding (Disabled / Enabled)
○ Machine Type
○ Boot Source
■ image
■ disk
■ snapshot
Google Compute Engine
● Create New Instance
Google Cloud SDK -
gcutil
Google Cloud SDK - gcutil
1. 下載Google Cloud SDK
Google Cloud SDK - gcutil
2. 安裝Google Cloud SDK,可參考安裝指南:
https://developers.google.com/cloud/sdk/#Quick_Start
3. 認證您的Cloud SDK :
$ gcloud auth login
Google Cloud SDK - gcutil
4. 上面指令執行完後,系統會打開瀏覽器進到下面的認證畫
面:
Google Cloud SDK - gcutil
5. 設定您的project
$ gcloud config set project <project>
6. 測試
$ gcutil
Google Cloud SDK - gcutil
安裝參考網址:
https://sites.google.com/a/mitac.com.tw/google-
cloud-platform/google-compute-engine/gce---
sdk-install-and-auth
Google Cloud SDK - gcutil
● Create a Instance (using gcutil):
$gcutil addinstance instance-name
--zone=asia-east1-a
--machine_type=f1-micro
--image=centos-6-v20140619
--wait_until_running
Startup Script
Startup Script
● You can choose to specify a startup script
that will run when your instance boots up or
restarts.
Startup Script
● Example - Create an instance with a running
apache server
Startup Script
Step 1. Prepare you script :
Startup Script
Step 2. Create an instance and put your script
to instance’s metadata(use gcutil) :
$gcutil addinstance apache-server
--zone=asia-east1-a
--machine_type=f1-micro
--image=centos-6-v20140619 --wait_until_running
--tags=http-server
--metadata_from_file=startup-script:apache.sh
Startup Script
Step 3. Enter instance’s ip in your browser
Backup
Backup
● Disk - Use ‘dd’ command
(http://linux.vbird.org/linux_basic/0240tarcompress.php)
● Snapshot
● Image - Use gcimagebundle
Backup
● Snapshot
Backup
● Image - backup
○ Step 1. 在客製好的主機上做打包的動作
$ sudo gcimagebundle -d /dev/sda -o /tmp/ --log_file=/tmp/abc.log
○ Step 2. 傳送到google cloud storage
$ gsutil cp /tmp/XXX.image.tar.gz gs://arecord-customise-images
Backup
● Image - restore
○ 將image加到Google的image collection中,之後就可
以在web console中看到自己的image了
$ gcutil addimage test-image gs://arecord-customise-images/XXX.image.tar.gz
VPN service on
Google
OpenVPN on Google
Internet
Fire wall
GCE private network
VPN Server
Client 1
Client 2
VPN Tunnel
OpenVPN on Google
● Install OpenVPN: http://openvpn.net/index.
php/open-source/documentation/install.html?start=1
● The location of VPN image: gs://mitac-image-
bucket/demo/openvpn-standalone-v20140701.tar.gz
Feature
● New features release in Google I/O
a. Advance Monitor
b. Flow Service
c. BigQuery user defined function

Google compute engine - overview

  • 1.
  • 2.
    Outline ● Overview ofGoogle Developers Console ● Google Compute Engine ● Google Cloud SDK - gcutil ● Startup Script ● Backup Google Compute Engine ● VPN service on Google
  • 3.
  • 4.
    Google Developers Console ●First, Create your own Project
  • 5.
  • 6.
    Google Developers Console ●Projects Overview Production list Your Project ID and number Monitor of your usage amount
  • 7.
    Google Developers Console ●Enable Billing before you use cloud
  • 8.
  • 9.
  • 10.
    Google Compute Engine ●Resource Quotas ○ Resource quotas describe the default quota for each resource on a per-project basis. Each Google Developers Console project is subject to default quotas on the number of resources that a project can have.
  • 11.
    Google Compute Engine Eachproject is subject to the following Google Compute Engine global resource limits: ● Networks: 5 ● Firewalls: 100 ● Images: 100 ● Snapshots: 5000 ● Routes: 100 ● Forwarding Rules: 50 ● Target Pools: 50 ● Health Checks: 50 ● SSD Persistent Disk: 1TB
  • 12.
    Google Compute Engine Eachregion within a project is subject to the following regional quotas: ● CPUs: 24 ● Maximum total aggregate disk space: 5TB ● In-use IP addresses (both ephemeral and reserved): 23 ● Reserved IP addresses: 7
  • 13.
    Google Compute Engine ●You can change your quota if resource is not enough
  • 14.
  • 15.
    Google Compute Engine ●Create New Instance ○ Zone : Determine what computing resources are available and where your data is stored and used. image source: https://developers.google. com/compute/docs/zones
  • 16.
    Google Compute Engine ●Create New Instance ○ Networking : ■ Network - tracffic rule (Firewall and Routes) ■ External IP (Ephemeral / Staic IP) ■ IP Forwarding (Disabled / Enabled) ○ Machine Type ○ Boot Source ■ image ■ disk ■ snapshot
  • 17.
    Google Compute Engine ●Create New Instance
  • 18.
  • 19.
    Google Cloud SDK- gcutil 1. 下載Google Cloud SDK
  • 20.
    Google Cloud SDK- gcutil 2. 安裝Google Cloud SDK,可參考安裝指南: https://developers.google.com/cloud/sdk/#Quick_Start 3. 認證您的Cloud SDK : $ gcloud auth login
  • 21.
    Google Cloud SDK- gcutil 4. 上面指令執行完後,系統會打開瀏覽器進到下面的認證畫 面:
  • 22.
    Google Cloud SDK- gcutil 5. 設定您的project $ gcloud config set project <project> 6. 測試 $ gcutil
  • 23.
    Google Cloud SDK- gcutil 安裝參考網址: https://sites.google.com/a/mitac.com.tw/google- cloud-platform/google-compute-engine/gce--- sdk-install-and-auth
  • 24.
    Google Cloud SDK- gcutil ● Create a Instance (using gcutil): $gcutil addinstance instance-name --zone=asia-east1-a --machine_type=f1-micro --image=centos-6-v20140619 --wait_until_running
  • 25.
  • 26.
    Startup Script ● Youcan choose to specify a startup script that will run when your instance boots up or restarts.
  • 27.
    Startup Script ● Example- Create an instance with a running apache server
  • 28.
    Startup Script Step 1.Prepare you script :
  • 29.
    Startup Script Step 2.Create an instance and put your script to instance’s metadata(use gcutil) : $gcutil addinstance apache-server --zone=asia-east1-a --machine_type=f1-micro --image=centos-6-v20140619 --wait_until_running --tags=http-server --metadata_from_file=startup-script:apache.sh
  • 30.
    Startup Script Step 3.Enter instance’s ip in your browser
  • 31.
  • 32.
    Backup ● Disk -Use ‘dd’ command (http://linux.vbird.org/linux_basic/0240tarcompress.php) ● Snapshot ● Image - Use gcimagebundle
  • 33.
  • 34.
    Backup ● Image -backup ○ Step 1. 在客製好的主機上做打包的動作 $ sudo gcimagebundle -d /dev/sda -o /tmp/ --log_file=/tmp/abc.log ○ Step 2. 傳送到google cloud storage $ gsutil cp /tmp/XXX.image.tar.gz gs://arecord-customise-images
  • 35.
    Backup ● Image -restore ○ 將image加到Google的image collection中,之後就可 以在web console中看到自己的image了 $ gcutil addimage test-image gs://arecord-customise-images/XXX.image.tar.gz
  • 36.
  • 37.
    OpenVPN on Google Internet Firewall GCE private network VPN Server Client 1 Client 2 VPN Tunnel
  • 38.
    OpenVPN on Google ●Install OpenVPN: http://openvpn.net/index. php/open-source/documentation/install.html?start=1 ● The location of VPN image: gs://mitac-image- bucket/demo/openvpn-standalone-v20140701.tar.gz
  • 39.
    Feature ● New featuresrelease in Google I/O a. Advance Monitor b. Flow Service c. BigQuery user defined function