Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Deploy a BOSH Director with the RackHD CPI

Xuebin He edited this page Jul 5, 2017 · 12 revisions

Prerequisites

First, follow the instructions for making a RackHD CPI release.

To complete deployment, your workstation (the computer that you created the RackHD release on) needs network access to two machines: an available RackHD node, onto which the BOSH director will be deployed, and the RackHD server.

To configure your network, follow the instructions in the RackHD documentation.

If you have configured a physical network for deployment, follow the steps in the Deploy to a physical environment section. If you want to deploy to a virtual network, follow the steps in the Deploy to a virtual environment section.

Deploy to a physical environment

Download BOSH release tarball

From the BOSH website, download a BOSH release tarball and a stemcell tarball that are compatible with your environment. (We've been testing against BOSH 219 and the OpenStack KVM stemcell.)

Generate a public/private key pair

To access the machines that BOSH provisions for you via ssh, you will need to generate a valid public/private key pair.

Generate a key pair using ssh-keygen.

$ ssh-keygen -f director-ssh-key

After prompting you for a passphrase, the command creates a public key, director-ssh-key.pub, and a matching private key, director-ssh-key, in your current directory. Later, if you want to log into provisioned machines on your network, you can specify the key explicitly with ssh -i /path/to/director-ssh-key ..., or you can configure a tool like ssh-agent to manage your keys for you.

Create manifest

In your project's root directory, copy the file director.yml.template to a new file called director.yml.

$ cd /path/to/bosh-rackhd-cpi-release/manifests
$ cp director.yml.template director.yml

Open the file in a text editor, and add information about your system to the incomplete lines in the file:

  • On line 1, specify something else
  • On line 3, specify something else
  • On line 6, specify your RackHD CPI release name, e.g. rackhd-cpi
  • On line 7, specify the path to your RackHD CPI release tarball.
  • On line 8, specify the path of your BOSH release tarball.
  • On line 16, specify the range of IPs on your network, e.g. xxx.xxx.xxx.xxx/xx
  • On line 17, specify the gateway IP of your network
  • On line 18, specify the director IP.
  • On line 24, specify your base64-encoded public key, i.e., the output of the command base64 director-ssh-key.pub.
  • On line 26, specify the path to your stemcell tarball.
  • On line 84, specify the IP address of your RackHD server.
  • On line 86, specify a URL of the form: nats://nats:${NATS_PASSWORD}@${RACKHD_SERVER_IP}:4222, where ${RACKHD_SERVER_IP} is the IP address of your RackHD server.
  • On line 90, specify a URL of the form: http://${DIRECTOR_IP}:25250, where ${DIRECTOR_IP} is the IP address of your director.
  • On line 96, specify a URL of the form: https://mbus:Pbc7ssdfh8w2@${DIRECTOR_IP}:6868, where ${DIRECTOR_IP} is the IP address of your director.
  • On line 100, specify the IP address of your RackHD server.

Deploy from manifest

Use bosh-init to deploy the director to a physical environment.

$ bosh-init deploy manifests/director.yml

Deploy to a virtual environment

  1. vSphere and vCenter installed.
  2. BOSH Director with vSphere CPI deployed. (Use bosh-init to deploy vSphere BOSH Director)
  3. RackHD Virtual Environment is setup. (see [here](Set up a RackHD server and RackHD nodes on a virtual environment).)

Generate a public/private key pair

To access the machines that BOSH provisions for you via ssh, you will need to generate a valid public/private key pair.

Generate a key pair using ssh-keygen.

$ ssh-keygen -f director-ssh-key

After prompting you for a passphrase, the command creates a public key, director-ssh-key.pub, and a matching private key, director-ssh-key, in your current directory. Later, if you want to log into provisioned machines on your network, you can specify the key explicitly with ssh -i /path/to/director-ssh-key ..., or you can configure a tool like ssh-agent to manage your keys for you.

Run script to set up director

Set up these environment variables:

  • BOSH_VSPHERE_DIRECTOR - IP Address of BOSH vSphere Director
  • BOSH_DIRECTOR_PUBLIC_IP - Public IP Address of the Director that will be set up (ie. 10.10.10.215)
  • BOSH_DIRECTOR_PRIVATE_IP - Private IP Address of the Director that will be set up (ie. 12.12.12.215)
  • BOSH_DIRECTOR_PUBLIC_KEY - cat of the Public key file
  • RACKHD_API_URL - URL of the RackHD Server (including port, default 80)
  • RACKHD_NETWORK - Name of Private Network that the RackHD server and nodes are on.
  • CPI_RELEASE_NAME - Name of RackHD CPI Release (Empty to default)

Once everything's ready to go, run the setup-director.sh script:

ci/tasks/setup-director.sh