Using Terraform to Deploy the Site Recovery Manager 8.3 Appliance
Previously I covered how to deploy the SRM appliance using PowerCLI, but as I started to tinker with Terraform I figured why not create a new blog post to document the process. Without the latest Terraform vSphere 1.20.0 Provider, this wouldnt be possible! Lets dive in and take a look on how we can do some appliance deployments.
Using PowerCLI to Deploy the Site Recovery Manager 8.3 Appliance
Terraform vSphere Provider 1.20.0 is out! That means time to deploy some #vSphere labs using #Terraform! #vExpert
— David Stamen (@davidstamen) June 24, 2020
Pre-Requsites
Link to Code
Execute the Runbook
- The script is pretty straight forward, you will need to extract the SRM 8.3 ISO to a local directory and fill in the appropriate variables on the configuration file.
1git clone https://github.com/dstamen/Terraform.git #Clone the Github Repository
2cd Terraform/deploy-srm #Change to Runbook Directory
3vi modules/deploy-srm1/main.tf #Update the configuration file to provide your vCenter Server and Appliance Settings and then Save the file
4terraform init #Initialize and install the provider if needed
5terraform plan #Validate the run book will work
6terraform apply #Deploy your VMs!
Things I learned about Terraform OVF Properties
I spent a little bit too much time figuring out how to map the OVF properties, every time I would run a deployment I would get the following error.
Usually when I am scripting an OVF deployment I will use the following PowerCLI code and navigate through each level to find the OVF Properties
1$ovffile = "path.ova"
2Get-OVFConfiguration $ovffile
But that didnt work….
Next I would review the UI Properties and try those keys.
But that didnt work….
So next I dove into the .OVF file and that is where I finally found the magic keys. When deploying an OVF/OVA through Terraform, you MUST use the ovf:key value defined. At some point I would hope it would be easier to find this information.
Conclusion
Im loving all the new pieces of automation that are coming out to help simplify deployments. I have alot to learn to enhance the script such as using variables, but this was a good start and gets the job done!
What would you like to see next? Leave a comment below!
comments powered by Disqus