我正在使用 Openstack Kilo 和 Terraform V 0.10 我需要将同一网络的多个接口附加到一个实例。我尝试了以下尝试:
使用同一网络在 openstack_compute_instance_v2 中添加网络块 3 次:
resource "openstack_compute_instance_v2" "VM`1" {
name = "VM1"
count = "1"
image_name = "image"
flavor_name = "flavor"
network = {
uuid = "${openstack_networking_network_v2.NET_1.id}"
}
network = {
uuid = "${openstack_networking_network_v2.NET_1.id}"
}
network = {
uuid = "${openstack_networking_network_v2.NET_1.id}"
}
}
创建了同一网络的三个端口并尝试将它们添加到 compute_instance 中:
resource "openstack_compute_instance_v2" "VM1" {
name = "VM1"
count = "1"
image_name = "image"
flavor_name = "flavor"
network = {
port = "${openstack_networking_port_v2.port_1.id}"
}
network = {
port = "${openstack_networking_port_v2.port_2.id}"
}
network = {
port = "${openstack_networking_port_v2.port_3.id}"
}
}
不幸的是,两者都不起作用。我能够使用单端口启动实例。创建后我想添加其他接口。
从字面上看,我想用单一界面创建以下虚拟机后:
nova interface-attach --net-id $NET_1 "$VM1"
nova interface-attach --net-id $NET_1 "$VM1"