Resources

zsphere_cluster

This resource allows you to manage clusters in ZSvirt. A cluster is a logical grouping of hosts that share the same hypervisor type and storage. It provides resource isolation and is the basic unit for resource management in ZSvirt.

zsphere_cluster (Resource)

This resource allows you to manage clusters in ZSvirt. A cluster is a logical grouping of hosts that share the same hypervisor type and storage. It provides resource isolation and is the basic unit for resource management in ZSvirt.

Example Usage

resource "zsphere_cluster" "cluster" {
  name            = "cluster_from_terraform"
  description     = "Add an example cluster from terraform"
  hypervisor_type = "KVM"
  type            = "zstack"
  datacenter_uuid = "3b03dd8222294d86ac7f7ed6ca02baa6" # "uuid_of_parent_zone"
  architecture    = "x86_64"

  # Advanced features
  cpu_mode   = "hostPassthrough"
  network_hp = false

  # DRS settings (requires hypervisor_type = KVM)
  drs_enabled            = false
  drs_threshold_cpu      = 80
  drs_threshold_memory   = 80
  drs_threshold_duration = 300
}

output "zsphere_cluster" {
  value = zsphere_cluster.cluster
}

Schema

Required

  • datacenter_uuid (String) The UUID of the datacenter (zone) to which the cluster belongs.
  • hypervisor_type (String) The hypervisor type of the cluster. Valid values are: KVM, Simulator, baremetal, baremetal2, xdragon.
  • name (String) The name of the cluster. This is a mandatory field.

Optional

  • architecture (String) The CPU architecture of the cluster. Valid values are: x86_64, aarch64, mips64el, loongarch64.
  • automation_level (String) Automation level for DRS. Valid values: Manual, Automatic, closed
  • check_cpu_model (String) CPU model validation. Valid values: default, false, true
  • cpu_mode (String) CPU mode. Valid values: hostPassthrough, virtio, kvm
  • cpu_over_provisioning_ratio (String) CPU over-provisioning ratio. Example: 4
  • description (String) A description of the cluster, providing additional context or details.
  • display_network_cidr (String) Display network CIDR. Example: 192.168.1.0/24
  • drs_enabled (Boolean) Enable Dynamic Resource Scheduling (DRS).
  • drs_threshold_cpu (Number) DRS CPU threshold percentage. Example: 80
  • drs_threshold_duration (Number) DRS threshold duration in seconds. Example: 300
  • drs_threshold_memory (Number) DRS memory threshold percentage. Example: 80
  • migrate_network_cidr (String) Migration network CIDR. Example: 192.168.2.0/24
  • network_hp (Boolean) Enable network HP (ovsdpdk).
  • type (String) The type of the cluster. Valid values are: zstack, baremetal, baremetal2.
  • vm_ha_level (String) VM HA level. Valid values: NeverStop, BestEffort

Read-Only

  • state (String) The state of the cluster, such as 'Enabled' or 'Disabled'.
  • uuid (String) The unique identifier of the cluster. Automatically generated by ZSvirt.

On this page