Cloud Volumes Automation via Terraform
This solution documents the automated deployments of Cloud Volumes on AWS (CVO Single Node, CVO HA and FSX ONTAP) and Azure (CVO Single Node, CVO HA and ANF) using Terraform modules. The code can be found at https://github.com/NetApp/na_cloud_volumes_automation
Pre-requisites
-
Terraform >= 0.13
-
Cloud Manager Account
-
Cloud Provider Account – AWS, Azure
-
Host machine (any OS supported by Terraform)
Provider documentation
The documentation of Terraform provider for Cloud Manager is available at: https://registry.terraform.io/providers/NetApp/netapp-cloudmanager/latest/docs
Controlling the provider version
Note that you can also control the provider version. This is controlled by a required_providers block in your Terraform configuration.
The syntax is as follows:
Read more on provider version control.
Running Specific Modules
AWS
This section contains various Terraform configuration files to deploy/configure single node NetApp CVO (Cloud Volumes ONTAP) on AWS (Amazon Web Services).
Terraform Documentation: https://registry.terraform.io/providers/NetApp/netapp-cloudmanager/latest/docs
In order to run the template:
-
Clone the repository.
-
Navigate to the desired folder
-
Configure AWS credentials from the CLI.
-
AWS Access Key ID [None]: accesskey
-
AWS Secret Access Key [None]: secretkey
-
Default region name [None]: us-west-2
-
Default output format [None]: json
-
-
Update the variable values in
vars/aws_cvo_single_node_deployment.tfvar
You can choose to deploy the connector by setting the variable "aws_connector_deploy_bool" value to true/false. -
Initialize the Terraform repository to install all the pre-requisites and prepare for deployment.
-
Verify the terraform files using terraform validate command.
-
Make a dry run of the configuration to get a preview of all the changes expected by the deployment.
-
Run the deployment
To delete the deployment
Connector
Terraform variables for NetApp AWS connector instance for CVO deployment.
Name | Type | Description |
---|---|---|
aws_connector_deploy_bool |
Bool |
(Required) Check for Connector deployment. |
aws_connector_name |
String |
(Required) The name of the Cloud Manager Connector. |
aws_connector_region |
String |
(Required) The region where the Cloud Manager Connector will be created. |
aws_connector_key_name |
String |
(Required) The name of the key pair to use for the Connector instance. |
aws_connector_company |
String |
(Required) The name of the company of the user. |
aws_connector_instance_type |
String |
(Required) The type of instance (for example, t3.xlarge). At least 4 CPU and 16 GB of memory are required. |
aws_connector_subnet_id |
String |
(Required) The ID of the subnet for the instance. |
aws_connector_security_group_id |
String |
(Required) The ID of the security group for the instance, multiple security groups can be provided separated by ','. |
aws_connector_iam_instance_profile_name |
String |
(Required) The name of the instance profile for the Connector. |
aws_connector_account_id |
String |
(Optional) The NetApp account ID that the Connector will be associated with. If not provided, Cloud Manager uses the first account. If no account exists, Cloud Manager creates a new account. You can find the account ID in the account tab of Cloud Manager at https://cloudmanager.netapp.com. |
aws_connector_public_ip_bool |
Bool |
(Optional) Indicates whether to associate a public IP address to the instance. If not provided, the association will be done based on the subnet's configuration. |
Single Node Instance
Terraform variables for single NetApp CVO instance.
Name | Type | Description |
---|---|---|
cvo_name |
String |
(Required) The name of the Cloud Volumes ONTAP working environment. |
cvo_region |
String |
(Required) The region where the working environment will be created. |
cvo_subnet_id |
String |
(Required) The subnet id where the working environment will be created. |
cvo_vpc_id |
String |
(Optional) The VPC ID where the working environment will be created. If this argument isn't provided, the VPC will be calculated by using the provided subnet ID. |
cvo_svm_password |
String |
(Required) The admin password for Cloud Volumes ONTAP. |
cvo_writing_speed_state |
String |
(Optional) The write speed setting for Cloud Volumes ONTAP: ['NORMAL','HIGH']. The default is 'NORMAL'. |
Azure
This section contains various Terraform configuration files to deploy/configure ANF (Azure Netapp Files) Volume on Azure.
Terraform Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
In order to run the template:
-
Clone the repository.
-
Navigate to the desired folder
-
Login to your Azure CLI (Azure CLI must be installed).
-
Update the variable values in
vars/azure_anf.tfvars
.You can choose to deploy the ANF volume using an existing vnet and subnet by setting the variable "vnet_creation_bool" and "subnet_creation_bool" value to false and supplying the "subnet_id_for_anf_vol". You can also set those values to true and create a new vnet and subnet in which case, the subnet ID will automatically be taken from the newly created subnet. -
Initialize the Terraform repository to install all the pre-requisites and prepare for deployment.
-
Verify the terraform files using terraform validate command.
-
Make a dry run of the configuration to get a preview of all the changes expected by the deployment.
-
Run the deployment
To delete the deployment
Single Node Instance
Terraform variables for single NetApp ANF Volume.
Name | Type | Description |
---|---|---|
az_location |
String |
(Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. |
az_prefix |
String |
(Required) The name of the resource group where the NetApp Volume should be created. Changing this forces a new resource to be created. |
az_vnet_address_space |
String |
(Required) The address space to be used by the newly created vnet for ANF volume deployment. |
az_subnet_address_prefix |
String |
(Required) The subnet address prefix to be used by the newly created vnet for ANF volume deployment. |
az_volume_path |
String |
(Required) A unique file path for the volume. Used when creating mount targets. Changing this forces a new resource to be created. |
az_capacity_pool_size |
Integer |
(Required) Capacity Pool Size mentioned in TB. |
az_vnet_creation_bool |
Boolean |
(Required) Set this boolean to |
az_subnet_creation_bool |
Boolean |
(Required) Set this boolean to |
az_subnet_id_for_anf_vol |
String |
(Required) Mention the subnet id in case you decide to use an existing subnet by setting |
az_netapp_pool_service_level |
String |
(Required) The target performance of the file system. Valid values include |
az_netapp_vol_service_level |
String |
(Required) The target performance of the file system. Valid values include |
az_netapp_vol_protocol |
String |
(Optional) The target volume protocol expressed as a list. Supported single value include |
az_netapp_vol_security_style |
String |
(Optional) Volume security style, accepted values are |
az_netapp_vol_storage_quota |
String |
(Required) The maximum Storage Quota allowed for a file system in Gigabytes. |
|
As per the recommendation, this script uses the prevent_destroy lifecycle argument to mitigate the possibility of accidental data loss in the configuration file. For more information on the prevent_destroy lifecycle argument please see the terraform documentation: https://developer.hashicorp.com/terraform/tutorials/state/resource-lifecycle#prevent-resource-deletion.
|
GCP
This section contains various Terraform configuration files to deploy/configure single node NetApp CVO (Cloud Volumes ONTAP) on GCP (Google Cloud Platform).
Terraform Documentation: https://registry.terraform.io/providers/NetApp/netapp-cloudmanager/latest/docs
In order to run the template:
-
Clone the repository.
-
Navigate to the desired folder
-
Save the GCP authentication key JSON file in the directory.
-
Update the variable values in
vars/gcp_cvo_single_node_deployment.tfvar
You can choose to deploy the connector by setting the variable "gcp_connector_deploy_bool" value to true/false. -
Initialize the Terraform repository to install all the pre-requisites and prepare for deployment.
-
Verify the terraform files using terraform validate command.
-
Make a dry run of the configuration to get a preview of all the changes expected by the deployment.
-
Run the deployment
To delete the deployment
Connector
Terraform variables for NetApp GCP connector instance for CVO deployment.
Name | Type | Description |
---|---|---|
gcp_connector_deploy_bool |
Bool |
(Required) Check for Connector deployment. |
gcp_connector_name |
String |
(Required) The name of the Cloud Manager Connector. |
gcp_connector_project_id |
String |
(Required) The GCP project_id where the connector will be created. |
gcp_connector_zone |
String |
(Required) The GCP zone where the Connector will be created. |
gcp_connector_company |
String |
(Required) The name of the company of the user. |
gcp_connector_service_account_email |
String |
(Required) The email of the service_account for the connector instance. This service account is used to allow the Connector to create Cloud Volume ONTAP. |
gcp_connector_service_account_path |
String |
(Required) The local path of the service_account JSON file for GCP authorization purposes. This service account is used to create the Connector in GCP. |
gcp_connector_account_id |
String |
(Optional) The NetApp account ID that the Connector will be associated with. If not provided, Cloud Manager uses the first account. If no account exists, Cloud Manager creates a new account. You can find the account ID in the account tab of Cloud Manager at https://cloudmanager.netapp.com. |
Single Node Instance
Terraform variables for single NetApp CVO instance on GCP.
Name | Type | Description |
---|---|---|
gcp_cvo_name |
String |
(Required) The name of the Cloud Volumes ONTAP working environment. |
gcp_cvo_project_id |
String |
(Required) The ID of the GCP project. |
gcp_cvo_zone |
String |
(Required) The zone of the region where the working environment will be created. |
gcp_cvo_gcp_service_account |
String |
(Required) The gcp_service_account email in order to enable tiering of cold data to Google Cloud Storage. |
gcp_cvo_svm_password |
String |
(Required) The admin password for Cloud Volumes ONTAP. |
gcp_cvo_workspace_id |
String |
(Optional) The ID of the Cloud Manager workspace where you want to deploy Cloud Volumes ONTAP. If not provided, Cloud Manager uses the first workspace. You can find the ID from the Workspace tab on https://cloudmanager.netapp.com. |
gcp_cvo_license_type |
String |
(Optional) The type of license to use. For single node: ['capacity-paygo', 'gcp-cot-explore-paygo', 'gcp-cot-standard-paygo', 'gcp-cot-premium-paygo', 'gcp-cot-premium-byol'], For HA: ['ha-capacity-paygo', 'gcp-ha-cot-explore-paygo', 'gcp-ha-cot-standard-paygo', 'gcp-ha-cot-premium-paygo', 'gcp-ha-cot-premium-byol']. The default is 'capacity-paygo' for single node, and 'ha-capacity-paygo' for HA. |
gcp_cvo_capacity_package_name |
String |
(Optional) The capacity package name: ['Essential', 'Professional', 'Freemium']. Default is 'Essential'. |