repo to deploy HX via Terraform & HX
Installation scripts for Cisco HyperFlex using the Cisco Intersight Terraform provider.
The Cisco Intersight Terraform provider is now available for use direcly from the Terraform Registry at https://registry.terraform.io/providers/CiscoDevNet/intersight/latest.
- Terraform 0.14.0 or later must be installed
git clone https://github.com/ucs-compute-solutions/terraform-intersight-hyperflex.git
Authentication with the Intersight API requires the use of API keys that should be generated within the Intersight UI. See (https://intersight.com/help) or (https://communities.cisco.com/docs/DOC-76947) for more information on generating and using API keys. The values for the API key and the path to the key file must be entered into the terraform.tfvars file:
- Using a supported web browser, log in to Cisco Intersight at https://www.intersight.com.
- Click the gear icon in the top-right corner. Then click Settings.
- Click API Keys in the menu on the left.
- Click Generate API Key in the top-right corner.
- Enter a description for the API key, such as Ansible. Then click Generate.
- Click the icon to copy the API key ID and then paste the key ID in the terraform.tfvars file, in the line beginning with api_key=.
- Click the icon to save the secret key to a local text file. Note the location of the downloaded file and move the file to a different folder if desired.
- Enter the path to the downloaded file named SecretKey.txt in the terraform.tfvars file, in the line beginning with api_key_file=.
The remainder of the variables in the terraform.tfvars file must be modified with your unique values for the cluster you wish to install.
Once all the required variables are entered, from a command line change to the create_profile or create_edge_profile folder as appropriate and run the following commands:
terraform init
This command will initialize the environment and download the Cisco Intersight Terraform provider to the .terraform folder.
terraform plan
This command will execute the script without committing any changes and give a list of all the resources that will be created. Examine the output of the plan execution for any warnings or errors.
terraform apply
This command will execute the plan and commit all the new resources or changes to the environment.
Once the Terraform script has completed, all the necessary policies and profiles for your Cisco HyperFlex cluster will appear in your Cisco Intersight management UI, shown in the Policies section and the Profiles section. View the new HyperFlex profile in Intersight, and use the Intersight UI to begin a Validation or Deployment of the newly created cluster.