Skip to main content

In-Place VM Scaling with Terraform

The NetActuate Terraform provider supports in-place VM plan changes. When you modify the plan attribute of a server resource, Terraform scales the VM without rebuilding it — preserving the IP address, hostname, and disk contents.

How It Works

Changing only the plan attribute on a netactuate_server resource triggers the ScaleServer API instead of a destroy-and-recreate cycle. Terraform polls the scaling job until it completes, then waits for the VM to return to RUNNING status.

Key behaviors:

  • The IP address is preserved across all scaling operations
  • Hostname and disk contents remain unchanged
  • Scale up (for example, VR1x1x25 to VR2x2x25) typically completes in seconds and may not require a reboot
  • Scale down (for example, VR2x2x25 to VR1x1x25) requires a reboot to reduce allocated RAM, usually completing in around 13 seconds

The allow_reboot Attribute

The allow_reboot attribute controls whether the API can restart the VM during a scaling operation:

resource "netactuate_server" "web" {
hostname = "web01.example.com"
plan = "VR2x2x25"
location = "SJC"
image = "Ubuntu 22.04"
allow_reboot = true
}
  • When set to true (the default), the API reboots the VM if the scaling operation requires it. This is necessary for any downscale that reduces RAM.
  • When set to false, scaling operations that require a reboot will fail. Use this only if your workload cannot tolerate any restart.

Example: Scaling a VM

Start with a small plan in your terraform.tfvars:

plan = "VR1x1x25"

Reference the variable in your server resource:

variable "plan" {
type = string
}

resource "netactuate_server" "web" {
hostname = "web01.example.com"
plan = var.plan
location = "SJC"
image = "Ubuntu 22.04"
allow_reboot = true
}

To scale up, change the plan value:

plan = "VR2x2x25"

Run terraform apply. Terraform detects an in-place update and calls the ScaleServer API:

netactuate_server.web: Modifying... [id=12345]
netactuate_server.web: Still modifying... [5s elapsed]
netactuate_server.web: Modifications complete after 8s [id=12345]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

The VM retains its IP address, hostname, and all data on disk.

What Triggers Scaling vs Rebuild

Not every change to a server resource triggers an in-place scale. The provider uses these rules:

ChangeResult
plan onlyIn-place scale (no rebuild)
location, image, or hostnameFull rebuild (new VM)
plan combined with other changesFull rebuild (new VM)

If you need to change the plan and another attribute at the same time, Terraform will destroy and recreate the VM. To avoid data loss, change the plan first, apply, then change the other attribute in a separate apply.

Available Plans

The following plans are representative. Use data.netactuate_plans to list all plans available at your location.

PlanvCPUsRAM (GB)Disk (GB)
VR1x1x251125
VR2x2x252225
VR4x4x504450
VR8x8x20088200

Portal and API Scaling

For scaling VMs through the portal or the REST API directly, see VM Scaling.

Additional Resources

Need Help?

If you need assistance, visit our support page.