This document shows how to initialize new environment on SoftLayer.

Step 1: Create a Deployment Manifest

  1. Create a deployment directory.

    $ mkdir ~/my-bosh
    
  2. Create a deployment manifest file named bosh.yml in the deployment directory based on the template below.

    Note: The example below uses several predefined passwords. We recommend replacing them with passwords of your choice.

---
name: bosh

releases:
- name: bosh
  url: https://bosh.io/d/github.com/cloudfoundry/bosh?v=261.4
  sha1: 4da9cedbcc8fbf11378ef439fb89de08300ad091
- name: bosh-softlayer-cpi
  url: https://bosh.io/d/github.com/cloudfoundry-incubator/bosh-softlayer-cpi-release?v=3.0.5
  sha1: e7eac102bf24b5c80574ffd287dff429bc8f0cd9

resource_pools:
- name: vms
  network: default
  stemcell:
    url: https://bosh.io/d/stemcells/bosh-softlayer-xen-ubuntu-trusty-go_agent?v=3363.12.1
    sha1: c5350a9e0b03a4f9af2b89525be620cb77bc6a4f
  cloud_properties:
    Domain: softlayer.com
    VmNamePrefix: bosh-softlayer
    EphemeralDiskSize: 100
    StartCpus: 4
    MaxMemory: 8192
    Datacenter:
      Name: SOFTLAYER-DATACENTER-NAME # <--- Replace with the datacenter (eg lon02)
    HourlyBillingFlag: true
    PrimaryNetworkComponent:
      NetworkVlan:
        Id: SOFTLAYER-PUBLIC-VLAN # <--- Replace with the public VLAN ID
    PrimaryBackendNetworkComponent:
      NetworkVlan:
        Id: SOFTLAYER-PRIVATE-VLAN # <--- Replace with the private VLAN ID
    NetworkComponents:
    - MaxSpeed: 1000

disk_pools:
- name: disks
  disk_size: 40_000

networks:
- name: default
  type: dynamic
  dns: [8.8.8.8]

jobs:
- name: bosh
  instances: 1

  templates:
  - {name: nats, release: bosh}
  - {name: postgres, release: bosh}
  - {name: blobstore, release: bosh}
  - {name: director, release: bosh}
  - {name: health_monitor, release: bosh}
  - {name: powerdns, release: bosh}
  - {name: softlayer_cpi, release: bosh-softlayer-cpi}

  resource_pool: vms
  persistent_disk_pool: disks

  networks:
  - name: default

  properties:
    nats:
      address: 127.0.0.1
      user: nats
      # password: nats-password # <--- Uncomment & change

    postgres: &db
      listen_address: 127.0.0.1
      host: 127.0.0.1
      user: postgres
      # password: postgres-password # <--- Uncomment & change
      database: bosh
      adapter: postgres

    blobstore:
      address: 127.0.0.1
      port: 25250
      provider: dav
      director:
        user: director
        # password: director-password # <--- Uncomment & change
      agent:
        user: agent
        # password: agent-password # <--- Uncomment & change

    director:
      address: 127.0.0.1
      name: bosh
      cpi_job: softlayer_cpi
      db: *db
      user_management:
        provider: local
        local:
          users:
          # - {name: admin, password: admin} # <--- Uncomment & change
          # - {name: hm, password: hm-password} # <--- Uncomment & change

    hm:
      director_account:
        user: hm
        # password: hm-password # <--- Uncomment & change
      resurrector_enabled: true

    dns:
      address: 127.0.0.1
      domain_name: bosh
      db: *db
      webserver:
        port: 8081
        address: 0.0.0.0

    softlayer: &softlayer
      username: SOFTLAYER-USER-ID # <--- Replace with your softlayer user id
      apiKey: SOFTLAYER-API-KEY # <--- Replace with your softlayer api key

    # agent: {mbus: "nats://nats:nats-password@bosh-softlayer.softlayer.com:4222"} # <--- Uncomment & change

    ntp: &ntp [0.pool.ntp.org, 1.pool.ntp.org]

cloud_provider:
  template: {name: softlayer_cpi, release: bosh-softlayer-cpi}

  # mbus: https://admin:admin-password@bosh-softlayer.softlayer.com:6868 # <--- Uncomment & change

  properties:
    softlayer: *softlayer
    # agent: {mbus: "https://admin:admin-password@bosh-softlayer.softlayer.com:6868"} # <--- Uncomment & change
    blobstore: {provider: local, path: /var/vcap/micro_bosh/data/cache}
    ntp: *ntp

We need to specify the director hostname bosh-softlayer.softlayer.com in mbus: "nats://nats:nats-password@bosh-softlayer.softlayer.com:4222” or mbus: https://admin:admin-password@bosh-softlayer.softlayer.com:6868. This is Softlayer specific. Before the director is created, we don’t know its IP. Softlayer CPI will change the hostname to IP after the director is created.


Step 2: Prepare a SoftLayer Environment

To prepare your SoftLayer environment:


Create a Softlayer account

If you do not have an SoftLayer account, create one for one month free.

Use the login credentials received in your provided email to login to SoftLayer Customer Portal.


Generate an API Key

API keys are used to securely access the SoftLayer API. Follow Generate an API Key to generate your API key.


Access SoftLayer VPN

To access SoftLayer Private network, you need to access SoftLayer VPN. Follow VPN Access to access the VPN. You can get your VPN password from your user profile. Follow VPN Access to access the VPN.


Order VLANs

VLANs provide the ability to partition devices and subnets on the network. To order VLANs, login to SoftLayer Customer Portal and navigate to Network > IP Management > VLANs. Once on the page, click the “Order VLAN” link in the top-right corner. Fill in the pop-up window to order the VLANs as you need. The VLAN IDs are needed in the deployment manifest.


Step 3: Deploy

Note: See Migrating to bosh-init from the micro CLI plugin if you have an existing MicroBOSH.

  1. Install bosh-init.

  2. Establish VPN connection between your host and Softlayer. The machine where to run bosh-init needs to communicate with the target director VM over the SoftLayer private network.

  3. Run bosh-init deploy ./bosh.yml with sudo to start the deployment process. The reason why need to run bosh-init deploy with sudo is that it needs to update /etc/hosts file which needs suffient permission.

    $ sudo bosh-init deploy ./bosh.yml
    ...
    
  4. Install the BOSH Command Line Interface (CLI).

  5. Use bosh target DIRECTOR-IP to log into your new BOSH Director. You can get the DIRECTOR-IP from /etc/hosts on boshcli vm. The default username and password are admin and admin if no user is configured in manifest in advance when deploying director or created by bosh create user command.

    $ bosh target DIRECTOR-IP
    
    Target set to 'bosh'
    Your username: admin
    Enter password: *****
    Logged in as 'admin'
    
    $ bosh vms
    
    No deployments
    
  6. Save the deployment state file left in your deployment directory so you can later update/delete your Director. See Deployment state section of ‘Using bosh-init’ for more details.


Back to Table of Contents

Previous: Bootstrapping an environment


Contribute changes to this page