Can you use terraform to create local KVM?

Can you use terraform to create local KVM?

Terraform is a popular tool for provisioning infrastructure on cloud provider such as EC2 and Azure, but there is also a provider written for local KVM libvirt resources. Using the libvirt provider, we can use standard Terraform constructs to create local VMs, networks, and disks.

How to create local KVM resources in cloud?

KVM: Terraform and cloud-init to create local KVM resources Terraform is a popular tool for provisioning infrastructure on cloud provider such as EC2 and Azure, but there is also a provider written for local KVM libvirt resources. Using the libvirt provider, we can use standard Terraform constructs to create local VMs, networks, and disks.

How to create a local KVM using libvirt?

Using the libvirt provider, we can use standard Terraform constructs to create local VMs, networks, and disks. As a prerequisite for this article, you must install KVM and libvirt as described here.

What’s the difference between terraform and cloud-init?

While terraform is used to setup the virtual hardware resources, cloud-init is used to initialize the OS level configuration including: user accounts, ssh login keys, packages, and networking.

How to use the libvirt provisioner with terraform?

In this post we will use the libvirt provisioner with Terraform to deploy a KVM Virtual Machine on a Remote KVM Host using SSH and use Ansible to deploy Nginx on our VM. In my previous post I demonstrated how I provisioned my KVM Host and created a dedicated user for Terraform to authenticate to our KVM host to provision VMs.

How do I install terraform on my Mac?

Click on the tab (s) below relevant to your operating system. Download Docker Desktop for Mac. After you install Terraform and Docker on your local machine, start Docker Desktop. Create a directory named learn-terraform-docker-container. Then, navigate into it. Paste the following Terraform configuration into a file and name it main.tf.

How to install terraform libvirt provider in Golang?

Installing Terraform libvirt Provider Installing golang 1.9 Building libvirt provider Moving the libvirt provider to terraform.d Creating a Terraform configuration file for KVM Initialization Apply Changes Check your new infrastructure Terraformis what they call “Infrastructure as a code”.