Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Added resource for license management #110

Merged
merged 29 commits into from
Aug 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7fb8093
added license resource
girishramnani-crest Jul 13, 2017
7c8bf4e
resolved the update issue
girishramnani-crest Jul 14, 2017
7eac7c5
added check for deleting the key
girishramnani-crest Jul 14, 2017
8ec88ee
Added integration tests
girishramnani-crest Jul 18, 2017
9fb4f69
added documentation for the terraform site
girishramnani-crest Jul 21, 2017
38f1afe
solved the wrong file name issue
girishramnani-crest Jul 23, 2017
333c9e3
changed the test messages to be more informative
girishramnani-crest Jul 23, 2017
b51f522
removed the TODO and changed the testNames for consistency
girishramnani-crest Jul 23, 2017
6fe8231
changed the tags from [G] to [INFO]
girishramnani-crest Jul 23, 2017
0a4fbfb
renamed to test to have uppercase initials and better comments
girishramnani-crest Jul 23, 2017
cad35d1
managed invalid key
girishramnani-crest Jul 24, 2017
d361dc8
changed the decode method with a list->filter
girishramnani-crest Jul 24, 2017
d69af82
changes to merge with github master
girishramnani-crest Jul 25, 2017
d0bd3c5
updated readme
girishramnani-crest Jul 25, 2017
6cfc998
final check and cleanup
girishramnani-crest Jul 25, 2017
3495fd2
use different method to add license for vsphere and standalone
girishramnani-crest Aug 2, 2017
4339e00
add consistent spacing, removed the check for license_key
girishramnani-crest Aug 3, 2017
322c3e8
changed labels to TypeMap and updated the readme
girishramnani-crest Aug 3, 2017
62cd62a
updated the docs,made labels static in the test config and set labels…
girishramnani-crest Aug 5, 2017
a638adc
solved the wrong config and inlined the key env variable
girishramnani-crest Aug 8, 2017
48a46cf
error check for invalid license instead of decode error and indentati…
girishramnani-crest Aug 10, 2017
6f712bb
added error and ExpectError check for ESXi server
girishramnani-crest Aug 10, 2017
7e239a1
changed VCPUs to CPUs in the docs
girishramnani-crest Aug 10, 2017
316e794
split the test into vcenter and esxi specific and removed the tabs in…
girishramnani-crest Aug 11, 2017
d669808
mentioned the VSPHERE_TEST_ESXI env variable in the doc
girishramnani-crest Aug 11, 2017
f76eba8
made the config a const
girishramnani-crest Aug 14, 2017
44a3744
extracted updateLabels function and changed the create license proced…
girishramnani-crest Aug 17, 2017
de493e3
moved the error
girishramnani-crest Aug 17, 2017
05cdd19
Merge branch 'master' into license-resource
vancluever Aug 17, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

195 changes: 195 additions & 0 deletions vendor/github.com/vmware/govmomi/license/manager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,14 @@
"version": "v0.15.0",
"versionExact": "v0.15.0"
},
{
"checksumSHA1": "gqiwfI1jgNjANcUHiI1z5f+3zF4=",
"path": "github.com/vmware/govmomi/license",
"revision": "b63044e5f833781eb7b305bc035392480ee06a82",
"revisionTime": "2017-06-19T23:14:37Z",
"version": "v0.15.0",
"versionExact": "v0.15.0"
},
{
"checksumSHA1": "J3JrwZagGYMX6oNMkdsUFf8hHo8=",
"comment": "v0.15.0",
Expand Down
62 changes: 62 additions & 0 deletions vsphere/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Terraform vSphere Provider Dev Docs

This document is in place for developer documentation. User documentation is located [HERE](https://www.terraform.io/docs/providers/vsphere/) on Terraform's website.

Thank-you [@tkak](https://github.com/tkak) and [Rakuten, Inc.](https://github.com/rakutentech) for their original contribution of the source base used for this provider!

## Introductory Documentation

Both [README.md](../../../README.md) and [BUILDING.md](../../../BUILDING.md) should be read first!

## Base API Dependency ~ [govmomi](https://github.com/vmware/govmomi)

This provider utilizes [govmomi](https://github.com/vmware/govmomi) Go Library for communicating to VMware vSphere APIs (ESXi and/or vCenter).
Because of the dependency this provider is compatible with VMware systems that are supported by govmomi. Much thanks to the dev team that maintains govmomi, and
even more thanks to their guidance with the development of this provider. We have had many issues answered by the govmomi team!

#### vSphere CLI ~ [govc](https://github.com/vmware/govmomi/blob/master/govc/README.md)

One of the great tools that govmomi contains is [govc](https://github.com/vmware/govmomi/blob/master/govc/README.md). It is a command line tool for using the govmomi API. Not only is it a tool to use, but also it's
[source base](https://github.com/vmware/govmomi/blob/master/govc/) is a great resource of examples on how to exercise the API.

## Required privileges for running Terraform as non-administrative user
Most of the organizations are concerned about administrative privileges. In order to use Terraform provider as non priviledged user, we can define a new Role within a vCenter and assign it appropriate privileges:
Navigate to Administration -> Access Control -> Roles
Click on "+" icon (Create role action), give it appropraite name and select following privileges:
* Datastore
- Allocate space
- Browse datastore
- Low level file operations
- Remove file
- Update virtual machine files
- Update virtual machine metadata

* Folder (all)
- Create folder
- Delete folder
- Move folder
- Rename folder

* Network
- Assign network

* Resource
- Apply recommendation
- Assign virtual machine to resource pool

* Virtual Machine
- Configuration (all) - for now
- Guest Operations (all) - for now
- Interaction (all)
- Inventory (all)
- Provisioning (all)

* License
- Add license
- Remove license
- Update license labels

These settings were tested with [vSphere 6.0](https://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.vsphere.security.doc%2FGUID-18071E9A-EED1-4968-8D51-E0B4F526FDA3.html) and [vSphere 5.5](https://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.vsphere.security.doc%2FGUID-18071E9A-EED1-4968-8D51-E0B4F526FDA3.html). For additional information on roles and permissions, please refer to official VMware documentation.

This section is a work in progress and additional contributions are more than welcome.

1 change: 1 addition & 0 deletions vsphere/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func Provider() terraform.ResourceProvider {
"vsphere_folder": resourceVSphereFolder(),
"vsphere_virtual_disk": resourceVSphereVirtualDisk(),
"vsphere_virtual_machine": resourceVSphereVirtualMachine(),
"vsphere_license": resourceVSphereLicense(),
},

ConfigureFunc: providerConfigure,
Expand Down
Loading