
Lets start with Terraform Provider to automate the vCloud director service provider easy.
First you need to install Terraform
After that create a folder with vCloud name or your choice.
Need to create three files
- a). variables-vcloud.tf (here need to define variables)
- b). terraform.tfvars (here we have to define values/ parameters)
- c). terraform-vcloud.tf (this is actual code where we will going to use terraform.tfvars values)
Use terraform init so that it can initialize your environment like vCloud or vSphere etc. and if it required then it will install necessary package.
I am using https://www.terraform.io/docs/providers/vcd/index.html from HashiCorp.
Lets start with coding.
Here is Git Repository
https://github.com/sandepkaushik/Terraform-vCloud-Director-Service-Provider.git
First define variable so that we can initialize vCloud director.

After that need to define values/parameter so that we can use in actual code.

Below we have to define username and password for vCloud with administrator permission so that it can provision.

Once it’s initialize we can start our code to create
- Organisation (Org)
- Org VDC
- External network
- Or we can use Existing External Network
- Org VDC admin user
- Edge Gateway – with Static IP
- Edge Gateway – with Auto IP
- Creating Network
- Routed Network
- Isolated Network
- Direct Network
- Create a Catalog
- Adding ISO into Catalog
- vApp for Org VDC
- VMs in vAPP
Below snapshot is for Variable.




Here is the Organization which we created via Terraform.

Here is the external network.

Here is the EDGE gateway

Here is the Org VDC

Here is Tenant VDC view

Here is vAPP view

Here is VM view.

Here is Network view.

Here is Catalog view.

Here is media and other file view.

Leave a Reply