admin管理员组文章数量:1187854
I'm using Terraform to manage OpenStack resources and I'm encountering an issue where a port is apparently in a "DOWN" state after attaching it to an instance using the openstack_compute_interface_attach_v2
resource.
Here's a simplified version of my Terraform configuration:
resource "openstack_networking_port_v2" "port" {
network_id = "<network_id>"
fixed_ip {
subnet_id = "<subnet_id>"
}
security_group_ids = "<security_group_ids>"
}
resource "openstack_compute_interface_attach_v2" "attachment" {
instance_id = "<instance_id>"
port_id = "<port_id>"
}
The port is created successfully, however after attaching it to the instance the port appears to not work correctly.
In the OpenStack dashboard, the port status shows as active and using the openstack-cli to inspect the port also confirms that the port is active. However, when I SSH into the VM and check the network interfaces, the attached port shows as DOWN
.
root@test:~# ip addr
...
...
3: ens7: <BROADCAST,MULTICAST> mtu 8900 qdisc noop state DOWN group default qlen 1000
link/ether ...
altname enp0s7
The interface ens7
corresponds to the port that was attached via Terraform.
Inside the VM, I manually ran the following commands to fix the issue temporarily:
Set the interface to the UP
state.
ip link set ens7 up
Obtain the IP address for ens7
, which matches the fixed IP to the port.
dhclient ens7
After running these commands, the ens7
interface is now fully functional.
Questions:
Why does the attached port not work out of the box without manually bringing it up and requesting an IP address using DHCP? Is this a configuration issue in OpenStack, the instance OS, or Terraform (provider)?
How can I ensure the interface is fully functional automatically after attachment without requiring manual intervention?
本文标签: terraformWhy is my OpenStack port down after attaching it to an instanceStack Overflow
版权声明:本文标题:terraform - Why is my OpenStack port down after attaching it to an instance? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738315162a2074243.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论