Create a model through Terraform templates
Last updated
Last updated
is an open source IaC (Infrastructure-as-Code) tool for configuring and deploying cloud infrastructure. It codifies infrastructure in configuration files that describe the desired state for your topology. Terraform enables the management of any infrastructure such as public and private clouds.
A Terraform Template is a declarative code set written in HashiCorp Configuration Language (HCL), acting as a blueprint to define specific infrastructure resources. This approach ensures efficient and consistent configuration.
Templates are usually composed of multiple files, each dedicated to specific aspects of the overall template. This organization allows grouping diverse resource types, from networks to operating systems, facilitating flexible and scalable infrastructure design.
This module is a template for the creation of the particular resources of each instance we are going to deploy, such as the VM, Network Interfaces, OS image, caching and storage type of the OS disk, and more.
The VM resource that you wish to instantiate must have the label "vdi_instance". Otherwise, it will not be recognized as a VDI Resource.
Manually deploying each VM instance can be time consuming and prone to configuration errors, that's why Cloud Manager offers a solution by automating the provisioning process using Terraform's iterative capabilities.
Begin by defining the configuration for your VM instance in your VM Template. Configure the necessary parameters such as Instance Type, OS image, Networking settings, etc.
Use the for_each construct to iterate over a list of VM configurations. This list needs to use the variable vdi_instances. This will allow you to dynamically create multiple instances based on the specified parameters. The variable vdi_instances can be directly used in resource configurations or other parts of the Terraform code, referencing it as var.vdi_instances.
Consider utilizing a Shared template or module for provisioning shared resources across multiple instances. This approach allows you to define and manage common infrastructure components such as Network Security Groups, Virtual Networks, Subnets, and more. These resources will be linked to the Main module via output variables, customized according to the specific requirements of the Cloud Provider.
Once your Terraform templates are created, you are ready to use them to create a model.
Log in to Thinfinity® Workspace.
Click on your profile picture to display a menu in which Cloud Manager should appear as an option.
Next, click on + Add > VDI/DaaS Model to initiate the Wizard.
Select your Cloud Provider. We will authenticate through Azure for this example.
Select Custom when prompted by the Wizard.
Select your existing cloud provider credentials or enter them if you haven't done so in the Credentials tab. Give them an identifying Name and Description and click Next.
Enter your Configuration parameters and click Next. Remember that these configuration parameters are Cloud specific.
Next, in Provisioning Options, select a connection mode and a pool mode.
Public IP
Assigns a public IP address, allowing direct internet access.
Private IP
Assigns a private IP address, restricting access to within the virtual network.
Breadth-First
Distributes new connections evenly across available hosts in a pool.
Depth-First
Assigns new connections to a single host until capacity is reached, then moves to the next.
None
Instances are not part of a pool, operating independently without load balancing.
10. Then select a Deployment mode.
On demand
Scheduled
Instances are automatically deployed at specific times according to a predefined schedule
11. Configure the Power options.
On demand
Manually set a fixed number of minutes to turn an instance off after disconnecting from it.
Scheduled
Instances automatically turn on and off at specific times according to a predefined schedule.
Both
You have the flexibility to either manually control the instances power state or let them operate on a schedule, depending on your requirements.
12. Configure how instances are destroyed.
Never
Instances will persist indefinitely unless manually deleted.
Scheduled
Instances are automatically destroyed at specific times according to a predefined schedule.
13. To finish, enter an identifying name and description for your new model.
If the model was created successfully, the Wizard will display a message confirming the creation of the model.
Upload your Terraform Template files folder in the corresponding tabs. and .
Will trigger a deployment whenever an is opened
For more information about the creation of Terraform templates, please refer to the .