Google is making the power of its datacenter, network, and technology innovations available to the world through its Cloud services. This presentation will provide an overview of the Google Cloud Platform and a deeper dive on Google Compute Engine. Google recently made an open source contribution to SaltStack and now you can now use Salt Cloud to manage your Compute Engine resources (IaaS virtual machine services). Come find out more about Google's Cloud Platform and how you can leverage Google scale with SaltStack.
2. Agenda: January 30th, 2014
Whirlwind Tour of Google Cloud Platform
Google Compute Engine
Using SaltStack and Compute Engine (demo)
1
2
3
3. Whirlwind Tour of Google Cloud Platform
Google Compute Engine
Using SaltStack and Compute Engine (demo)
1
2
3
4. For the past 15 years, Google
has been building out the
world’s fastest, most powerful,
highest quality cloud
infrastructure on the planet.
Images by Connie Zhou
Why Google Cloud Platform?
8. “[Google's] ability to build, organize, and
operate a huge network of servers and fiber-
optic cables with an efficiency and speed that
rocks physics on its heels.
This is what makes Google Google: its physical
network, its thousands of fiber miles, and those
many thousands of servers that, in aggregate,
add up to the mother of all clouds.”
- Wired
Images by Connie Zhou
17. Persistent Disk
10 TB
• Data and root partitions
• Billed only by capacity (GB/month)
• Performance caps scale linearly with size
• Volume striping is automatic
• Differential snapshots
• Create new PDs based on snapshots
19. Global Snapshot and Restore
GCS
vol1 vol2 vol3
vol1.
t2
vol2.
t2
vol3.
t3
t1 t1 t1
t1 t1 t1
t1 t1 t1
t1 t1
t1 t1
t2 t2
t2
t2
t3 t3 t3
● Point in time snapshot to
Google Cloud Storage
(GCS)
● Differential snapshots
● GCS global replication!
● Restore from snapshot
anywhere in the world
us-central1-a
europe-west1-a
24. Enhanced Reliability
us-central1-a
scheduled maintenance event
Live Migration
• No downtime during
scheduled datacenter
maintenance events
Automatic Restart
• Instances automatically
restarted if subjected to
system events such as
hardware failure
26. Images by Connie Zhou
Networking
• Google's Network
• Projects are isolated private networks
• TCP, UDP, ICMP only
• Multiple private network groups and firewalls
• Tags and address ranges
• Addresses
• public: static or ephemeral
• private: ephemeral with DNS
• Routes, gateways, VPNs, and IP Forwarding
27. Region: us-central1
Target Pool (tp-a)
Load-balancer
• Region based
• Session affinity
• Hashed on src ip:port and dst ip:port
• Consists of:
• Target pool: collection of instances
• Forwarding rules: protocol:port, pool
• HTTP health check: optional us-central1-b
us-central1-a
www0
www1
www2
www3
Forwarding Rules
tcp:443 ➔ tp-a
tcp:80 ➔ tp-a
Internet
http://googlecloudplatform.blogspot.com/2013/11/compute-engine-load-balancing-hits-1-million-requests-per-second.html
29. Noteworthy
• Metadata
• Startup scripts
• SSH Keys
• Tags (instance/network)
• OAuth2 and Scopes
• Access other Google Cloud Platform services
• Ecosystem is growing
• Partners: RightScale, Scalr, New Relic, MongoLab, MapR, and many more...
• Open Source: Salt, Chef, Puppet, Ansible, Vagrant, Docker, CoreOS, fog, libcloud
30. Whirlwind Tour of Google Cloud Platform
Google Compute Engine
Using SaltStack and Compute Engine (demo)
1
2
3
31. Start to finish
1. Use the Developers Console to create the salt master (metadata: saltdemo=yup)
salt
This is a Compute
Engine instance
named "salt"
32. Start to finish
1. Use the Developers Console to create the salt-master (metadata: saltdemo=yup)
2. Use salt-cloud to create 4 instances (2 per zone), install apache
us-central1-a
minion1
minion3
us-central1-b
minion2
minion4
salt
# salt-cloud -P -m /etc/salt/demo.map
# salt 'minion*' state.highstate
GooglePublicAPI
33. Start to finish
1. Use the Developers Console to create the salt-master (metadata: saltdemo=yup)
2. Use salt-cloud to create 4 instances (2 per zone)
3. Use salt-cloud networking functions Region: us-central1
Target Pool (lb-tp)
us-central1-a
minion1
minion3
us-central1-b
minion2
minion4
Forwarding Rules
tcp:80 ➔ lb-tp
PublicLBIP:a.b.c.d
salt
# salt-cloud -f create_fwrule gce ...
# salt-cloud -f create_lb gce ...
34. Start to finish
1. Use the Developers Console to create the salt-master (metadata: saltdemo=yup)
2. Use salt-cloud to create 4 instances (2 per zone)
3. Use salt-cloud networking functions
4. Generate some HTTP requests to LB IP
Region: us-central1
Target Pool (lb-tp)
us-central1-a
minion1
minion3
us-central1-b
minion2
minion4
Forwarding Rules
tcp:80 ➔ lb-tp
PublicLBIP:a.b.c.d
Internet
dst port 80
salt
35. The salt master via custom "startup-script" metadata
startup-script1 #!/bin/bash
2
3 SALT=$(curl -s http://metadata/computeMetadata/v1beta1/instance/attributes/saltdemo)
4
5 if [ "$SALT" = "yup" ]; then
6 # update and install dependencies (libcloud 0.14.0 + bugfix)
7 apt-get install vim tmux git python-pip -y
8 pip install git+https://github.com/apache/libcloud@58f3722ba54dc79cc9ef40271f6a3d39d6e8841d
9
10 # salt master
11 curl -L http://bootstrap.saltstack.org | sudo sh -s -- -M -N git v2014.1.0rc3
12
13 # dev gce provider
14 git clone https://github.com/erjohnso/salt
15 cp salt/salt/cloud/clouds/gce.py /usr/lib/python2.7/dist-packages/salt/cloud/clouds/gce.py
16
17 # set up root
18 mkdir /root/.gsutil
19 echo 1391212799 > /root/.gsutil/.last_software_update_check
20 gsutil cp gs://5ej/saltconf/root-ssh/goo* /root/.ssh
21 chmod 600 /root/.ssh/google_compute_engine
22
23 # copy salt config/srv files
24 gsutil cp -Rp gs://5ej/saltconf/etc /
25 gsutil cp -Rp gs://5ej/saltconf/srv /
26 fi