CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 10
Google Compute Engine
Create a Service Account
in the Google Cloud Console and download the key as JSON file. For a matter of clarity in the examples this file is referenced as examples/gce.json
.
Unlike the default support provided by LibCloud this module offers the possibility to create VMs and preemptible VMs with a Docker container declaration which is similar to Docker compose of which an example can be found in userdata/gce/fuzzos.yml
. Note that this concept is in some stage which can be considered as beta by Google and may still subject to change in the future.
Run N instances with a custom Docker container declaration.
laniakea gce -declaration fuzzos.yml \
-create \
-count 5
Run N preemptible instances with a custom Docker container declaration and add tags to each and list the instances after creation.
laniakea gce -declaration fuzzos.yml \
-create \
-count 5 \
-preemtible \
-tags foo bar baz
Keep in mind that preemptible instances are only valid for a max period of 24h and may terminate earlier.
Terminate all instances with a certain tag and are in the state running
.
laniakea gce -declaration fuzzos.yml \
-terminate \
-tags foo \
-state running
laniakea gce --help
usage: laniakea gce [-h] [-create | -start | -reboot | -stop | -terminate] [-conf path] [-declaration path]
[-tags seq [seq ...]] [-zone zone] [-size name] [-image name] [-count #] [-disk-size #]
[-disk-auto-delete] [-preemptible] [-list] [-states seq [seq ...]] [-names seq [seq ...]]
optional arguments:
-h, --help show this help message and exit
Mandatory Compute Engine Parameters:
-create Create Compute Engine VMs. (default: False)
-start Start stopped instances. (default: False)
-reboot Reboot running instances. (default: False)
-stop Stop running instances. (default: False)
-terminate Terminate instances. (default: False)
Optional Parameters:
-conf path Google Compute configuration (default: /Users/posidron/Library/Application
Support/laniakea/examples/gce.json)
-declaration path Google Compute configuration (default: /Users/posidron/Library/Application
Support/laniakea/userdata/gce/fuzzos.yml)
-tags seq [seq ...] Tags associated with an instance. (default: [])
-zone zone Where the instance is going to run. "all" for some operations. (default: us-east1-b)
-size name The instance size for the created VM. (default: n1-standard-8)
-image name The operating system for the created instance. (default: cos-stable-71-11151-71-0)
-count # The amount of nodes to be spawned. (default: 1)
-disk-size # Persistent boot disk size. (default: 10)
-disk-auto-delete Automatically delete the disk on VM termination. (default: True)
-preemptible Use preemptible instances (max 24h runtime). (default: False)
-list List instances. (default: False)
-states seq [seq ...] States used for filtering. (default: [])
-names seq [seq ...] Names used for filtering. (default: [])