Show me the code! – By Davanum Srinivas

June 24, 2014

Running Cloud Foundry’s Micro BOSH on latest DevStack

Filed under: cloud foundry, openstack — Tags: , , , — Davanum Srinivas @ 7:45 am

The Cloud Foundry docs are excellent. Here’s where i started from:
http://docs.cloudfoundry.org/deploying/openstack/

I provisioned a big beefy bare metal box with Ubuntu 14.04 LTS on SoftLayer and installed DevStack on it as usual. Here’s the super simple local.conf that i used. Note the 100GB volume needed later for Micro BOSH deployment.

[[local|localrc]]
FLAT_INTERFACE=eth0
PUBLIC_INTERFACE=eth1
ADMIN_PASSWORD=passw0rd
MYSQL_PASSWORD=passw0rd
RABBIT_PASSWORD=passw0rd
SERVICE_PASSWORD=passw0rd
VOLUME_BACKING_FILE_SIZE=100GB

Once you deploy DevStack, follow the steps in the CF docs url above, Here’s the ~/.fog file that i used in step #2. Note that i am just using the “admin” credentials and the “admin” tenant for all openstack operations

:openstack:
  :openstack_auth_url:  http://9.193.231.50:5000/v2.0/tokens
  :openstack_api_key:   passw0rd
  :openstack_username:  admin
  :openstack_tenant: admin
  :openstack_region:

Here’s a script to create all the security groups and floating ips needed in step #3.

nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 
nova secgroup-add-rule default tcp 22 22 0.0.0.0/0

nova secgroup-create ssh ssh
nova secgroup-add-rule ssh udp 68 68 0.0.0.0/0
nova secgroup-add-rule ssh tcp 22 22 0.0.0.0/0
nova secgroup-add-rule ssh icmp -1 -1 0.0.0.0/0

nova secgroup-create bosh bosh
nova secgroup-add-group-rule bosh bosh tcp 1 65535
nova secgroup-add-rule bosh tcp 4222 4222 0.0.0.0/0
nova secgroup-add-rule bosh tcp 6868 6868 0.0.0.0/0
nova secgroup-add-rule bosh tcp 25250 25250 0.0.0.0/0
nova secgroup-add-rule bosh tcp 25555 25555 0.0.0.0/0
nova secgroup-add-rule bosh tcp 25777 25777 0.0.0.0/0
nova secgroup-add-rule bosh tcp 53 53 0.0.0.0/0
nova secgroup-add-rule bosh udp 68 68 0.0.0.0/0
nova secgroup-add-rule bosh udp 53 53 0.0.0.0/0

nova secgroup-create cf-public cf-public
nova secgroup-add-rule cf-public udp 68 68 0.0.0.0/0
nova secgroup-add-rule cf-public tcp 80 80 0.0.0.0/0
nova secgroup-add-rule cf-public tcp 443 443 0.0.0.0/0

nova secgroup-create cf-private cf-private
nova secgroup-add-rule cf-private udp 68 68 0.0.0.0/0
nova secgroup-add-group-rule cf-private cf-private tcp 1 65535

nova floating-ip-create

For Step #4, i used this stem cell – bosh-stemcell-2611-openstack-kvm-ubuntu-lucid.tgz and the following microbosh.yml

---
name: microbosh-openstack

logging:
  level: DEBUG

network:
  type: dynamic
  vip: 172.24.4.1

resources:
  persistent_disk: 16384
  cloud_properties:
    instance_type: m1.small

cloud:
  plugin: openstack
  properties:
    openstack:
      auth_url: http://9.193.231.50:5000/v2.0
      username: admin
      api_key: passw0rd
      tenant: admin
      default_security_groups: ["ssh", "bosh"]
      default_key_name: microbosh
      private_key: /opt/stack/bosh-workspace/microbosh.pem

apply_spec:
  properties:
    director:
      max_threads: 3
    hm:
      resurrector_enabled: true
    ntp:
      - 0.north-america.pool.ntp.org
      - 1.north-america.pool.ntp.org

That was it! Final check on status.

stack@bigblue:~/bosh-workspace/deployments$ bosh micro status
Stemcell CID   6203baa8-d64f-4701-952e-a33ea0aabdb0
Stemcell name  bosh-stemcell-2611-openstack-kvm-ubuntu-lucid
VM CID         55fc5d01-e56a-4120-bd8c-6ec1c7d295ea
Disk CID       a9eb53a9-74a1-4210-8afe-d04ba68536ac
Micro BOSH CID bm-c84e8442-016a-499f-aa31-19a8a9c58a9e
Deployment     /opt/stack/bosh-workspace/deployments/microbosh-openstack/micro_bosh.yml
Target         https://172.24.4.1:25555

stack@bigblue:~/bosh-workspace/deployments$ bosh status
Config
             /opt/stack/.bosh_config

Director
  Name       microbosh-openstack
  URL        https://172.24.4.1:25555
  Version    1.2611.0 (00000000)
  User       admin
  UUID       46aa8b77-3f41-4268-952e-37c07f938b86
  CPI        openstack
  dns        enabled (domain_name: microbosh)
  compiled_package_cache disabled
  snapshots  disabled

Deployment
  not set

Next up, Will try steps #5, #6, #7 and report back here.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: