TerraformPilot

DevOps

Terraform for SmartOS and Illumos: Triton-Style Zones

Provision SmartOS / Illumos infrastructure with Terraform: zones, ZFS datasets, vmadm-managed VMs, and the Triton DataCenter / Joyent successor stack.

LLuca Berton1 min read

SmartOS / Illumos runs the world's busiest ZFS+zones stacks. Triton (the Joyent DataCenter successor) is alive in 2026 in storage providers and specialty hosting. Terraform integration is niche but real via the joyent/triton provider (CloudAPI) and shell-out wrappers for vmadm on bare SmartOS.

Triton Provider

#
terraform {
  required_providers {
    triton = { source = "joyent/triton", version = "~> 0.10" }
  }
}
 
provider "triton" {
  account = var.triton_account
  url     = "https://us-east-1.api.joyent.com"
  key_id  = var.triton_key_id
}
 
resource "triton_machine" "web" {
  name    = "web-1"
  package = "g4-highcpu-1G"
  image   = "smartos-base-23.4.0"
 
  networks = [data.triton_network.public.id]
 
  metadata = {
    user-script = file("${path.module}/init.sh")
  }
}

Bare SmartOS via remote-exec

#

For self-hosted SmartOS (no Triton), Terraform uses null_resource + vmadm:

resource "null_resource" "zone" {
  connection {
    type        = "ssh"
    user        = "root"
    host        = var.global_zone_ip
    private_key = file("~/.ssh/id_ed25519")
  }
 
  provisioner "file" {
    content     = jsonencode({
      brand     = "joyent"
      image_uuid = var.image_uuid
      alias     = "web-1"
      max_physical_memory = 1024
      quota     = 20
      nics = [{
        nic_tag = "admin"
        ip      = "10.0.0.21"
        netmask = "255.255.255.0"
      }]
    })
    destination = "/tmp/zone.json"
  }
 
  provisioner "remote-exec" {
    inline = ["vmadm create -f /tmp/zone.json"]
  }
}

Best Practices

#
  • Triton CloudAPI is read-modify-friendly — use it over raw vmadm where possible.
  • Pin image UUIDs — SmartOS images are immutable but versioned.
  • Keep ZFS dataset layout in Terraform (via null_resource + zfs create) so you can reproduce a zone.
  • DTrace stays out of Terraform — diagnostic only.
#
#Terraform#SmartOS#Illumos#ZFS#Zones

Share this article