VM Worker Redundancy
This guide demonstrates how to deploy redundant VM workers across multiple NetActuate locations using Terraform. By distributing workers across different points of presence (POPs), you ensure high availability and fault tolerance for your workloads.
Overview
NetActuate's global network of 40+ locations makes it straightforward to deploy redundant infrastructure. Using the NetActuate Terraform provider, you can codify multi-location deployments and manage them as infrastructure-as-code.
Prerequisites
- Terraform installed (v1.0+)
- NetActuate API key configured
- The NetActuate Terraform provider installed
Terraform Configuration
The following example deploys VM workers across two locations for redundancy:
terraform {
required_providers {
netactuate = {
source = "netactuate/netactuate"
version = "~> 1.0"
}
}
}
provider "netactuate" {
api_key = var.netactuate_api_key
}
variable "netactuate_api_key" {
description = "NetActuate API key"
type = string
sensitive = true
}
variable "worker_count" {
description = "Number of workers per location"
type = number
default = 2
}
variable "locations" {
description = "List of POP locations for redundancy"
type = list(string)
default = ["SJC", "AMS"]
}
resource "netactuate_server" "worker" {
count = var.worker_count * length(var.locations)
hostname = "worker-${var.locations[floor(count.index / var.worker_count)]}-${count.index % var.worker_count + 1}"
location = var.locations[floor(count.index / var.worker_count)]
plan = var.plan_id
image = var.image_id
ssh_keys = var.ssh_key_ids
}
Deploying
terraform init
terraform plan
terraform apply
Verifying Redundancy
After deployment, verify that workers are distributed across your chosen locations:
terraform output -json | jq '.worker_ips'
Confirm that each location has the expected number of running workers in the NetActuate portal under Infrastructure > Virtual Machines.
Next Steps
- How to Deploy a Virtual Machine — Portal-based deployment walkthrough
- Terraform Provider — Full Terraform provider documentation
- API Reference — Automate deployments via the API
Need Help?
For guidance on redundant deployments, connect with a NetActuate infrastructure expert at support@netactuate.com or open a support ticket from the portal: portal.netactuate.com.