vagrant-softlayer 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,256 +1,258 @@
1
- # Vagrant SoftLayer Provider
2
-
3
- <span class="badges">
4
- [![Gem Version](https://badge.fury.io/rb/vagrant-softlayer.png)](http://badge.fury.io/rb/vagrant-softlayer)
5
- [![Code Climate](https://codeclimate.com/github/audiolize/vagrant-softlayer.png)](https://codeclimate.com/github/audiolize/vagrant-softlayer)
6
- </span>
7
-
8
- This is a [Vagrant](http://www.vagrantup.com) plugin that adds a [SoftLayer](http://www.softlayer.com)
9
- provider to Vagrant, allowing Vagrant to control and provision SoftLayer CCI instances.
10
-
11
- **NOTE:** This plugin work with Vagrant 1.3+, altough Vagrant 1.4+ is strongly advised.
12
-
13
- ## Features
14
-
15
- * Basic lifecycle (boot, halt, reboot, suspend, resume) of SoftLayer CCI instances.
16
- * OS reload on a CCI (`vagrant rebuild`).
17
- * SSH into the instances.
18
- * Provision the instances with any built-in Vagrant provisioner.
19
- * Minimal synced folder support via `rsync`.
20
-
21
- ## Installation
22
-
23
- > **NOTE**
24
- >
25
- > If you're using Vagrant 1.3, you need to [Set the SSL_CERT_FILE environment variable](https://github.com/audiolize/vagrant-softlayer/wiki/The-SSL_CERT_FILE-environment-variable) first.
26
-
27
- Installation is performed in the prescribed manner for Vagrant 1.1+ plugins.
28
- After installing, `vagrant up` and specify the `softlayer` provider. An example is
29
- shown below.
30
-
31
- ```
32
- $ vagrant plugin install vagrant-softlayer
33
- ...
34
- $ vagrant up --provider=softlayer
35
- ...
36
- ```
37
-
38
- Of course prior to doing this, you'll need to obtain an SoftLayer-compatible
39
- box file for Vagrant.
40
-
41
- ## Box File Format
42
-
43
- Every provider in Vagrant must introduce a custom box format. This
44
- provider introduces `softlayer` boxes. You can view an example box in
45
- the `example_box/` directory. That directory also contains instructions
46
- on how to build a box.
47
-
48
- The box format is basically just the required `metadata.json` file
49
- along with a `Vagrantfile` that does default settings for the
50
- provider-specific configuration for this provider.
51
-
52
- ## Configuration
53
-
54
- This provider exposes quite a few provider-specific configuration options:
55
-
56
- ### Authentication
57
-
58
- Parameter | Description | Default | Required
59
- -------------- | ------------------------------------ | ---------------------------------- | --------
60
- `api_key` | The API key for accessing SoftLayer | | yes
61
- `endpoint_url` | The endpoint SoftLayer API url | SoftLayer::API_PUBLIC_ENDPOINT | yes
62
- `username` | The username for accessing SoftLayer | | yes
63
-
64
- > **NOTE**
65
- >
66
- > In place of the API key and username you can use environment variables, respectively `SL_API_KEY` and `SL_USERNAME`.
67
-
68
- ### DNS Management
69
-
70
- If the DNS zone of the configured domain is hosted by SoftLayer, you can automatically manage it.
71
-
72
- Parameter | Description | Default | Required
73
- ------------ | ------------------------------------- | ------- | --------
74
- `manage_dns` | Add/remove A record on create/destroy | false | no
75
-
76
- ### Join Local Load Balancers
77
-
78
- See [Join load balancers](https://github.com/audiolize/vagrant-softlayer/wiki/Join-load-balancers).
79
-
80
- ### Instance Configuration
81
-
82
- Parameter | Description | Default | Required
83
- ------------------ | -----------------------------------------------------------| ----------------| --------
84
- `datacenter` | Datacenter shortname | First available | no
85
- `dedicated` | Allocate a dedicated CCI (non-shared host) | false | no
86
- `disk_capacity` | The capacity of each disk | | no **
87
- `domain` | The domain of the instance | | yes
88
- `force_private_ip` | Use private IP for communication even if public IP is set | false | no
89
- `hostname` | The hostname of the instance | | yes *
90
- `hourly_billing` | Hourly billing type (false for monthly) | true | no
91
- `image_guid` | The global identifier for the compute or flex image to use | | no **
92
- `local_disk` | Use a local disk (false for SAN) | true | no
93
- `max_memory` | The amount of RAM of the instance in Mb | 1024 | no
94
- `network_speed` | Network port speed in Mbps | 10 | no
95
- `operating_system` | The instance operating system identifier | UBUNTU_LATEST | no **
96
- `post_install` | URI of Post-install script to download | | no
97
- `private_only` | Only create access to the private network | false | no
98
- `ssh_key` | ID or label of the SSH key(s) to provision | | yes
99
- `start_cpus` | The number of processors of the instance | 1 | no
100
- `user_data` | User defined metadata string | | no
101
- `vlan_private` | The ID, name or qualified name of the private VLAN | Auto-generated | no
102
- `vlan_public` | The ID, name or qualified name of the public VLAN | Auto-generated | no
103
-
104
- \* The `hostname` could be specified either using `config.vm.hostname` or the provider parameter.
105
-
106
- \** When defining the instance you can either specify an `image_guid` or `operating_system` with optional `disk_capacity`.
107
-
108
- ### Timeouts
109
-
110
- Parameter | Description | Default | Required
111
- ------------------- | ------------------------------------------| ----------------| --------
112
- `provision_timeout` | Provisioning wait timeout in seconds | 1200 | no
113
- `rebuild_timeout` | Rebuild wait timeout in seconds | 1200 | no
114
-
115
- These can be set like typical provider-specific configuration:
116
-
117
- ```
118
- Vagrant.configure("2") do |config|
119
- # ... other stuff
120
-
121
- config.vm.provider :softlayer do |sl|
122
- sl.api_key = "foo"
123
- sl.username = "bar"
124
- sl.ssh_key = "Vagrant insecure key"
125
- end
126
- end
127
- ```
128
-
129
- ## OS Reload
130
-
131
- Reload of an instance's operating system is performed with the `vagrant rebuild` command.
132
- The primary disk of the instance will be formatted and a fresh copy of the underlying OS
133
- will be applied. Note that only `ssh_key` and `post_install` parameter will be read
134
- during rebuild, all the other parameters will be ignored. Provisioners will always run
135
- after rebuild.
136
-
137
- ## Synced Folders
138
-
139
- There is minimal support for synced folders. Upon `vagrant up`,
140
- `vagrant reload`, and `vagrant provision`, the SoftLayer provider will use
141
- `rsync` (if available) to uni-directionally sync the folder to
142
- the remote machine over SSH.
143
-
144
- This is good enough for all built-in Vagrant provisioners (shell, ansible,
145
- chef, and puppet) to work!
146
-
147
- ## Other Examples
148
-
149
- ### Multiple disks
150
-
151
- The `disk_capacity` parameter accepts an hash with the following structure:
152
-
153
- ```
154
- {
155
- disk_id => disk_size,
156
- disk_id => disk_size,
157
- ...
158
- }
159
- ```
160
-
161
- Disk ID 1 is reserved is reserved for swap space, in the following example two disks
162
- of 25Gb and 100Gb will be provisioned:
163
-
164
- ```
165
- Vagrant.configure("2") do |config|
166
- # ... other stuff
167
-
168
- config.vm.provider :softlayer do |sl, override|
169
- # ... other stuff
170
-
171
- sl.disk_capacity = { 0 => 25, 2 => 100 }
172
- end
173
- end
174
- ```
175
-
176
- ### Override SSH Username
177
-
178
- If you're running Vagrant with an user different from root, probably you need
179
- to override the username used for ssh connection. You can do it using the standard
180
- Vagrant syntax:
181
-
182
- ```
183
- Vagrant.configure("2") do |config|
184
- # ... other stuff
185
-
186
- config.vm.provider :softlayer do |sl, override|
187
- # ... other stuff
188
-
189
- override.ssh.username = "root"
190
- end
191
- end
192
- ```
193
-
194
- ### Multiple SSH keys
195
-
196
- Multiple SSH keys to be provisioned could be specified using an array:
197
-
198
- ```
199
- Vagrant.configure("2") do |config|
200
- # ... other stuff
201
-
202
- config.vm.provider :softlayer do |sl|
203
- sl.api_key = "foo"
204
- sl.username = "bar"
205
- # ssh_keys is just an alias of ssh_key
206
- sl.ssh_keys = ["Vagrant insecure key", "My personal key"]
207
- end
208
- end
209
- ```
210
-
211
- Also, a bunch of aliases for the `ssh_key` parameter are provided for better semantic:
212
-
213
- * `ssh_keys`
214
- * `ssh_key_id`
215
- * `ssh_key_ids`
216
- * `ssh_key_name`
217
- * `ssh_key_names`
218
-
219
- ## Quick Start Guide
220
-
221
- For those new to Vagrant, see the [Quick Start Guide](https://github.com/audiolize/vagrant-softlayer/blob/master/QUICKSTART.md).
222
-
223
- ## Development
224
-
225
- To work on the `vagrant-softlayer` plugin, clone this repository out, and use
226
- [Bundler](http://gembundler.com) to get the dependencies:
227
-
228
- ```
229
- $ bundle
230
- ```
231
-
232
- Once you have the dependencies, verify the unit tests pass with `rake`:
233
-
234
- ```
235
- $ bundle exec rake
236
- ```
237
-
238
- If those pass, you're ready to start developing the plugin. You can test
239
- the plugin without installing it into your Vagrant environment by just
240
- creating a `Vagrantfile` in the top level of this directory (it is gitignored)
241
- and add the following line to your `Vagrantfile`:
242
-
243
- ```
244
- Vagrant.require_plugin "vagrant-softlayer"
245
- ```
246
-
247
- Use bundler to execute Vagrant:
248
-
249
- ```
250
- $ bundle exec vagrant up --provider=softlayer
251
- ```
252
-
253
- ## Credits
254
-
255
- Emiliano Ticci (@emyl)
256
- Julio Lajara (@ju2wheels)
1
+ # Vagrant SoftLayer Provider
2
+
3
+ <span class="badges">
4
+ [![Gem Version](https://badge.fury.io/rb/vagrant-softlayer.png)](http://badge.fury.io/rb/vagrant-softlayer)
5
+ [![Code Climate](https://codeclimate.com/github/audiolize/vagrant-softlayer.png)](https://codeclimate.com/github/audiolize/vagrant-softlayer)
6
+ </span>
7
+
8
+ This is a [Vagrant](http://www.vagrantup.com) plugin that adds a [SoftLayer](http://www.softlayer.com)
9
+ provider to Vagrant, allowing Vagrant to control and provision SoftLayer CCI instances.
10
+
11
+ **NOTE:** This plugin work with Vagrant 1.3+, altough Vagrant 1.4+ is strongly advised.
12
+
13
+ ## Features
14
+
15
+ * Basic lifecycle (boot, halt, reboot, suspend, resume) of SoftLayer CCI instances.
16
+ * OS reload on a CCI (`vagrant rebuild`).
17
+ * SSH into the instances.
18
+ * Provision the instances with any built-in Vagrant provisioner.
19
+ * Minimal synced folder support via `rsync`.
20
+
21
+ ## Installation
22
+
23
+ > **NOTE**
24
+ >
25
+ > If you're using Vagrant 1.3, you need to [Set the SSL_CERT_FILE environment variable](https://github.com/audiolize/vagrant-softlayer/wiki/The-SSL_CERT_FILE-environment-variable) first.
26
+
27
+ Installation is performed in the prescribed manner for Vagrant 1.1+ plugins.
28
+ After installing, `vagrant up` and specify the `softlayer` provider. An example is
29
+ shown below.
30
+
31
+ ```
32
+ $ vagrant plugin install vagrant-softlayer
33
+ ...
34
+ $ vagrant up --provider=softlayer
35
+ ...
36
+ ```
37
+
38
+ Of course prior to doing this, you'll need to obtain an SoftLayer-compatible
39
+ box file for Vagrant.
40
+
41
+ ## Box File Format
42
+
43
+ Every provider in Vagrant must introduce a custom box format. This
44
+ provider introduces `softlayer` boxes. You can view an example box in
45
+ the `example_box/` directory. That directory also contains instructions
46
+ on how to build a box.
47
+
48
+ The box format is basically just the required `metadata.json` file
49
+ along with a `Vagrantfile` that does default settings for the
50
+ provider-specific configuration for this provider.
51
+
52
+ ## Configuration
53
+
54
+ This provider exposes quite a few provider-specific configuration options:
55
+
56
+ ### Authentication
57
+
58
+ Parameter | Description | Default | Required
59
+ -------------- | ------------------------------------ | ---------------------------------- | --------
60
+ `api_key` | The API key for accessing SoftLayer | | yes
61
+ `endpoint_url` | The endpoint SoftLayer API url | SoftLayer::API_PUBLIC_ENDPOINT | yes
62
+ `username` | The username for accessing SoftLayer | | yes
63
+
64
+ > **NOTE**
65
+ >
66
+ > In place of the API key and username you can use environment variables, respectively `SL_API_KEY` and `SL_USERNAME`.
67
+
68
+ ### DNS Management
69
+
70
+ If the DNS zone of the configured domain is hosted by SoftLayer, you can automatically manage it.
71
+
72
+ Parameter | Description | Default | Required
73
+ ------------ | ------------------------------------- | ------- | --------
74
+ `manage_dns` | Add/remove A record on create/destroy | false | no
75
+
76
+ ### Join Local Load Balancers
77
+
78
+ See [Join load balancers](https://github.com/audiolize/vagrant-softlayer/wiki/Join-load-balancers).
79
+
80
+ ### Instance Configuration
81
+
82
+ Parameter | Description | Default | Required
83
+ ------------------ | -----------------------------------------------------------| ----------------| --------
84
+ `datacenter` | Datacenter shortname | First available | no
85
+ `dedicated` | Allocate a dedicated CCI (non-shared host) | false | no
86
+ `disk_capacity` | The capacity of each disk | | no **
87
+ `domain` | The domain of the instance | | yes
88
+ `force_private_ip` | Use private IP for communication even if public IP is set | false | no
89
+ `hostname` | The hostname of the instance | | yes *
90
+ `hourly_billing` | Hourly billing type (false for monthly) | true | no
91
+ `image_guid` | The global identifier for the compute or flex image to use | | no **
92
+ `local_disk` | Use a local disk (false for SAN) | true | no
93
+ `max_memory` | The amount of RAM of the instance in Mb | 1024 | no
94
+ `network_speed` | Network port speed in Mbps | 10 | no
95
+ `operating_system` | The instance operating system identifier | UBUNTU_LATEST | no **
96
+ `post_install` | URI of Post-install script to download | | no
97
+ `private_only` | Only create access to the private network | false | no
98
+ `ssh_key` | ID or label of the SSH key(s) to provision | | yes
99
+ `start_cpus` | The number of processors of the instance | 1 | no
100
+ `user_data` | User defined metadata string | | no
101
+ `vlan_private` | The ID, name or qualified name of the private VLAN | Auto-generated | no
102
+ `vlan_public` | The ID, name or qualified name of the public VLAN | Auto-generated | no
103
+
104
+ \* The `hostname` could be specified either using `config.vm.hostname` or the provider parameter.
105
+
106
+ \** When defining the instance you can either specify an `image_guid` or `operating_system` with optional `disk_capacity`.
107
+
108
+ ### Timeouts/Waits
109
+
110
+ Parameter | Description | Default | Required
111
+ ------------------- | ------------------------------------------| ----------------| --------
112
+ `api_timeout` | SoftLayer API call timeout in seconds | 60 | no
113
+ `provision_timeout` | Provisioning wait timeout in seconds | 1200 | no
114
+ `rebuild_timeout` | Rebuild wait timeout in seconds | 1200 | no
115
+ `transaction_wait` | Wait for order transactions to complete | true | no
116
+
117
+ These can be set like typical provider-specific configuration:
118
+
119
+ ```
120
+ Vagrant.configure("2") do |config|
121
+ # ... other stuff
122
+
123
+ config.vm.provider :softlayer do |sl|
124
+ sl.api_key = "foo"
125
+ sl.username = "bar"
126
+ sl.ssh_key = "Vagrant insecure key"
127
+ end
128
+ end
129
+ ```
130
+
131
+ ## OS Reload
132
+
133
+ Reload of an instance's operating system is performed with the `vagrant rebuild` command.
134
+ The primary disk of the instance will be formatted and a fresh copy of the underlying OS
135
+ will be applied. Note that only `ssh_key` and `post_install` parameter will be read
136
+ during rebuild, all the other parameters will be ignored. Provisioners will always run
137
+ after rebuild.
138
+
139
+ ## Synced Folders
140
+
141
+ There is minimal support for synced folders. Upon `vagrant up`,
142
+ `vagrant reload`, and `vagrant provision`, the SoftLayer provider will use
143
+ `rsync` (if available) to uni-directionally sync the folder to
144
+ the remote machine over SSH.
145
+
146
+ This is good enough for all built-in Vagrant provisioners (shell, ansible,
147
+ chef, and puppet) to work!
148
+
149
+ ## Other Examples
150
+
151
+ ### Multiple disks
152
+
153
+ The `disk_capacity` parameter accepts an hash with the following structure:
154
+
155
+ ```
156
+ {
157
+ disk_id => disk_size,
158
+ disk_id => disk_size,
159
+ ...
160
+ }
161
+ ```
162
+
163
+ Disk ID 1 is reserved is reserved for swap space, in the following example two disks
164
+ of 25Gb and 100Gb will be provisioned:
165
+
166
+ ```
167
+ Vagrant.configure("2") do |config|
168
+ # ... other stuff
169
+
170
+ config.vm.provider :softlayer do |sl, override|
171
+ # ... other stuff
172
+
173
+ sl.disk_capacity = { 0 => 25, 2 => 100 }
174
+ end
175
+ end
176
+ ```
177
+
178
+ ### Override SSH Username
179
+
180
+ If you're running Vagrant with an user different from root, probably you need
181
+ to override the username used for ssh connection. You can do it using the standard
182
+ Vagrant syntax:
183
+
184
+ ```
185
+ Vagrant.configure("2") do |config|
186
+ # ... other stuff
187
+
188
+ config.vm.provider :softlayer do |sl, override|
189
+ # ... other stuff
190
+
191
+ override.ssh.username = "root"
192
+ end
193
+ end
194
+ ```
195
+
196
+ ### Multiple SSH keys
197
+
198
+ Multiple SSH keys to be provisioned could be specified using an array:
199
+
200
+ ```
201
+ Vagrant.configure("2") do |config|
202
+ # ... other stuff
203
+
204
+ config.vm.provider :softlayer do |sl|
205
+ sl.api_key = "foo"
206
+ sl.username = "bar"
207
+ # ssh_keys is just an alias of ssh_key
208
+ sl.ssh_keys = ["Vagrant insecure key", "My personal key"]
209
+ end
210
+ end
211
+ ```
212
+
213
+ Also, a bunch of aliases for the `ssh_key` parameter are provided for better semantic:
214
+
215
+ * `ssh_keys`
216
+ * `ssh_key_id`
217
+ * `ssh_key_ids`
218
+ * `ssh_key_name`
219
+ * `ssh_key_names`
220
+
221
+ ## Quick Start Guide
222
+
223
+ For those new to Vagrant, see the [Quick Start Guide](https://github.com/audiolize/vagrant-softlayer/blob/master/QUICKSTART.md).
224
+
225
+ ## Development
226
+
227
+ To work on the `vagrant-softlayer` plugin, clone this repository out, and use
228
+ [Bundler](http://gembundler.com) to get the dependencies:
229
+
230
+ ```
231
+ $ bundle
232
+ ```
233
+
234
+ Once you have the dependencies, verify the unit tests pass with `rake`:
235
+
236
+ ```
237
+ $ bundle exec rake
238
+ ```
239
+
240
+ If those pass, you're ready to start developing the plugin. You can test
241
+ the plugin without installing it into your Vagrant environment by just
242
+ creating a `Vagrantfile` in the top level of this directory (it is gitignored)
243
+ and add the following line to your `Vagrantfile`:
244
+
245
+ ```
246
+ Vagrant.require_plugin "vagrant-softlayer"
247
+ ```
248
+
249
+ Use bundler to execute Vagrant:
250
+
251
+ ```
252
+ $ bundle exec vagrant up --provider=softlayer
253
+ ```
254
+
255
+ ## Credits
256
+
257
+ Emiliano Ticci (@emyl)
258
+ Julio Lajara (@ju2wheels)