资源
zsphere_distributed_switch
管理 ZSvirt 分布式交换机(vSwitch),用于承载端口组等二层网络资源。
zsphere_distributed_switch(资源)
管理 ZSvirt 分布式交换机(vSwitch),用于承载端口组等二层网络资源。
示例用法
resource "zsphere_distributed_switch" "distributed_switch" {
name = "distributed_switch_example"
description = "Distributed switch created from terraform"
datacenter_uuid = "1d7fff50bd624a2f97ac1f8c834c6acc"
vswitch_type = "LinuxBridge"
# use LACP (802.3ad) with hash policy
bonding_name = "Uplink1"
bonding_mode = "802.3ad"
xmit_hash_policy = "layer2"
# Option 3: Attach to clusters
cluster_uuids = ["c54f0cef45854149970374da8b2d0750"]
cluster_attachments = [
{
cluster_uuid = "c54f0cef45854149970374da8b2d0750"
host_params = [
{
host_uuid = "550a685224d349d0a9c29924aed0422d"
physical_interface = "ens12"
}
]
}
]
}
output "zsphere_distributed_switch" {
value = zsphere_distributed_switch.distributed_switch
}参数说明
必填参数
datacenter_uuid(字符串)分布式交换机所属数据中心(区域)UUID。name(字符串)distributed名称 switch.
可选参数
bonding_mode(字符串)The bonding mode. 可选值: 802.3ad, active-backup.bonding_name(字符串)The name of the bonding aggregate port (e.g., Uplink1).cluster_attachments(属性列表)(参见下方嵌套结构)cluster_uuids(字符串列表)List of cluster UUIDs to attach the distributed switch to.description(字符串)分布式交换机描述。physical_interface(字符串)The physical interface used by the distributed switch (used when not using bonding).vswitch_type(字符串)The type of virtual switch. Default is LinuxBridge.xmit_hash_policy(字符串)The transmit hash policy for bonding mode 802.3ad. 可选值: layer2, layer2+3, layer3+4.
只读属性
attached_cluster_uuids(字符串列表)List of cluster UUIDs attached to this distributed switch.type(字符串)The type of the L2 network.uuid(字符串)分布式交换机 UUID。
cluster_attachments 嵌套结构
必填参数:
cluster_uuid(字符串)要挂载的集群 UUID。
可选参数:
host_params(属性列表)(参见下方嵌套结构)
cluster_attachments.host_params 嵌套结构
必填参数:
host_uuid(字符串)物理主机 UUID。physical_interface(字符串)The physical interface name on the host.