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

[JUJU-163]create openstack FIPs on networks on AZ to match the server's addresses. #13478

Merged
merged 9 commits into from
Nov 9, 2021

Conversation

hmlanigan
Copy link
Member

@hmlanigan hmlanigan commented Nov 4, 2021

Update the Openstack provider to select networks to create a FIP in based on the AZs of networks the server is attached to.

Refactored some and added interfaces to Openstack networking to mock tests.

Drive by adds ProviderNetworkId to SubnetInfo for Openstack subnets.

QA steps

Bootstrap OpenStack clouds. Finding one with multiple AZ configurations would be interesting.

Bug reference

https://bugs.launchpad.net/juju/+bug/1928979

Choose an external network for a FIP based on the AZ of the instance
if an external-network has not been configured.
All Networking related interfaces moved and added to a new file.  The
networkingBase struct because a wrapper for the Environ and implementer
of the new NetworkingBase interface.
@hmlanigan hmlanigan added kind/bug indicates a bug in the project do not merge Even if a PR has been approved, do not merge the PR! 2.9 labels Nov 4, 2021
Compute and Network AZ are created independently in OpenStack.  No
guarentee they are called the same.  Find the server Addresses, then use
the AZ of the networks those Addresses are on to find external networks
to create FIPs on.
Related updates to unit tests for fix for LP:1928979.
@hmlanigan hmlanigan force-pushed the openstack-network-az branch from ca04b61 to 3fad2fd Compare November 5, 2021 18:44
@hmlanigan hmlanigan removed the do not merge Even if a PR has been approved, do not merge the PR! label Nov 5, 2021
@hmlanigan hmlanigan requested a review from manadart November 5, 2021 18:44
Copy link
Member

@manadart manadart left a comment

Choose a reason for hiding this comment

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

Code looks good.

Canonistack seems to be having some issues at the moment, but I was able to deploy onto my Serverstack bastion.

Works fine for assigning public IPs, but there is only the one AZ.

One suggestion for an extra log line.

netIds = append(netIds, network.Id)
break
}
}
if azName == "" && len(network.AvailabilityZones) == 0 {
if azNames.IsEmpty() || len(network.AvailabilityZones) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Let's log out that we including this network because of the absence of AZ specificity. Users wondering at this behaviour will have something to go on.

"github.com/juju/juju/core/instance"
)

type networkingSuite struct {
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

Let users know why an external network was included for potential FIP
allocation if AZs are not found.
@hmlanigan
Copy link
Member Author

$$merge$$

@hmlanigan hmlanigan changed the title create openstack FIPs on networks on AZ to match the server's addresses. [JUJU-163]create openstack FIPs on networks on AZ to match the server's addresses. Nov 9, 2021
@jujubot jujubot merged commit 8d4ba8e into juju:2.9 Nov 9, 2021
@hmlanigan hmlanigan deleted the openstack-network-az branch November 9, 2021 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 kind/bug indicates a bug in the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants