Skip to content
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

Compute V2: Don't fail when disassociating floating IP from the instance when it is already not associated. #761

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

rnurgaliyev
Copy link
Contributor

According to Compute API documentation, an attempt to remove floating IP association from an instance may fail with 409, when floating IP address was not associated with this instance initially.

This patch enables "create_before_destroy" lifecycle in openstack_compute_floatingip_associate_v2 resource. When used together with an instance, whose lifecycle also has create_before_destroy, this patch will remove downtime in a rolling update - floating IP address will be reassociated only when the new instance is completely provisioned.

Without this patch, setting create_before_destroy in lifecycle of openstack_compute_floatingip_associate_v2 will cause terraform to fail. New VM will be provisioned before deleting the old one, then new floating ip address association will be created, re-assigning same floating IP address from the existing resource, but on the next step terraform will fail while trying to delete old association since it is not there anymore in OpenStack. However, there is no need to fail - resource is actually deleted, and consequent "terraform plan" will show no changes.

This issue is discussed in here: https://github.com/terraform-providers/terraform-provider-openstack/issues/439

@ghost ghost added the size/XS label Jun 4, 2019
@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 4, 2019

Build succeeded.

Copy link
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you so much for working on this.

@jtopjian
Copy link
Contributor

jtopjian commented Jun 4, 2019

I think it would be hard to write an acceptance test for this. I have tested this offline and can confirm it works.

@jtopjian jtopjian merged commit bf7e220 into terraform-provider-openstack:master Jun 4, 2019
@rnurgaliyev rnurgaliyev deleted the improve_fip_lifecycle branch June 12, 2019 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants