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.
zsphere_host (Resource)
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.
Example Usage
resource "zsphere_host" "host" {
name = "host_from_terraform"
description = "Add an example host from terraform"
management_ip = "192.168.1.100"
cluster_uuid = "uuid of the cluster"
username = "root"
password = "password"
ssh_port = 22
iommu = false
ept = true
}
output "zsphere_host" {
value = zsphere_host.host
}
output "host_uuid" {
value = zsphere_host.host.uuid
description = "The UUID of the host"
}
output "host_status" {
value = zsphere_host.host.status
description = "The status of the host"
}Schema
Required
cluster_uuid(String) The UUID of the cluster to which the host belongs.management_ip(String) The management IP address of the host.name(String) The name of the host. This is a mandatory field.password(String, Sensitive) The password for SSH authentication to the host.username(String, Sensitive) The username for SSH authentication to the host.
Optional
description(String) A description of the host, providing additional context or details.ept(Boolean) Enable Intel EPT hardware-assisted virtualization. Default is true. Note: Only applicable for Intel CPUs.iommu(Boolean) Enable scanning host IOMMU settings. This is required for GPU passthrough, vGPU virtualization, and SR-IOV features. Default is false.ssh_port(Number) The SSH port for connecting to the host. Default is 22.
Read-Only
architecture(String) The CPU architecture of the host. Valid values are: x86_64, aarch64, mips64el, loongarch64.hypervisor_type(String) The hypervisor type of the host. Valid values are: KVM, Simulator, baremetal, baremetal2, xdragon.state(String) The state of the host, such as 'Enabled' or 'Disabled'.status(String) The operational status of the host, such as 'Connected' or 'Disconnected'.type(String) The type of the host. Same as hypervisor_type.uuid(String) The unique identifier of the host. Automatically generated by ZSvirt.zone_uuid(String) The UUID of the zone to which the host belongs.
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_distributed_switch
Manages a distributed switch (L2VirtualSwitch) in ZSvirt.