Skip to content

vrouter in redundant mode acquire guest ips from first ip of the tier#3587

Merged
DaanHoogland merged 8 commits into
apache:masterfrom
ArthurHlt:order-ip-red-router
Mar 14, 2020
Merged

vrouter in redundant mode acquire guest ips from first ip of the tier#3587
DaanHoogland merged 8 commits into
apache:masterfrom
ArthurHlt:order-ip-red-router

Conversation

@ArthurHlt
Copy link
Copy Markdown
Contributor

@ArthurHlt ArthurHlt commented Sep 9, 2019

Description

Vrouter in redundant mode actually acquire guest ips in a tier in a random mode.
This is painful when you use terraform or other systems to acquire specific IP because vrouter can take the one selected.

It looks like a bug more than an intended behaviour.

With this PR vrouter in redundant mode will now take first available ips in the tier which can be predicted

Types of changes

  • Breaking change
  • New feature
  • Bug fix
  • Enhancement
  • Cleanup

How Has This Been Tested?

This is tested against production which works great.
There is no unit test as it looks like there is no in this part of the code, it also not breaking anything and can be considered as a bug fix.

add patch to stop random attribution of ip in a guest network for vrouter
@svenvogel
Copy link
Copy Markdown
Contributor

@ArthurHlt you use redundant vrouter? which hypervisor?

@ArthurHlt
Copy link
Copy Markdown
Contributor Author

ArthurHlt commented Sep 10, 2019

@svenvogel thanks for reaching me. yes we use redundant vrouter on xenserver hypervisors.

@yadvr yadvr added this to the 4.14.0.0 milestone Dec 7, 2019
@andrijapanicsb
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@andrijapanicsb a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-530

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 28, 2020

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-662

@weizhouapache
Copy link
Copy Markdown
Member

@ArthurHlt @rhtyd
can we have a global settings for it ?
some companies use the first 3 ips as gateway, some companies use the last 3 ips as gateway.
maybe we can specify it in global setting (options: first, last, random)

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 6, 2020

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-764

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@andrijapanicsb a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@ArthurHlt
Copy link
Copy Markdown
Contributor Author

ArthurHlt commented Feb 7, 2020

@weizhouapache it's actually ip inside vpc tiers created by cloudstack when you set redundant mode.
There is nothing about vip or vlan context, it's only inside vpc.
By the way, when you are not in redundant mode, vrouter take the first ip in tiers.

But maybe I missed something here

@weizhouapache
Copy link
Copy Markdown
Member

@weizhouapache it's actually ip inside vpc tiers created by cloudstack when you set redundant mode.
There is nothing about vip or vlan context, it's only inside vpc.
By the way, when you are not in redundant mode, vrouter take the first ip in tiers.

But maybe I missed something here

@ArthurHlt when you create a vpc tier, the gateway ip can be any ip in the cidr (.1, .254, .XX).
if vr is not redundant, the ip of guest nic in VR will be set to gateway ip.

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

@ArthurHlt I can see how and why you want to change this behaviour but it is actually by design. A @weizhouapache describes we'll need a setting to steer the behaviour and prevent your patch for breaking other people's clouds. sorry, your code looks fine.

@ArthurHlt
Copy link
Copy Markdown
Contributor Author

@DaanHoogland @weizhouapache That's all make sense to me.
Well i want to pursue the PR for adressing these changes you have requested. I'm just wondering how to add parameters like this ? If a gentleman can give me some code to look at for adding this, i will be very pleased

@DaanHoogland
Copy link
Copy Markdown
Contributor

@ArthurHlt if you promise never to call me a gentleman again; in the IpAddressManager that you added your new method in, you can see an example of a ConfigKey in the beginning of the interface. in IpAddressManagerImpl search for it being used (and further advertised on runtime). GuestNetworkGuru has similar config items, you can choose to put them in any Configurable.

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-928)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39367 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3587-t928-kvm-centos7.zip
Smoke tests completed. 79 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 12, 2020

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-1025

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-1213)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37389 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3587-t1213-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Smoke tests completed. 83 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@DaanHoogland
Copy link
Copy Markdown
Contributor

@weizhouapache can you give this a second look, please?


if (vpcRouterDeploymentDefinition.isRedundant()) {
guestNic.setIPv4Address(_ipAddrMgr.acquireGuestIpAddress(guestNetwork, null));
guestNic.setIPv4Address(_ipAddrMgr.acquireFirstGuestIpAddress(guestNetwork));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ArthurHlt should acquireGuestIpAddressForVrouterRedundant be used here as well?

if (routerDeploymentDefinition.isPublicNetwork()) {
if (routerDeploymentDefinition.isRedundant()) {
gatewayNic.setIPv4Address(_ipAddrMgr.acquireGuestIpAddress(guestNetwork, null));
gatewayNic.setIPv4Address(_ipAddrMgr.acquireFirstGuestIpAddress(guestNetwork));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ArthurHlt should acquireGuestIpAddressForVrouterRedundant be used here ?

@ArthurHlt
Copy link
Copy Markdown
Contributor Author

@weizhouapache thanks for the catch, i've totally forget it.

I've reworked all enum and config that i've made to be able to retrieve configkey value in router package. This actually now look more clean inside but I'm stilling feeling bad to do this in router package: https://github.com/apache/cloudstack/pull/3587/files#diff-2df46c6f8af49cedaa2a089ace159b03R890

Comment thread engine/components-api/src/main/java/com/cloud/network/IpAddressManager.java Outdated
@ArthurHlt
Copy link
Copy Markdown
Contributor Author

@weizhouapache thanks for the hint, this is a better way to handle this. What's your opinion now ?

@andrijapanicsb
Copy link
Copy Markdown
Contributor

ping @weizhouapache - any chance to get it in today?

@weizhouapache
Copy link
Copy Markdown
Member

@andrijapanicsb I will test it.

@weizhouapache
Copy link
Copy Markdown
Member

@ArthurHlt can you remove some unused import ?

@ArthurHlt
Copy link
Copy Markdown
Contributor Author

ArthurHlt commented Mar 13, 2020

@weizhouapache done ;)

@weizhouapache
Copy link
Copy Markdown
Member

@andrijapanicsb tested with isolated networks and vpc with redundant VRs. both work fine.
It is ready for merge I think.

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@andrijapanicsb a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-1050

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@DaanHoogland
Copy link
Copy Markdown
Contributor

nothing outstanding, LGTM*2 and tested. let's merge when the monkey agrees.

@andrijapanicsb
Copy link
Copy Markdown
Contributor

Will merge if tests are finished with no errors, despite the freeze date, as everything else is OK atm (manul test, approvals, no conflicts)

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-1243)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33319 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3587-t1243-kvm-centos7.zip
Smoke tests completed. 83 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@DaanHoogland DaanHoogland merged commit 3575f5e into apache:master Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants