vagrant-softlayer 0.3.3 → 0.4.0
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.
- checksums.yaml +4 -4
- data/.gitignore +16 -16
- data/CHANGELOG.md +61 -49
- data/QUICKSTART.md +380 -376
- data/README.md +258 -256
- data/contrib/vagrant-softlayer-boxes +418 -416
- data/contrib/vagrant-softlayer-vlans +339 -329
- data/lib/vagrant-softlayer/action/create_instance.rb +74 -74
- data/lib/vagrant-softlayer/action/setup_softlayer.rb +39 -39
- data/lib/vagrant-softlayer/action/update_dns.rb +94 -94
- data/lib/vagrant-softlayer/action/wait_for_provision.rb +40 -40
- data/lib/vagrant-softlayer/action/wait_for_rebuild.rb +38 -36
- data/lib/vagrant-softlayer/config.rb +282 -268
- data/lib/vagrant-softlayer/util/load_balancer.rb +96 -103
- data/lib/vagrant-softlayer/util/network.rb +75 -75
- data/lib/vagrant-softlayer/util/warden.rb +38 -38
- data/lib/vagrant-softlayer/version.rb +5 -5
- data/spec/vagrant-softlayer/config_spec.rb +271 -267
- data/vagrant-softlayer.gemspec +55 -55
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac525a0384060d259341b1a335869f424ffd70ed
|
4
|
+
data.tar.gz: de16e3b426f3b3123d30c7fffafd4d42dad97de9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1678d44963cf308e704329f581e992c2253086de04700830dc5f757e4ceb2adcb47f4217fd11d8df21a607fc533d4c64c06086511f9a39b79af931f229e4783
|
7
|
+
data.tar.gz: cc7179b5adbfbc5a5b8464c35ffd98d28984821a511fa07ccf31fccb9433e84cdaddf7a29868050b929a7a3eecf379de2fe8dea44139e75b1e5358a9654416f5
|
data/.gitignore
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
.DS_Store
|
2
|
-
|
3
|
-
.bundle
|
4
|
-
pkg/*
|
5
|
-
Gemfile.lock
|
6
|
-
|
7
|
-
.rspec
|
8
|
-
|
9
|
-
.vagrant
|
10
|
-
.vagrant.d/*
|
11
|
-
Vagrantfile
|
12
|
-
|
13
|
-
# Miscellaneous local stuff
|
14
|
-
example_box/*.box
|
15
|
-
scripts/*
|
16
|
-
|
1
|
+
.DS_Store
|
2
|
+
|
3
|
+
.bundle
|
4
|
+
pkg/*
|
5
|
+
Gemfile.lock
|
6
|
+
|
7
|
+
.rspec
|
8
|
+
|
9
|
+
.vagrant
|
10
|
+
.vagrant.d/*
|
11
|
+
Vagrantfile
|
12
|
+
|
13
|
+
# Miscellaneous local stuff
|
14
|
+
example_box/*.box
|
15
|
+
scripts/*
|
16
|
+
|
17
17
|
*~
|
data/CHANGELOG.md
CHANGED
@@ -1,49 +1,61 @@
|
|
1
|
-
## 0.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
-
|
12
|
-
|
13
|
-
## 0.3.
|
14
|
-
|
15
|
-
ENHANCEMENTS:
|
16
|
-
|
17
|
-
- Add
|
18
|
-
- Add
|
19
|
-
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
-
|
1
|
+
## 0.4.0 (October 1, 2014)
|
2
|
+
ENHANCEMENTS:
|
3
|
+
- Begins transition to SoftLayer API 2.x/3.x
|
4
|
+
- Add support for SoftLayer API timeout
|
5
|
+
|
6
|
+
## 0.3.4 (October 1, 2014)
|
7
|
+
ENHANCEMENTS:
|
8
|
+
- Add transaction_wait provider option.
|
9
|
+
|
10
|
+
BUG FIXES:
|
11
|
+
- Backport SoftLayer::VirtualServer#wait_until_ready to fix transaction wait problems.
|
12
|
+
|
13
|
+
## 0.3.3 (August 21, 2014)
|
14
|
+
|
15
|
+
ENHANCEMENTS:
|
16
|
+
|
17
|
+
- Add parallel execution capability.
|
18
|
+
- Add configuration variables for provision and rebuild timeout.
|
19
|
+
- Use builtin synced folders if available.
|
20
|
+
|
21
|
+
BUG FIXES:
|
22
|
+
|
23
|
+
- Raise a proper exception on timeout.
|
24
|
+
|
25
|
+
## 0.3.2 (August 1, 2014)
|
26
|
+
|
27
|
+
ENHANCEMENTS:
|
28
|
+
|
29
|
+
- Add ability to specify vlans by name or qualified name.
|
30
|
+
- Add vagrant-softlayer-vlans contrib tool.
|
31
|
+
- Add ability to force private IP address usage.
|
32
|
+
- Add quick start guide and Vagrant Cloud boxes.
|
33
|
+
|
34
|
+
BUG FIXES:
|
35
|
+
|
36
|
+
- Fix crash on destroy/rebuild when the instance don't exist.
|
37
|
+
|
38
|
+
## 0.3.1 (June 3, 2014)
|
39
|
+
|
40
|
+
BUG FIXES:
|
41
|
+
|
42
|
+
- Lock down softlayer_api gem to 1.0.x
|
43
|
+
|
44
|
+
## 0.3.0 (April 15, 2014)
|
45
|
+
|
46
|
+
NEW FEATURES:
|
47
|
+
|
48
|
+
- Add selection of disk sizes for templates.
|
49
|
+
- Add selection of block devices by id.
|
50
|
+
- Add vagrant-softlayer-boxes contrib tool for creating boxes.
|
51
|
+
- Add suspend/resume commands.
|
52
|
+
|
53
|
+
## 0.2.0 (December 5, 2013)
|
54
|
+
|
55
|
+
NEW FEATURES:
|
56
|
+
|
57
|
+
- Automatic joining of local load balancers.
|
58
|
+
|
59
|
+
## 0.1.0 (November 18, 2013)
|
60
|
+
|
61
|
+
- Initial release.
|
data/QUICKSTART.md
CHANGED
@@ -1,377 +1,381 @@
|
|
1
|
-
# vagrant-softlayer Quick Start Guide
|
2
|
-
|
3
|
-
This is quick start guide to setting up [Vagrant](http://www.vagrantup.com) and the `vagrant-softlayer`
|
4
|
-
plugin to build your first Cloud Computing Instance (CCI). While this guide will explain the process,
|
5
|
-
it is not intended as a replacement for existing documentation and you should always review the latest
|
6
|
-
documentation resources for more in depth coverage or updates as functionality changes quickly:
|
7
|
-
|
8
|
-
Resource | Description
|
9
|
-
------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
10
|
-
[Ruby](https://www.ruby-lang.org/en/) | Obligatory Ruby language documentation.
|
11
|
-
[Ruby Quick Start](https://www.ruby-lang.org/en/documentation/quickstart/) | Ruby in 20 minutes quick start guide, as its essential to understand some Ruby basics to have a proper grasp for how [Vagrant](http://www.vagrantup.com) and `Vagrantfile`s work.
|
12
|
-
[SoftLayer Developer Network](http://sldn.softlayer.com/) | SoftLayer API documentation.
|
13
|
-
[Vagrant](http://docs.vagrantup.com/v2/) | [Vagrant](http://www.vagrantup.com) documentation has a lot of sections but its worth a full read to understand what configuration options are available.
|
14
|
-
[Vagrant Cloud](https://vagrantcloud.com/) | Source for Vagrant boxes.
|
15
|
-
[Vagrant GitHub Issues](https://github.com/mitchellh/vagrant/issues) | A lot of common issues and question are opened and answered here, this is more active than the Vagrant Google Group forum.
|
16
|
-
[Vagrant Google Group Forum](https://groups.google.com/forum/#!forum/vagrant-up) | Like `Vagrant GitHub Issues`, this is another good location for finding common pitfalls, bugs, or getting help.
|
17
|
-
[Vagrant: Up and Running](http://www.amazon.com/Vagrant-Up-Running-Mitchell-Hashimoto/dp/1449335837) | [Vagrant](http://www.vagrantup.com) book by original dev released by O'Reilly.
|
18
|
-
[vagrant-softlayer](https://github.com/audiolize/vagrant-softlayer/) | Provides full documentation on available vagrant-softlayer settings.
|
19
|
-
[vagrant-softlayer Contrib Tools](https://github.com/audiolize/vagrant-softlayer/tree/master/contrib) | Provides overview of available tools to assist you with configuring and using `vagrant-softlayer`
|
20
|
-
[vagrant-softlayer Load Balancers Configuration](https://github.com/audiolize/vagrant-softlayer/wiki/Join-load-balancers) | `vagrant-softlayer` wiki page describing configuration for adding CCI to a SoftLayer Load Balancer.
|
21
|
-
[vagrantbox.es](http://www.vagrantbox.es/) | Source for [Vagrant](http://www.vagrantup.com) boxes.
|
22
|
-
[veewee](https://github.com/jedi4ever/veewee) | Veewe is a tool used to create non cloud [Vagrant](http://www.vagrantup.com) boxes.
|
23
|
-
|
24
|
-
## Vagrant History and Overiew
|
25
|
-
|
26
|
-
[Vagrant](http://www.vagrantup.com) is a wrapper around virtualization hypervisors (KVM, VirtualBox, VMWare, etc),
|
27
|
-
infrastructure as a server (IaaS) cloud providers/technology (OpenStack, SoftLayer,
|
28
|
-
DigitalOcean, Amazon AWS, etc), and configuration management tools (Ansible, Chef,
|
29
|
-
Puppet, Salt, etc). While [Vagrant](http://www.vagrantup.com) was originally only designed to support VirtualBox,
|
30
|
-
through the use of extensive plugins its feature set has grown and continues to expand.
|
31
|
-
|
32
|
-
[Vagrant](http://www.vagrantup.com) configuration revolves around 3 major components that are used to define a CCI or
|
33
|
-
vm in general on any hypervisor:
|
34
|
-
|
35
|
-
### Providers:
|
36
|
-
|
37
|
-
Provider plugins allow [Vagrant](http://www.vagrantup.com) to abstract away the automation required
|
38
|
-
to create a virtual machine on a hypervisor in a way that allows you to specify both the resource
|
39
|
-
requirements of the virtual machine (such as memory, cpu, disk, networking, peripherals) but also
|
40
|
-
allow the use of hypervisor specific settings to be used for extra configuration.
|
41
|
-
|
42
|
-
### Provisioners:
|
43
|
-
|
44
|
-
Provisioner plugins allow [Vagrant](http://www.vagrantup.com) to abstract away the automation required
|
45
|
-
to perform tasks on the virtual machine once its created. Normally this would consist of either triggering
|
46
|
-
a configuration management tool, script, or action that then modifies the virtual machine.
|
47
|
-
|
48
|
-
### Boxes:
|
49
|
-
|
50
|
-
[Vagrant](http://www.vagrantup.com) uses boxes as means to provide a pre-configured base from which to create
|
51
|
-
virtual machine instances. A box is just a zip or tar archive which contains:
|
52
|
-
|
53
|
-
* JSON metadata file describing what provider the box supports, what version the box is and other details.
|
54
|
-
* `Vagrantfile` which preconfigures the virtual machine instance or provider with specific settings (all of which
|
55
|
-
can later be overriden).
|
56
|
-
* Virtual disk image files (vmdk, img, vdi, etc) for non cloud providers (such as VirtualBox, VMWare). Since
|
57
|
-
[Vagrant](http://www.vagrantup.com) doesnt actually build an OS from scratch using typical install media as is
|
58
|
-
done with a manual install, it uses the virtual disk image to effectively clone a machine starting point on the
|
59
|
-
hypervisor.
|
60
|
-
|
61
|
-
## Install Vagrant
|
62
|
-
|
63
|
-
[Download](http://www.vagrantup.com/downloads.html) the appropriate [Vagrant](http://www.vagrantup.com)
|
64
|
-
installer for your platform and install.
|
65
|
-
|
66
|
-
## Install vagrant-softlayer
|
67
|
-
|
68
|
-
Open a terminal and run the following:
|
69
|
-
|
70
|
-
`vagrant plugin install vagrant-softlayer`
|
71
|
-
|
72
|
-
Alternatively you can also do a manual gem install if you manually download it from the RubyGems.org [vagrant-softlayer](http://rubygems.org/gems/vagrant-softlayer)
|
73
|
-
gem page:
|
74
|
-
|
75
|
-
`vagrant plugin install vagrant-softlayer-<version>.gem`
|
76
|
-
|
77
|
-
For developers wishing to extend and test `vagrant-softlayer`, a gem for manual install with your included changes
|
78
|
-
can built by running the following in the main `vagrant-softlayer` project directory:
|
79
|
-
|
80
|
-
`gem build vagrant-softlayer.gemspec`
|
81
|
-
|
82
|
-
## Install Vagrant Boxes
|
83
|
-
|
84
|
-
[Vagrant](http://www.vagrantup.com) boxes can be installed using a URI (file or web URL) for a box or a [Vagrant Cloud](https://vagrantcloud.com/)
|
85
|
-
box label used to download a box from that service.
|
86
|
-
|
87
|
-
Boxes can be created using the `vagrant-softlayer-boxes` tool located in the `contrib/` folder which is available at
|
88
|
-
`~/.vagrant.d/gems/gems/vagrant-softlayer-<version>/contrib/vagrant-softlayer-boxes` or Windows equivalent once you have
|
89
|
-
installed `vagrant-softlayer`.
|
90
|
-
|
91
|
-
If you would like to create boxes for non cloud providers, we recommend taking a look at [veewee](https://github.com/jedi4ever/veewee).
|
92
|
-
|
93
|
-
To simplify this guide and make manual box install optional, we have added boxes for SoftLayer OS templates to [Vagrant Cloud](https://vagrantcloud.com/):
|
94
|
-
|
95
|
-
Vagrant Cloud URI | Description
|
96
|
-
----------------------------------- | -----------------------------------------------------------------------------------------------------------------------------------------------------
|
97
|
-
ju2wheels/SL_CENTOS_5_32 | CentOS 5 32bit/i386
|
98
|
-
ju2wheels/SL_CENTOS_5_64 | CentOS 5 64bit/x86_64
|
99
|
-
ju2wheels/SL_CENTOS_6_32 | CentOS 6 32bit/i386
|
100
|
-
ju2wheels/SL_CENTOS_6_64 | CentOS 6 64bit/x86_64
|
101
|
-
ju2wheels/SL_CENTOS_LATEST_32 | Latest available CentOS 32bit/i386
|
102
|
-
ju2wheels/SL_CENTOS_LATEST_64 | Latest available CentOS 64bit/x86_64
|
103
|
-
ju2wheels/SL_CENTOS_LATEST | Latest available CentOS
|
104
|
-
ju2wheels/SL_CLOUDLINUX_5_32 | CloudLinux 5 32bit/i386
|
105
|
-
ju2wheels/SL_CLOUDLINUX_5_64 | CloudLinux 5 64bit/x86_64
|
106
|
-
ju2wheels/SL_CLOUDLINUX_6_32 | CloudLinux 6 32bit/i386
|
107
|
-
ju2wheels/SL_CLOUDLINUX_6_64 | CloudLinux 6 64bit/x86_64
|
108
|
-
ju2wheels/SL_CLOUDLINUX_LATEST_32 | Latest available CloudLinux 32bit/i386
|
109
|
-
ju2wheels/SL_CLOUDLINUX_LATEST_64 | Latest available CloudLinux 64bit/x86_64
|
110
|
-
ju2wheels/SL_CLOUDLINUX_LATEST | Latest available CloudLinux
|
111
|
-
ju2wheels/SL_DEBIAN_5_32 | Debian 5 32bit/i386
|
112
|
-
ju2wheels/SL_DEBIAN_5_64 | Debian 5 64bit/x86_64
|
113
|
-
ju2wheels/SL_DEBIAN_6_32 | Debian 6 32bit/i386
|
114
|
-
ju2wheels/SL_DEBIAN_6_64 | Debian 6 64bit/x86_64
|
115
|
-
ju2wheels/SL_DEBIAN_7_32 | Debian 7 32bit/i386
|
116
|
-
ju2wheels/SL_DEBIAN_7_64 | Debian 7 64bit/x86_64
|
117
|
-
ju2wheels/SL_DEBIAN_LATEST_32 | Latest available Debian 32bit/i386
|
118
|
-
ju2wheels/SL_DEBIAN_LATEST_64 | Latest available Debian 64bit/x86_64
|
119
|
-
ju2wheels/SL_DEBIAN_LATEST | Latest available Debian
|
120
|
-
ju2wheels/SL_REDHAT_5_32 | Red Hat Enterprise Linux 5 32bit/i386
|
121
|
-
ju2wheels/SL_REDHAT_5_64 | Red Hat Enterprise Linux 5 64bit/x86_64
|
122
|
-
ju2wheels/SL_REDHAT_6_32 | Red Hat Enterprise Linux 6 32bit/i386
|
123
|
-
ju2wheels/SL_REDHAT_6_64 | Red Hat Enterprise Linux 6 64bit/x86_64
|
124
|
-
ju2wheels/SL_REDHAT_LATEST_32 | Latest available Red Hat Enterprise Linux 32bit/i386
|
125
|
-
ju2wheels/SL_REDHAT_LATEST_64 | Latest available Red Hat Enterprise Linux 64bit/x86_64
|
126
|
-
ju2wheels/SL_REDHAT_LATEST | Latest available Red Hat Enterprise Linux
|
127
|
-
ju2wheels/SL_GENERIC | Generic SoftLayer box with no OS template defined, you will have to explicity set `operating_system`/`disk_capacity` or `image_guid` in your provider
|
128
|
-
ju2wheels/SL_UBUNTU_10_32 | Ubuntu 10.04 LTS 32bit/i386
|
129
|
-
ju2wheels/SL_UBUNTU_10_64 | Ubuntu 10.04 LTS 64bit/x86_64
|
130
|
-
ju2wheels/SL_UBUNTU_12_32 | Ubuntu 12.04 LTS 32bit/i386
|
131
|
-
ju2wheels/SL_UBUNTU_12_64 | Ubuntu 12.04 LTS 64bit/x86_64
|
132
|
-
ju2wheels/SL_UBUNTU_14_32 | Ubuntu 14.04 LTS 32bit/i386
|
133
|
-
ju2wheels/SL_UBUNTU_14_64 | Ubuntu 14.04 LTS 64bit/x86_64
|
134
|
-
ju2wheels/SL_UBUNTU_8_32 | Ubuntu 8.04 LTS 32bit/i386
|
135
|
-
ju2wheels/SL_UBUNTU_8_64 | Ubuntu 8.04 LTS 64bit/x86_64
|
136
|
-
ju2wheels/SL_UBUNTU_LATEST_32 | Latest available Ubuntu 32bit/i386
|
137
|
-
ju2wheels/SL_UBUNTU_LATEST_64 | Latest available Ubuntu 64bit/x86_64
|
138
|
-
ju2wheels/SL_UBUNTU_LATEST | Latest available Ubuntu
|
139
|
-
ju2wheels/SL_VYATTACE_6.5_64 | Vyatta Community Edition 6.5 64bit/x86_64
|
140
|
-
ju2wheels/SL_VYATTACE_6.6_64 | Vyatta Community Edition 6.6 64bit/x86_64
|
141
|
-
ju2wheels/SL_VYATTACE_LATEST_64 | Latest available Vyatta Community Edition 64bit/x86_64
|
142
|
-
ju2wheels/SL_VYATTACE_LATEST | Latest available Vyatta Community Edition
|
143
|
-
ju2wheels/SL_WIN_2003-DC-SP2-1_32 | Windows 2003 Datacenter Edition SP2 32bit
|
144
|
-
ju2wheels/SL_WIN_2003-DC-SP2-1_64 | Windows 2003 Datacenter Edition SP2 64bit
|
145
|
-
ju2wheels/SL_WIN_2003-ENT-SP2-5_32 | Windows 2003 Enterprise Edition SP2 32bit
|
146
|
-
ju2wheels/SL_WIN_2003-ENT-SP2-5_64 | Windows 2003 Enterprise Edition SP2 64bit
|
147
|
-
ju2wheels/SL_WIN_2003-STD-SP2-5_32 | Windows 2003 Standard Edition SP2 32bit
|
148
|
-
ju2wheels/SL_WIN_2003-STD-SP2-5_64 | Windows 2003 Standard Edition SP2 64bit
|
149
|
-
ju2wheels/SL_WIN_2008-DC-R2_64 | Windows 2008 R2 Datacenter Edition 64bit
|
150
|
-
ju2wheels/SL_WIN_2008-DC-SP2_32 | Windows 2008 Datacenter Edition SP2 32bit
|
151
|
-
ju2wheels/SL_WIN_2008-DC-SP2_64 | Windows 2008 Datacenter Edition SP2 64bit
|
152
|
-
ju2wheels/SL_WIN_2008-ENT-R2_64 | Windows 2008 R2 Enterprise Edition 64bit
|
153
|
-
ju2wheels/SL_WIN_2008-ENT-SP2_32 | Windows 2008 Enterprise Edition SP2 32bit
|
154
|
-
ju2wheels/SL_WIN_2008-ENT-SP2_64 | Windows 2008 Enterprise Edition SP2 64bit
|
155
|
-
ju2wheels/SL_WIN_2008-STD-R2_64 | Windows 2008 R2 Standard Edition 64bit
|
156
|
-
ju2wheels/SL_WIN_2008-STD-R2-SP1_64 | Windows 2008 R2 Standard Edition SP1 64bit
|
157
|
-
ju2wheels/SL_WIN_2008-STD-SP2_32 | Windows 2008 Standard Edition SP2 32bit
|
158
|
-
ju2wheels/SL_WIN_2008-STD-SP2_64 | Windows 2008 Standard Edition SP2 64bit
|
159
|
-
ju2wheels/SL_WIN_2012-DC_64 | Windows 2012 Datacenter Edition 64bit
|
160
|
-
ju2wheels/SL_WIN_2012-STD_64 | Windows 2012 Standard Edition 64bit
|
161
|
-
ju2wheels/SL_WIN_LATEST_32 | Latest available Windows 32bit
|
162
|
-
ju2wheels/SL_WIN_LATEST_64 | Latest available Windows 64bit
|
163
|
-
ju2wheels/SL_WIN_LATEST | Latest available Windows
|
164
|
-
|
165
|
-
Install box from URI:
|
166
|
-
`vagrant box add BOXNAME URI`
|
167
|
-
|
168
|
-
Install box from [Vagrant Cloud](https://vagrantcloud.com/):
|
169
|
-
`vagrant box add 'USERNAME/BOXNAME'`
|
170
|
-
|
171
|
-
## Vagrant Box Standards vs SoftLayer Standards
|
172
|
-
|
173
|
-
When creating or using [Vagrant](http://www.vagrantup.com), the accepted community standard is that
|
174
|
-
the image be built with a default of having a `vagrant` user, with `vagrant` as the password, and
|
175
|
-
the [Vagrant insecure public key](https://github.com/mitchellh/vagrant/blob/master/keys/vagrant.pub)
|
176
|
-
applied to the `vagrant` user for ssh (the private key is always available to vagrant under
|
177
|
-
`~/.vagrant.d/insecure_private_key`).
|
178
|
-
|
179
|
-
Since SoftLayer doesnt really use [Vagrant](http://www.vagrantup.com), their image standards are bit
|
180
|
-
different. As shown in example template below, it is necessary to change the default user for the OS
|
181
|
-
you are using from `vagrant` to `root` (in the case of Linux).
|
182
|
-
|
183
|
-
If you do not want to use password based logins, you will also have to set your public ssh keys in
|
184
|
-
your SoftLayer portal, assign the name labels you set to `sl.ssh_keys`, and the path to their equivalent
|
185
|
-
private key half in `cci.ssh.private_key_path`.
|
186
|
-
|
187
|
-
## Working with a Vagrantfile to define CCI(s)
|
188
|
-
|
189
|
-
A `Vagrantfile` is the "configuration" file used by [Vagrant](http://www.vagrantup.com) when performing
|
190
|
-
actions against a virtual machine. Although its used as a configuration file, it is really a standard
|
191
|
-
Ruby file and anything that can be done in a normal Ruby script can also be accomplished in the
|
192
|
-
`Vagrantfile`.
|
193
|
-
|
194
|
-
A `Vagrantfile` supports two styles of virtual machine definitions, one supports a single virtual machine
|
195
|
-
and the other supports specifiying the definition of multiple virtual machines in a single file.
|
196
|
-
|
197
|
-
Single Virtual Machine:
|
198
|
-
```
|
199
|
-
Vagrant.configure("2") do |config|
|
200
|
-
# ... vm settings
|
201
|
-
|
202
|
-
config.vm.provider :softlayer do |sl|
|
203
|
-
sl.api_key = "foo"
|
204
|
-
sl.username = "bar"
|
205
|
-
sl.ssh_key = "Vagrant insecure key"
|
206
|
-
end
|
207
|
-
end
|
208
|
-
```
|
209
|
-
|
210
|
-
Multiple Virtual Machines:
|
211
|
-
```
|
212
|
-
Vagrant.configure("2") do |config|
|
213
|
-
# ... shared vm settings
|
214
|
-
|
215
|
-
config.vm.define "sl_cci_shorthostname" do |cci|
|
216
|
-
cci.vm.provider :softlayer do |sl|
|
217
|
-
sl.api_key = "foo"
|
218
|
-
sl.username = "bar"
|
219
|
-
sl.ssh_key = "Vagrant insecure key"
|
220
|
-
end
|
221
|
-
end
|
222
|
-
|
223
|
-
config.vm.define "sl_cci2_shorthostname" do |cci2|
|
224
|
-
cci2.vm.provider :softlayer do |sl|
|
225
|
-
sl.api_key = "foo"
|
226
|
-
sl.username = "bar"
|
227
|
-
sl.ssh_key = "Vagrant insecure key"
|
228
|
-
end
|
229
|
-
end
|
230
|
-
end
|
231
|
-
```
|
232
|
-
|
233
|
-
Lastly, we provide what a more complete template of what a Vagrantfile might contain when creating a CCI:
|
234
|
-
|
235
|
-
```
|
236
|
-
Vagrant.require_version ">= 1.5.2"
|
237
|
-
|
238
|
-
Vagrant.configure(2) do |config|
|
239
|
-
#See http://docs.vagrantup.com/v2/vagrantfile/vagrant_settings.html
|
240
|
-
config.vagrant.host = :detect
|
241
|
-
|
242
|
-
config.vm.define "sl_cci_shortname" do |cci|
|
243
|
-
#See http://docs.vagrantup.com/v2/vagrantfile/index.html
|
244
|
-
cci.vm.box = "ju2wheels/SL_GENERIC"
|
245
|
-
cci.vm.hostname = "sl-vagrant-cci"
|
246
|
-
#cci.vm.boot_timeout = 300
|
247
|
-
#cci.vm.box_check_update = false
|
248
|
-
#cci.vm.box_download_checksum = nil
|
249
|
-
#cci.vm.box_download_checksum_type = nil
|
250
|
-
#cci.vm.box_download_client_cert = nil
|
251
|
-
#cci.vm.box_download_insecure = false
|
252
|
-
#cci.vm.box_url = "https://vagrantcloud.com/ju2wheels/SL_GENERIC/version/1/provider/softlayer.box"
|
253
|
-
#cci.vm.box_version = ">=0"
|
254
|
-
#cci.vm.graceful_halt_timeout = 300
|
255
|
-
#cci.vm.guest = :linux
|
256
|
-
#cci.vm.usable_port_range = 2200..2250
|
257
|
-
|
258
|
-
#See http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html
|
259
|
-
cci.ssh.forward_agent = true
|
260
|
-
cci.ssh.forward_x11 = false
|
261
|
-
#cci.ssh.guest_port = 22
|
262
|
-
#cci.ssh.host = nil #Normally determined by provider
|
263
|
-
#cci.ssh.insert_key = true
|
264
|
-
#cci.ssh.password = nil
|
265
|
-
#cci.ssh.port = 22
|
266
|
-
#cci.ssh.private_key_path = [ File.expand_path("~/.ssh/id_rsa") ]
|
267
|
-
#cci.ssh.pty = false #Warning this setting is not recommended and can break things, recommended to create flex image with sudoers fixed for problematic distros
|
268
|
-
#See https://github.com/audiolize/vagrant-softlayer/issues/11
|
269
|
-
#cci.ssh.shell = "bash -l"
|
270
|
-
#cci.ssh.username = "vagrant"
|
271
|
-
|
272
|
-
#Windows specific config options for vagrant-windows plugin
|
273
|
-
#cci.windows.halt_check_interval = 1 if Vagrant.has_plugin?("vagrant-windows")
|
274
|
-
#cci.windows.halt_timeout = 30 if Vagrant.has_plugin?("vagrant-windows")
|
275
|
-
cci.windows.set_work_network = true if Vagrant.has_plugin?("vagrant-windows")
|
276
|
-
#cci.winrm.guest_port = 5985 if Vagrant.has_plugin?("vagrant-windows")
|
277
|
-
#cci.winrm.host = "localhost" if Vagrant.has_plugin?("vagrant-windows")
|
278
|
-
#cci.winrm.max_tries = 20 if Vagrant.has_plugin?("vagrant-windows")
|
279
|
-
#cci.winrm.password = "vagrant" if Vagrant.has_plugin?("vagrant-windows")
|
280
|
-
#cci.winrm.port = 5985 if Vagrant.has_plugin?("vagrant-windows")
|
281
|
-
#cci.winrm.timeout = 1800 if Vagrant.has_plugin?("vagrant-windows")
|
282
|
-
cci.winrm.username = "vagrant" if Vagrant.has_plugin?("vagrant-windows")
|
283
|
-
|
284
|
-
#See http://docs.vagrantup.com/v2/networking/index.html
|
285
|
-
#cci.vm.network :forwarded_port, guest: 22, guest_ip: nil, host:2222, host_ip: nil, protocol: "tcp", auto_correct: true
|
286
|
-
|
287
|
-
#Always put the private network before the public so it matches SoftLayer (when using VirtualBox or other hypervisor), eth0 is private and eth1 public, they are created in order provided
|
288
|
-
#cci.vm.network :private_network, type: "dhcp", ip: nil, auto_config: true, virtualbox__intnet: true
|
289
|
-
#cci.vm.network :private_network, type: "static", ip: "192.168.10.5", auto_config: true, virtualbox__intnet: "internalnetname"
|
290
|
-
#cci.vm.network :public_network, type: "dhcp", ip: nil, auto_config: true, virtualbox__intnet: false, bridge: "wlan0"
|
291
|
-
#cci.vm.network :public_network, type: "static", ip: '192.168.1.20', auto_config: true, virtualbox__intnet: false, bridge: "wlan0"
|
292
|
-
|
293
|
-
#See http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
|
294
|
-
#Guest must have NFS, if using VirtualBox there must be a private network with static IP present, may require root privs (it will prompt)
|
295
|
-
#cci.vm.synced_folder ".", "/vagrant", disabled: false, create: false, group: "root", owner: "root", type: "nfs", nfs_udp: true, nfs_version: 3, mount_options: []
|
296
|
-
#cci.vm.synced_folder ".", "/vagrant", disabled: false, create: false, group: "root", owner: "root", type: "rsync", rsync__args: ["--verbose", "--archive", "--delete", "-z"],
|
297
|
-
# rsync__auto: true, rsync__exclude: [ ".vagrant", ".git"], mount_options: []
|
298
|
-
#cci.vm.synced_folder ".", "/vagrant", disabled: false, create: false, group: "root", owner: "root", type: "smb", smb_host: nil, smb_username: nil, smb_password: nil, mount_options: []
|
299
|
-
|
300
|
-
cci.vm.provider :softlayer do |sl, cci_override|
|
301
|
-
#Override the default setting only if using this provider
|
302
|
-
cci_override.vm.box = "ju2wheels/SL_CENTOS_6_64"
|
303
|
-
cci_override.ssh.username = "root"
|
304
|
-
|
305
|
-
#Note: If you use SL_GENERIC box you must set sl.image_guid or sl.operating_system/sl.dis_capacity, otherwise it is pre-set for you by the box
|
306
|
-
|
307
|
-
sl.api_key = ENV["SL_API_KEY"]
|
308
|
-
#sl.
|
309
|
-
#sl.
|
310
|
-
#sl.
|
311
|
-
sl.
|
312
|
-
|
313
|
-
#sl.
|
314
|
-
sl.
|
315
|
-
|
316
|
-
#sl.
|
317
|
-
sl.
|
318
|
-
|
319
|
-
#sl.
|
320
|
-
#sl.
|
321
|
-
#sl.
|
322
|
-
#sl.
|
323
|
-
#sl.
|
324
|
-
sl.
|
325
|
-
#sl.
|
326
|
-
#sl.
|
327
|
-
sl.
|
328
|
-
#sl.
|
329
|
-
#sl.
|
330
|
-
|
331
|
-
|
332
|
-
#sl.
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
#
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
#
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
#
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
1
|
+
# vagrant-softlayer Quick Start Guide
|
2
|
+
|
3
|
+
This is quick start guide to setting up [Vagrant](http://www.vagrantup.com) and the `vagrant-softlayer`
|
4
|
+
plugin to build your first Cloud Computing Instance (CCI). While this guide will explain the process,
|
5
|
+
it is not intended as a replacement for existing documentation and you should always review the latest
|
6
|
+
documentation resources for more in depth coverage or updates as functionality changes quickly:
|
7
|
+
|
8
|
+
Resource | Description
|
9
|
+
------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
10
|
+
[Ruby](https://www.ruby-lang.org/en/) | Obligatory Ruby language documentation.
|
11
|
+
[Ruby Quick Start](https://www.ruby-lang.org/en/documentation/quickstart/) | Ruby in 20 minutes quick start guide, as its essential to understand some Ruby basics to have a proper grasp for how [Vagrant](http://www.vagrantup.com) and `Vagrantfile`s work.
|
12
|
+
[SoftLayer Developer Network](http://sldn.softlayer.com/) | SoftLayer API documentation.
|
13
|
+
[Vagrant](http://docs.vagrantup.com/v2/) | [Vagrant](http://www.vagrantup.com) documentation has a lot of sections but its worth a full read to understand what configuration options are available.
|
14
|
+
[Vagrant Cloud](https://vagrantcloud.com/) | Source for Vagrant boxes.
|
15
|
+
[Vagrant GitHub Issues](https://github.com/mitchellh/vagrant/issues) | A lot of common issues and question are opened and answered here, this is more active than the Vagrant Google Group forum.
|
16
|
+
[Vagrant Google Group Forum](https://groups.google.com/forum/#!forum/vagrant-up) | Like `Vagrant GitHub Issues`, this is another good location for finding common pitfalls, bugs, or getting help.
|
17
|
+
[Vagrant: Up and Running](http://www.amazon.com/Vagrant-Up-Running-Mitchell-Hashimoto/dp/1449335837) | [Vagrant](http://www.vagrantup.com) book by original dev released by O'Reilly.
|
18
|
+
[vagrant-softlayer](https://github.com/audiolize/vagrant-softlayer/) | Provides full documentation on available vagrant-softlayer settings.
|
19
|
+
[vagrant-softlayer Contrib Tools](https://github.com/audiolize/vagrant-softlayer/tree/master/contrib) | Provides overview of available tools to assist you with configuring and using `vagrant-softlayer`
|
20
|
+
[vagrant-softlayer Load Balancers Configuration](https://github.com/audiolize/vagrant-softlayer/wiki/Join-load-balancers) | `vagrant-softlayer` wiki page describing configuration for adding CCI to a SoftLayer Load Balancer.
|
21
|
+
[vagrantbox.es](http://www.vagrantbox.es/) | Source for [Vagrant](http://www.vagrantup.com) boxes.
|
22
|
+
[veewee](https://github.com/jedi4ever/veewee) | Veewe is a tool used to create non cloud [Vagrant](http://www.vagrantup.com) boxes.
|
23
|
+
|
24
|
+
## Vagrant History and Overiew
|
25
|
+
|
26
|
+
[Vagrant](http://www.vagrantup.com) is a wrapper around virtualization hypervisors (KVM, VirtualBox, VMWare, etc),
|
27
|
+
infrastructure as a server (IaaS) cloud providers/technology (OpenStack, SoftLayer,
|
28
|
+
DigitalOcean, Amazon AWS, etc), and configuration management tools (Ansible, Chef,
|
29
|
+
Puppet, Salt, etc). While [Vagrant](http://www.vagrantup.com) was originally only designed to support VirtualBox,
|
30
|
+
through the use of extensive plugins its feature set has grown and continues to expand.
|
31
|
+
|
32
|
+
[Vagrant](http://www.vagrantup.com) configuration revolves around 3 major components that are used to define a CCI or
|
33
|
+
vm in general on any hypervisor:
|
34
|
+
|
35
|
+
### Providers:
|
36
|
+
|
37
|
+
Provider plugins allow [Vagrant](http://www.vagrantup.com) to abstract away the automation required
|
38
|
+
to create a virtual machine on a hypervisor in a way that allows you to specify both the resource
|
39
|
+
requirements of the virtual machine (such as memory, cpu, disk, networking, peripherals) but also
|
40
|
+
allow the use of hypervisor specific settings to be used for extra configuration.
|
41
|
+
|
42
|
+
### Provisioners:
|
43
|
+
|
44
|
+
Provisioner plugins allow [Vagrant](http://www.vagrantup.com) to abstract away the automation required
|
45
|
+
to perform tasks on the virtual machine once its created. Normally this would consist of either triggering
|
46
|
+
a configuration management tool, script, or action that then modifies the virtual machine.
|
47
|
+
|
48
|
+
### Boxes:
|
49
|
+
|
50
|
+
[Vagrant](http://www.vagrantup.com) uses boxes as means to provide a pre-configured base from which to create
|
51
|
+
virtual machine instances. A box is just a zip or tar archive which contains:
|
52
|
+
|
53
|
+
* JSON metadata file describing what provider the box supports, what version the box is and other details.
|
54
|
+
* `Vagrantfile` which preconfigures the virtual machine instance or provider with specific settings (all of which
|
55
|
+
can later be overriden).
|
56
|
+
* Virtual disk image files (vmdk, img, vdi, etc) for non cloud providers (such as VirtualBox, VMWare). Since
|
57
|
+
[Vagrant](http://www.vagrantup.com) doesnt actually build an OS from scratch using typical install media as is
|
58
|
+
done with a manual install, it uses the virtual disk image to effectively clone a machine starting point on the
|
59
|
+
hypervisor.
|
60
|
+
|
61
|
+
## Install Vagrant
|
62
|
+
|
63
|
+
[Download](http://www.vagrantup.com/downloads.html) the appropriate [Vagrant](http://www.vagrantup.com)
|
64
|
+
installer for your platform and install.
|
65
|
+
|
66
|
+
## Install vagrant-softlayer
|
67
|
+
|
68
|
+
Open a terminal and run the following:
|
69
|
+
|
70
|
+
`vagrant plugin install vagrant-softlayer`
|
71
|
+
|
72
|
+
Alternatively you can also do a manual gem install if you manually download it from the RubyGems.org [vagrant-softlayer](http://rubygems.org/gems/vagrant-softlayer)
|
73
|
+
gem page:
|
74
|
+
|
75
|
+
`vagrant plugin install vagrant-softlayer-<version>.gem`
|
76
|
+
|
77
|
+
For developers wishing to extend and test `vagrant-softlayer`, a gem for manual install with your included changes
|
78
|
+
can built by running the following in the main `vagrant-softlayer` project directory:
|
79
|
+
|
80
|
+
`gem build vagrant-softlayer.gemspec`
|
81
|
+
|
82
|
+
## Install Vagrant Boxes
|
83
|
+
|
84
|
+
[Vagrant](http://www.vagrantup.com) boxes can be installed using a URI (file or web URL) for a box or a [Vagrant Cloud](https://vagrantcloud.com/)
|
85
|
+
box label used to download a box from that service.
|
86
|
+
|
87
|
+
Boxes can be created using the `vagrant-softlayer-boxes` tool located in the `contrib/` folder which is available at
|
88
|
+
`~/.vagrant.d/gems/gems/vagrant-softlayer-<version>/contrib/vagrant-softlayer-boxes` or Windows equivalent once you have
|
89
|
+
installed `vagrant-softlayer`.
|
90
|
+
|
91
|
+
If you would like to create boxes for non cloud providers, we recommend taking a look at [veewee](https://github.com/jedi4ever/veewee).
|
92
|
+
|
93
|
+
To simplify this guide and make manual box install optional, we have added boxes for SoftLayer OS templates to [Vagrant Cloud](https://vagrantcloud.com/):
|
94
|
+
|
95
|
+
Vagrant Cloud URI | Description
|
96
|
+
----------------------------------- | -----------------------------------------------------------------------------------------------------------------------------------------------------
|
97
|
+
ju2wheels/SL_CENTOS_5_32 | CentOS 5 32bit/i386
|
98
|
+
ju2wheels/SL_CENTOS_5_64 | CentOS 5 64bit/x86_64
|
99
|
+
ju2wheels/SL_CENTOS_6_32 | CentOS 6 32bit/i386
|
100
|
+
ju2wheels/SL_CENTOS_6_64 | CentOS 6 64bit/x86_64
|
101
|
+
ju2wheels/SL_CENTOS_LATEST_32 | Latest available CentOS 32bit/i386
|
102
|
+
ju2wheels/SL_CENTOS_LATEST_64 | Latest available CentOS 64bit/x86_64
|
103
|
+
ju2wheels/SL_CENTOS_LATEST | Latest available CentOS
|
104
|
+
ju2wheels/SL_CLOUDLINUX_5_32 | CloudLinux 5 32bit/i386
|
105
|
+
ju2wheels/SL_CLOUDLINUX_5_64 | CloudLinux 5 64bit/x86_64
|
106
|
+
ju2wheels/SL_CLOUDLINUX_6_32 | CloudLinux 6 32bit/i386
|
107
|
+
ju2wheels/SL_CLOUDLINUX_6_64 | CloudLinux 6 64bit/x86_64
|
108
|
+
ju2wheels/SL_CLOUDLINUX_LATEST_32 | Latest available CloudLinux 32bit/i386
|
109
|
+
ju2wheels/SL_CLOUDLINUX_LATEST_64 | Latest available CloudLinux 64bit/x86_64
|
110
|
+
ju2wheels/SL_CLOUDLINUX_LATEST | Latest available CloudLinux
|
111
|
+
ju2wheels/SL_DEBIAN_5_32 | Debian 5 32bit/i386
|
112
|
+
ju2wheels/SL_DEBIAN_5_64 | Debian 5 64bit/x86_64
|
113
|
+
ju2wheels/SL_DEBIAN_6_32 | Debian 6 32bit/i386
|
114
|
+
ju2wheels/SL_DEBIAN_6_64 | Debian 6 64bit/x86_64
|
115
|
+
ju2wheels/SL_DEBIAN_7_32 | Debian 7 32bit/i386
|
116
|
+
ju2wheels/SL_DEBIAN_7_64 | Debian 7 64bit/x86_64
|
117
|
+
ju2wheels/SL_DEBIAN_LATEST_32 | Latest available Debian 32bit/i386
|
118
|
+
ju2wheels/SL_DEBIAN_LATEST_64 | Latest available Debian 64bit/x86_64
|
119
|
+
ju2wheels/SL_DEBIAN_LATEST | Latest available Debian
|
120
|
+
ju2wheels/SL_REDHAT_5_32 | Red Hat Enterprise Linux 5 32bit/i386
|
121
|
+
ju2wheels/SL_REDHAT_5_64 | Red Hat Enterprise Linux 5 64bit/x86_64
|
122
|
+
ju2wheels/SL_REDHAT_6_32 | Red Hat Enterprise Linux 6 32bit/i386
|
123
|
+
ju2wheels/SL_REDHAT_6_64 | Red Hat Enterprise Linux 6 64bit/x86_64
|
124
|
+
ju2wheels/SL_REDHAT_LATEST_32 | Latest available Red Hat Enterprise Linux 32bit/i386
|
125
|
+
ju2wheels/SL_REDHAT_LATEST_64 | Latest available Red Hat Enterprise Linux 64bit/x86_64
|
126
|
+
ju2wheels/SL_REDHAT_LATEST | Latest available Red Hat Enterprise Linux
|
127
|
+
ju2wheels/SL_GENERIC | Generic SoftLayer box with no OS template defined, you will have to explicity set `operating_system`/`disk_capacity` or `image_guid` in your provider
|
128
|
+
ju2wheels/SL_UBUNTU_10_32 | Ubuntu 10.04 LTS 32bit/i386
|
129
|
+
ju2wheels/SL_UBUNTU_10_64 | Ubuntu 10.04 LTS 64bit/x86_64
|
130
|
+
ju2wheels/SL_UBUNTU_12_32 | Ubuntu 12.04 LTS 32bit/i386
|
131
|
+
ju2wheels/SL_UBUNTU_12_64 | Ubuntu 12.04 LTS 64bit/x86_64
|
132
|
+
ju2wheels/SL_UBUNTU_14_32 | Ubuntu 14.04 LTS 32bit/i386
|
133
|
+
ju2wheels/SL_UBUNTU_14_64 | Ubuntu 14.04 LTS 64bit/x86_64
|
134
|
+
ju2wheels/SL_UBUNTU_8_32 | Ubuntu 8.04 LTS 32bit/i386
|
135
|
+
ju2wheels/SL_UBUNTU_8_64 | Ubuntu 8.04 LTS 64bit/x86_64
|
136
|
+
ju2wheels/SL_UBUNTU_LATEST_32 | Latest available Ubuntu 32bit/i386
|
137
|
+
ju2wheels/SL_UBUNTU_LATEST_64 | Latest available Ubuntu 64bit/x86_64
|
138
|
+
ju2wheels/SL_UBUNTU_LATEST | Latest available Ubuntu
|
139
|
+
ju2wheels/SL_VYATTACE_6.5_64 | Vyatta Community Edition 6.5 64bit/x86_64
|
140
|
+
ju2wheels/SL_VYATTACE_6.6_64 | Vyatta Community Edition 6.6 64bit/x86_64
|
141
|
+
ju2wheels/SL_VYATTACE_LATEST_64 | Latest available Vyatta Community Edition 64bit/x86_64
|
142
|
+
ju2wheels/SL_VYATTACE_LATEST | Latest available Vyatta Community Edition
|
143
|
+
ju2wheels/SL_WIN_2003-DC-SP2-1_32 | Windows 2003 Datacenter Edition SP2 32bit
|
144
|
+
ju2wheels/SL_WIN_2003-DC-SP2-1_64 | Windows 2003 Datacenter Edition SP2 64bit
|
145
|
+
ju2wheels/SL_WIN_2003-ENT-SP2-5_32 | Windows 2003 Enterprise Edition SP2 32bit
|
146
|
+
ju2wheels/SL_WIN_2003-ENT-SP2-5_64 | Windows 2003 Enterprise Edition SP2 64bit
|
147
|
+
ju2wheels/SL_WIN_2003-STD-SP2-5_32 | Windows 2003 Standard Edition SP2 32bit
|
148
|
+
ju2wheels/SL_WIN_2003-STD-SP2-5_64 | Windows 2003 Standard Edition SP2 64bit
|
149
|
+
ju2wheels/SL_WIN_2008-DC-R2_64 | Windows 2008 R2 Datacenter Edition 64bit
|
150
|
+
ju2wheels/SL_WIN_2008-DC-SP2_32 | Windows 2008 Datacenter Edition SP2 32bit
|
151
|
+
ju2wheels/SL_WIN_2008-DC-SP2_64 | Windows 2008 Datacenter Edition SP2 64bit
|
152
|
+
ju2wheels/SL_WIN_2008-ENT-R2_64 | Windows 2008 R2 Enterprise Edition 64bit
|
153
|
+
ju2wheels/SL_WIN_2008-ENT-SP2_32 | Windows 2008 Enterprise Edition SP2 32bit
|
154
|
+
ju2wheels/SL_WIN_2008-ENT-SP2_64 | Windows 2008 Enterprise Edition SP2 64bit
|
155
|
+
ju2wheels/SL_WIN_2008-STD-R2_64 | Windows 2008 R2 Standard Edition 64bit
|
156
|
+
ju2wheels/SL_WIN_2008-STD-R2-SP1_64 | Windows 2008 R2 Standard Edition SP1 64bit
|
157
|
+
ju2wheels/SL_WIN_2008-STD-SP2_32 | Windows 2008 Standard Edition SP2 32bit
|
158
|
+
ju2wheels/SL_WIN_2008-STD-SP2_64 | Windows 2008 Standard Edition SP2 64bit
|
159
|
+
ju2wheels/SL_WIN_2012-DC_64 | Windows 2012 Datacenter Edition 64bit
|
160
|
+
ju2wheels/SL_WIN_2012-STD_64 | Windows 2012 Standard Edition 64bit
|
161
|
+
ju2wheels/SL_WIN_LATEST_32 | Latest available Windows 32bit
|
162
|
+
ju2wheels/SL_WIN_LATEST_64 | Latest available Windows 64bit
|
163
|
+
ju2wheels/SL_WIN_LATEST | Latest available Windows
|
164
|
+
|
165
|
+
Install box from URI:
|
166
|
+
`vagrant box add BOXNAME URI`
|
167
|
+
|
168
|
+
Install box from [Vagrant Cloud](https://vagrantcloud.com/):
|
169
|
+
`vagrant box add 'USERNAME/BOXNAME'`
|
170
|
+
|
171
|
+
## Vagrant Box Standards vs SoftLayer Standards
|
172
|
+
|
173
|
+
When creating or using [Vagrant](http://www.vagrantup.com), the accepted community standard is that
|
174
|
+
the image be built with a default of having a `vagrant` user, with `vagrant` as the password, and
|
175
|
+
the [Vagrant insecure public key](https://github.com/mitchellh/vagrant/blob/master/keys/vagrant.pub)
|
176
|
+
applied to the `vagrant` user for ssh (the private key is always available to vagrant under
|
177
|
+
`~/.vagrant.d/insecure_private_key`).
|
178
|
+
|
179
|
+
Since SoftLayer doesnt really use [Vagrant](http://www.vagrantup.com), their image standards are bit
|
180
|
+
different. As shown in example template below, it is necessary to change the default user for the OS
|
181
|
+
you are using from `vagrant` to `root` (in the case of Linux).
|
182
|
+
|
183
|
+
If you do not want to use password based logins, you will also have to set your public ssh keys in
|
184
|
+
your SoftLayer portal, assign the name labels you set to `sl.ssh_keys`, and the path to their equivalent
|
185
|
+
private key half in `cci.ssh.private_key_path`.
|
186
|
+
|
187
|
+
## Working with a Vagrantfile to define CCI(s)
|
188
|
+
|
189
|
+
A `Vagrantfile` is the "configuration" file used by [Vagrant](http://www.vagrantup.com) when performing
|
190
|
+
actions against a virtual machine. Although its used as a configuration file, it is really a standard
|
191
|
+
Ruby file and anything that can be done in a normal Ruby script can also be accomplished in the
|
192
|
+
`Vagrantfile`.
|
193
|
+
|
194
|
+
A `Vagrantfile` supports two styles of virtual machine definitions, one supports a single virtual machine
|
195
|
+
and the other supports specifiying the definition of multiple virtual machines in a single file.
|
196
|
+
|
197
|
+
Single Virtual Machine:
|
198
|
+
```
|
199
|
+
Vagrant.configure("2") do |config|
|
200
|
+
# ... vm settings
|
201
|
+
|
202
|
+
config.vm.provider :softlayer do |sl|
|
203
|
+
sl.api_key = "foo"
|
204
|
+
sl.username = "bar"
|
205
|
+
sl.ssh_key = "Vagrant insecure key"
|
206
|
+
end
|
207
|
+
end
|
208
|
+
```
|
209
|
+
|
210
|
+
Multiple Virtual Machines:
|
211
|
+
```
|
212
|
+
Vagrant.configure("2") do |config|
|
213
|
+
# ... shared vm settings
|
214
|
+
|
215
|
+
config.vm.define "sl_cci_shorthostname" do |cci|
|
216
|
+
cci.vm.provider :softlayer do |sl|
|
217
|
+
sl.api_key = "foo"
|
218
|
+
sl.username = "bar"
|
219
|
+
sl.ssh_key = "Vagrant insecure key"
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
config.vm.define "sl_cci2_shorthostname" do |cci2|
|
224
|
+
cci2.vm.provider :softlayer do |sl|
|
225
|
+
sl.api_key = "foo"
|
226
|
+
sl.username = "bar"
|
227
|
+
sl.ssh_key = "Vagrant insecure key"
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
```
|
232
|
+
|
233
|
+
Lastly, we provide what a more complete template of what a Vagrantfile might contain when creating a CCI:
|
234
|
+
|
235
|
+
```
|
236
|
+
Vagrant.require_version ">= 1.5.2"
|
237
|
+
|
238
|
+
Vagrant.configure(2) do |config|
|
239
|
+
#See http://docs.vagrantup.com/v2/vagrantfile/vagrant_settings.html
|
240
|
+
config.vagrant.host = :detect
|
241
|
+
|
242
|
+
config.vm.define "sl_cci_shortname" do |cci|
|
243
|
+
#See http://docs.vagrantup.com/v2/vagrantfile/index.html
|
244
|
+
cci.vm.box = "ju2wheels/SL_GENERIC"
|
245
|
+
cci.vm.hostname = "sl-vagrant-cci"
|
246
|
+
#cci.vm.boot_timeout = 300
|
247
|
+
#cci.vm.box_check_update = false
|
248
|
+
#cci.vm.box_download_checksum = nil
|
249
|
+
#cci.vm.box_download_checksum_type = nil
|
250
|
+
#cci.vm.box_download_client_cert = nil
|
251
|
+
#cci.vm.box_download_insecure = false
|
252
|
+
#cci.vm.box_url = "https://vagrantcloud.com/ju2wheels/SL_GENERIC/version/1/provider/softlayer.box"
|
253
|
+
#cci.vm.box_version = ">=0"
|
254
|
+
#cci.vm.graceful_halt_timeout = 300
|
255
|
+
#cci.vm.guest = :linux
|
256
|
+
#cci.vm.usable_port_range = 2200..2250
|
257
|
+
|
258
|
+
#See http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html
|
259
|
+
cci.ssh.forward_agent = true
|
260
|
+
cci.ssh.forward_x11 = false
|
261
|
+
#cci.ssh.guest_port = 22
|
262
|
+
#cci.ssh.host = nil #Normally determined by provider
|
263
|
+
#cci.ssh.insert_key = true
|
264
|
+
#cci.ssh.password = nil
|
265
|
+
#cci.ssh.port = 22
|
266
|
+
#cci.ssh.private_key_path = [ File.expand_path("~/.ssh/id_rsa") ]
|
267
|
+
#cci.ssh.pty = false #Warning this setting is not recommended and can break things, recommended to create flex image with sudoers fixed for problematic distros
|
268
|
+
#See https://github.com/audiolize/vagrant-softlayer/issues/11
|
269
|
+
#cci.ssh.shell = "bash -l"
|
270
|
+
#cci.ssh.username = "vagrant"
|
271
|
+
|
272
|
+
#Windows specific config options for vagrant-windows plugin
|
273
|
+
#cci.windows.halt_check_interval = 1 if Vagrant.has_plugin?("vagrant-windows")
|
274
|
+
#cci.windows.halt_timeout = 30 if Vagrant.has_plugin?("vagrant-windows")
|
275
|
+
cci.windows.set_work_network = true if Vagrant.has_plugin?("vagrant-windows")
|
276
|
+
#cci.winrm.guest_port = 5985 if Vagrant.has_plugin?("vagrant-windows")
|
277
|
+
#cci.winrm.host = "localhost" if Vagrant.has_plugin?("vagrant-windows")
|
278
|
+
#cci.winrm.max_tries = 20 if Vagrant.has_plugin?("vagrant-windows")
|
279
|
+
#cci.winrm.password = "vagrant" if Vagrant.has_plugin?("vagrant-windows")
|
280
|
+
#cci.winrm.port = 5985 if Vagrant.has_plugin?("vagrant-windows")
|
281
|
+
#cci.winrm.timeout = 1800 if Vagrant.has_plugin?("vagrant-windows")
|
282
|
+
cci.winrm.username = "vagrant" if Vagrant.has_plugin?("vagrant-windows")
|
283
|
+
|
284
|
+
#See http://docs.vagrantup.com/v2/networking/index.html
|
285
|
+
#cci.vm.network :forwarded_port, guest: 22, guest_ip: nil, host:2222, host_ip: nil, protocol: "tcp", auto_correct: true
|
286
|
+
|
287
|
+
#Always put the private network before the public so it matches SoftLayer (when using VirtualBox or other hypervisor), eth0 is private and eth1 public, they are created in order provided
|
288
|
+
#cci.vm.network :private_network, type: "dhcp", ip: nil, auto_config: true, virtualbox__intnet: true
|
289
|
+
#cci.vm.network :private_network, type: "static", ip: "192.168.10.5", auto_config: true, virtualbox__intnet: "internalnetname"
|
290
|
+
#cci.vm.network :public_network, type: "dhcp", ip: nil, auto_config: true, virtualbox__intnet: false, bridge: "wlan0"
|
291
|
+
#cci.vm.network :public_network, type: "static", ip: '192.168.1.20', auto_config: true, virtualbox__intnet: false, bridge: "wlan0"
|
292
|
+
|
293
|
+
#See http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
|
294
|
+
#Guest must have NFS, if using VirtualBox there must be a private network with static IP present, may require root privs (it will prompt)
|
295
|
+
#cci.vm.synced_folder ".", "/vagrant", disabled: false, create: false, group: "root", owner: "root", type: "nfs", nfs_udp: true, nfs_version: 3, mount_options: []
|
296
|
+
#cci.vm.synced_folder ".", "/vagrant", disabled: false, create: false, group: "root", owner: "root", type: "rsync", rsync__args: ["--verbose", "--archive", "--delete", "-z"],
|
297
|
+
# rsync__auto: true, rsync__exclude: [ ".vagrant", ".git"], mount_options: []
|
298
|
+
#cci.vm.synced_folder ".", "/vagrant", disabled: false, create: false, group: "root", owner: "root", type: "smb", smb_host: nil, smb_username: nil, smb_password: nil, mount_options: []
|
299
|
+
|
300
|
+
cci.vm.provider :softlayer do |sl, cci_override|
|
301
|
+
#Override the default setting only if using this provider
|
302
|
+
cci_override.vm.box = "ju2wheels/SL_CENTOS_6_64"
|
303
|
+
cci_override.ssh.username = "root"
|
304
|
+
|
305
|
+
#Note: If you use SL_GENERIC box you must set sl.image_guid or sl.operating_system/sl.dis_capacity, otherwise it is pre-set for you by the box
|
306
|
+
|
307
|
+
sl.api_key = ENV["SL_API_KEY"]
|
308
|
+
#sl.api_timeout = 60
|
309
|
+
#sl.datacenter = nil #Use first available
|
310
|
+
#sl.dedicated = false
|
311
|
+
#sl.disk_capacity = { 0 => 25 } # { disk_num => capacity_gb }, disk 1 reserved for swap by SoftLayer dont use
|
312
|
+
sl.domain = ENV["SL_DOMAIN"]
|
313
|
+
#sl.endpoint_url = SoftLayer::API_PUBLIC_ENDPOINT
|
314
|
+
#sl.force_private_ip = false
|
315
|
+
sl.hostname = cci.vm.hostname
|
316
|
+
#sl.hourly_billing = true
|
317
|
+
#sl.image_guid = "AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE" #Dont use this with sl.operating_system/sl.disk_capacity, they are mutually exclusive
|
318
|
+
sl.local_disk = false
|
319
|
+
#sl.manage_dns = false
|
320
|
+
#sl.max_memory = 1024
|
321
|
+
#sl.network_speed = 10
|
322
|
+
#sl.operating_system = "SL_CENTOS_6_64" #Set in box, here for override or if you used SL_GENERIC, see contrib/vagrant-softlayer-boxes of vagrant-softlayer plugin for box generator
|
323
|
+
#sl.post_install = nil #URL for post install script
|
324
|
+
#sl.private_only = false
|
325
|
+
#sl.provision_timeout = 1200
|
326
|
+
#sl.rebuild_timeout = 1200
|
327
|
+
sl.ssh_keys = [ "SL-root-pk" ]
|
328
|
+
#sl.start_cpus = 1
|
329
|
+
#sl.transaction_wait = true
|
330
|
+
#sl.user_data = nil
|
331
|
+
sl.username = ENV["SL_API_USERNAME"] || ENV['USER'] || ENV['USERNAME']
|
332
|
+
#sl.vlan_private = nil #Automatically generated, override to vlan number string otherwise, see contrib/vagrant-softlayer-vlans tool for list of acceptable vlan values
|
333
|
+
#sl.vlan_public = nil #Automatically generated, override to vlan number string otherwise
|
334
|
+
|
335
|
+
#Join a load balancer, see https://github.com/audiolize/vagrant-softlayer/wiki/Join-load-balancers for more options
|
336
|
+
#sl.join_load_balancer vip: "1.1.1.1", port: 443, method: "Round Robin", type: "TCP" do |service|
|
337
|
+
#service.destination_port = 443
|
338
|
+
#service.health_check = "Ping"
|
339
|
+
#service.weight = 2
|
340
|
+
#end
|
341
|
+
end if Vagrant.has_plugin?("SoftLayer")
|
342
|
+
|
343
|
+
#cci.vm.provision :file do |fileupload|
|
344
|
+
# fileupload.source = "/tmp/local_example.txt"
|
345
|
+
# fileupload.destination = "/tmp/uploaded_vm_example.txt"
|
346
|
+
#end
|
347
|
+
|
348
|
+
#cci.vm.provision :shell do |shellscript|
|
349
|
+
#Use the id to override it somewhere else, and preserve_order ensures it gets executed at the point
|
350
|
+
#where it was originally defined instead of where it was overriden.
|
351
|
+
# shellscript.inline = "/bin/echo -n 'hello_world' > /dev/null", id: "helloworld", preserve_order: true
|
352
|
+
#end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
```
|
356
|
+
|
357
|
+
## Building the CCI using the Vagrantfile
|
358
|
+
|
359
|
+
Once you have a `Vagrantfile` built up the last step is building your CCI. However, before running the build command,
|
360
|
+
there are few important environment variables that [Vagrant](http://www.vagrantup.com) uses which you should be
|
361
|
+
aware of:
|
362
|
+
|
363
|
+
Environment Variable | Recommended Value | Description
|
364
|
+
--------------------------- | --------------------------------------------------------- | -----------
|
365
|
+
VAGRANT_CWD | UNSET, set as needed | Changes the default CWD where [Vagrant](http://www.vagrantup.com) looks for a `Vagrantfile`
|
366
|
+
VAGRANT_DEFAULT_PROVIDER | "softlayer" | Sets the default provider so you dont have to manually specify it as a CLI option to [Vagrant](http://www.vagrantup.com).
|
367
|
+
VAGRANT_DEFAULT_PROVISIONER | UNSET, set as needed | Sets the default provisioner so you dont have to manually specify it as a CLI option to [Vagrant](http://www.vagrantup.com).
|
368
|
+
VAGRANT_DOTFILE_PATH | "~/.vagrant.d/state/" (Must make this directory manually) | [Vagrant](http://www.vagrantup.com) will normally create a `.vagrant` directory in the CWD to maintain state, to avoid this as we move through different directories with different `Vagrantfile`s, we pin it to the user [Vagrant](http://www.vagrantup.com) directory.
|
369
|
+
VAGRANT_HOME | "~/.vagrant.d/" | The default directory where [Vagrant](http://www.vagrantup.com) will install plugins on a per user basis and maintain any related files.
|
370
|
+
VAGRANT_LOG | UNSET, set as needed | Sets the default [Vagrant](http://www.vagrantup.com) log level
|
371
|
+
VAGRANT_VAGRANTFILE | UNSET, set as needed | Sets the name of the `Vagrantfile` [Vagrant](http://www.vagrantup.com) will use as a configuration file. Can be changed with each execution of [Vagrant](http://www.vagrantup.com) to allow you to maintain multiple `Vagrantfile`s of different names in the same directory.
|
372
|
+
|
373
|
+
When you run your CCI build command, a few things will happen internally in [Vagrant](http://www.vagrantup.com) (see [Load Order and Merging](http://docs.vagrantup.com/v2/vagrantfile/index.html) ):
|
374
|
+
|
375
|
+
1. [Vagrant](http://www.vagrantup.com) will load the `Vagrantfile` associated with the box you specified (if any exists).
|
376
|
+
2. [Vagrant](http://www.vagrantup.com) will load a `Vagrantfile` from your `VAGRANT_HOME` and merge it ontop of the last (if any esits).
|
377
|
+
3. [Vagrant](http://www.vagrantup.com) will load a `Vagrantfile` from `VAGRANT_CWD` and merge it ontop of last (if any exists).
|
378
|
+
4. [Vagrant](http://www.vagrantup.com) then executes the requested command using the merged configuration.
|
379
|
+
|
380
|
+
Now finally to build your CCI:
|
377
381
|
`vagrant up`
|