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, closedcheck_cpu_model(String) CPU model validation. Valid values: default, false, truecpu_mode(String) CPU mode. Valid values: hostPassthrough, virtio, kvmcpu_over_provisioning_ratio(String) CPU over-provisioning ratio. Example: 4description(String) A description of the cluster, providing additional context or details.display_network_cidr(String) Display network CIDR. Example: 192.168.1.0/24drs_enabled(Boolean) Enable Dynamic Resource Scheduling (DRS).drs_threshold_cpu(Number) DRS CPU threshold percentage. Example: 80drs_threshold_duration(Number) DRS threshold duration in seconds. Example: 300drs_threshold_memory(Number) DRS memory threshold percentage. Example: 80migrate_network_cidr(String) Migration network CIDR. Example: 192.168.2.0/24network_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.
zsphere_datacenter
This resource allows you to manage datacenters (zones) in ZSvirt. A datacenter (zone) is a logical container that groups compute resources like clusters and hosts. It provides resource isolation and can be used to organize infrastructure for different environments or tenants.
zsphere_host
This resource allows you to manage hosts in ZSvirt. A host is a physical or virtual machine that provides compute resources for running virtual machines. It is a fundamental component of the ZSvirt cloud infrastructure.