Coder Social home page Coder Social logo

pnc's Introduction

Terraform & vSphere Demo

For Virtual Machine Provisioning using the vSphere Provider.

There are 3 different examples, one in each folder.

Pre-Requisites and Tips

  1. Set the vSphere Environment Variables:
export VSPHERE_USER="<Username>@vsphere.local"
export VSPHERE_PASSWORD="<Password>"
export VSPHERE_SERVER="<IP Address>"
export VSPHERE_ALLOW_UNVERIFIED_SSL=true
  1. All examples tested using Terraform v11.11. If using a different version, you may experience issues.

  2. All examples tested using the vSphere Provider v1.9.1_x4. If using a different version, you may experience issues.

  3. Clone this repo to your local directory.

git clone [email protected]:Arslan-SE/PNC.git
  1. Destroy the changes and provision resources (if any).
terraform destroy

1_getVsphereData

  • This example is very simple. It pulls some data from the vCenter environment.
  1. Navigate to the example:
cd 3_getVsphereData/
  1. Save the terraform.tfvars.example file as terraform.tfvars and update the values.
cp terraform.tfvars.example terraform.tfvars
vi terraform.tfvars
  1. Initialize Terraform to pull the providers.
terraform init
  1. Make a dry run to see what will actually happen.
terraform plan
  1. Apply the changes and provision resources (if any).
terraform apply

2_createSomeResources

  • This example will provision a folder and then apply tags and attributes to that folder.
  1. Navigate to the example:
cd 3_create_SomeResources/
  1. Save the terraform.tfvars.example file as terraform.tfvars and update the values.
cp terraform.tfvars.example terraform.tfvars
vi terraform.tfvars
  1. Initialize Terraform to pull the providers.
terraform init
  1. Make a dry run to see what will actually happen.
terraform plan
  1. Apply the changes and provision resources (if any).
terraform apply
  1. Destroy the changes and provision resources (if any).
terraform destroy

3_create_VmResource

  • This example brings the other two examples together along with provisioning a VM using a cloned template.
  1. Navigate to the example:
cd 3_create_VmResource/
  1. Save the terraform.tfvars.example file as terraform.tfvars and update the values.
cp terraform.tfvars.example terraform.tfvars
vi terraform.tfvars
  1. Initialize Terraform to pull the providers.
terraform init
  1. Make a dry run to see what will actually happen.
terraform plan
  1. Apply the changes and provision resources (if any).
terraform apply
  1. Destroy the changes and provision resources (if any).
terraform destroy

Authors

Edited by Arslan Saeed

License

MIT

pnc's People

Contributors

arslan-se avatar marcchua avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.