Tenancy Terraform File Requirements#

Note

Tenants, tenancies, and other features are available if you have paid for multi-tenant support. Contact Penguin Computing to learn more.

Terraform files are used to create tenancies in a ICE ClusterWare ™ super-cluster. The superadministrator controls most of the values in the Terraform file. At this time, the only value a tenancy administrator can request is the number of bare metal compute nodes.

The Terraform file used to create a tenancy is not stored in the ClusterWare database and does not need a unique name. The Terraform file should conform to the Terraform 1.11.x syntax. See https://developer.hashicorp.com/terraform/language/v1.11.x/syntax for details.

Two sample Terraform files are available on any super-cluster head node in the /opt/scyld/clusterware-tools/examples/terraform directory.

The ClusterWare Terraform tenancy provisioning endpoint supports standard Terraform syntax, such as the count keyword.

Provider Syntax#

The Provider has four required fields:

  • scheduler: Must be slurm.

  • management: Must be full.

  • pub_key: Set a public key for tenancy SSH authentication.

  • user: Set a user for tenancy SSH authentication.

For example:

provider "cw" {
  scheduler = "slurm"
  management = "full"
  pub_key = "ssh-ed25519 ABC/abc user@mach"
  user = "root"
}

Resources Syntax#

Two resources are available: cw_vm_node and cw_bare_metal_node. There must be exactly 5 cw_vm_node resources in the Terraform file, with every role having a single matching cw_vm_node.

cw_vm_node#

  • vcpus: Required. An integer >= 1 that matches the value in the mtconfig.json file used during multi-tenancy setup.

  • ram_gb: Required. An integer >= 1 that matches the value in the mtconfig.json file used during multi-tenancy setup.

  • storage_gb: Required. An integer >= 1 that matches the value in the mtconfig.json file used during multi-tenancy setup.

  • role: Required. One of head, gateway, slurm, sensu, login

For example, for a head node:

resource "cw_vm_node" "head" {
  vcpus = 4
  ram_gb = 8
  storage_gb = 128
  role = "head"
}

cw_bare_metal_node#

  • shape: Required. A valid shape name for your bare metal provider that matches the value in the node-mtshapes.json file used during multi-tenancy setup.

  • role: Required. Must be compute.

  • count: Optional. Any number of compute nodes >= 1 can be included. Ommitting this line provisions 1 compute node for the tenancy.

For example, to provision 20 compute nodes:

resource "cw_bare_metal_node" "compute" {
  shape = "BareMetal"
  role = "compute"
  count = 20
}