Friday, November 30, 2012

Juju environment in the HPCloud

I've been an HPCloud user a long time. They rocked the cloud world as one of the first OpenStack deployments open to the public.

And I work at Canonical, so Juju is key to my cloud usage. There are some "howtos" for getting the hpcloud to work with Juju but I was just missing a few things... not sure if it was out of date or what, but the following worked fine.

Create an "environment" within your ~/.juju/environments.yaml that looks like this:
default: hpcloud
environments:
  hpcloud:
# Get api-keys here:  
#  https://console.hpcloud.com/account/api_keys 
# after you have a valid hpcloud account and login
    access-key: **************:****************
# from the api-key page use the access key 
#     with a central colon (:)
    secret-key: *************************************
# secret-key is just below the access-key you used above, 
# typically hidden/obscured by default
    juju-origin: ppa
# This was the most important line.
# juju-origin defaults to "distro" and the ubuntu in hp cloud
# currently is precise without an upgraded juju, so without
# setting this to ppa, you have a catch-22
    control-bucket: make-your-own-bucketname-cb
#make this up
    admin-secret: make-up-your-own-admin-secret
#make this up
    region: az-1.region-a.geo-1
    default-image-id: 8419
# use an appropriate image number from the selected region
#  you are using in the next line
#  8419 is valid for az-1
    project-name: hpcloud@medberry.net
# This is shown as the tenant name.
#  yours may look more like email@example.net-tenant-name
    default-instance-type: standard.medium
# This value while required, is ignored since Juju added constraints
# you can set it to any arbitrary string
# use "juju set-constraint instance-type=standard.medium" 
# to actually set a default instance type after you bootstrap
# and you can set the default at bootstrap time
# with "juju bootstrap --contraint "instance-type=standard.medium"
    auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
    auth-mode: keypair
    type: openstack
    default-series: precise

By default, your ~/.ssh/id_rsa.pub will be injected into the instances. You can pass an alternative in by adding an:


 authorized-keys: ssh-rsa AAAAPUBLIC_KEY_TEXT_HERE


in the hpcloud environment stanza.

No comments: