knife-vcair 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +89 -0
- data/CHANGELOG.md +18 -0
- data/Gemfile +4 -0
- data/Guardfile +23 -0
- data/LICENSE +202 -0
- data/README.md +197 -0
- data/Rakefile +35 -0
- data/example.env +5 -0
- data/install-linux-vcair-example.sh +22 -0
- data/install-winrm-vcair-example.bat +36 -0
- data/knife-vcair.gemspec +35 -0
- data/lib/chef/knife/cloud/vcair_server_create_options.rb +73 -0
- data/lib/chef/knife/cloud/vcair_service.rb +57 -0
- data/lib/chef/knife/cloud/vcair_service_options.rb +77 -0
- data/lib/chef/knife/vcair_helpers.rb +94 -0
- data/lib/chef/knife/vcair_image_list.rb +51 -0
- data/lib/chef/knife/vcair_ip_list.rb +59 -0
- data/lib/chef/knife/vcair_network_list.rb +57 -0
- data/lib/chef/knife/vcair_server_create.rb +231 -0
- data/lib/chef/knife/vcair_server_delete.rb +34 -0
- data/lib/chef/knife/vcair_server_list.rb +33 -0
- data/lib/chef/knife/vcair_server_show.rb +37 -0
- data/lib/chef/knife/vcair_vm_delete.rb +51 -0
- data/lib/chef/knife/vcair_vm_list.rb +62 -0
- data/lib/knife-vcair/version.rb +6 -0
- data/spec/integration/config/knife.rb +9 -0
- data/spec/integration/config/validation.pem +27 -0
- data/spec/integration/vchs_spec.rb +108 -0
- data/spec/spec_helper.rb +73 -0
- data/spec/unit/lib/chef/knife/vcair_server_create_spec.rb +231 -0
- data/spec/utils/knifeutils.rb +35 -0
- data/spec/utils/matchers.rb +29 -0
- metadata +257 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 06e8218ec3d029bc32086adb6b02bca62e2eaa52
|
4
|
+
data.tar.gz: 0dd36e3994dce157de1475725d3ffe7206b87001
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 688e1e6c79e5f6621beb4a652de9f66fce9cce42093f5ca3a1d52f8596e573fe4a8f556a301357862ae49678b1530e24ee0a7b26406ff0840eb19ed22aeaabd2
|
7
|
+
data.tar.gz: f0bbbc861117fe14550f77be187d57d7a002629fd0d5c27224532f3175c4985aca18db3f93ddc9662516479ee9fb9c86d374c85421df7b5b3cfb00988fe22c94
|
data/.gitignore
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
#----------------------------------------------------------------------------
|
2
|
+
# Ignore these files when commiting to a git repository.
|
3
|
+
#
|
4
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
5
|
+
#
|
6
|
+
# The original version of this file is found here:
|
7
|
+
# https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt
|
8
|
+
#
|
9
|
+
# Corrections? Improvements? Create a GitHub issue:
|
10
|
+
# http://github.com/RailsApps/rails-composer/issues
|
11
|
+
#----------------------------------------------------------------------------
|
12
|
+
|
13
|
+
# bundler state
|
14
|
+
/.bundle
|
15
|
+
/vendor/bundle/
|
16
|
+
/vendor/ruby/
|
17
|
+
vendor/
|
18
|
+
|
19
|
+
# minimal Rails specific artifacts
|
20
|
+
db/*.sqlite3
|
21
|
+
/log/*
|
22
|
+
/tmp/*
|
23
|
+
|
24
|
+
# various artifacts
|
25
|
+
**.war
|
26
|
+
*.rbc
|
27
|
+
*.sassc
|
28
|
+
.rspec
|
29
|
+
.redcar/
|
30
|
+
.sass-cache
|
31
|
+
/config/config.yml
|
32
|
+
/config/database.yml
|
33
|
+
/coverage.data
|
34
|
+
/coverage/
|
35
|
+
/db/*.javadb/
|
36
|
+
/db/*.sqlite3
|
37
|
+
/doc/api/
|
38
|
+
/doc/app/
|
39
|
+
/doc/features.html
|
40
|
+
/doc/specs.html
|
41
|
+
/public/cache
|
42
|
+
/public/stylesheets/compiled
|
43
|
+
/public/system/*
|
44
|
+
/spec/tmp/*
|
45
|
+
/cache
|
46
|
+
/capybara*
|
47
|
+
/capybara-*.html
|
48
|
+
/gems
|
49
|
+
/specifications
|
50
|
+
rerun.txt
|
51
|
+
pickle-email-*.html
|
52
|
+
/pkg/
|
53
|
+
|
54
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
55
|
+
# or operating system, you probably want to add a global ignore instead:
|
56
|
+
# git config --global core.excludesfile ~/.gitignore_global
|
57
|
+
#
|
58
|
+
# Here are some files you may want to ignore globally:
|
59
|
+
|
60
|
+
# scm revert files
|
61
|
+
**.orig
|
62
|
+
|
63
|
+
# Mac finder artifacts
|
64
|
+
.DS_Store
|
65
|
+
|
66
|
+
# Netbeans project directory
|
67
|
+
/nbproject/
|
68
|
+
|
69
|
+
# RubyMine project files
|
70
|
+
.idea
|
71
|
+
|
72
|
+
# Textmate project files
|
73
|
+
/*.tmproj
|
74
|
+
|
75
|
+
# vim artifacts
|
76
|
+
**.swp
|
77
|
+
.env
|
78
|
+
public/uploads
|
79
|
+
Procfile.dev
|
80
|
+
|
81
|
+
# RVM
|
82
|
+
.ruby-version
|
83
|
+
.ruby-gemset
|
84
|
+
.rails_footnotes
|
85
|
+
public/import/
|
86
|
+
tags
|
87
|
+
*~
|
88
|
+
|
89
|
+
Gemfile.lock
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
## 0.6.1
|
2
|
+
* Fixed network selection for creating servers #23
|
3
|
+
* Update bootstrap scripts #17
|
4
|
+
* Update development dependencies for Chef 12
|
5
|
+
* Fixed --cpu and --memory options/tests #15
|
6
|
+
* Readme updates #12
|
7
|
+
|
8
|
+
## 0.6.0
|
9
|
+
* VMworld version
|
10
|
+
|
11
|
+
## 0.1.3
|
12
|
+
* Vulk gets server create working
|
13
|
+
* rename from vCHS to vCloud Air
|
14
|
+
|
15
|
+
## 0.1.0
|
16
|
+
* Implementation using knife-cloud gem
|
17
|
+
* First listing functionality
|
18
|
+
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :rspec, cmd: "bundle exec rspec --color -r rspec/instafail -f RSpec::Instafail -r debugger" do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
# Rails example
|
10
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
+
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
14
|
+
watch('config/routes.rb') { "spec/routing" }
|
15
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
16
|
+
|
17
|
+
# Capybara features specs
|
18
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
19
|
+
|
20
|
+
# Turnip features and steps
|
21
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
22
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
23
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright 2015 Chef Software, Inc.
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
Knife vcair
|
2
|
+
===============
|
3
|
+
|
4
|
+
This is the official Chef Knife plugin VMware's vCloud Hybrid Service (vcair). This plugin gives knife the ability to create, bootstrap and manage instances on vcair-based public and private clouds.
|
5
|
+
|
6
|
+
Please refer to the [CHANGELOG](CHANGELOG.md) for version history and known issues.
|
7
|
+
|
8
|
+
# Installation #
|
9
|
+
|
10
|
+
## Current Source Build Instructions: ##
|
11
|
+
|
12
|
+
Then build and install this gem, run:
|
13
|
+
|
14
|
+
$ gem build knife-vcair.gemspec
|
15
|
+
$ gem install knife-vcair-0.6.X.gem
|
16
|
+
|
17
|
+
or if you are using the Chef Development Kit (Chef DK), to install it run:
|
18
|
+
|
19
|
+
$ chef gem install knife-vcair-0.X.0.gem
|
20
|
+
|
21
|
+
## Future Rubygems Instructions: ##
|
22
|
+
|
23
|
+
This plugin is distributed as a Ruby Gem. To install it, run:
|
24
|
+
|
25
|
+
$ gem install knife-vcair
|
26
|
+
|
27
|
+
If you are using the Chef Development Kit (Chef DK), to install it run:
|
28
|
+
|
29
|
+
$ chef gem install knife-vcair
|
30
|
+
|
31
|
+
# Configuration #
|
32
|
+
|
33
|
+
In order to communicate with an vcair API you will need to tell Knife
|
34
|
+
your vcair API endpoint, username, password and organization. The
|
35
|
+
easiest way to accomplish this is to create these entries in your
|
36
|
+
`knife.rb` file:
|
37
|
+
|
38
|
+
knife[:vcair_api_host] = 'vcair.example.com'
|
39
|
+
knife[:vcair_username] = 'Your vcair username'
|
40
|
+
knife[:vcair_password] = 'Your vcair password'
|
41
|
+
knife[:vcair_org] = 'Your vcair organization'
|
42
|
+
|
43
|
+
If your knife.rb file will be checked into a SCM system (ie readable
|
44
|
+
by others) you may want to read the values from environment variables.
|
45
|
+
|
46
|
+
knife[:vcair_api_host] = "#{ENV['VCAIR_API_URL']}"
|
47
|
+
knife[:vcair_username] = "#{ENV['VCAIR_USERNAME']}"
|
48
|
+
knife[:vcair_password] = "#{ENV['VCAIR_PASSWORD']}"
|
49
|
+
knife[:vcair_org] = "#{ENV['VCAIR_ORG']}"
|
50
|
+
|
51
|
+
## VMware's vcair ##
|
52
|
+
|
53
|
+
If you are using VMware's hosted vcair the API URL is found by logging
|
54
|
+
into the https://vchs.vmware.com, and clicking on your Dashboard's
|
55
|
+
Virtual Data Center. On the right under "Related Links" click on the
|
56
|
+
"vCloud Director API URL" and copy that value. It should look
|
57
|
+
something like
|
58
|
+
`https://p3v11-vcd.vchs.vmware.com:443/cloud/org/M511664989-4904/`
|
59
|
+
From this we will take our base API URL `p3v11-vcd.vchs.vmware.com`
|
60
|
+
and get our organization `M511664989-4904` that is appended to our
|
61
|
+
https://vchs.vmware.com login, giving us the values:
|
62
|
+
|
63
|
+
knife[:vcair_api_host] = 'p3v11-vcd.vchs.vmware.com'
|
64
|
+
knife[:vcair_username] = 'user@somedomain.com
|
65
|
+
knife[:vcair_password] = 'VCAIRSECRET'
|
66
|
+
knife[:vcair_org] = 'M511664989-4904'
|
67
|
+
|
68
|
+
# knife vcair subcommands #
|
69
|
+
|
70
|
+
This plugin provides the following Knife subcommands. Specific command
|
71
|
+
options can be found by invoking the subcommand with a `--help`
|
72
|
+
option.
|
73
|
+
|
74
|
+
## knife vcair server create OR knife vcair vm create ##
|
75
|
+
|
76
|
+
Instanciate a new VApp+VM from a Template from one of the available Catalogs.
|
77
|
+
|
78
|
+
**NOTE:** If `--vcair-net NETWORK` is not provided, the first non-isolated (i.e. natRouted or bridged) network is chosen
|
79
|
+
|
80
|
+
Windows example:
|
81
|
+
```
|
82
|
+
knife vcair server create \
|
83
|
+
--winrm-password Password1 \
|
84
|
+
--image W2K12-STD-64BIT \
|
85
|
+
--bootstrap-protocol winrm \
|
86
|
+
--customization-script ./install-winrm-vcair.bat \
|
87
|
+
--cpus 4 \
|
88
|
+
--memory 4096 \
|
89
|
+
--node-name windows2012 \
|
90
|
+
--vcair-net M511664989-4904-default-routed
|
91
|
+
```
|
92
|
+
|
93
|
+
The windows example requires a custom install script to setup winrm,
|
94
|
+
and set/change the initial password without using the web console. A
|
95
|
+
working example
|
96
|
+
[./install-winrm-vcair-example.bat](https://github.com/vulk/knife-vcair/blob/server-create/install-winrm-vcair-example.bat)
|
97
|
+
is included in this repo.
|
98
|
+
|
99
|
+
|
100
|
+
Linux example:
|
101
|
+
```
|
102
|
+
knife vcair server create \
|
103
|
+
--ssh-password Password1 \
|
104
|
+
--image "CentOS64-64bit" \
|
105
|
+
--customization-script ./install-linux-vcair.sh \
|
106
|
+
--cpus 4 \
|
107
|
+
--memory 4096 \
|
108
|
+
--node-name centos64 \
|
109
|
+
--vcair-net M511664989-4904-default-routed
|
110
|
+
```
|
111
|
+
|
112
|
+
The Linux example requires a custom script to set DNS servers for obtaining chef-client via omnibus.
|
113
|
+
This also includes a workaround for Ubuntu images to allow password authentication via SSH.
|
114
|
+
The Linux images require you pass the ssh-password. Ssh public keys
|
115
|
+
are not supported yet.
|
116
|
+
|
117
|
+
Assumptions:
|
118
|
+
* each VApp will only contain one VM.
|
119
|
+
* a routed network with a default SNAT rule allowing internet and DNS
|
120
|
+
* a firewall rule allowing that network to reach internet
|
121
|
+
|
122
|
+
**TODO**
|
123
|
+
* Allow specifying (possibly multiple) networks in server create
|
124
|
+
- Rather than just searching for one that ends in 'routed'
|
125
|
+
* Allow specifying nat setup / external IPs
|
126
|
+
* Allow specifying catalog item by name OR id, public or private
|
127
|
+
* Automatically image_os_type / bootstrap_protocol default basode on template default to linux/ssh
|
128
|
+
* See if windows images can be updated to set password correctly when set via the vchs API
|
129
|
+
* See if Linux images / API can be updated to use ssh keys
|
130
|
+
* Add support for `admin_auto_logon_*` to fog, and get windows/linux images updated to respect
|
131
|
+
* Support IP allocation modes other than DHCP, including manual
|
132
|
+
|
133
|
+
## knife vcair server delete OR knife vcair vm delete ##
|
134
|
+
|
135
|
+
Delete a vcair vAPP. `knife vcair vm delete` is the same command if
|
136
|
+
the term 'vm' is preferred over 'server'. **PLEASE NOTE** - this does
|
137
|
+
not delete the associated node and client objects from the Chef server
|
138
|
+
without using the `-P` option to purge the client.
|
139
|
+
|
140
|
+
## knife vcair server list OR knife vcair vm list ##
|
141
|
+
|
142
|
+
List the currently deployed vcair servers by their vAPP. `knife vcair vm list` is the same command if the term 'vm' is preferred over 'server'.
|
143
|
+
|
144
|
+
## knife vcair image list OR knife vcair template list ##
|
145
|
+
|
146
|
+
List the available vcair templates or images that may be used for deploying VMs.
|
147
|
+
|
148
|
+
## knife vcair network list ##
|
149
|
+
|
150
|
+
Lists the networks available to the current vcair organization.
|
151
|
+
|
152
|
+
## knife vcair nat list ##
|
153
|
+
|
154
|
+
**TODO** List the Network Address Translation (NAT) rules modifying the source/destination IP Addresses or packets arriving to and leaving from the vcair organization network.
|
155
|
+
|
156
|
+
## knife vcair firewall list ##
|
157
|
+
|
158
|
+
**TODO** The list of firewall rules configured for the current vcair organization network.
|
159
|
+
|
160
|
+
## knife vcair ip list ##
|
161
|
+
|
162
|
+
**TODO** The list of public IP Addresses provided and allocated for the current vcair organization network.
|
163
|
+
|
164
|
+
|
165
|
+
# Notes #
|
166
|
+
|
167
|
+
* The 20140619 Ubuntu images seems to not use customizaton (script nor setting password) and default to not allowing ssh w/ password even if known.
|
168
|
+
|
169
|
+
```ruby
|
170
|
+
template = public_catalog.catalog_items.get_by_name('Ubuntu Server 12.04 LTS (amd64 20140619)'
|
171
|
+
```
|
172
|
+
|
173
|
+
* An [example](https://gist.github.com/jicowan/e19fcbea08a9c6e2b1b6) of a [custom bootstrap template (distro)](https://docs.chef.io/knife_bootstrap.html#custom-templates) from @jicowan
|
174
|
+
|
175
|
+
# License #
|
176
|
+
|
177
|
+
Author:: Matt Ray (<matt@chef.io>)
|
178
|
+
|
179
|
+
Author:: Seth Thomas (<sthomas@chef.io>)
|
180
|
+
|
181
|
+
Author:: Chris McClimans (<c@vulk.co>)
|
182
|
+
|
183
|
+
Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
184
|
+
|
185
|
+
License:: Apache License, Version 2.0
|
186
|
+
|
187
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
188
|
+
you may not use this file except in compliance with the License.
|
189
|
+
You may obtain a copy of the License at
|
190
|
+
|
191
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
192
|
+
|
193
|
+
Unless required by applicable law or agreed to in writing, software
|
194
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
195
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
196
|
+
See the License for the specific language governing permissions and
|
197
|
+
limitations under the License.
|