Skip to content
BroganD1993 edited this page Sep 9, 2014 · 1 revision

Installation

Users can grab the package from Pypi

$ pip install gstack

Configuration

Before running gstack you must configure it. To do so run

$ gstack-configure

You can configure a profile of your choice with the optional -p or --profile flag

$ gstack-configure -p exampleprofile

If you don't specify a profile, gstack-configure will default to a profile called initial

Enter your configuration information as prompted.

Install the latest gcloud

gstack comes with a self-signed certificate for the local endpoint gstack/data/server.crt, copy the certificate to the gcutil certificates file google-cloud-sdk/platform/gcutil/lib/httplib2/httplib2/cacerts.txt

Modify ~/.config/gcloud/properties and add in your credentials, example:

[auth]

disable_ssl_validation = True

client_id = your_cloudstack_id

client_secret = your_cloudstack_secret

auth_host = https://localhost:5000/oauth2/auth

token_host = https://localhost:5000/oauth2/token

At this stage your CloudStack apikey and secretkey need to be entered in the gcutil auth_helper.py file at google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/auth_helper.py

This is far from ideal and we opened a feature request with google to pass the client_id and client_secret as options to gcutil, hopefully future release of gcutil will allow us to do so.

gcutil will issue auth requests to the local Flask application, get an OAuth token and then issue requests to the CloudStack endpoint you specified when cofiguring gstack.

Usage

Start gstack:

$ gstack

You can launch gstack using a configuration profile created earlier using the optional -p or --profile flag

$ gstack -p exampleprofile

If you don't specify a profile, gstack will default to initial

You can start gstack in debug mode using the optional -d or --debug flag

$ gstack -d True

After gstack starts to run you can login to gcloud.

$ gcloud auth login

Once logged in to gcloud you can start issuing gcutil commands to gstack.

$ gcutil --api_host=https://localhost:5000/ [email protected] listzones
name status next-maintenance
Sandbox-simulator UP None scheduled

Trouble shooting

CertificateHostnameMismatch

  • Ensure that the addresses you entered for authorization_uri_base, api_host and auth_host_name are the exact same as the address you binded gstack to earlier when configuring with gstack-configure.

Authentication/authorization issues

  • Ensure that you set your cloudstack id as OAUTH2_CLIENT_ID and cloudstack secret as OAUTH2_CLIENT_SECRET in google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/auth_helper.py.