Because BOSH documentation is sparse and out of date, I've compiled these notes to help with future work.
- ubuntu with ruby installed
- install keypair for use with github
gem install fog
- create key pair specifically for fog
- create a fog config:
:default:
:aws_access_key_id: YOUR_ACCESS_KEY
:aws_secret_access_key: YOUR_SECRET_KEY
:private_key_path: '/Users/shane/.ssh/fog_rsa'
:public_key_path: '/Users/shane/.ssh/fog_rsa.pub'
- type
fog
, then follow steps below:
connection = Fog::Compute.new({ :provider => 'AWS', :region => 'us-east-1' })
Fog.credentials = Fog.credentials.merge({ :private_key_path => "/Users/shane/.ssh/fog_rsa", :public_key_path => "/Users/shane/.ssh/fog_rsa.pub" })
connection.import_key_pair('shane-fog', IO.read('/Users/shane/.ssh/fog_rsa.pub')) if connection.key_pairs.get('shane-fog').nil?
server = connection.servers.bootstrap({:key_name => 'shane-fog', :flavor_id => 'm1.small', :bits => 64, :username => 'ubuntu'})
address = connection.addresses.create
address.server = server
server.reload
server.dns_name
volume = connection.volumes.create(:size => 16, :device => "/dev/sdi", :availability_zone => server.availability_zone)
volume.server = server
server.ssh(['sudo mkfs.ext4 /dev/sdi -F'])
server.ssh(['sudo mkdir -p /var/vcap/store'])
server.ssh(['sudo mount /dev/sdi /var/vcap/store'])
puts server.ssh(['df']).first.stdout
connection = Fog::Compute.new({ :provider => 'AWS', :region => 'us-east-1' })
connection.security_groups.create name: "microbosh", description: "microboshes"
group = connection.security_groups.get("microbosh")
group.authorize_port_range(25555..25555) # BOSH Director API
group.authorize_port_range(6868..6868) # Message Bus
group.authorize_port_range(25888..25888) # AWS Registry API
group.authorize_port_range(22..22) # SSH access
quit fog
ssh -i /Users/shane/.ssh/fog_rsa [email protected]
sudo su -
export ORIGUSER=ubuntu
curl -s https://raw.github.com/drnic/bosh-getting-started/master/scripts/prepare_inception.sh | bash
source /etc/profile
Now that the inception vm is created, start the edit/build/deploy cycle.
In an effort to save time with downloading and uploading artifacts, the following steps were all done on an EC2 instance (the inception vm created above).
- forked
cloudfoundry/bosh
tocinderella/bosh
in order to make changes necessary for Cinderella. - make changes and commit to
cinderella/bosh
- cd ..
- Check out bosh-release:
git clone https://github.com/cloudfoundry/bosh-release.git
- cd bosh-release
git submodule update --init
bosh create release --with-tarball
(will create manifest and tarball in bosh-release/dev_releases needed in step 10)- cd ../bosh/agent
- bundle install
- extra packages needed:
sudo apt-get install debootstrap kpartx
- create stemcell from manifest and tarball created in step 6 (from bosh/agent):
rake stemcell2:micro[aws,/root/projects/bosh-release/dev_releases/cinders-10.1-dev.yml,/root/projects/bosh-release/dev_releases/cinders-10.1-dev.tgz]
...
Generated stemcell: /var/tmp/bosh/agent-0.6.7-18060/work/work/micro-bosh-stemcell-aws-0.7.0.tgz - cd /var/vcap/deployments
gem install bosh_deployer
- select cinders deployment:
bosh deployment cinders
WARNING! Your target has been changed to `http://cinders:25555'! Deployment set to '/var/vcap/deployments/cinders/micro_bosh.yml' - do actual deploy of micro bosh stemcell:
bosh deploy /var/tmp/bosh/agent-0.6.7-18060/work/work/micro-bosh-stemcell-aws-0.7.0.tgz
- Create inception vm
- Create micro bosh from new stemcell (these notes heavily influenced from)
- Prepare inception script
- Hints on how to create a cpi