vagrant-vsphere 0.19.0 → 0.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +1 -1
- data/.rubocop.yml +13 -0
- data/.rubocop_todo.yml +37 -0
- data/CHANGELOG.md +189 -0
- data/DEVELOPMENT.md +67 -0
- data/Gemfile +2 -3
- data/README.md +86 -175
- data/Rakefile +4 -1
- data/lib/vSphere/action.rb +22 -28
- data/lib/vSphere/action/clone.rb +46 -46
- data/lib/vSphere/action/close_vsphere.rb +8 -10
- data/lib/vSphere/action/connect_vsphere.rb +6 -6
- data/lib/vSphere/action/destroy.rb +6 -6
- data/lib/vSphere/action/get_ssh_info.rb +4 -5
- data/lib/vSphere/action/get_state.rb +3 -5
- data/lib/vSphere/action/is_created.rb +2 -2
- data/lib/vSphere/action/is_running.rb +2 -2
- data/lib/vSphere/action/message_already_created.rb +2 -2
- data/lib/vSphere/action/message_not_created.rb +1 -1
- data/lib/vSphere/action/message_not_running.rb +1 -1
- data/lib/vSphere/action/power_off.rb +2 -2
- data/lib/vSphere/action/power_on.rb +4 -4
- data/lib/vSphere/config.rb +2 -2
- data/lib/vSphere/plugin.rb +5 -6
- data/lib/vSphere/provider.rb +1 -1
- data/lib/vSphere/util/machine_helpers.rb +6 -6
- data/lib/vSphere/util/vim_helpers.rb +27 -23
- data/lib/vSphere/util/vm_helpers.rb +1 -2
- data/lib/vSphere/version.rb +1 -1
- data/lib/vagrant-vsphere.rb +1 -1
- data/spec/action_spec.rb +1 -0
- data/spec/clone_spec.rb +40 -42
- data/spec/connect_vsphere_spec.rb +8 -8
- data/spec/get_ssh_info_spec.rb +2 -2
- data/spec/spec_helper.rb +59 -63
- data/vSphere.gemspec +5 -4
- metadata +19 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14074f0f5c34af5e128fe77d438bec5ae938e51b
|
4
|
+
data.tar.gz: 51041c4397e9f7b15eb3e1940a95ddaf22110bfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56984a55ea2b947cdcc6c5dd1d163a016c80b7f0d673abcfd8735a18a2d718959234664c9d6b10898802209af2e4cfe1b0a213d3a3395d3b1b32498d397fe3eb
|
7
|
+
data.tar.gz: 8555e5f65a2015a5871716adbad0ad2972a8816357b94180a316b0422b116cba473f4b4328989687c87db43b84bae92838b8ea641dd1884c85c3174d9e155425
|
data/.bumpversion.cfg
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
Style/FileName:
|
4
|
+
Exclude:
|
5
|
+
- 'lib/vagrant-vsphere.rb'
|
6
|
+
|
7
|
+
Lint/RescueException:
|
8
|
+
Exclude:
|
9
|
+
# the logic in the method `find_clustercompute_or_compute_resource` does not
|
10
|
+
# work when rescuing StandardError, so exclude
|
11
|
+
# lib/vSphere/util/vim_helpers.rb to continue rescuing Exception in that
|
12
|
+
# method
|
13
|
+
- 'lib/vSphere/util/vim_helpers.rb'
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2014-12-31 12:33:22 -0700 using RuboCop version 0.28.0.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 10
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Max: 106
|
11
|
+
|
12
|
+
# Offense count: 1
|
13
|
+
# Configuration parameters: CountComments.
|
14
|
+
Metrics/ClassLength:
|
15
|
+
Max: 149
|
16
|
+
|
17
|
+
# Offense count: 3
|
18
|
+
Metrics/CyclomaticComplexity:
|
19
|
+
Max: 15
|
20
|
+
|
21
|
+
# Offense count: 99
|
22
|
+
# Configuration parameters: AllowURI, URISchemes.
|
23
|
+
Metrics/LineLength:
|
24
|
+
Max: 177
|
25
|
+
|
26
|
+
# Offense count: 11
|
27
|
+
# Configuration parameters: CountComments.
|
28
|
+
Metrics/MethodLength:
|
29
|
+
Max: 54
|
30
|
+
|
31
|
+
# Offense count: 3
|
32
|
+
Metrics/PerceivedComplexity:
|
33
|
+
Max: 16
|
34
|
+
|
35
|
+
# Offense count: 24
|
36
|
+
Style/Documentation:
|
37
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
## 0.19.1 (2014-12-31)
|
2
|
+
|
3
|
+
- Move version history and contributing notes out of `README.md` into separate
|
4
|
+
files
|
5
|
+
- Add RuboCop, fail the Travis-CI build if RuboCop or unit tests fail
|
6
|
+
|
7
|
+
## 0.19.0 (2014-12-31)
|
8
|
+
|
9
|
+
- Add support for ClusterComputeResource and DatastoreCluster
|
10
|
+
([#101 GregDomjan:StorageSDRS](https://github.com/nsidc/vagrant-vsphere/pull/101))
|
11
|
+
|
12
|
+
## 0.18.0 (2014-12-30)
|
13
|
+
|
14
|
+
- Gracefully power off the VM with `vagrant halt`, and shutdown before
|
15
|
+
deleting the VM with `vagrant destroy`
|
16
|
+
([#104 clintoncwolfe:shutdown-guest-on-halt](https://github.com/nsidc/vagrant-vsphere/pull/104))
|
17
|
+
- Add configuration option `mac` to specify a MAC address for the VM
|
18
|
+
([#108 dataplayer:master](https://github.com/nsidc/vagrant-vsphere/pull/108))
|
19
|
+
|
20
|
+
## 0.17.0 (2014-12-29)
|
21
|
+
|
22
|
+
- Add ability to configure the CPU Count
|
23
|
+
([#96 rylarson:add-cpu-configuration](https://github.com/nsidc/vagrant-vsphere/pull/96))
|
24
|
+
- Prompt the user to enter a password if none is given, or the configuration
|
25
|
+
value is set to `:ask`
|
26
|
+
([#97 topmedia:password-prompt](https://github.com/nsidc/vagrant-vsphere/pull/97))
|
27
|
+
- Add support for `vagrant reload`
|
28
|
+
([#105 clintoncwolfe:add-reload-action](https://github.com/nsidc/vagrant-vsphere/pull/105))
|
29
|
+
- Fix compatibility with Vagrant 1.7 to use vSphere connection info from a
|
30
|
+
base box
|
31
|
+
([#111 mkuzmin:get-state](https://github.com/nsidc/vagrant-vsphere/pull/111))
|
32
|
+
|
33
|
+
## 0.16.0 (2014-10-01)
|
34
|
+
|
35
|
+
- Add ability to configure amount of memory the new cloned VM will have
|
36
|
+
([#94 rylarson:add-memory-configuration](https://github.com/nsidc/vagrant-vsphere/pull/94))
|
37
|
+
|
38
|
+
## 0.15.0 (2014-09-23)
|
39
|
+
|
40
|
+
- Make `vagrant destroy` work in all vm states
|
41
|
+
([#93 rylarson:make-destroy-work-in-all-vm-states](https://github.com/nsidc/vagrant-vsphere/pull/93),
|
42
|
+
fixes [#77](https://github.com/nsidc/vagrant-vsphere/issues/77))
|
43
|
+
- If the VM is powered on, then it is powered off, and destroyed
|
44
|
+
- If the VM is powered off, it is just destroyed
|
45
|
+
- If the VM is suspended, it is powered on, then powered off, then
|
46
|
+
destroyed
|
47
|
+
|
48
|
+
## 0.14.0 (2014-09-19)
|
49
|
+
|
50
|
+
- Add vlan configuration
|
51
|
+
([#91 rylarson:add-vlan-configuration](https://github.com/nsidc/vagrant-vsphere/pull/91))
|
52
|
+
- Added a new configuration option `vlan` that lets you specify the vlan
|
53
|
+
string
|
54
|
+
- If vlan is set, the clone spec is modified with an edit action to connect
|
55
|
+
the first NIC on the VM to the configured VLAN
|
56
|
+
|
57
|
+
## 0.13.1 (2014-09-18)
|
58
|
+
|
59
|
+
- Change Nokogiri major version dependency
|
60
|
+
([#90 highsineburgh:SAITRADLab-master](https://github.com/nsidc/vagrant-vsphere/pull/90))
|
61
|
+
|
62
|
+
## 0.13.0 (2014-09-03)
|
63
|
+
|
64
|
+
- Find and install box file for multi-provider boxes automatically
|
65
|
+
([#86 mkuzmin:install-box](https://github.com/nsidc/vagrant-vsphere/pull/86)
|
66
|
+
&
|
67
|
+
[#87 mkuzmin/provider-name](https://github.com/nsidc/vagrant-vsphere/pull/87))
|
68
|
+
|
69
|
+
## 0.12.0 (2014-08-16)
|
70
|
+
|
71
|
+
- Use a directory name where `Vagrantfile` is stored as a prefix for VM name
|
72
|
+
([#82 mkuzmin:name-prefix](https://github.com/nsidc/vagrant-vsphere/pull/82))
|
73
|
+
|
74
|
+
## 0.11.0 (2014-07-17)
|
75
|
+
|
76
|
+
- Create the VM target folder if it doesn't exist
|
77
|
+
([#76 marnovdm:feature/create_vm_folder](https://github.com/nsidc/vagrant-vsphere/pull/76))
|
78
|
+
|
79
|
+
## 0.10.0 (2014-07-07)
|
80
|
+
|
81
|
+
- New optional parameter to clone into custom folder in vSphere
|
82
|
+
([#73 mikola-spb:vm-base-path](https://github.com/nsidc/vagrant-vsphere/pull/73))
|
83
|
+
- Follows [semver](http://semver.org/) better, this adds functionality in a
|
84
|
+
backwards compatible way, so bumps the minor. 0.9.0, should have been a
|
85
|
+
major version
|
86
|
+
|
87
|
+
## 0.9.2 (2014-07-07)
|
88
|
+
|
89
|
+
- Instruct Vagrant to set the guest hostname according to `Vagrantfile`
|
90
|
+
([#69 ddub:set-hostname](https://github.com/nsidc/vagrant-vsphere/pull/69))
|
91
|
+
|
92
|
+
## 0.9.1 (2014-07-07)
|
93
|
+
|
94
|
+
- Reuse folder sync code from Vagrant core
|
95
|
+
([#66 mkuzmin:sync-folders](https://github.com/nsidc/vagrant-vsphere/pull/66))
|
96
|
+
|
97
|
+
## 0.9.0 (2014-07-07)
|
98
|
+
|
99
|
+
- Increases Vagrant requirements to 1.6.3+
|
100
|
+
- Supports differentiating between SSH/WinRM communicator
|
101
|
+
([#67 marnovdm:feature/waiting-for-winrm](https://github.com/nsidc/vagrant-vsphere/pull/67))
|
102
|
+
|
103
|
+
## 0.8.5 (2014-07-07)
|
104
|
+
|
105
|
+
- Fixed synced folders to work with WinRM communicator
|
106
|
+
([#72 10thmagnitude:master](https://github.com/nsidc/vagrant-vsphere/pull/72))
|
107
|
+
|
108
|
+
## 0.8.4 (2014-07-07)
|
109
|
+
|
110
|
+
- Use root resource pool when cloning from template
|
111
|
+
([#63: matt-richardson:support-resource-pools-on-vsphere-standard-edition](https://github.com/nsidc/vagrant-vsphere/pull/63))
|
112
|
+
|
113
|
+
## 0.8.3 (2014-07-03)
|
114
|
+
|
115
|
+
- Fixed "No error message" on rbvmomi method calls
|
116
|
+
([#74: mkuzmin:rbvmomi-error-messages](https://github.com/nsidc/vagrant-vsphere/pull/74))
|
117
|
+
|
118
|
+
## 0.8.2 (2014-04-23)
|
119
|
+
|
120
|
+
- Fixes no error messages
|
121
|
+
([#58 leth:no-error-message](https://github.com/nsidc/vagrant-vsphere/pull/58))
|
122
|
+
- Fixes typo ([#57 marnovdm](https://github.com/nsidc/vagrant-vsphere/pull/57))
|
123
|
+
- Fixes additional no error messages
|
124
|
+
|
125
|
+
## 0.8.1 (2014-04-10)
|
126
|
+
|
127
|
+
- Fixes [#47](https://github.com/nsidc/vagrant-vsphere/issues/47) via
|
128
|
+
[#52 olegz-alertlogic](https://github.com/nsidc/vagrant-vsphere/pull/52)
|
129
|
+
|
130
|
+
## 0.8.0 (2014-04-08)
|
131
|
+
|
132
|
+
- Adds configuration for connecting via proxy server
|
133
|
+
([#40 tkak:feature-proxy-connection](https://github.com/nsidc/vagrant-vsphere/pull/40))
|
134
|
+
|
135
|
+
## 0.7.2 (2014-04-08)
|
136
|
+
|
137
|
+
- Includes template in get_location
|
138
|
+
([#38 tim95030:issue-27](https://github.com/nsidc/vagrant-vsphere/pull/38))
|
139
|
+
- Updates `Gemfile` to fall back to old version of Vagrant if ruby < 2.0.0 is
|
140
|
+
available
|
141
|
+
|
142
|
+
## 0.7.1 (2014-03-17)
|
143
|
+
|
144
|
+
- Fixes rsync error reporting
|
145
|
+
- Updates `locales/en.yaml`
|
146
|
+
- Restricts RbVmomi dependency
|
147
|
+
|
148
|
+
## 0.7.0 (2013-12-31)
|
149
|
+
|
150
|
+
- Handle multiple private key paths
|
151
|
+
- Add auto name generation based on machine name
|
152
|
+
- Add support for linked clones
|
153
|
+
|
154
|
+
## 0.6.0 (2013-11-21)
|
155
|
+
|
156
|
+
- Add support for the `vagrant ssh -c` command
|
157
|
+
|
158
|
+
## 0.5.1 (2013-10-21)
|
159
|
+
|
160
|
+
- Fix rsync on Windows, adapted from
|
161
|
+
[mitchellh/vagrant-aws#77](https://github.com/mitchellh/vagrant-aws/pull/77)
|
162
|
+
|
163
|
+
## 0.5.0 (2013-10-17)
|
164
|
+
|
165
|
+
- Allow setting static ip addresses using Vagrant private networks
|
166
|
+
- Allow cloning from VM or template
|
167
|
+
|
168
|
+
## 0.4.0
|
169
|
+
|
170
|
+
- Add support for specifying datastore location for new VMs
|
171
|
+
|
172
|
+
## 0.3.0
|
173
|
+
|
174
|
+
- Lock Nokogiri version at 1.5.10 to prevent library conflicts
|
175
|
+
- Add support for customization specs
|
176
|
+
|
177
|
+
## 0.2.0
|
178
|
+
|
179
|
+
- Add halt action
|
180
|
+
([#16 catharsis:haltaction](https://github.com/nsidc/vagrant-vsphere/pull/16))
|
181
|
+
|
182
|
+
## 0.1.0
|
183
|
+
|
184
|
+
- Add folder syncing with guest OS
|
185
|
+
- Add provisioning
|
186
|
+
|
187
|
+
## 0.0.1
|
188
|
+
|
189
|
+
- Initial release
|
data/DEVELOPMENT.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
### Contributing
|
2
|
+
|
3
|
+
1. Fork it
|
4
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
5
|
+
3. Commit your RuboCop-compliant and test-passing changes (`git commit -am 'Add
|
6
|
+
some feature'`)
|
7
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
8
|
+
5. Create new Pull Request
|
9
|
+
|
10
|
+
### Versioning
|
11
|
+
|
12
|
+
This plugin follows the principles of
|
13
|
+
[Semantic Versioning 2.0.0](http://semver.org/).
|
14
|
+
|
15
|
+
### Unit Tests
|
16
|
+
|
17
|
+
Please run the unit tests to verify your changes. To do this simply run `rake`.
|
18
|
+
If you want a quick merge, write a spec that fails before your changes are
|
19
|
+
applied and that passes after.
|
20
|
+
|
21
|
+
If you don't have rake installed, first install [bundler](http://bundler.io/)
|
22
|
+
and run `bundle install`. Then you can run `bundle exec rake`, even if rake is
|
23
|
+
still not installed to your `PATH`.
|
24
|
+
|
25
|
+
### RuboCop
|
26
|
+
|
27
|
+
Please make changes [RuboCop](https://github.com/bbatsov/rubocop)-compliant.
|
28
|
+
|
29
|
+
Changes that eliminate rules from
|
30
|
+
[`.rubocop_todo.yml`](https://github.com/nsidc/vagrant-vsphere/blob/master/.rubocop_todo.yml)
|
31
|
+
are welcome.
|
32
|
+
|
33
|
+
### Travis-CI
|
34
|
+
|
35
|
+
[Travis](https://travis-ci.org/nsidc/vagrant-vsphere) will automatically run
|
36
|
+
RuboCop and the unit tests when you create a new pull request. If there are any
|
37
|
+
failures, a notification will appear on the pull request. To update your pull
|
38
|
+
request, simply create a new commit on the branch that fixes the failures, and
|
39
|
+
push to the branch.
|
40
|
+
|
41
|
+
### Development Without Building the Plugin
|
42
|
+
|
43
|
+
To test your changes when developing the plugin, you have two main
|
44
|
+
options. First, you can build and install the plugin from source every time you
|
45
|
+
make a change:
|
46
|
+
|
47
|
+
1. Make changes
|
48
|
+
2. `rake build`
|
49
|
+
3. `vagrant plugin install ./pkg/vagrant-vsphere-$VERSION.gem`
|
50
|
+
4. `vagrant up --provider=vsphere`
|
51
|
+
|
52
|
+
Second, you can use Bundler and the Vagrant gem to execute vagrant commands,
|
53
|
+
saving time as you never have to wait for the plugin to build and install:
|
54
|
+
|
55
|
+
1. Make changes
|
56
|
+
2. `bundle exec vagrant up --provider=vsphere`
|
57
|
+
|
58
|
+
This method uses the version of Vagrant specified in
|
59
|
+
[`Gemfile`](https://github.com/nsidc/vagrant-vsphere/blob/master/Gemfile). It
|
60
|
+
will also cause Bundler and Vagrant to output warnings every time you run
|
61
|
+
`bundle exec vagrant`, because `Gemfile` lists **vagrant-vsphere** twice (once
|
62
|
+
with `gemspec` and another time in the `group :plugins` block), and Vagrant
|
63
|
+
prefers to be run from the official installer rather than through the gem.
|
64
|
+
|
65
|
+
Despite those warning messages, this is the
|
66
|
+
[officially recommended](https://docs.vagrantup.com/v2/plugins/development-basics.html)
|
67
|
+
method for Vagrant plugin development.
|
data/Gemfile
CHANGED
@@ -7,9 +7,8 @@ group :development do
|
|
7
7
|
# gem dependency because we expect to be installed within the
|
8
8
|
# Vagrant environment itself using `vagrant plugin`.
|
9
9
|
|
10
|
-
ruby
|
11
|
-
gem 'vagrant', :
|
12
|
-
|
10
|
+
ruby '2.0.0'
|
11
|
+
gem 'vagrant', git: 'git://github.com/mitchellh/vagrant.git', tag: 'v1.6.3'
|
13
12
|
end
|
14
13
|
|
15
14
|
group :plugins do
|
data/README.md
CHANGED
@@ -2,21 +2,27 @@
|
|
2
2
|
|
3
3
|
# Vagrant vSphere Provider
|
4
4
|
|
5
|
-
This is a [Vagrant](http://www.vagrantup.com) 1.6.3+ plugin that adds a
|
6
|
-
|
5
|
+
This is a [Vagrant](http://www.vagrantup.com) 1.6.3+ plugin that adds a
|
6
|
+
[vSphere](http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fright-pane.html)
|
7
|
+
provider to Vagrant, allowing Vagrant to control and provision machines using
|
8
|
+
VMware. New machines are created from virtual machines or templates which must
|
9
|
+
be configured prior to using using this provider.
|
7
10
|
|
8
|
-
This provider is built on top of the
|
11
|
+
This provider is built on top of the
|
12
|
+
[RbVmomi](https://github.com/vmware/rbvmomi) Ruby interface to the vSphere API.
|
9
13
|
|
10
14
|
## Requirements
|
15
|
+
|
11
16
|
* Vagrant 1.6.3+
|
12
17
|
* VMware with vSphere API
|
13
18
|
* Ruby 1.9+
|
14
19
|
* libxml2, libxml2-dev, libxslt, libxslt-dev
|
15
20
|
|
16
21
|
## Current Version
|
17
|
-
**version: 0.19.
|
22
|
+
**version: 0.19.1**
|
18
23
|
|
19
|
-
vagrant-vsphere (**version: 0.19.
|
24
|
+
vagrant-vsphere (**version: 0.19.1**) is available from
|
25
|
+
[RubyGems.org](https://rubygems.org/gems/vagrant-vsphere)
|
20
26
|
|
21
27
|
## Installation
|
22
28
|
|
@@ -28,26 +34,32 @@ vagrant plugin install vagrant-vsphere
|
|
28
34
|
|
29
35
|
This will install the plugin from RubyGems.org.
|
30
36
|
|
31
|
-
Alternatively, you can clone this repository and build the source with `gem
|
32
|
-
After the gem is built, run the plugin install command
|
37
|
+
Alternatively, you can clone this repository and build the source with `gem
|
38
|
+
build vSphere.gemspec`. After the gem is built, run the plugin install command
|
39
|
+
from the build directory.
|
33
40
|
|
34
41
|
### Potential Installation Problems
|
35
42
|
|
36
|
-
The requirements for [Nokogiri](http://nokogiri.org/) must be installed before
|
43
|
+
The requirements for [Nokogiri](http://nokogiri.org/) must be installed before
|
44
|
+
the plugin can be installed. See the
|
45
|
+
[Nokogiri tutorial](http://nokogiri.org/tutorials/installing_nokogiri.html) for
|
37
46
|
detailed instructions.
|
38
47
|
|
39
|
-
The plugin forces use of Nokogiri ~> 1.5 to prevent conflicts with older
|
48
|
+
The plugin forces use of Nokogiri ~> 1.5 to prevent conflicts with older
|
49
|
+
versions of system libraries, specifically zlib.
|
40
50
|
|
41
51
|
## Usage
|
42
52
|
|
43
|
-
After installing the plugin, you must create a vSphere box. The example_box
|
44
|
-
that can be used to create a dummy box
|
53
|
+
After installing the plugin, you must create a vSphere box. The example_box
|
54
|
+
directory contains a metadata.json file that can be used to create a dummy box
|
55
|
+
with the command:
|
45
56
|
|
46
57
|
```bash
|
47
58
|
tar cvzf dummy.box ./metadata.json
|
48
59
|
```
|
49
60
|
|
50
|
-
This can be installed using the standard Vagrant methods or specified in the
|
61
|
+
This can be installed using the standard Vagrant methods or specified in the
|
62
|
+
Vagrantfile.
|
51
63
|
|
52
64
|
After creating the dummy box, make a Vagrantfile that looks like the following:
|
53
65
|
|
@@ -72,8 +84,10 @@ And then run `vagrant up --provider=vsphere`.
|
|
72
84
|
|
73
85
|
### Custom Box
|
74
86
|
|
75
|
-
The bulk of this configuration can be included as part of a custom box. See the
|
76
|
-
|
87
|
+
The bulk of this configuration can be included as part of a custom box. See the
|
88
|
+
[Vagrant documentation](http://docs.vagrantup.com/v2/boxes.html) and the Vagrant
|
89
|
+
[AWS provider](https://github.com/mitchellh/vagrant-aws/tree/master/example_box)
|
90
|
+
for more information and an example.
|
77
91
|
|
78
92
|
### Supported Commands
|
79
93
|
|
@@ -82,29 +96,37 @@ and `ssh`.
|
|
82
96
|
|
83
97
|
`up` supports provisioning of the new VM with the standard Vagrant provisioners.
|
84
98
|
|
85
|
-
|
86
99
|
## Configuration
|
87
100
|
|
88
101
|
This provider has the following settings, all are required unless noted:
|
89
102
|
|
90
|
-
* `host` -
|
103
|
+
* `host` - IP or name for the vSphere API
|
91
104
|
* `insecure` - _Optional_ verify SSL certificate from the host
|
92
105
|
* `user` - user name for connecting to vSphere
|
93
106
|
* `password` - password for connecting to vSphere. If no value is given, or the
|
94
107
|
value is set to `:ask`, the user will be prompted to enter the password on
|
95
108
|
each invocation.
|
96
|
-
* `data_center_name` - _Optional_ datacenter containing the computed resource,
|
97
|
-
|
98
|
-
|
99
|
-
* `
|
109
|
+
* `data_center_name` - _Optional_ datacenter containing the computed resource,
|
110
|
+
the template and where the new VM will be created, if not specified the first
|
111
|
+
datacenter found will be used
|
112
|
+
* `compute_resource_name` - _Required if cloning from template_ the name of the
|
113
|
+
host containing the resource pool for the new VM
|
114
|
+
* `resource_pool_name` - the resource pool for the new VM. If not supplied, and
|
115
|
+
cloning from a template, uses the root resource pool
|
116
|
+
* `clone_from_vm` - _Optional_ use a virtual machine instead of a template as
|
117
|
+
the source for the cloning operation
|
100
118
|
* `template_name` - the VM or VM template to clone
|
101
|
-
* `vm_base_path` - _Optional_ path to folder where new VM should be created, if
|
102
|
-
|
119
|
+
* `vm_base_path` - _Optional_ path to folder where new VM should be created, if
|
120
|
+
not specified template's parent folder will be used
|
121
|
+
* `name` - _Optional_ name of the new VM, if missing the name will be auto
|
122
|
+
generated
|
103
123
|
* `customization_spec_name` - _Optional_ customization spec for the new VM
|
104
124
|
* `data_store_name` - _Optional_ the datastore where the VM will be located
|
105
|
-
* `linked_clone` - _Optional_ link the cloned VM to the parent to share virtual
|
125
|
+
* `linked_clone` - _Optional_ link the cloned VM to the parent to share virtual
|
126
|
+
disks
|
106
127
|
* `proxy_host` - _Optional_ proxy host name for connecting to vSphere via proxy
|
107
|
-
* `proxy_port` - _Optional_ proxy port number for connecting to vSphere via
|
128
|
+
* `proxy_port` - _Optional_ proxy port number for connecting to vSphere via
|
129
|
+
proxy
|
108
130
|
* `vlan` - _Optional_ vlan to connect the first NIC to
|
109
131
|
* `memory_mb` - _Optional_ Configure the amount of memory (in MB) for the new VM
|
110
132
|
* `cpu_count` - _Optional_ Configure the number of CPUs for the new VM
|
@@ -112,30 +134,39 @@ This provider has the following settings, all are required unless noted:
|
|
112
134
|
|
113
135
|
### Cloning from a VM rather than a template
|
114
136
|
|
115
|
-
To clone from an existing VM rather than a template, set `clone_from_vm` to
|
137
|
+
To clone from an existing VM rather than a template, set `clone_from_vm` to
|
138
|
+
true. If this value is set, `compute_resource_name` and `resource_pool_name` are
|
139
|
+
not required.
|
116
140
|
|
117
141
|
### Template_Name
|
118
142
|
|
119
|
-
* The template name includes the actual template name and the directory path
|
120
|
-
|
143
|
+
* The template name includes the actual template name and the directory path
|
144
|
+
containing the template.
|
145
|
+
* **For example:** if the template is a directory called **vagrant-templates**
|
146
|
+
and the template is called **ubuntu-lucid-template** the `template_name`
|
147
|
+
setting would be:
|
148
|
+
|
121
149
|
```
|
122
150
|
vsphere.template_name = "vagrant-templates/ubuntu-lucid-template"
|
123
151
|
```
|
124
|
-
![Vagrant Vsphere Screenshot](https://raw.githubusercontent.com/nsidc/vagrant-vsphere/master/vsphere_screenshot.png)
|
125
152
|
|
153
|
+
![Vagrant Vsphere Screenshot](https://raw.githubusercontent.com/nsidc/vagrant-vsphere/master/vsphere_screenshot.png)
|
126
154
|
|
127
155
|
### VM_Base_Path
|
128
156
|
|
129
|
-
* The new vagrant VM will be created in the same directory as the template it
|
130
|
-
|
131
|
-
*
|
157
|
+
* The new vagrant VM will be created in the same directory as the template it
|
158
|
+
originated from.
|
159
|
+
* To create the VM in a directory other than the one where the template was
|
160
|
+
located, include the **vm_base_path** setting.
|
161
|
+
* **For example:** if the machines will be stored in a directory called
|
162
|
+
**vagrant-machines** the `vm_base_path` would be:
|
163
|
+
|
132
164
|
```
|
133
165
|
vsphere.vm_base_path = "vagrant-machines"
|
134
166
|
```
|
135
167
|
|
136
168
|
![Vagrant Vsphere Screenshot](https://raw.githubusercontent.com/nsidc/vagrant-vsphere/master/vsphere_screenshot.png)
|
137
169
|
|
138
|
-
|
139
170
|
### Setting a static IP address
|
140
171
|
|
141
172
|
To set a static IP, add a private network to your vagrant file:
|
@@ -144,13 +175,20 @@ To set a static IP, add a private network to your vagrant file:
|
|
144
175
|
config.vm.network 'private_network', ip: '192.168.50.4'
|
145
176
|
```
|
146
177
|
|
147
|
-
The IP address will only be set if a customization spec name is given. The
|
178
|
+
The IP address will only be set if a customization spec name is given. The
|
179
|
+
customization spec must have network adapter settings configured. For each
|
180
|
+
private network specified, there needs to be a corresponding network adapter in
|
181
|
+
the customization spec. An error will be thrown if there are more networks than
|
182
|
+
adapters.
|
148
183
|
|
149
184
|
### Auto name generation
|
150
185
|
|
151
|
-
The name for the new VM will be automagically generated from the Vagrant machine
|
186
|
+
The name for the new VM will be automagically generated from the Vagrant machine
|
187
|
+
name, the current timestamp and a random number to allow for simultaneous
|
188
|
+
executions.
|
152
189
|
|
153
|
-
This is useful if running Vagrant from multiple directories or if multiple
|
190
|
+
This is useful if running Vagrant from multiple directories or if multiple
|
191
|
+
machines are defined in the Vagrantfile.
|
154
192
|
|
155
193
|
### Setting the MAC address
|
156
194
|
|
@@ -166,6 +204,7 @@ easily break networking.
|
|
166
204
|
## Example Usage
|
167
205
|
|
168
206
|
### FILE: Vagrantfile
|
207
|
+
|
169
208
|
```ruby
|
170
209
|
VAGRANT_INSTANCE_NAME = "vagrant-vsphere"
|
171
210
|
|
@@ -193,168 +232,40 @@ end
|
|
193
232
|
```
|
194
233
|
|
195
234
|
### Vagrant Up
|
235
|
+
|
196
236
|
```bash
|
197
237
|
vagrant up --provider=vsphere
|
198
238
|
```
|
199
|
-
|
200
239
|
### Vagrant SSH
|
240
|
+
|
201
241
|
```bash
|
202
242
|
vagrant ssh
|
203
243
|
```
|
204
244
|
|
205
245
|
### Vagrant Destroy
|
246
|
+
|
206
247
|
```bash
|
207
248
|
vagrant destroy
|
208
249
|
```
|
209
250
|
|
210
251
|
## Version History
|
211
|
-
* 0.0.1
|
212
|
-
* Initial release
|
213
|
-
* 0.1.0
|
214
|
-
* Add folder syncing with guest OS
|
215
|
-
* Add provisioning
|
216
|
-
* 0.2.0
|
217
|
-
* Merge halt action from [catharsis](https://github.com/catharsis)
|
218
|
-
* 0.3.0
|
219
|
-
* Lock Nokogiri version at 1.5.10 to prevent library conflicts
|
220
|
-
* Add support for customization specs
|
221
|
-
* 0.4.0
|
222
|
-
* Add support for specifying datastore location for new VMs
|
223
|
-
* 0.5.0
|
224
|
-
* Allow setting static ip addresses using Vagrant private networks
|
225
|
-
* Allow cloning from VM or template
|
226
|
-
* 0.5.1
|
227
|
-
* fix rsync on Windows, adapted from [mitchellh/vagrant-aws#77](https://github.com/mitchellh/vagrant-aws/pull/77)
|
228
|
-
* 0.6.0
|
229
|
-
* add support for the `vagrant ssh -c` command
|
230
|
-
* 0.7.0
|
231
|
-
* handle multiple private key paths
|
232
|
-
* add auto name generation based on machine name
|
233
|
-
* add support for linked clones
|
234
|
-
* 0.7.1
|
235
|
-
* fixes rsync error reporting
|
236
|
-
* updates locales yaml
|
237
|
-
* restricts rbvmomi dependency
|
238
|
-
* 0.7.2
|
239
|
-
* includes template in get_location (from: tim95030 fixes issue #38)
|
240
|
-
* updates Gemfile to fall back to old version of vagrant for if ruby < 2.0.0 is available.
|
241
|
-
* 0.8.0
|
242
|
-
* Adds configuration for connecting via proxy server (tkak issue #40)
|
243
|
-
* 0.8.1
|
244
|
-
* Fixes [#47](https://github.com/nsidc/vagrant-vsphere/issues/47) via [olegz-alertlogic #52](https://github.com/nsidc/vagrant-vsphere/pull/52)
|
245
|
-
* 0.8.2
|
246
|
-
* fixes no error messages [#58 leth:no-error-message](https://github.com/nsidc/vagrant-vsphere/pull/58)
|
247
|
-
* fixes typo [#57 targetx007](https://github.com/nsidc/vagrant-vsphere/pull/57)
|
248
|
-
* fixes additional no error messages
|
249
|
-
* 0.8.3
|
250
|
-
* Fixed "No error message" on rbvmomi method calls. [#74: mkuzmin:rbvmomi-error-messages](https://github.com/nsidc/vagrant-vsphere/pull/74)
|
251
|
-
* 0.8.4
|
252
|
-
* Use root resource pool when cloning from template [#63: matt-richardson:support-resource-pools-on-vsphere-standard-edition](https://github.com/nsidc/vagrant-vsphere/pull/63)
|
253
|
-
* 0.8.5
|
254
|
-
* fixed synced folders to work with WinRM communicator [#72 10thmagnitude:master](https://github.com/nsidc/vagrant-vsphere/pull/72)
|
255
|
-
* 0.9.0
|
256
|
-
* increases Vagrant requirements to 1.6.3+
|
257
|
-
* Supports differentiating between SSH/WinRM communicator [#67 marnovdm:feature/waiting-for-winrm](https://github.com/nsidc/vagrant-vsphere/pull/67)
|
258
|
-
* 0.9.1
|
259
|
-
* reuse folder sync code from Vagrant core. [#66 mkuzmin:sync-folders](https://github.com/nsidc/vagrant-vsphere/pull/66)
|
260
|
-
* 0.9.2
|
261
|
-
* Instruct vagrant to set the guest hostname according to Vagrantfile [#69 ddub:set-hostname](https://github.com/nsidc/vagrant-vsphere/pull/69)
|
262
|
-
* 0.10.0
|
263
|
-
* new optional parameter to clone into custom folder in vSphere [#73 mikola-spb:vm-base-path](https://github.com/nsidc/vagrant-vsphere/pull/73)
|
264
|
-
* follows [semver](http://semver.org/) better, this adds functionality in a
|
265
|
-
backwards compatible way, so bumps the minor. 0.9.0, should have been a
|
266
|
-
major version.
|
267
|
-
* 0.11.0
|
268
|
-
* Create the VM target folder if it doesn't exist #76 marnovdm:feature/create_vm_folder.
|
269
|
-
* 0.12.0
|
270
|
-
* Use a directory name where Vagrantfile is stored as a prefix for VM name [#82 mkuzmin:name-prefix](https://github.com/nsidc/vagrant-vsphere/pull/82).
|
271
|
-
* 0.13.0
|
272
|
-
* Find and install box file for multi-provider boxes automatically [#86 mkuzmin:install-box](https://github.com/nsidc/vagrant-vsphere/pull/86) & [#87 mkuzmin/provider-name](https://github.com/nsidc/vagrant-vsphere/pull/87).
|
273
|
-
* 0.13.1
|
274
|
-
* Change Nokogiri Major Version dependency [#90 highsineburgh:SAITRADLab-master](https://github.com/nsidc/vagrant-vsphere/pull/90)
|
275
|
-
* 0.14.0 Add vlan configuration [#91 rylarson:add-vlan-configuration](https://github.com/nsidc/vagrant-vsphere/pull/91)
|
276
|
-
* Added a new configuration option 'vlan' that lets you specify the vlan string
|
277
|
-
* If vlan is set, the clone spec is modified with an edit action to connect the first NIC on the VM to the configured VLAN.
|
278
|
-
* 0.15.0 Make destroy work in all vm states [#93 rylarson:make-destroy-work-in-all-vm-states](https://github.com/nsidc/vagrant-vsphere/pull/93) (fixes #77)
|
279
|
-
* If the VM is powered on, then it is powered off, and destroyed.
|
280
|
-
* If the VM is powered off, it is just destroyed.
|
281
|
-
* If the VM is suspended, it is powered on, then powered off, then destroyed.
|
282
|
-
* 0.16.0 Add ability to configure amount of memory the new cloned VM will have [#94 rylarson:add-memory-configuration](https://github.com/nsidc/vagrant-vsphere/pull/94).
|
283
|
-
* 0.17.0
|
284
|
-
* Add ability to configure the CPU Count
|
285
|
-
[#96 rylarson:add-cpu-configuration](https://github.com/nsidc/vagrant-vsphere/pull/96).
|
286
|
-
* Prompt the user to enter a password if none is given, or the configuration
|
287
|
-
value is set to `:ask`
|
288
|
-
[#97 topmedia:password-prompt](https://github.com/nsidc/vagrant-vsphere/pull/97).
|
289
|
-
* Add support for `vagrant reload`
|
290
|
-
[#105 clintoncwolfe:add-reload-action](https://github.com/nsidc/vagrant-vsphere/pull/105).
|
291
|
-
* Fix compatibility with Vagrant 1.7 to use vSphere connection info from a base
|
292
|
-
box
|
293
|
-
[#111 mkuzmin:get-state](https://github.com/nsidc/vagrant-vsphere/pull/111).
|
294
|
-
* 0.18.0
|
295
|
-
* Gracefully power off the VM with `vagrant halt`, and shutdown before
|
296
|
-
deleting the VM with `vagrant destroy`
|
297
|
-
[#104 clintoncwolfe:shutdown-guest-on-halt](https://github.com/nsidc/vagrant-vsphere/pull/104).
|
298
|
-
* Add configuration option `mac` to specify a MAC address for the VM
|
299
|
-
[#108 dataplayer:master](https://github.com/nsidc/vagrant-vsphere/pull/108).
|
300
|
-
* 0.19.0
|
301
|
-
* Add support for ClusterComputeResource and DatastoreCluster
|
302
|
-
[#101 GregDomjan:StorageSDRS](https://github.com/nsidc/vagrant-vsphere/pull/101).
|
303
|
-
|
304
|
-
## Versioning
|
305
|
-
|
306
|
-
This plugin follows the principles of [Semantic Versioning 2.0.0](http://semver.org/)
|
307
252
|
|
308
|
-
|
309
|
-
|
310
|
-
1. Fork it
|
311
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
312
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
313
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
314
|
-
5. Create new Pull Request
|
315
|
-
|
316
|
-
### Unit Tests
|
317
|
-
|
318
|
-
Please run the unit tests to verify your changes. To do this simply run `rake`.
|
319
|
-
If you want a quick merge, write a spec that fails before your changes are applied and that passes after.
|
320
|
-
|
321
|
-
|
322
|
-
If you don't have rake installed, first install [bundler](http://bundler.io/) and run `bundle install`.
|
253
|
+
See
|
254
|
+
[`CHANGELOG.md`](https://github.com/nsidc/vagrant-vsphere/blob/master/CHANGELOG.md).
|
323
255
|
|
324
|
-
|
325
|
-
|
326
|
-
To test your changes when developing the plugin, you have two main
|
327
|
-
options. First, you can build and install the plugin from source every time you
|
328
|
-
make a change:
|
329
|
-
|
330
|
-
1. Make changes
|
331
|
-
2. `rake build`
|
332
|
-
3. `vagrant plugin install ./pkg/vagrant-vsphere-$VERSION.gem`
|
333
|
-
4. `vagrant up --provider=vsphere`
|
334
|
-
|
335
|
-
Second, you can use Bundler and the Vagrant gem to execute vagrant commands,
|
336
|
-
saving time as you never have to wait for the plugin to build and install:
|
337
|
-
|
338
|
-
1. Make changes
|
339
|
-
2. `bundle exec vagrant up --provider=vsphere`
|
340
|
-
|
341
|
-
This method uses the version of Vagrant specified in
|
342
|
-
[`Gemfile`](https://github.com/nsidc/vagrant-vsphere/blob/master/Gemfile). It
|
343
|
-
will also cause Bundler and Vagrant to output warnings every time you run
|
344
|
-
`bundle exec vagrant`, because `Gemfile` lists **vagrant-vsphere** twice (once
|
345
|
-
with `gemspec` and another time in the `group :plugins` block), and Vagrant
|
346
|
-
prefers to be run from the official installer rather than through the gem.
|
256
|
+
## Contributing
|
347
257
|
|
348
|
-
|
349
|
-
[
|
350
|
-
method for Vagrant plugin development.
|
258
|
+
See
|
259
|
+
[`DEVELOPMENT.md`](https://github.com/nsidc/vagrant-vsphere/blob/master/DEVELOPMENT.md).
|
351
260
|
|
352
261
|
## License
|
353
262
|
|
354
|
-
The Vagrant vSphere Provider is licensed under the MIT license. See
|
263
|
+
The Vagrant vSphere Provider is licensed under the MIT license. See
|
264
|
+
[LICENSE.txt][license].
|
355
265
|
|
356
266
|
[license]: https://raw.github.com/nsidc/vagrant-vsphere/master/LICENSE.txt
|
357
267
|
|
358
268
|
## Credit
|
359
269
|
|
360
|
-
This software was developed by the National Snow and Ice Data Center with
|
270
|
+
This software was developed by the National Snow and Ice Data Center with
|
271
|
+
funding from multiple sources.
|