bosh-bootstrap 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog.md CHANGED
@@ -18,6 +18,7 @@
18
18
  * Added `ssh` action to ssh into the microbosh
19
19
  * Added `delete` actions to delete the microbosh (but not the IP address and security groups)
20
20
  * Add back `bosh-bootstrap` CLI & remove bosh_cli dependency (v0.11.1)
21
+ * Specify which AWS AZ to use via `provider.az` in settings.yml (v0.11.2)
21
22
 
22
23
  ## v0.10
23
24
 
data/README.md CHANGED
@@ -158,6 +158,19 @@ bosh login
158
158
 
159
159
  The `deploy` command can be re-run and it will not prompt again for inputs. It aims to be idempotent. This means that if you see any errors when running `deploy`, such as unavailability of VMs or IP addresses, then when you resolve those issues you can re-run the `deploy` command and it will resume the bootstrap of micro-bosh (and the optional inception VM).
160
160
 
161
+ ### Restrict AWS availability zones
162
+
163
+ If you get any errors from AWS about availability zones (AZs) being unavailable to your AWS account, or a specific instance type/flavor is not available to you in your AZ, then you can try specifying an explicit AZ in your `~/.microbosh/settings.yml` file.
164
+
165
+ Add `provider.az` to specify an AZ within the region you have chosen:
166
+
167
+ ```
168
+ provider:
169
+ name: "aws"
170
+ region: us-east-1
171
+ az: us-east-1c
172
+ ```
173
+
161
174
  ## SSH access
162
175
 
163
176
  You can open an SSH shell to your micro bosh:
data/TODO.md CHANGED
@@ -1,12 +1,43 @@
1
1
  ## Known issues
2
2
 
3
+ * specify an AZ to use in the region
3
4
  * target & create user after deployment
4
5
  * upgrade (if its already running successfully; else delete & redeploy)
5
6
  * multiple deployments
6
7
  * bosh name (currently fixed at test-bosh)
7
8
  * ~/.microbosh folder is singular
8
9
 
9
- * specify an AZ to use in the region
10
+
11
+ ### Specify region
12
+
13
+ You run the tool, it fails because of region restrictions.
14
+
15
+ Add the following to your settings.yml
16
+
17
+ ``` yaml
18
+ provider:
19
+ name: "aws"
20
+ ignore_az:
21
+ - us-east-1b
22
+ - us-west-2c
23
+ ```
24
+
25
+ Or:
26
+
27
+ ``` yaml
28
+ provider:
29
+ name: "aws"
30
+ region: us-east-1
31
+ az: us-east-1c
32
+ ```
33
+
34
+ The AZ choice then maps into `micro_bosh.yml`:
35
+
36
+ ``` yaml
37
+ resources:
38
+ cloud_properties:
39
+ availability_zone: AZ
40
+ ```
10
41
 
11
42
  ### Display status
12
43
 
@@ -1,3 +1,5 @@
1
+ require "fileutils"
2
+
1
3
  class Bosh::Bootstrap::KeyPair
2
4
  include FileUtils
3
5
 
@@ -16,7 +16,7 @@ module Bosh::Bootstrap::MicroboshProviders
16
16
  end
17
17
 
18
18
  def to_hash
19
- super.merge({
19
+ data = super.merge({
20
20
  "network"=>{"type"=>"dynamic", "vip"=>public_ip},
21
21
  "resources"=>
22
22
  {"persistent_disk"=>persistent_disk,
@@ -30,6 +30,10 @@ module Bosh::Bootstrap::MicroboshProviders
30
30
  {"blobstore"=>{"address"=>public_ip},
31
31
  "nats"=>{"address"=>public_ip}},
32
32
  "properties"=>{"aws_registry"=>{"address"=>public_ip}}}})
33
+ if az = settings.exists?("provider.az")
34
+ data["resources"]["cloud_properties"]["availability_zone"] = az
35
+ end
36
+ data
33
37
  end
34
38
 
35
39
  def persistent_disk
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Bootstrap
3
- VERSION = "0.11.1"
3
+ VERSION = "0.11.2"
4
4
  end
5
5
  end
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: test-bosh
3
+ logging:
4
+ level: DEBUG
5
+ network:
6
+ type: dynamic
7
+ vip: 1.2.3.4
8
+ resources:
9
+ persistent_disk: 16384
10
+ cloud_properties:
11
+ instance_type: m1.medium
12
+ availability_zone: us-west-2a
13
+ cloud:
14
+ plugin: aws
15
+ properties:
16
+ aws:
17
+ access_key_id: ACCESS
18
+ secret_access_key: SECRET
19
+ region: us-west-2
20
+ ec2_endpoint: ec2.us-west-2.amazonaws.com
21
+ default_security_groups:
22
+ - ssh
23
+ - bosh_agent_http
24
+ - bosh_nats_server
25
+ - bosh_blobstore
26
+ - bosh_director
27
+ - bosh_registry
28
+ default_key_name: test-bosh
29
+ ec2_private_key: ~/.microbosh/ssh/test-bosh
30
+ apply_spec:
31
+ agent:
32
+ blobstore:
33
+ address: 1.2.3.4
34
+ nats:
35
+ address: 1.2.3.4
36
+ properties:
37
+ aws_registry:
38
+ address: 1.2.3.4
@@ -28,6 +28,25 @@ describe Bosh::Bootstrap::MicroboshProviders::AWS do
28
28
  yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.aws_ec2.yml"))
29
29
  end
30
30
 
31
+ it "supports explicit provider.az" do
32
+ setting "provider.az", "us-west-2a"
33
+ setting "provider.name", "aws"
34
+ setting "provider.region", "us-west-2"
35
+ setting "provider.credentials.aws_access_key_id", "ACCESS"
36
+ setting "provider.credentials.aws_secret_access_key", "SECRET"
37
+ setting "address.ip", "1.2.3.4"
38
+ setting "key_pair.path", "~/.microbosh/ssh/test-bosh"
39
+ setting "bosh.name", "test-bosh"
40
+ setting "bosh.salted_password", "salted_password"
41
+ setting "bosh.persistent_disk", 16384
42
+
43
+ subject = Bosh::Bootstrap::MicroboshProviders::AWS.new(microbosh_yml, settings)
44
+
45
+ subject.create_microbosh_yml(settings)
46
+ File.should be_exists(microbosh_yml)
47
+ yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.aws_ec2.us-west-2a.yml"))
48
+ end
49
+
31
50
  describe "stemcell" do
32
51
  before do
33
52
  setting "provider.name", "aws"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -183,6 +183,7 @@ files:
183
183
  - lib/bosh-bootstrap/version.rb
184
184
  - lib/bosh/cli/commands/bootstrap.rb
185
185
  - spec/assets/.gitkeep
186
+ - spec/assets/microbosh_yml/micro_bosh.aws_ec2.us-west-2a.yml
186
187
  - spec/assets/microbosh_yml/micro_bosh.aws_ec2.yml
187
188
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml
188
189
  - spec/assets/microbosh_yml/micro_bosh.openstack.yml
@@ -225,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
226
  version: '0'
226
227
  segments:
227
228
  - 0
228
- hash: -2381433706831646133
229
+ hash: 671953131192924937
229
230
  requirements: []
230
231
  rubyforge_project:
231
232
  rubygems_version: 1.8.25
@@ -235,6 +236,7 @@ summary: bosh-bootstrap configures and deploys a microbosh deployed on either AW
235
236
  or OpenStack.
236
237
  test_files:
237
238
  - spec/assets/.gitkeep
239
+ - spec/assets/microbosh_yml/micro_bosh.aws_ec2.us-west-2a.yml
238
240
  - spec/assets/microbosh_yml/micro_bosh.aws_ec2.yml
239
241
  - spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml
240
242
  - spec/assets/microbosh_yml/micro_bosh.openstack.yml