Wednesday, August 1, 2012

GCE FTW!

Turns out I know a gal, who knows a guy who happens to be "a big deal" at g-plex... (thanks Phil!) ;-) So totally need to redact this post:

http://blog.jcuff.net/2012/07/gce-denied.html

ok, so let's take it for a whirl...

start the clock!

toofan:~ jcuff$ date
Wed Aug 1 10:21:58 EDT 2012

Ok, off we go!!

toofan:~ jcuff$ mkdir gce
toofan:~ jcuff$ cd gce
toofan:gce jcuff$ curl http://dl.google.com/dl/compute/gcutil.tar.gz > gcutil.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  693k  100  693k    0     0   759k      0 --:--:-- --:--:-- --:--:-- 1288k
toofan:gce jcuff$ tar zxvf gcutil.tgz 
x gcutil/share/lib/apiclient/http.py
x gcutil/share/lib/apiclient/discovery.py
x gcutil/share/lib/apiclient/mimeparse.py
[snip]

toofan:gcutil jcuff$ ./gcutil auth --project_id=harvardresearch
Go to the following link in your browser:


Enter verification code: 
Authentication successful.
INFO: Authorization succeeded for user jcuff

toofan:gcutil jcuff$ ./gcutil getproject 

+-----------------------------------------+---------------------------+
|                property                 |           value           |
+-----------------------------------------+---------------------------+
| name                                    | jcuff.net:harvardresearch |
| description                             |                           |
| creation time                           | 2012-08-01T14:17:32.902   |
| ips                                     |                           |
| INSTANCES quota usage / limit           | 0.0 / 8.0                 |
| CPUS quota usage / limit                | 0.0 / 8.0                 |
| EPHEMERAL_ADDRESSES quota usage / limit | 0.0 / 8.0                 |
| DISKS quota usage / limit               | 0.0 / 8.0                 |
| DISKS_TOTAL_GB quota usage / limit      | 0.0 / 100.0               |
| SNAPSHOTS quota usage / limit           | 0.0 / 1000.0              |
|                                         |                           |
| Common Instance Metadata                |                           |
+-----------------------------------------+---------------------------+

toofan:gcutil jcuff$ ./gcutil addinstance research
1: us-central1-a
2: us-central2-a
3: us-east1-a
>>> 3
1: n1-standard-1
2: n1-standard-1-d
3: n1-standard-2
4: n1-standard-2-d
5: n1-standard-4
6: n1-standard-4-d
7: n1-standard-8
8: n1-standard-8-d
>>> 8

Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
INFO: Waiting for insert of research. Current status: RUNNING. Sleeping for 3s.

toofan:gcutil jcuff$ ./gcutil ssh research

Identity added: /Users/jcuff/.ssh/google_compute_engine 

Welcome to Ubuntu 12.04 LTS (GNU/Linux 2.6.39-gcg-201203291735 x86_64)

 * Documentation:  https://help.ubuntu.com/
Running a Google Compute Engine VM Instance
 * You are running on an EPHEMERAL root disk, which is NOT PERSISTENT.
   For persistent data, use Persistent Disks:
     https://developers.google.com/compute/docs/disks#persistentdisks

0 packages can be updated.
0 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

jcuff@research:~$ uptime
 14:30:56 up 0 min,  1 user,  load average: 0.14, 0.04, 0.02

jcuff@research:~$ uname -a  
Linux research 2.6.39-gcg-201203291735 #1 SMP Thu Mar 29 17:37:55 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux

jcuff@research:~$ cat /proc/cpuinfo | grep "model name"
model name : Intel(R) Xeon(R) CPU @ 2.60GHz
model name : Intel(R) Xeon(R) CPU @ 2.60GHz
model name : Intel(R) Xeon(R) CPU @ 2.60GHz
model name : Intel(R) Xeon(R) CPU @ 2.60GHz
model name : Intel(R) Xeon(R) CPU @ 2.60GHz
model name : Intel(R) Xeon(R) CPU @ 2.60GHz
model name : Intel(R) Xeon(R) CPU @ 2.60GHz
model name : Intel(R) Xeon(R) CPU @ 2.60GHz

jcuff@research:~$ logout
Connection closed.
toofan:gcutil jcuff$ ./gcutil deleteinstance research
Delete instance research? [y/N]
>>> y


Stop the clock!

toofan:~ jcuff$ date
Wed Aug 1 10:32:06 EDT 2012

Oh my! That was EPIC! 11 mins, and I had to read some docs... sweet!

This thing is going to change the world yet again!!

UPDATE: once you know what you are doing, you can boot 8 nodes in 10 seconds!

http://blog.jcuff.net/2012/08/gce-part-ii-fun-with-api.html


[any opinions here are all mine, and have absolutely nothing to do with my employer]
(c) 2011 James Cuff