Skip to content

Commit

Permalink
* Release 1.5.0 with support for OnCommand Cloud Manager 3.3.0 (#3)
Browse files Browse the repository at this point in the history
** aws_standalone
ADD: Berksfile for cookbook resolution
UPDATE: Files::occm-role-policy to include updated IAM requirements for OCCM 3.3.0
UPDATE: Script::bootstrap.sh to install the ChefDK client and use the Berksfile to package the cookbooks and dependencies.
UPDATE: Templates::create_ontap.json.tpl to include variable to set the ontap_write_speed
UPDATE: Main.tf to streamline resource idempotence and deployment
UPDATE: Output.tf variable outputs
UPDATE: templates.tf to include changes in setting the write_speed
UPDATE: variables.tf formatting and defaults.

** aws_standalone_full
ADD: Berksfile for cookbook resolution
UPDATE: Files::occm-role-policy to include updated IAM requirements for OCCM 3.3.0
UPDATE: Script::bootstrap.sh to install the ChefDK client and use the Berksfile to package the cookbooks and dependencies.
UPDATE: Templates::create_ontap.json.tpl to include variable to set the ontap_write_speed
UPDATE: Main.tf to streamline resource idempotence and deployment
UPDATE: Output.tf variable outputs
UPDATE: templates.tf to include changes in setting the write_speed
UPDATE: variables.tf formatting and defaults.
  • Loading branch information
goodrum committed Jun 28, 2017
1 parent 9777fcf commit f1ac66b
Show file tree
Hide file tree
Showing 20 changed files with 939 additions and 538 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

*/*.tfvars
*/*.tfstate*
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# aws_standalone Terraform CHANGELOG

This file is used to list changes made in each version of the aws_standalone Terraform.


## v1.5.0

- aws_standalone
- ADD: Berksfile for cookbook resolution
- UPDATE: Files::occm-role-policy to include updated IAM requirements for OCCM 3.3.0
- UPDATE: Script::bootstrap.sh to install the ChefDK client and use the Berksfile to package the cookbooks and dependencies.
- UPDATE: Templates::create_ontap.json.tpl to include variable to set the ontap_write_speed
- UPDATE: Main.tf to streamline resource idempotence and deployment
- UPDATE: Output.tf variable outputs
- UPDATE: templates.tf to include changes in setting the write_speed
- UPDATE: variables.tf formatting and defaults.

- aws_standalone_full
ADD: Berksfile for cookbook resolution
UPDATE: Files::occm-role-policy to include updated IAM requirements for OCCM 3.3.0
UPDATE: Script::bootstrap.sh to install the ChefDK client and use the Berksfile to package the cookbooks and dependencies.
UPDATE: Templates::create_ontap.json.tpl to include variable to set the ontap_write_speed
UPDATE: Main.tf to streamline resource idempotence and deployment
UPDATE: Output.tf variable outputs
UPDATE: templates.tf to include changes in setting the write_speed
UPDATE: variables.tf formatting and defaults.

## v1.0.0

- Initial release with support for deployment and setup of OnCommand Cloud Manager and the creation and deletion of ONTAP Cloud for AWS systems
134 changes: 78 additions & 56 deletions aws_standalone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,14 @@ _Note: On `terraform destroy`, the associated ONTAP Cloud system deployed will b
- [ONTAP Cloud charges and AWS fees](#ontap-cloud-charges-and-aws-fees)
- [NetApp and Amazon Marketplace registration](#netapp-and-amazon-marketplace-registration)
- [Tools and versions](#tools-and-versions)
- [Usage](#usage)
- [Before you begin](#before-you-begin)
- [Terraform Commands](#terraform-commands)
- [Re-running the provisioning effort and changes](#re-running-the-provisioning-effort-and-changes)
- [Resources](#resources)
- [Variables](#variables)
- [AWS Variables](#aws-variables)
- [OnCommand Cloud Manager Variables](#oncommand-cloud-manager-variables)
- [ONTAP Cloud for AWS](#ontap-cloud-for-aws)
- [Terraform Configuration Files](#terraform-configuration-files)
- [Files](#files)
- [Scripts](#scripts)
- [Templates](#templates)
- [Default Variable Values](#default-variable-values)
- [CHEF Solo integration](#chef-solo-integration)
- [Run_Lists and Attributes](#run_lists-and-attributes)
- [Usage](#usage)
- [Before you begin](#before-you-begin)
- [Re-running the provisioning effort and changes](#re-running-the-provisioning-effort-and-changes)
- [Contribute](#contribute)
- [License & Authors](#license-&-authors)

Expand All @@ -40,16 +33,47 @@ This Terraform template will deploy cloud instances and resources into your Amaz

### NetApp and Amazon Marketplace registration
Prior running this template, you will need to ensure that your AWS account has subscribed to the official ONTAP Cloud for AWS and OnCommand Cloud Manager images:
* Visit the [official page for OnCommand Cloud Manager in the AWS Marketplace](https://aws.amazon.com/marketplace/pp/B018REK8QG]) for more information.
* Visit the [official page for ONTAP Cloud in the AWS Marketplace](https://aws.amazon.com/marketplace/pp/B011KEZ734]) for more information.
* Visit the [official page for OnCommand Cloud Manager in the AWS Marketplace](https://aws.amazon.com/marketplace/pp/B018REK8QG) for more information.
* Visit the [official page for ONTAP Cloud in the AWS Marketplace](https://aws.amazon.com/marketplace/pp/B011KEZ734) for more information.

### Tools and versions

- OnCommand Cloud Manager 3.2.0+
- Chef Solo 12.5+
- Terraform v0.9.2+

### Resources
## Usage
### Before you begin
---
Verify your meet these requirements
- [Terraform v0.9.2+](https://www.terraform.io/downloads.html) installed on your local machine
- You have an active and valid AWS account with an Identity and Access Management user credentials. More information found [in the official AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).
- You have registered for access to the OnCommand Cloud Manager and ONTAP Cloud AMI<br>Simply go to each of the below links and register
- [OnCommand Cloud Manager](https://aws.amazon.com/marketplace/pp/B018REK8QG)
- [ONTAP Cloud for AWS](https://aws.amazon.com/marketplace/pp/B011KEZ734)

### Terraform Commands
---
- `terraform plan`: Execute the planned output to verify the current desired infrastructure state
- `terraform apply`: Run the configuration using the supplied variables.
- `terraform destroy`: Execute the destruction sequence to remove all resources.
- `terraform taint`: Mark a resource for recreation. All child dependent resources will be reset and redeployed as well.

### Re-running the provisioning effort and changes
---
All host configurations have been place in custom resources using the Terraform `null_resource` operator. This allows for easy re-application of templates and services. All of the configurations are designed to set the desired state and only update when the existing configuration does not match. Only if a specific resource is marked for destruction, will the destroy triggers enact.

#### Configuration Resources
---
- `null_resource.ontap_cloud`: Manages the configuration of OnCommand Cloud Manager and the ONTAP Cloud system

#### Redeploying an instance
---
If you mark an instance for redeployment, the associated configuration resource will be marked as well. The deletion of a host will trigger clean-up resources if defined.

Since the ONTAP Cloud system can be added or removed outside of this infrastructure, the process to reset the OnCommand Cloud Manager host will delete the existing ONTAP Cloud system and force a redeployment. This action will also cause the Peritus Test Case host to rerun its configuration to ensure that everything connects.

## Resources
This Terraform will create the following resources:
- AWS Identity Access Management (IAM) Policy
- AWS Identity Access Management (IAM) Profile
Expand All @@ -58,40 +82,52 @@ This Terraform will create the following resources:
- AWS EC2 Instance using OnCommand Cloud Manager marketplace image
- NetApp ONTAP Cloud for AWS instance with 1TB of storage

### Variables
## Variables
_NOTE: properties in bold are required_

#### Configuration Variables
| Variable | Description | Default Value |
| ------------- |------------- |------------- |
| **`owner_name`** | Your Username to identify your infrastructure. | |
| `converge` | Setting this variable on subsquent runs will force a reload of the configuration and re-apply the configurations. Changing this value will notify the provisioning resources to reconverge their configurations. You can override the value from the command line by running `terraform apply -var converge=true` <br><br> _Note: Once changed, the value is preserved so the next time the `terraform apply` command is run, the value will revert to the default._| false |

#### AWS Variables
| Variable | Description |
| ------------- |-------------|
| **`aws_profile`** | Identifies the AWS Shared Credentials File profile name. More information found [in the official AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).|
| **`key_name`** | Existing AWS KeyPair name. Must match the KeyPair referenced in `key_file_path`.|
| **`key_file_path`** | Local file path to the SSH key selected as the `aws_keyname`.|
| **`region:`** | AWS region to which the systems will be deployed.|
| **`subnet_id`** | AWS Subnet to which the systems will be deployed. Must exist in your region.|
| Variable | Description | Default Value |
| ------------- |------------- |------------- |
| `aws_profile` | Identifies the AWS Shared Credentials File profile name. More information found [in the official AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).| default |
| `region:` | AWS region to which the systems will be deployed.| us-east-1 |
| **`subnet_id`** | AWS Subnet to which the systems will be deployed. Must exist in your region.| |
| **`key_name`** | Existing AWS KeyPair name. Must match the KeyPair referenced in `key_file_path`.| |
| **`key_file_path`** | Local file path to the SSH key selected as the `aws_keyname`.| |

#### OnCommand Cloud Manager Variables
| Variable | Description |
| ------------- |-------------|
| **`occm_email`**| The email address to register as the Cloud Admin for the new OnCommand Cloud Manager server.|
| **`occm_password`**| OnCommand Cloud Manager Admin password.|
| **`company_name`**| Your company name to which the OnCommand Cloud manager system will be registered.|
| `occm_amis`| This is a reference variable and does not need to be set. List of the OnCommand Cloud Manager AMIs per region.|
| Variable | Description | Default Value |
| ------------- |------------- |------------- |
| **`occm_email`**| The email address to register as the Cloud Admin for the new OnCommand Cloud Manager server.| |
| **`occm_password`**| OnCommand Cloud Manager Admin password.| |
| **`company_name`**| Your company name to which the OnCommand Cloud manager system will be registered.| |
| `occm_amis`| This is a reference variable and does not need to be set. List of the OnCommand Cloud Manager AMIs per region.| Automatically selected based on region |

#### ONTAP Cloud for AWS
| Variable | Description |
| ------------- |-------------|
| **`ontap_name`**| New ONTAP Cloud Name.|
| **`ontap_password`**| New ONTAP Cloud password for Admin.|
| `ontap_size`| Size of the Aggregate: Pick One - 100GB, 500GB, 1TB, 2TB, 4TB, 8TB. Default = '1TB'.|
| `ontap_instance`| AWS Instance type for ONTAP Cloud instance. Note: must be a supported size for the selected license type". Default = 'm4.xlarge'.|
| `license_type`| ONTAP Cloud license type. Supported values are ['cot-explore-paygo', 'cot-standard-paygo', 'cot-premium-paygo']. Default value is 'cot-explore-paygo'|
| Variable | Description | Default Value |
| ------------- |------------- |------------- |
| `ontap_name`| New ONTAP Cloud Name.| demolab |
| `ontap_password`| New ONTAP Cloud password for Admin.| netapp123 |
| `ontap_size`| Size of the Aggregate: Pick One - 100GB, 500GB, 1TB, 2TB, 4TB, 8TB. | 500GB |
| `ontap_instance`| AWS Instance type for ONTAP Cloud instance. Note: must be a supported size for the selected license type". Default = 'm4.xlarge'.| m4.xlarge |
| `license_type`| ONTAP Cloud license type. Supported values are ['cot-explore-paygo', 'cot-standard-paygo', 'cot-premium-paygo']. | cot-explore-paygo |
| `write_speed`| Sets the ONTAP Cloud write speed. 'normal' is standard with high consistency guarantee, while 'high' will increase write performance at the risk of potential data loss in the event of a failure. | normal |


### Terraform Configuration Files

```
├── aws_standalone/
│ ├── files
│ │ ├── occm-ec2-role.json
│ │ ├── occm-role-policy.json
│ │ ├── solo.rb
│ │ ├── Berksfile
│ ├── scripts
│ │ ├── check_server_health.sh
│ │ ├── bootstrap.sh
Expand All @@ -102,19 +138,23 @@ _NOTE: properties in bold are required_
│ │ │ ├── occm
│ │ │ │ ├── admin_credentials.json.tpl
│ │ │ │ ├── ontap_credentials.json.tpl
│ ├── terraform.tfvars
│ ├── main.tf
│ ├── output.tf
│ ├── README.md
│ ├── variables.tf
```

#### Files
---
- `files/occm-ec2-role.json`: Default role model for IAM EC2 Role used by OnCommand Cloud manager
- `files/occm-role-policy.json`: Creates a new IAM policy used by OnCommand Cloud Manager's IAM EC2 Role and sets valid permissions for the system.
- `files/solo.rb`: Configures CHEF Solo defaults for bootstrapping purposes.
- `files/Berksfile`: Berkshelf configuration file to identify cookbooks and dependencies.

#### Scripts
---
- `scripts/check_server_health.sh`: Forces Terraform to wait for the OnCommand Cloud Manager system services to be fully up prior to provisioning. This solves a race condition where SSH responds faster than the services have time to complete first-boot.
- `scripts/bootstrap.sh`: Executes the installation of Git, downloads the Chef Client, Clones the CHEF cookbooks, and triggers the CHEF Solo command to self-bootstrap.
- `scripts/bootstrap.sh`: Executes the installation of Git, downloads the Chef Client and ChefDK, uses Berkshelf to package the CHEF cookbooks, and triggers the CHEF Solo command to self-bootstrap.

#### Templates
---
Expand All @@ -128,6 +168,7 @@ _NOTE: properties in bold are required_
Create a new file called `terraform.tfvars` to include the variable name and the value to which to assign. This file can be used to preserve the values of the Terraform variables but is explicitly not included in source code control as per the included .gitignore file.

```
owner_name = "Jeremy Goodrum"
aws_profile = "exosphere"
key_name = "terraform"
key_file_path = "~/Downloads/terraform.pem"
Expand All @@ -149,25 +190,6 @@ This Terraform template requires the use of the [ONTAP Cloud CHEF Cookbook](gith
#### Run_Lists and Attributes
Once the OnCommand Cloud Manager has booted and passed the server_health tests, the remote provisioners will transfer the files and start the bootstap process. The current list of supported node attributes can be found at the [ONTAP Cloud CHEF Cookbook](github.com/exospheredata/netapp_ontap_cloud) repository. The values for these can be added or removed in the `create_ontap.json.tpl` file in the templates directory.

## Usage
### Before you begin
Verify your meet these requirements
- [Terraform v0.9.2+](https://www.terraform.io/downloads.html) installed on your local machine
- You have an active and valid AWS account with an Identity and Access Management user credentials. More information found [in the official AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).
- You have registered for access to the OnCommand Cloud Manager and ONTAP Cloud AMI
- Simply go to each of the below links and register
- [OnCommand Cloud Manager](https://aws.amazon.com/marketplace/pp/B018REK8QG)
- [ONTAP Cloud for AWS](https://aws.amazon.com/marketplace/pp/B011KEZ734)


### Re-running the provisioning effort and changes
Since the ONTAP Cloud system can be added or removed outside of this infrastructure, the provisioner for this resource was moved to use the null_resource method and outside of the instance creation. This means that if you need to re-run the configuration, you will only need to `taint` the resource as such:
```
terraform taint null_resource.ontap_cloud
```

The above command will force the system to run the provisioner once again. The process will idempodently execute the run_list provided in the `create_ontap.json.tpl` under recipes.

## Contribute
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
Expand Down
11 changes: 11 additions & 0 deletions aws_standalone/files/Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Berksfile
#
# maintainer:: Exosphere Data, LLC
# maintainer_email:: [email protected]
#
# Copyright:: 2017, Exosphere Data, LLC, All Rights Reserved.
#

source 'https://supermarket.chef.io'

cookbook 'netapp_ontap_cloud', git: 'https://github.com/exospheredata/netapp_ontap_cloud.git'
Loading

0 comments on commit f1ac66b

Please sign in to comment.