Terraform for Hyper-V Virtualization
Automate Microsoft Hyper-V with Terraform: taliesins/hyperv provider, VM provisioning, virtual switches, and Windows Server-based hypervisor management.
DevOps
Automate Xen and XCP-ng pools with Terraform: xenorchestra provider, VM provisioning, SR storage, and Citrix Hypervisor lab automation.
Xen / XCP-ng is the open-source hypervisor descended from XenServer. The terra-farm/xenorchestra Terraform provider talks to Xen Orchestra to create VMs, manage networks, and control SRs (storage repositories). Common in cost-sensitive shops, Citrix migrations, and homelabs.
terraform {
required_providers {
xenorchestra = {
source = "terra-farm/xenorchestra"
version = "~> 0.30"
}
}
}
provider "xenorchestra" {
url = "wss://${var.xo_host}"
username = var.username
password = var.password
}data "xenorchestra_pool" "main" { name_label = "Acme-Pool" }
data "xenorchestra_template" "ubuntu" { name_label = "ubuntu-24.04-cloud" }
data "xenorchestra_sr" "ssd" { name_label = "ssd-pool"; pool_id = data.xenorchestra_pool.main.id }
data "xenorchestra_network" "vlan100" { name_label = "vlan-100"; pool_id = data.xenorchestra_pool.main.id }
resource "xenorchestra_vm" "web" {
name_label = "web-1"
template = data.xenorchestra_template.ubuntu.id
cpus = 2
memory_max = 4 * 1024 * 1024 * 1024
network {
network_id = data.xenorchestra_network.vlan100.id
}
disk {
sr_id = data.xenorchestra_sr.ssd.id
name_label = "root"
size = 32 * 1024 * 1024 * 1024
}
cloud_config = <<-EOT
#cloud-config
hostname: web-1
users:
- name: ubuntu
ssh_authorized_keys:
- ${chomp(file("~/.ssh/id_ed25519.pub"))}
EOT
}Automate Microsoft Hyper-V with Terraform: taliesins/hyperv provider, VM provisioning, virtual switches, and Windows Server-based hypervisor management.
Automate Nutanix AHV with Terraform: nutanix/nutanix provider, VM provisioning, categories, and Prism Central infrastructure as code.
Provision VMs on Proxmox VE with Terraform using the bpg/proxmox provider: API token auth, cloud-init, LXC containers, and storage pools.
Provision VMs on VMware ESXi and vCenter with Terraform: vsphere provider, templates, cloud-init, networking, and resource pools.