bosh-bootstrap 0.10.2 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/.rspec +1 -0
  2. data/.travis.yml +0 -1
  3. data/ChangeLog.md +23 -4
  4. data/Gemfile +5 -2
  5. data/Guardfile +2 -0
  6. data/README.md +209 -197
  7. data/TODO.md +55 -0
  8. data/bosh-bootstrap.gemspec +5 -12
  9. data/lib/bosh/cli/commands/bootstrap.rb +42 -0
  10. data/lib/bosh-bootstrap/cli/commands/delete.rb +26 -0
  11. data/lib/bosh-bootstrap/cli/commands/deploy.rb +89 -0
  12. data/lib/bosh-bootstrap/cli/commands/ssh.rb +32 -0
  13. data/lib/bosh-bootstrap/cli/helpers/bundle.rb +12 -0
  14. data/lib/bosh-bootstrap/cli/helpers/interactions.rb +15 -0
  15. data/lib/bosh-bootstrap/cli/helpers/settings.rb +61 -0
  16. data/lib/bosh-bootstrap/cli/helpers.rb +11 -0
  17. data/lib/bosh-bootstrap/key_pair.rb +21 -0
  18. data/lib/bosh-bootstrap/microbosh.rb +74 -0
  19. data/lib/bosh-bootstrap/microbosh_providers/aws.rb +104 -0
  20. data/lib/bosh-bootstrap/microbosh_providers/base.rb +50 -0
  21. data/lib/bosh-bootstrap/microbosh_providers/openstack.rb +61 -0
  22. data/lib/bosh-bootstrap/microbosh_providers/vsphere.rb +78 -0
  23. data/lib/bosh-bootstrap/microbosh_providers.rb +11 -0
  24. data/lib/bosh-bootstrap/network.rb +33 -0
  25. data/lib/bosh-bootstrap/network_providers/aws.rb +28 -0
  26. data/lib/bosh-bootstrap/network_providers/dummy.rb +10 -0
  27. data/lib/bosh-bootstrap/network_providers/openstack.rb +28 -0
  28. data/lib/bosh-bootstrap/network_providers.rb +11 -0
  29. data/lib/bosh-bootstrap/version.rb +1 -1
  30. data/lib/bosh-bootstrap.rb +3 -4
  31. data/spec/assets/microbosh_yml/micro_bosh.aws_ec2.yml +37 -0
  32. data/spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml +39 -0
  33. data/spec/assets/microbosh_yml/micro_bosh.openstack.yml +30 -0
  34. data/spec/assets/microbosh_yml/micro_bosh.vsphere.yml +34 -0
  35. data/spec/integration/aws/aws_ec2_basic_spec.rb +39 -0
  36. data/spec/integration/aws/aws_helpers.rb +8 -61
  37. data/spec/spec_helper.rb +8 -3
  38. data/spec/support/capture_stdout.rb +18 -0
  39. data/spec/unit/cli/bootstrap_spec.rb +41 -0
  40. data/spec/unit/commands/delete_spec.rb +20 -0
  41. data/spec/unit/commands/deploy_spec.rb +64 -0
  42. data/spec/unit/commands/ssh_spec.rb +19 -0
  43. data/spec/unit/key_pair_spec.rb +13 -0
  44. data/spec/unit/microbosh_providers/aws_spec.rb +68 -0
  45. data/spec/unit/microbosh_providers/openstack_spec.rb +27 -0
  46. data/spec/unit/microbosh_providers/vsphere_spec.rb +42 -0
  47. data/spec/unit/microbosh_spec.rb +27 -0
  48. data/spec/unit/network_providers/aws_spec.rb +29 -0
  49. data/spec/unit/network_providers/openstack_spec.rb +29 -0
  50. data/spec/unit/network_spec.rb +17 -0
  51. metadata +71 -235
  52. data/CleanupCi.md +0 -8
  53. data/bin/bosh-bootstrap +0 -8
  54. data/docs/README.md +0 -3
  55. data/docs/devstack-openstack-tutorial.md +0 -215
  56. data/lib/bosh/providers/README.md +0 -5
  57. data/lib/bosh/providers/aws.rb +0 -258
  58. data/lib/bosh/providers/base_provider.rb +0 -48
  59. data/lib/bosh/providers/openstack.rb +0 -79
  60. data/lib/bosh/providers.rb +0 -21
  61. data/lib/bosh-bootstrap/cli.rb +0 -1347
  62. data/lib/bosh-bootstrap/commander/README.md +0 -47
  63. data/lib/bosh-bootstrap/commander/command.rb +0 -25
  64. data/lib/bosh-bootstrap/commander/commands.rb +0 -80
  65. data/lib/bosh-bootstrap/commander/local_server.rb +0 -68
  66. data/lib/bosh-bootstrap/commander/remote_script_command.rb +0 -51
  67. data/lib/bosh-bootstrap/commander/remote_server.rb +0 -137
  68. data/lib/bosh-bootstrap/commander/upload_command.rb +0 -17
  69. data/lib/bosh-bootstrap/commander.rb +0 -9
  70. data/lib/bosh-bootstrap/helpers/fog_setup.rb +0 -50
  71. data/lib/bosh-bootstrap/helpers/settings.rb +0 -99
  72. data/lib/bosh-bootstrap/helpers/settings_setter.rb +0 -41
  73. data/lib/bosh-bootstrap/helpers.rb +0 -3
  74. data/lib/bosh-bootstrap/stages/stage_micro_bosh_delete/bosh_micro_delete +0 -19
  75. data/lib/bosh-bootstrap/stages/stage_micro_bosh_delete.rb +0 -90
  76. data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy/bosh_micro_deploy +0 -79
  77. data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy/install_key_pair_for_user +0 -23
  78. data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy.rb +0 -146
  79. data/lib/bosh-bootstrap/stages/stage_micro_bosh_download/download_micro_bosh_stemcell +0 -93
  80. data/lib/bosh-bootstrap/stages/stage_micro_bosh_download.rb +0 -139
  81. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/configure_git +0 -25
  82. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/create_vcap_user +0 -79
  83. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_base_packages +0 -30
  84. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_bosh +0 -11
  85. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_bosh_plugins +0 -25
  86. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_hub +0 -26
  87. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_ruby +0 -30
  88. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_useful_gems +0 -29
  89. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/validate_bosh_deployer +0 -18
  90. data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm.rb +0 -69
  91. data/lib/bosh-bootstrap/stages/stage_salted_password/convert_salted_password +0 -11
  92. data/lib/bosh-bootstrap/stages/stage_salted_password.rb +0 -51
  93. data/lib/bosh-bootstrap/stages/stage_setup_new_bosh/setup_bosh_user +0 -29
  94. data/lib/bosh-bootstrap/stages/stage_setup_new_bosh.rb +0 -51
  95. data/lib/bosh-bootstrap/stages/stage_validate_inception_vm/validate_ubuntu +0 -6
  96. data/lib/bosh-bootstrap/stages/stage_validate_inception_vm.rb +0 -39
  97. data/lib/bosh-bootstrap/stages.rb +0 -10
  98. data/spec/assets/bosh/public_stemcells/aws_micro.out +0 -7
  99. data/spec/assets/micro_bosh_yml/micro_bosh.aws_ec2.yml +0 -35
  100. data/spec/assets/micro_bosh_yml/micro_bosh.aws_vpc.yml +0 -37
  101. data/spec/integration/aws/aws_basic_spec.rb +0 -39
  102. data/spec/integration/aws/aws_edge_prebuilt_ami_spec.rb +0 -46
  103. data/spec/integration/aws/aws_edge_prebuilt_spec.rb +0 -46
  104. data/spec/integration/aws/aws_edge_spec.rb +0 -45
  105. data/spec/unit/aws_spec.rb +0 -177
  106. data/spec/unit/bosh/providers/aws_spec.rb +0 -174
  107. data/spec/unit/cli_spec.rb +0 -134
  108. data/spec/unit/cli_ssh_spec.rb +0 -95
  109. data/spec/unit/cli_upgrade_inception_spec.rb +0 -29
  110. data/spec/unit/settings_setter_spec.rb +0 -29
  111. data/vendor/cache/POpen4-0.1.4.gem +0 -0
  112. data/vendor/cache/Platform-0.4.0.gem +0 -0
  113. data/vendor/cache/activesupport-3.2.8.gem +0 -0
  114. data/vendor/cache/awesome_print-1.1.0.gem +0 -0
  115. data/vendor/cache/aws-s3-0.6.3.gem +0 -0
  116. data/vendor/cache/blobstore_client-0.4.0.gem +0 -0
  117. data/vendor/cache/bosh_cli-1.0.3.gem +0 -0
  118. data/vendor/cache/bosh_common-0.5.4.gem +0 -0
  119. data/vendor/cache/builder-3.2.0.gem +0 -0
  120. data/vendor/cache/coderay-1.0.8.gem +0 -0
  121. data/vendor/cache/diff-lcs-1.1.3.gem +0 -0
  122. data/vendor/cache/escape-0.0.4.gem +0 -0
  123. data/vendor/cache/excon-0.20.1.gem +0 -0
  124. data/vendor/cache/fog-1.8.0.gem +0 -0
  125. data/vendor/cache/formatador-0.2.4.gem +0 -0
  126. data/vendor/cache/guard-1.6.2.gem +0 -0
  127. data/vendor/cache/guard-rspec-2.4.0.gem +0 -0
  128. data/vendor/cache/highline-1.6.18.gem +0 -0
  129. data/vendor/cache/httpclient-2.2.4.gem +0 -0
  130. data/vendor/cache/i18n-0.6.1.gem +0 -0
  131. data/vendor/cache/json_pure-1.6.8.gem +0 -0
  132. data/vendor/cache/listen-0.7.2.gem +0 -0
  133. data/vendor/cache/log4r-1.1.10.gem +0 -0
  134. data/vendor/cache/lumberjack-1.0.2.gem +0 -0
  135. data/vendor/cache/method_source-0.8.1.gem +0 -0
  136. data/vendor/cache/mime-types-1.22.gem +0 -0
  137. data/vendor/cache/multi_json-1.1.0.gem +0 -0
  138. data/vendor/cache/net-scp-1.0.4.gem +0 -0
  139. data/vendor/cache/net-ssh-2.2.2.gem +0 -0
  140. data/vendor/cache/net-ssh-gateway-1.1.0.gem +0 -0
  141. data/vendor/cache/netaddr-1.5.0.gem +0 -0
  142. data/vendor/cache/nokogiri-1.5.9.gem +0 -0
  143. data/vendor/cache/open4-1.3.0.gem +0 -0
  144. data/vendor/cache/progressbar-0.9.2.gem +0 -0
  145. data/vendor/cache/pry-0.9.11.4-java.gem +0 -0
  146. data/vendor/cache/pry-0.9.11.4.gem +0 -0
  147. data/vendor/cache/rake-10.0.3.gem +0 -0
  148. data/vendor/cache/rb-fsevent-0.9.3.gem +0 -0
  149. data/vendor/cache/redcard-1.0.0.gem +0 -0
  150. data/vendor/cache/rspec-2.12.0.gem +0 -0
  151. data/vendor/cache/rspec-core-2.12.2.gem +0 -0
  152. data/vendor/cache/rspec-expectations-2.12.1.gem +0 -0
  153. data/vendor/cache/rspec-mocks-2.12.2.gem +0 -0
  154. data/vendor/cache/ruby-atmos-pure-1.0.5.gem +0 -0
  155. data/vendor/cache/ruby-hmac-0.4.0.gem +0 -0
  156. data/vendor/cache/settingslogic-2.0.9.gem +0 -0
  157. data/vendor/cache/slop-3.4.3.gem +0 -0
  158. data/vendor/cache/spoon-0.0.1.gem +0 -0
  159. data/vendor/cache/terminal-table-1.4.5.gem +0 -0
  160. data/vendor/cache/thor-0.17.0.gem +0 -0
  161. data/vendor/cache/uuidtools-2.1.3.gem +0 -0
  162. data/vendor/cache/xml-simple-1.1.2.gem +0 -0
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format progress
2
2
  --color
3
+ --require spec_helper
data/.travis.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  script: bundle exec rake spec:$SUITE
3
- bundler_args: "--local"
4
3
  rvm:
5
4
  - ruby-1.9.3
6
5
  # - rbx-19mode
data/ChangeLog.md CHANGED
@@ -1,12 +1,31 @@
1
1
  # Change Log
2
2
 
3
- `bosh-bootstrap` is a command line tool that you can run on your laptop and automatically get a microbosh (and an inception VM) deployed on either AWS or OpenStack.
3
+ `bosh-bootstrap` is a command line tool that you can run on your laptop and automatically get a microbosh (and an inception VM) deployed on AWS (with OpenStack & vSphere coming soon).
4
4
 
5
5
  gem install bosh-bootstrap
6
- bosh-bootstrap deploy
6
+ bosh bootstrap deploy
7
+
8
+ ## v0.11
9
+
10
+ * Complete rewrite of bosh-bootstrap in orphan branch
11
+ * CodeClimate score changed from 0.82 to 3.85
12
+ * Initial support for AWS EC2; WIP for OpenStack; initial unit tests for vSphere
13
+ * Interactive Q&A is extracted into [cyoi](https://github.com/drnic/cyoi) (choose-your-own-infrastructure) library
14
+ * Accessing settings is much cleaner; functionality moved into fork of settingslogic called [readwritesettings](https://github.com/drnic/readwritesettings)
15
+ * Inception VM/server is now provisioned via separate CLI project [inception-server](https://github.com/drnic/inception-server)
16
+ * AWS/us-east-1 uses public AMIs; other regions & other CPIs use stemcells
17
+ * CLI via bosh plugin (`bosh bootstrap`) rather than a stand alone CLI (`bosh-bootstrap`)
18
+ * Added `ssh` action to ssh into the microbosh
19
+ * Added `delete` actions to delete the microbosh (but not the IP address and security groups)
7
20
 
8
21
  ## v0.10
9
22
 
23
+ Available on branch [v0.10](https://github.com/StarkAndWayne/bosh-bootstrap/tree/v0.10).
24
+
25
+ Install using:
26
+
27
+ gem install bosh-bootstrap -v "~> 0.10.0"
28
+
10
29
  * Only using latest pre-release bosh gems & stemcells/amis - do not upgrade if you want the old 2012 gems
11
30
  * AWS us-east-1 uses a pre-built AMI for extra speed
12
31
  * AWS all regions are working (using pre-created stemcell)
@@ -54,7 +73,7 @@ Changes:
54
73
 
55
74
  Work in progress:
56
75
 
57
- * AWS VPC support was begin by the core BOSH team; though work has stopped sadly.
76
+ * AWS VPC support was begin by the core bosh team; though work has stopped sadly.
58
77
  * Growing number of specs mostly using Fog.mock! mode; tests being run on travis
59
78
 
60
79
  ### v0.7.1
@@ -70,7 +89,7 @@ Work in progress:
70
89
  Highlights:
71
90
 
72
91
  * Defaults to downloading latest stemcell (rather than stable, which are getting old now).
73
- * Installs the Cloud Foundry plugin for BOSH https://github.com/StarkAndWayne/bosh-cloudfoundry
92
+ * Installs the Cloud Foundry plugin for bosh https://github.com/StarkAndWayne/bosh-cloudfoundry
74
93
 
75
94
  Additions:
76
95
 
data/Gemfile CHANGED
@@ -1,10 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in bosh-bootstrap.gemspec
4
3
  gemspec
5
4
 
5
+ if File.directory?("../cyoi")
6
+ gem "cyoi", path: "../cyoi"
7
+ end
8
+
6
9
  group :development do
7
10
  gem "awesome_print"
8
11
  gem "rb-fsevent", "~> 0.9.1"
9
12
  gem "guard-rspec"
10
- end
13
+ end
data/Guardfile CHANGED
@@ -1,5 +1,7 @@
1
1
  guard 'rspec', spec_paths: ["spec/unit"] do
2
2
  watch(%r{^spec/unit/(.+_spec)\.rb$})
3
+ watch(%r{^lib/bosh/cli/commands/(.+)\.rb$}) { |m| "spec/unit/cli" }
4
+ watch(%r{^lib/bosh-bootstrap/cli/commands/(.+)\.rb$}) { |m| "spec/unit/commands/#{m[1]}_spec.rb" }
3
5
  watch(%r{^lib/bosh-bootstrap/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
4
6
  watch('spec/spec_helper.rb') { "spec/unit" }
5
7
  end
data/README.md CHANGED
@@ -1,32 +1,67 @@
1
- # Stark & Wayne's Bosh Bootstrapper
1
+ # Bosh Bootstrap
2
2
 
3
- In order to deploy CloudFoundry, and a growing number of other complex systems, you will need a BOSH. BOSH provides a complete lifecycle manager/deployer for complex systems. CloudFoundry is a very complex system when it comes to deployment/upgrades.
3
+ In order to deploy Cloud Foundry, and a growing number of other complex systems, you will need a bosh. bosh provides a complete lifecycle manager/deployer for complex systems. Cloud Foundry is a very complex system when it comes to deployment/upgrades.
4
4
 
5
- The Stark & Wayne Bosh Bootstrapper is the simplest way to get a Micro BOSH running, to upgrade an existing Micro BOSH, and to delete it if you change your mind.
5
+ Bosh's primary role is orchestration of servers, their persistent storage and networking. It also includes its own packaging and configuration management systems.
6
6
 
7
- Bootstrap a Micro BOSH universe from one CLI command. Also allows SSH access and the ability to delete created Micro BOSHes.
7
+ Bosh can run on AWS, modern OpenStack, vSphere 5+ and latest vCloud. New infrastructures are being added regularly.
8
+
9
+ Bosh Bootstrap is the simplest way to get a micro bosh running and upgrade/destroy it over time. It attempts to auto-detect your infrastructure preferences and asks questions for any information it cannot determine.
10
+
11
+ Bosh Bootstrap currently supports AWS, with OpenStack and vSphere coming soon. To "support" one of Bosh's cloud providers is merely to know how to generate a `micro_bosh.yml` file for that Bosh CPI; and add the interactive Q & A to the [cyoi](https://github.com/drnic/cyoi) library.
12
+
13
+ It also performs the task as fast as it is possible. On AWS, if a public AMI has been published for your requested region then it will use that (currently: us-east-1/Virginia).
8
14
 
9
15
  ```
10
- $ bosh-bootstrap deploy
11
- Creating inception VM...
12
- Creating micro BOSH VM...
16
+ $ bosh bootstrap deploy
17
+ Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
18
+ 1. AWS (default)
19
+ 2. AWS (bosh)
20
+ 3. AWS (starkandwayne)
21
+ 4. AWS (pivotaltravis)
22
+ 5. AWS (swblobstore)
23
+ 6. Alternate credentials
24
+ Choose an auto-detected infrastructure: 3
25
+
26
+ Using provider AWS
27
+
13
28
 
14
- $ bosh-bootstrap ssh
15
- Open SSH tunnel to inception VM...
29
+ 1. *US East (Northern Virginia) Region (us-east-1)
30
+ 2. US West (Oregon) Region (us-west-2)
31
+ 3. US West (Northern California) Region (us-west-1)
32
+ 4. EU (Ireland) Region (eu-west-1)
33
+ 5. Asia Pacific (Singapore) Region (ap-southeast-1)
34
+ 6. Asia Pacific (Sydney) Region (ap-southeast-2)
35
+ 7. Asia Pacific (Tokyo) Region (ap-northeast-1)
36
+ 8. South America (Sao Paulo) Region (sa-east-1)
37
+ Choose AWS region: 1
38
+
39
+ Confirming: Using AWS/us-east-1
40
+ Acquiring a public IP address... 107.21.194.123
41
+
42
+ Confirming: Using address 107.21.194.123
43
+
44
+ ...
45
+
46
+ Generating ~/.bosh-bootstrap/universes/aws-us-east-1/micro_bosh.yml...
47
+ Deploying micro bosh server...
48
+
49
+ $ bosh bootstrap ssh
50
+ SSH to micro bosh server...
16
51
 
17
52
  $ bosh-bootstrap delete
18
- Deleting micro BOSH VM...
53
+ Deleting micro bosh VM...
19
54
  ```
20
55
 
21
- It is now very simple to bootstrap a micro BOSH from a single, local CLI. The bootstrapper first creates an inception VM and then uses the `bosh_deployer` (`bosh micro deploy`) to deploy micro BOSH.
56
+ It is now very simple to bootstrap a micro bosh from a single, local CLI.
22
57
 
23
- To be cute about it, the Stark & Wayne Bosh Bootstrapper aims to provide lifecycle management for the BOSH lifecycle manager. Zing! See the "Deep dive into deploy command" section below for greater understanding why the Stark & Wayne Bosh Bootstrapper is very useful.
58
+ To be cute about it, the Bosh Bootstrap aims to provide lifecycle management for the bosh lifecycle manager. Zing! See the "Deep dive into deploy command" section below for greater understanding why the Bosh Bootstrap is very useful.
24
59
 
25
60
  [![Gem Version](https://badge.fury.io/rb/bosh-bootstrap.png)](http://badge.fury.io/rb/bosh-bootstrap) [![Build Status](https://travis-ci.org/StarkAndWayne/bosh-bootstrap.png?branch=master)](https://travis-ci.org/StarkAndWayne/bosh-bootstrap) [![Code Climate](https://codeclimate.com/github/StarkAndWayne/bosh-bootstrap.png)](https://codeclimate.com/github/StarkAndWayne/bosh-bootstrap)
26
61
 
27
62
  ## Installation
28
63
 
29
- This bootstrapper tool is distributed as a RubyGem for Ruby 1.9+.
64
+ This bootstrap tool is distributed as a RubyGem for Ruby 1.9+.
30
65
 
31
66
  ```
32
67
  $ ruby -v
@@ -38,82 +73,84 @@ $ gem install bosh-bootstrap
38
73
 
39
74
  ### First time usage
40
75
 
41
- The first time you use `bosh-bootstrap` it will create everything necessary. The example output below includes user prompts.
76
+ The first time you use `bosh bootstrap` it will create everything necessary, including a public IP address, security groups, a private key, and the all-important micro bosh that you want. The example output below includes user prompts.
42
77
 
43
78
  ```
44
- $ bosh-bootstrap deploy
45
-
46
- Stage 1: Choose infrastructure
47
-
48
- Found infrastructure API credentials at ~/.fog (override with --fog)
79
+ $ bosh bootstrap deploy
80
+ Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
49
81
  1. AWS (default)
50
82
  2. AWS (bosh)
51
- 3. Openstack (default)
52
- Choose infrastructure: 1
53
-
54
- Confirming: using AWS infrastructure.
55
-
56
- 1. ap-northeast-1
57
- 2. ap-southeast-1
58
- 3. eu-west-1
59
- 4. us-east-1
60
- 5. us-west-1
61
- 6. us-west-2
62
- 7. sa-east-1
63
- Choose AWS region: 6
64
- Confirming: Using AWS us-west-2 region.
65
-
66
-
67
- Stage 2: Configuration
68
-
69
- Confirming: Micro BOSH will be named microbosh_aws_us_east_1
70
-
71
- BOSH username: drnic
72
- BOSH password: ********
73
- Confirming: After BOSH is created, your username will be drnic
74
-
75
- Confirming: Micro BOSH will be assigned IP address 174.129.227.124
76
-
77
- Confirming: Micro BOSH protected by security group named microbosh_aws_us_east_1, with ports [22, 6868, 25555, 25888]
78
-
79
- Confirming: Micro BOSH accessible via key pair named microbosh_aws_us_east_1
80
-
81
- Confirming: Micro BOSH will be created with stemcell micro-bosh-stemcell-aws-0.6.4.tgz
82
-
83
-
84
- Stage 3: Create/Allocate the Inception VM
85
-
86
- 1. create new inception VM
87
- 2. use an existing Ubuntu server
88
- 3. use this server (must be ubuntu & on same network as bosh)
89
- Create or specify an Inception VM: 1
90
-
91
- Confirming: Inception VM has been created
92
-
93
- Stage 4: Preparing the Inception VM
94
-
95
- Successfully created vcap user
96
- Successfully installed base packages
97
- Successfully installed ruby 1.9.3
98
- Successfully installed useful ruby gems
99
- Successfully installed bosh
100
- Successfully captured value of salted password
101
- Successfully validated bosh deployer
102
-
103
- Stage 5: Deploying micro BOSH
104
-
105
- Successfully downloaded micro-bosh stemcell
106
- Successfully uploaded micro-bosh deployment manifest file
107
- Successfully installed key pair for user
108
- Successfully deploy micro bosh
83
+ 3. AWS (starkandwayne)
84
+ 4. AWS (pivotaltravis)
85
+ 5. AWS (swblobstore)
86
+ 6. Alternate credentials
87
+ Choose an auto-detected infrastructure: 3
88
+
89
+ Using provider AWS
90
+
91
+
92
+ 1. *US East (Northern Virginia) Region (us-east-1)
93
+ 2. US West (Oregon) Region (us-west-2)
94
+ 3. US West (Northern California) Region (us-west-1)
95
+ 4. EU (Ireland) Region (eu-west-1)
96
+ 5. Asia Pacific (Singapore) Region (ap-southeast-1)
97
+ 6. Asia Pacific (Sydney) Region (ap-southeast-2)
98
+ 7. Asia Pacific (Tokyo) Region (ap-northeast-1)
99
+ 8. South America (Sao Paulo) Region (sa-east-1)
100
+ Choose AWS region: 1
101
+
102
+ Confirming: Using AWS/us-east-1
103
+ Acquiring a public IP address... 107.21.194.123
104
+
105
+ Confirming: Using address 107.21.194.123
106
+ Created security group ssh
107
+ -> opened ports ports TCP 22..22 from IP range 0.0.0.0/0
108
+ Created security group bosh_nats_server
109
+ -> opened ports ports TCP 4222..4222 from IP range 0.0.0.0/0
110
+ Created security group bosh_agent_http
111
+ -> opened ports ports TCP 6868..6868 from IP range 0.0.0.0/0
112
+ Created security group bosh_blobstore
113
+ -> opened ports ports TCP 25250..25250 from IP range 0.0.0.0/0
114
+ Created security group bosh_director
115
+ -> opened ports ports TCP 25555..25555 from IP range 0.0.0.0/0
116
+ Created security group bosh_registry
117
+ -> opened ports ports TCP 25777..25777 from IP range 0.0.0.0/0
118
+ Acquiring a key pair firstbosh... done
119
+
120
+ Confirming: Using key pair firstbosh
121
+ Determining stemcell image/file to use... ami-43f49d2a
122
+ bundle install
123
+ ...
124
+
125
+ bundle exec bosh micro deployment firstbosh
126
+ WARNING! Your target has been changed to `https://firstbosh:25555'!
127
+ Deployment set to '/Users/drnic/.microbosh/deployments/firstbosh/micro_bosh.yml'
128
+ bundle exec bosh -n micro deploy ami-43f49d2a
129
+
130
+ Deploy Micro BOSH
131
+ using existing stemcell (00:00:00)
132
+ creating VM from ami-43f49d2a (00:01:10)
133
+ waiting for the agent (00:02:34)
134
+ create disk (00:00:02)
135
+ mount disk (00:00:19)
136
+ fetching apply spec (00:00:00)
137
+ stopping agent services (00:00:02)
138
+ applying micro BOSH spec (00:00:16)
139
+ starting agent services (00:00:00)
140
+ waiting for the director (00:00:59)
141
+ Done 11/11 00:05:40
142
+ WARNING! Your target has been changed to `https://107.21.94.132:25555'!
143
+ Deployment set to '/Users/drnic/.microbosh/deployments/firstbosh/micro_bosh.yml'
144
+ Deployed `firstbosh/micro_bosh.yml' to `https://firstbosh:25555', took 00:05:40 to complete
109
145
  ```
110
146
 
111
- ### Local usage
147
+ Finally, target and create a user:
112
148
 
113
- During the `bosh-bootstrap deploy` sequence above, you could choose to use the local VM as the Inception VM.
114
-
115
- For AWS, it is important that you only use a VM that is on the same infrastructure region. The process of creating a micro-bosh VM is to use a local
116
- EBS volume to create an AMI. The target region for the micro-bosh VM must therefore be in the same region.
149
+ ```
150
+ bosh -u admin -p admin target https://107.21.94.132:25555
151
+ bosh -u admin -p admin create user
152
+ bosh login
153
+ ```
117
154
 
118
155
  ### Repeat usage
119
156
 
@@ -121,185 +158,163 @@ The `deploy` command can be re-run and it will not prompt again for inputs. It a
121
158
 
122
159
  ## SSH access
123
160
 
124
- You can open an SSH shell with the Inception VM:
161
+ You can open an SSH shell to your micro bosh:
125
162
 
126
163
  ```
127
- $ bosh-bootstrap ssh
164
+ $ bosh bootstrap ssh
128
165
  ```
129
166
 
130
- You can also pass a COMMAND argument and that command will be run instead of the shell being opened.
167
+ ## Deleting micro bosh
131
168
 
132
- ```
133
- $ bosh-bootstrap ssh 'whoami'
134
- ubuntu
135
- ```
136
-
137
- ## Deleting micro BOSH
138
-
139
- The `bosh-bootstrap delete` command will delete the target micro-bosh.
169
+ The `bosh bootstrap delete` command will delete the target micro-bosh.
140
170
 
141
171
  ```
142
- $ bosh-bootstrap delete
143
- Stage 1: Target inception VM to use to delete micro-bosh
144
-
145
- Confirming: Using inception VM ubuntu@ec2-184-73-231-239.compute-1.amazonaws.com
146
-
147
- Stage 2: Deleting micro BOSH
148
- Delete micro BOSH
149
- stopping agent services (00:00:01)
150
- unmount disk (00:00:10)
151
- detach disk (00:00:13)
152
- delete disk (00:02:35)
153
- delete VM (00:00:37)
154
- delete stemcell (00:00:00)
155
- Done 6/6 00:03:37
156
- Deleted deployment 'microbosh-aws-us-east-1', took 00:03:37 to complete
172
+ $ bosh bootstrap delete
157
173
  ```
158
174
 
159
- ## Deep dive into the BOSH Bootstrap deploy command
175
+ ## Deep dive into the Bosh Bootstrap deploy command
160
176
 
161
- What is actually happening when you run `bosh-bootstrap deploy`?
177
+ What is actually happening when you run `bosh bootstrap deploy`?
162
178
 
163
- At the heart of `bosh-bootstrap deploy` is the execution of the BOSH Deployer, a command provided with BOSH to bootstrap a single VM with all the parts of BOSH running on it. If you ran this command yourself you would run:
179
+ At the heart of `bosh bootstrap deploy` is the execution of the micro bosh deployer, a bosh plugin provided to bootstrap a single VM with all the parts of bosh running on it. If you ran this command yourself you would run:
164
180
 
165
181
  ```
166
- $ gem install bosh-deployer
167
- $ bosh download public stemcell some-microbosh-stemcell.tgz
168
- $ bosh micro deploy some-microbosh-stemcell.tgz
182
+ $ gem install bosh_cli_plugin_micro -s https://s3.amazonaws.com/bosh-jenkins-gems/
183
+ $ bosh micro deployment path/to/manifest/folder
184
+ $ bosh micro deploy ami-43f49d2a
169
185
  ```
170
186
 
171
- Unfortunately for this simple scenario, there are many little prerequisite steps before those three commands. The Stark & Wayne Bosh Bootstrapper replaces pages and pages of step-by-step instructions with a single command line that does everything. It even allows you to upgrade your Micro BOSH with newer BOSH releases: both publicly available stemcells and custom stemcells generated from the BOSH source code.
187
+ Unfortunately for this simple scenario, there are many little prerequisite steps before those three commands. Bosh Bootstrap replaces pages and pages of step-by-step instructions with a single command line that does everything. It even allows you to upgrade your micro bosh with newer bosh releases:
188
+
189
+ * public machine images (AMIs on AWS)
190
+ * publicly available stemcells
191
+ * custom stemcells generated from the bosh repository.
172
192
 
173
- To understand exactly what the `bosh-bootstrap deploy` command is doing, let's start with what the running parts of BOSH are and how `bosh micro deploy` deploys them.
193
+ To understand exactly what the `bosh bootstrap deploy` command is doing, let's start with what the running parts of bosh are and how `bosh micro deploy` deploys them.
174
194
 
175
- ### What is in BOSH?
195
+ ### What is in bosh?
176
196
 
177
- A running BOSH, whether it is running on a single server or a cluster of servers, is a collection of processes. The core of BOSH is the Director and the Blobstore. The remaining processes provide support, storage or messaging.
197
+ A running bosh, whether it is running on a single server or a cluster of servers, is a collection of processes. The core of bosh is the Director and the Blobstore. The remaining processes provide support, storage or messaging.
178
198
 
179
- * The Director, the public API for the bosh CLI and coordinator of BOSH behavior
199
+ * The Director, the public API for the bosh CLI and coordinator of bosh behavior
180
200
  * The Blobstore, to store and retrieve precompiled packages
181
201
  * Agents, run on each server within deployments
182
202
  * The Health Manager, to track the state of deployed systems (the infrastructure and running jobs)
183
- * Internal DNS, called PowerDNS, for internal unique naming of servers within BOSH deployments
203
+ * Internal DNS, called PowerDNS, for internal unique naming of servers within bosh deployments
184
204
  * Registry, for example AWS Registry, for tracking the infrastructure that has been provisioned (servers, persistent disks)
185
205
  * PostgreSQL
186
206
  * Redis
187
207
 
188
- When you deploy a BOSH using the BOSH Deployer (`bosh micro deploy`) or indirectly via the BOSH Bootstrapper, you are actually deploying a BOSH release that describes a BOSH called [bosh-release](https://github.com/cloudfoundry/bosh/tree/master/release). The processes listed above are called "jobs" and you can see the full list of jobs inside a BOSH within the [jobs/ directory](https://github.com/cloudfoundry/bosh/tree/master/release/jobs) of the `bosh` repository.
208
+ When you deploy a bosh using the bosh micro deployer (`bosh micro deploy`) or indirectly via the Bosh Bootstrap, you are actually deploying a bosh release that describes a bosh (see [release](https://github.com/cloudfoundry/bosh/tree/master/release) folder). The processes listed above are called "jobs" and you can see the full list of jobs inside a bosh within the [jobs/ directory](https://github.com/cloudfoundry/bosh/tree/master/release/jobs) of the `bosh` repository.
189
209
 
190
- But you don't yet have a BOSH to deploy another BOSH.
210
+ But you don't yet have a bosh to deploy another bosh.
191
211
 
192
- ### How to get your first BOSH?
212
+ ### How to get your first bosh?
193
213
 
194
- The BOSH Deployer (`bosh micro deploy`) exists to spin you up a pre-baked server with all the packages and jobs running.
214
+ The bosh micro deployer (`bosh micro deploy`) exists to spin you up a pre-baked server with all the packages and jobs running.
195
215
 
196
- When you run the BOSH Deployer on a server, it does not convert that server into a BOSH. Rather, it provisions a single brand new server, with all the required packages, configuration and startup scripts. We call this pre-baked server a Micro BOSH.
216
+ When you run the bosh micro deployer on a server, it does not convert that server into a bosh. Rather, it provisions a single brand new server, with all the required packages, configuration and startup scripts. We call this pre-baked server a micro bosh.
197
217
 
198
- A Micro BOSH server is a normal running server built from a base OS image that already contains all the packages, configuration and startup scripts for the jobs listed above.
218
+ A micro bosh server is a normal running server built from a base OS image that already contains all the packages, configuration and startup scripts for the jobs listed above.
199
219
 
200
- In BOSH terminology, call these pre-packaged base OS images "stemcells".
220
+ In bosh terminology, call these pre-packaged base OS images "stemcells".
201
221
 
202
- For AWS, vSphere and OpenStack there are publicly available stemcells that can bootstrap a Micro BOSH for that infrastructure. To see the current list of all public Micro BOSH stemcells for all infrastructure providers; and to download one of them:
203
222
 
204
- ```
205
- $ bosh public stemcells --tag micro
206
- $ bosh download public stemcell micro-bosh-stemcell-aws-0.6.4.tgz
207
- ```
208
-
209
- The CloudFoundry BOSH team will release new public stemcells over time. The BOSH Deployer allows you to upgrade to newer stemcells as easily as it is to deploy a Micro BOSH initially.
223
+ ### Configuring a micro bosh
210
224
 
211
- ```
212
- $ bosh micro deploy micro-bosh-stemcell-aws-0.6.4.tgz
213
- $ bosh micro deploy micro-stemcell-aws-0.7.0.tgz --update
214
- ```
225
+ The command above will not work without first providing bosh micro deployer with configuration details. The stemcell file alone is not sufficient information. When we deploy or update a micro bosh we need to provide the following:
215
226
 
216
- ### Configuring a Micro BOSH
217
-
218
- The command above will not work without first providing BOSH Deployer with configuration details. The stemcell file alone is not sufficient information. When we deploy or update a Micro BOSH we need to provide the following:
219
-
220
- * A static IP address - this IP address will be bound to the initial Micro BOSH server, and when the Micro BOSH is updated in future and the server is thrown away and replaced, then it is bound to the replacement servers
227
+ * A static IP address - this IP address will be bound to the initial micro bosh server, and when the micro bosh is updated in future and the server is thrown away and replaced, then it is bound to the replacement servers
221
228
  * Server properties - the instance type (such as m1.large on AWS) or RAM/CPU combination (on vSphere)
222
- * Server persistent disk - a single persistent, attached disk volume will be provisioned and mounted at `/var/vcap/store`; when the Micro BOSH is updated is is unmounted, unattached from the current server and then reattached and remounted to the upgraded server
223
- * Infrastructure API credentials - the magic permissions for the Micro BOSH to provision servers and persistent disks for its BOSH deployments
229
+ * Server persistent disk - a single persistent, attached disk volume will be provisioned and mounted at `/var/vcap/store`; when the micro bosh is updated is is unmounted, unattached from the current server and then reattached and remounted to the upgraded server
230
+ * Infrastructure API credentials - the magic permissions for the micro bosh to provision servers and persistent disks for its bosh deployments
224
231
 
225
- This information is to go into a file called `/path/to/deployments/NAME/micro_bosh.yml`. Before `bosh micro deploy` is run, we first need to tell BOSH Deployer which file contains the Micro BOSH deployment manifest.
232
+ This information is to go into a file called `/path/to/deployments/NAME/micro_bosh.yml`. Before `bosh micro deploy` is run, we first need to tell bosh micro deployer which file contains the micro bosh deployment manifest.
226
233
 
227
- In the Stark & Wayne Bosh Bootstrapper, the manifests are stored at `/var/vcap/store/microboshes/deployments/NAME/micro_bosh.yml`.
234
+ In the Bosh Bootstrap, the manifests are stored at `~/.microbosh/deployments/NAME/micro_bosh.yml`.
228
235
 
229
- So the BOSH Deployer command that is run to specify the deployment manifest and run the deployment is:
236
+ So the bosh micro deployer command that is run to specify the deployment manifest and run the deployment is:
230
237
 
231
238
  ```
232
- $ bosh micro deployment `/var/vcap/store/microboshes/deployments/NAME/micro_bosh.yml`
233
- $ bosh micro deploy /var/vcap/store/stemcells/micro-bosh-stemcell-aws-0.6.4.tgz
239
+ $ bosh micro deployment `~/.microbosh/deployments/NAME/micro_bosh.yml`
240
+ $ bosh micro deploy ami-43f49d2a
234
241
  ```
235
242
 
236
- ### Why does it take so long to deploy Micro BOSH on AWS?
243
+ ### Why does it take so long to deploy micro bosh on AWS?
244
+
245
+ On AWS it can take over 20 minutes to deploy or upgrade a micro bosh from a public stemcell. The majority of this time is taken with converting the stemcell file (such as `micro-bosh-stemcell-aws-0.6.4.tgz`) into an Amazon AMI.
237
246
 
238
- On AWS it can take over 20 minutes to deploy or upgrade a Micro BOSH from a public stemcell. The majority of this time is taken with converting the stemcell file (such as `micro-bosh-stemcell-aws-0.6.4.tgz`) into an Amazon AMI.
247
+ If you are using AWS us-east-1, like the examples above, then you will be automatically given the public AMI. This saves you about 15 minutes. POW!
239
248
 
240
- When you boot a new server on AWS you provide the base machine image for the root filesystem. This is called the Amazon Machine Image (AMI). For our Micro BOSH, we need an AMI that contains all the packages, process configuration and startup scripts. That is, we need to convert our stemcell into an AMI; then use the AMI to boot the Micro BOSH server.
249
+ When you boot a new server on AWS you provide the base machine image for the root filesystem. This is called the Amazon Machine Image (AMI). For our micro bosh, we need an AMI that contains all the packages, process configuration and startup scripts. That is, we need to convert our stemcell into an AMI; then use the AMI to boot the micro bosh server.
241
250
 
242
- The BOSH Deployer performs all the hard work to create an AMI. Believe me, it is a lot of hard work.
251
+ The bosh micro deployer performs all the hard work to create an AMI. Believe me, it is a lot of hard work.
243
252
 
244
- The summary of the process of creating the Micro BOSH AMI is:
253
+ The summary of the process of creating the micro bosh AMI is:
245
254
 
246
- 1. Create a new EBS volume (an attached disk) on the server running BOSH Deployer
255
+ 1. Create a new EBS volume (an attached disk) on the server running bosh micro deployer
247
256
  2. Unpack/upload the stemcell onto the EBS volume
248
257
  3. Create a snapshot of the EBS volume
249
258
  4. Register the snapshot as an AMI
250
259
 
251
- This process takes the majority of the time to deploy a new/replacement Micro BOSH server.
260
+ This process takes the majority of the time to deploy a new/replacement micro bosh server.
252
261
 
253
- ### Why can't I run BOSH Deployer from my laptop?
262
+ ### When I run Bosh Bootstrap from my laptop?
254
263
 
255
- One of the feature of the BOSH Bootstrapper is that you can run it from your local laptop. BOSH Deployer itself cannot be run from your laptop. The reason is hidden in the step-by-step AMI example above. In AWS, to create an EBS volume, create a snapshot and register it as an AMI, you need to be running the commands on an AWS server in the same target region as your future Micro BOSH server.
264
+ One of the feature of the Bosh Bootstrap is that you can run it from your local laptop if you:
256
265
 
257
- The server that runs the BOSH Deployer is commonly called the Inception VM. For AWS you need an Inception VM in the same AWS region that you will provision your Micro BOSH server. Since a BOSH also manages a stemcell process similar to the above, your BOSH must be in the same AWS region that you a deploying BOSH releases.
266
+ * Use AWS region us-east-1 (where there is a public AMI available)
267
+ * Use OpenStack or vSphere
258
268
 
259
- ### How does BOSH Bootstrapper get around this requirement?
269
+ ### When do I need an inception server?
260
270
 
261
- The BOSH Bootstrapper can run from your laptop or locally from an Inception VM.
271
+ There are occasions when it is preferable or required to provision a initial server (called an [inception server](https://github.com/drnic/inception-server)) and to run Bosh Bootstrap (`bosh bootstrap deploy`) within that.
262
272
 
263
- If you run it from your laptop, then it will prompt you to create a new Inception VM or for the host/username of a pre-existing Ubuntu server. The BOSH Bootstrapper will then use SSH to command the Inception VM to perform all the deployment steps discussed above.
273
+ * Using a AWS region other than us-east-1 (you need to be in that region to create an AMI)
274
+ * You want much faster internet between your terminal (an ssh session into your inception server) and your micro bosh and deployed servers
264
275
 
265
- That is the core of the service being provided by the BOSH Bootstrapper - to prepare an Inception VM and to command it to deploy and upgrade Micro BOSHes.
276
+ To provision an [inception server](https://github.com/drnic/inception-server):
277
+
278
+ ```
279
+ $ gem install inception-server
280
+ $ inception deploy
281
+ $ inception ssh
282
+ > gem install bosh-bootstrap
283
+ ```
284
+
285
+ Like Bosh Bootstrap, it will prompt for the infrastructure/cloud provider that you want, your credentials and then do everything for you automatically.
266
286
 
267
287
  ## Internal configuration/settings
268
288
 
269
- Once you've used the CLI it stores your settings for your BOSH, so that you can re-run the tool for upgrades or other future functionality.
289
+ Once you've used the CLI it stores your settings for your bosh, so that you can re-run the tool for upgrades or other future functionality.
270
290
 
271
- By default, the settings file is stored at `~/.bosh_bootstrap/manifest.yml`.
291
+ By default, the settings file is stored at `~/.microbosh/settings.yml`.
272
292
 
273
- For an AWS BOSH it looks like:
293
+ For an AWS bosh it looks like:
274
294
 
275
295
  ``` yaml
276
- ---
277
- fog_path: /Users/drnic/.fog
278
- fog_credentials:
279
- provider: AWS
280
- aws_access_key_id: ACCESS_KEY
281
- aws_secret_access_key: SECRET_KEY
296
+ ---
297
+ bosh:
298
+ name: firstbosh
299
+ provider:
300
+ name: aws
301
+ credentials:
302
+ provider: AWS
303
+ aws_access_key_id: ACCESS
304
+ aws_secret_access_key: SECRET
282
305
  region: us-east-1
283
- bosh_cloud_properties:
284
- aws:
285
- access_key_id: ACCESS_KEY
286
- secret_access_key: SECRET_KEY
287
- default_key_name: microbosh
288
- default_security_groups:
289
- - microbosh
290
- ec2_private_key: /home/vcap/.ssh/microbosh.pem
291
- bosh_resources_cloud_properties:
292
- instance_type: m1.medium
293
- bosh_provider: aws
294
- region_code: us-east-1
295
- bosh_username: drnic
296
- bosh_password: PASSWORD
297
- bosh:
298
- password: PASSWORD
299
- salted_password: 'sdfkjhadsjkadsfjhdsf'
300
- persistent_disk: 16384
301
- ip_address: 107.22.247.45
302
- micro_bosh_stemcell_name: "micro-bosh-stemcell-aws-0.6.4.tgz"
306
+ address:
307
+ ip: 107.21.194.123
308
+ key_pair:
309
+ name: firstbosh
310
+ fingerprint: 3c:09:26:84:df:43:92:d7:bb:31:05:e2:77:84:58:c7:d0:aa:27:18
311
+ private_key: |-
312
+ -----BEGIN RSA PRIVATE KEY-----
313
+ 42mrej3mV7BzyEzuwYfancQo6cVKUcjWmZPbTU882l8JAoGASGhmtSr/bIZ+sLeQCfdEz0g5xNvF
314
+ ls1q9vuRLx6cJlO0lZgIUhMWU6Ewk5Qt4bbH2vbxiFPEyEAKq52u24aXSBj7HRc8TTyZtbKMuJGM
315
+ l32aFX8NKv2qrErfjI5j43pJ62Hqk6v6F0OYUVQSXRXe2UNavuFt8WR1Adqy8QLW248=
316
+ ...
317
+ -----END RSA PRIVATE KEY-----
303
318
  ```
304
319
 
305
320
  ## Contributing
@@ -316,7 +331,4 @@ All documentation and source code is copyright of Stark & Wayne LLC.
316
331
 
317
332
  ## Subscription and Support
318
333
 
319
- This documentation & tool is freely available to all people and companies coming to CloudFoundry and BOSH.
320
-
321
- If you decide to run CloudFoundry and BOSH in production, please purchase a Subscription and Support Agreement with Stark & Wayne so we can continue to create and maintain top quality documentation and tools; and also provide you with bespoke support for your deployments. We want to help you be successfully.
322
-
334
+ This documentation & tool is freely available to all people and companies coming to Cloud Foundry and bosh.