-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider/openstack: "external"/existing security groups only apply one at a time? #6874
Comments
How bizarre... Thank you for the report! |
@jtopjian Indeed! |
Workaround for now is to add the guids to the port |
@carlpett I'm unable to reproduce this issue... would you be able to test 0.7-rc1 and see if you're still seeing this problem? |
@jtopjian Sure! We have national holidays though, so I won't be in office until tuesday. Will add a reminder to my calendar so that I actually remember.. :) |
Sorry, didn't have time yesterday. Anyway, did a runthough now, and it still happens. Here is a repro-tf file. It assumes there are three "outside" security groups, |
@carlpett I just ran the configuration you gave and am seeing similar behavior. My guess is because the instance is being attached to a specific port, Nova / Neutron will ignore the security groups on the instance and defer to the Port for security groups. This is only a hunch and I'll have to dig into the code to verify, but I think this is a safe assumption. I think the best that can be done here is a note in the documentation. |
@carlpett I created a patch that would disallow I found this bug and, although it says Fixed Released, this is still very much an issue. When booting an instance (using any tool) where all networks are configured with Ports, security groups will not attach to the instance. Since this is still an issue with OpenStack, I did not want to modify Terraform to outright Error out when security groups and ports are mixed. Instead, I dug into the original error you were seeing and found that it's a false error being triggered somewhere. Simply ignoring the EOF error causes the security groups to be applied (and removed). #7468 implements this fix. So, tl;dr: It's highly recommended to apply the security groups to the ports, but if you still apply them to the instance and if the instance's network(s) are only configured via ports, the security groups will not be applied upon creation, but they will now be successfully applied upon a second |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm trying to introduce Terraform into an existing Openstack environment. Currently, I'm setting up all the new instances using Terraform, but using existing security groups. We're using neutron security groups. When starting a new instance, only one security group is applied before erroring out with this message:
* openstack_compute_instance_v2.my-instance: Error adding security group to OpenStack server (1f3c51b9-3608-48b9-9b82-406965447c8f): EOF
If I run
terraform apply
again, it will add yet another security group, and then fail. So currently I have to run six applies before my instances are actually finished.Terraform Version
v0.6.16
Affected Resource(s)
Terraform Configuration Files
Where SG1..6 are the names of neutron security group existing outside of Terraform's control
Expected Behavior
All SGs are applied without error
Actual Behavior
openstack_compute_instance_v2.my-instance: Error adding security group to OpenStack server (1f3c51b9-3608-48b9-9b82-406965447c8f): EOF
Steps to Reproduce
terraform apply
terraform apply
terraform apply
terraform apply
terraform apply
terraform apply
;)
The text was updated successfully, but these errors were encountered: