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

BD Modifications to add Storage Volume resource management #156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bins/
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ This version supports OneView appliances with version 4.2 using the OneView REST

- Support for Update Group in Logical Enclosure.
- Support for Update Compliance in Logical Interconnect.
- Usecase for synergy infrastructure provisioning with Network.
- Usecase for synergy infrastructure provisioning with i3s.

### Oneview Features supported
- Enclosure
Expand Down Expand Up @@ -49,11 +47,11 @@ This version supports OneView appliances with version 4.2 using the OneView REST
### Notes
- Patch changes to sever profile to include boot order fixes.
- Usecase for infrasructure provisioning without storage and image streamer

# [v1.0.0]
### Notes
This is the first release of the OneView modules in Terraform and it adds support to core features listed below.
This version of the module supports OneView appliances with version 4.10, using the OneView REST API version 800.
This is the first release of the OneView modules in Terraform and it adds support to core features listed below.
This version of the module supports OneView appliances with version 4.10, using the OneView REST API version 800.

### Major changes:
- Support for Go 1.11
Expand Down
29 changes: 4 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
FROM golang:alpine
MAINTAINER "Priyanka Sood <[email protected]>"
FROM alpine

ENV TERRAFORM_VERSION=0.11.10
# Add the recently compiled Go binaries
ADD bins/linux/ /usr/local/terraform/

ENV USER root
RUN mkdir -p /usr/local/terraform
RUN apk update && \
apk add curl jq python bash ca-certificates git openssl unzip wget && \
cd /tmp && \
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/terraform/

ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH /go/bin:$PATH

RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
WORKDIR /go/src/github.com/HewlettPackard/terraform-provider-oneview

COPY . /go/src/github.com/HewlettPackard/terraform-provider-oneview

RUN cd $GOPATH/src/github.com/HewlettPackard/terraform-provider-oneview
RUN go build -o $GOPATH/bin/terraform-provider-oneview
RUN mv $GOPATH/bin/terraform-provider-oneview /usr/local/terraform/

RUN go get github.com/kardianos/govendor
# Add the folder above to the path
ENV PATH $PATH:/usr/local/terraform/
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A Terraform provider for oneview
## Installing `terraform-provider-oneview` with Go

* Install Go 1.11. For previous versions, you may have to set your `$GOPATH` manually, if you haven't done it yet.
* Install Terraform 0.11.x [from here](https://www.terraform.io/downloads.html) and save it into `/usr/local/bin/terraform` folder (create it if it doesn't exists). This provider DOES NOT SUPPORT Terraform 0.12 or above.
* Install Terraform 0.11.x or above [from here](https://www.terraform.io/downloads.html) and save it into `/usr/local/bin/terraform` folder (create it if it doesn't exists)
* Download the code by issuing a `go get` command.

```bash
Expand All @@ -24,18 +24,18 @@ $ mv $GOPATH/bin/terraform-provider-oneview /usr/local/bin/terraform
## Using `terraform-provider-oneview` with Docker


We also provide a lightweight and easy way to test and execute `terraform-provider-oneview`. The `prisood/terraform-provider-oneview` docker image contains
We also provide a lightweight and easy way to test and execute `terraform-provider-oneview`. The `dciacoe/terraform-provider-oneview` docker image contains
an installation of Terraform and our provider you can use by just pulling down the Docker Image:

```bash
# Download and store a local copy of terraform-provider-oneview and
# use it as a Docker image.
$ docker pull prisood/terraform-provider-oneview

$ docker pull dciacoe/terraform-provider-oneview
# Run docker commands using the "ash" shell from Alpine, this will create
# a sh session where you can create files, issue commands and execute both
# terraform and the provider with ease.
$ docker run -it prisood/terraform-provider-oneview /bin/sh
$ docker run -it dciacoe/terraform-provider-oneview /bin/sh
```


Expand All @@ -51,7 +51,6 @@ provider "oneview" {
ov_endpoint = "<ov_endpoint>"
ov_sslverify = true/false
ov_apiversion = <ov_apiversion>
ov_domain = "<ov_domain>"
ov_ifmatch = "*"
}
```
Expand Down
30 changes: 0 additions & 30 deletions docs/d/server_profile.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,3 @@ In addition to the arguments listed above, the following computed attributes are
* `ilo_ip` - The ILO ip address that is managing the server.

* `hardware_uri` - The URI of the hardware the server is provisioned on.

* `boot_order` - Defines the order in which boot will be attempted on the available devices.

* `boot_mode` - Boot mode settings to be configured on the server.

* `bios_option` - Server BIOS settings.

* `server_hardware_type` - Identifies the server hardware type for which the Server Profile was designed.

* `enclosure_group` - Identifies the enclosure group for which the Server Profile was designed.

* `affinity` - This identifies the behavior of the server profile when the server hardware is removed or replaced.

* `hide_unused_flex_nics` - This setting controls the enumeration of physical functions that do not correspond to connections in a profile.

* `serial_number_type` - Specifies the type of Serial Number and UUID to be programmed into the server ROM.

* `wwn_type` - Specifies the type of WWN address to be programmed into the IO devices.

* `mac_type` - Specifies the type of MAC address to be programmed into the IO Devices.

* `firmware` - Defines and enables firmware baseline management.

* `local_storage` - Local storage settings to be configured on the server.

* `logical_drives` - The list of logical drives associated with the controller.

* `san_storage` - The profile san storage configuration.

* `volume_attachments` - The list of storage volume attachments.
26 changes: 11 additions & 15 deletions docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ layout: "oneview"
page_title: "Provider: OneView"
sidebar_current: "docs-oneview-index"
description: |-
The Oneview provider is used to interact with your on premise OneView system. The provider needs to be configured with the proper credentials before it can be used.
The Oneview provider is used to interact with your on premise OneView system. The provider needs to be configured with the proper credentials before it can be used.
---

# Oneview Provider
# Oneview Provider

The Oneview provider is used to interact with [OneView](https://www.hpe.com/us/en/integrated-systems/software.html).
The provider needs to be configured with the proper credentials before it can be used.
The Oneview provider is used to interact with [OneView](https://www.hpe.com/us/en/integrated-systems/software.html).
The provider needs to be configured with the proper credentials before it can be used.

## Example Usage
```js
Expand All @@ -19,9 +19,7 @@ provider "oneview" {
ov_password = "password123"
ov_endpoint = oneview_url.com
ov_sslverify = true
ov_apiversion = 800
ov_domain = "Local"
ov_ifmatch = "*"
ov_apiversion = 200
}

//Create a new ethernet network
Expand All @@ -37,26 +35,24 @@ The Oneview provider supports static credentials and environment variables.

The following keys can be used to configure the provider.

* `ov_username` - (Optional) This is the OneView username.
* `ov_username` - (Optional) This is the OneView username.
It must be provided or sourced from ONEVIEW_OV_USER environment variable.

* `ov_password` - (Optional) This is the OneView password.
* `ov_password` - (Optional) This is the OneView password.
It must be provided or sourced from ONEVIEW_OV_PASSWORD environment variable.

* `ov_endpoint` - (Optional) This is the OneView URL.
It must be provided or sourced from ONEVIEW_OV_ENDPOINT environment variable.

* `ov_sslverify` - (Optional) This is a boolean value for whether ssl is enabled.
* `ov_sslverify` - (Optional) This is a boolean value for whether ssl is enabled.
It must be provided or sourced from ONEVIEW_OV_SSLVERIFY environment variable.

* `ov_apiversion` - (Optional) This specifies what API version to use.
It must be provided or sourced from ONEVIEW_OV_API_VERSION environment variable.

* `ov_domain` - (Optional) This is the domain to use for the oneview system.
It can be provided or sourced from ONEVIEW_OV_DOMAIN environment variable.

* `ov_ifmatch` - (Optional) This is the if-Match(ETag) request header to use for the oneview system.
It can be provided or sourced from ONEVIEW_OV_IF_MATCH environment variable.



* `i3s_endpoint` - (Optional) This is the endpoint to connect to an image streamer instance
It can be provided or sourced from ONEVIEW_I3S_ENDPOINT environment variable.
14 changes: 2 additions & 12 deletions docs/r/fcoe_network.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,13 @@ resource "oneview_fcoe_network" "default" {

## Argument Reference

The following arguments are supported:
The following arguments are supported:

* `name` - (Required) A unique name for the resource.

* `vlanId` - (Required) The Virtual LAN (VLAN) identification number (integer) assigned to the network.
* `vlanId` - (Required) The Virtual LAN (VLAN) identification number (integer) assigned to the network.
Changing this forces a new resource

* `initial_scope_uris` - (Optional) A list of URIs of the scopes to which the resource shall be initially assigned.

* `connection_template_uri` - The connection template URI that is associated with this Fibre Channel network.

* `managed_san_uri` - The managed SAN URI that is associated with this Fibre Channel network.

* `fabric_uri` - The URI of the fabric resource of which this resource is a member.

* `description` - Brief description of the resource.

## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:
Expand Down
65 changes: 65 additions & 0 deletions docs/r/icsp_server.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
layout: "oneview"
page_title: "Oneview: icsp_server"
sidebar_current: "docs-oneview-icsp-server"
description: |-
Hooks a server profile created in OneView into ICSP.
---

# oneview\_icsp\_server

Hooks a server profile created in OneView into ICSP.

## Example Usage

```js
resource "icsp_server" "default" {
ilo_ip = "15.x.x.x"
user_name = "ilo_user"
password = "ilo_password"
serial_number = "${oneview_server_profile.default.serial_number}"
build_plans = ["/rest/os-deployment-build-plans/1570001"]
}
```

## Argument Reference

The following arguments are supported:

* `ilo_ip` - (Required) The IP address of the iLO of the server.

* `user_name` - (Required) The user name required to log into the server's iLO.

* `password` - (Required) The password required to log into the server's iLO.

* `serial_number` - (Required) The serial number assigned to the Server.

- - -

* `port` - (Optional) The iLO port to use when logging in.
This defaults to 443.

* `build_plans` - (Optional) An array of build plan uris that you want to run on the server.

* `public_mac` - (Optional) The MAC address of the NIC that will be the public network connection.

* `public_slot_id` - (Optional) The slot id for the public network connection.

* `custom_attribute` - (Optional) A key/value pair for a custom attribute you would like associated with
the server on icsp. Custom Attribute options specified below.

Custom Attribute supports the following:

* `key` - (Required) - The unique name of the attribute.

* `value` - (Required) - The value of the attribute.

* `scope` - (Optional) - The scope of the attribute. Defaults to `server`.

## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

* `mid` - A unique ID assigned to the Server by Server Automation.

* `public_ipv4` - The public ip address if `public_mac` and `public_slot_id` were specified in the configuration.
69 changes: 3 additions & 66 deletions docs/r/logical_enclosure.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,74 +25,11 @@ resource "oneview_logical_enclosure" "default" {

The following arguments are supported:

* `name` -(Required) A unique name for the resource.
* `name` -(Optional) A unique name for the resource.

---

* `enclosure_uris` -(Required) The set of uris associated with the enclosure.
* `enclosure_uris` -(Optional) The set of uris associated with the enclosure.

* `enclosure_group_uri` - (Required) The uri of the enclosure group.

---
description: |-
Imports a Logical Enclosure from appliance.
---

Import a logical enclosure.

## Example Usage

```js
resource "oneview_logical_enclosure" "default" {
# Empty body
}
```
## Terraform Command to import

terraform import oneview_logical_enclosure.default <logical-enclosure-name>

## Argument Reference

The following arguments are supported:

* `logical-enclosure-name` - (Required) A unique name for the resource as per the appliance.

- - -
description: |-
Updates Logical Enclosure
---

# oneview\_logical\_enclosure

Update logical enclosure.

## Example Usage

```js
resource "oneview_logical_enclosure" "default" {
name = "default-logical-enclosure"
enclosure_uris = ["${oneview_enclosure1.uri}", "${oneview_enclosure2.uri}"]
enclosure_group_uri = "${oneview_enclosure_group.uri}"
update_type = "update-type"
}
```

## Argument Reference

The following arguments are supported:

* `name` -(Required) A unique name for the resource.

---

* `enclosure_uris` -(Required) The set of uris associated with the enclosure.

* `enclosure_group_uri` - (Required) The uri of the enclosure group.

* `update_type` - (Required) Type of update of Logical Enclosure.

| NO | Type of Update | Update String |
|----|------------------------------------------------|-------------------------------|
| 1 |`UpdateLogicalEnclosure` |'update' |
| 2 |`UpdateFromGroupLogicalEnclosure` |'updateByGroup' |
* `enclosure_group_uri` - (Optional) The uri of the enclosure group.

8 changes: 0 additions & 8 deletions docs/r/network_set.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,3 @@ In addition to the arguments listed above, the following computed attributes are
* `uri` - The URI of the created resource.

* `eTag` - Entity tag/version ID of the resource.

* `connection_template_uri` - The URI of the existing connection template associated with this object.

* `scopesUri` - The URI for the resource scope assignments.

* `description` - Brief description of the resource.

* `network_set_type` - NetworkSet Type whose default value is "Regular".
Loading