kvm/bridge: Allow Link Local Cidr (cloud0 interface) to be configured#3500
kvm/bridge: Allow Link Local Cidr (cloud0 interface) to be configured#3500yadvr merged 1 commit intoapache:masterfrom
Conversation
|
In addition, also tested and verified: systemvms do get their ips from within the control.cidr and they are fully functional. |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-141 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-172)
|
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java
Show resolved
Hide resolved
| Script.runSimpleBashScript("ip address add 169.254.0.1/16 dev " + linkLocalBr + ";" + "ip route add " + NetUtils.getLinkLocalCIDR() + " dev " + linkLocalBr + " src " + | ||
| NetUtils.getLinkLocalGateway()); | ||
| Script.runSimpleBashScript("ip address add " + NetUtils.getLinkLocalAddressFromCIDR(_controlCidr) + " dev " + linkLocalBr); | ||
| Script.runSimpleBashScript("ip route add " + _controlCidr + " dev " + linkLocalBr + " src " + NetUtils.getLinkLocalFirstAddressFromCIDR(_controlCidr)); |
There was a problem hiding this comment.
How about keeping NetUtils.getLinkLocalGateway() but extending it to accept a CIDR parameter? As internally it invokes getLinkLocalFirstAddressFromCIDR as well
There was a problem hiding this comment.
Could be, but there aren't many methods calling it. I see what you mean, I don't have a try preference for it though.
| Assert.assertTrue(driver.isValidProtocolAndVnetId("123", "vlan")); | ||
| Assert.assertTrue(driver.isValidProtocolAndVnetId("456", "vxlan")); | ||
| } | ||
|
|
| } | ||
|
|
||
| public static String getLinkLocalCIDR() { | ||
| return "169.254.0.0/16"; |
There was a problem hiding this comment.
Same as the comment above, instead of returning a hardcoded value, this method can return the configured CIDR and can make getLinkLocalGateway() above to be consistent with it.
There was a problem hiding this comment.
Do we have access to the configuration here? I don't think so. Therefor I changed it this way.
|
@wido cc @GabrielBrascher - can you review the oustanding comments. Tests LGTM. |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-168 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Left some remark, some changes I'll need to re-review, meanwhile I'll wait for regression tests to come back. |
|
Trillian test result (tid-191)
|
|
I think I addressed the comments above. Some seem to be a coding style thing but not really a technical change. Let me know if this PR is LGTM |
|
@wido can you comment on the IvsVifDriver removal? |
|
@rhtyd I did? The file is not referenced anywhere. I also think that it was a typo when the file was created. |
There are certain scenarios where the 169.254.0.0/16 subnet is used for different purposes then CloudStack on a hypervisor. Once of such scenarios is a BGP+EVPN+VXLAN setup using BGP Unnumbered where the 169.254.0.1 address is used by Frr/Zebra BGP routing to send traffic to the neighboring router. The following settings can be changed in the agent.properties (default values added): control.cidr=169.254.0.0/16 Make sure the global setting 'control.cidr' matches the values defined in the agent.propeties! In the future the mgmt server can send this parameter to a KVM Agent on startup, but at the moment this framework is not in place and thus these values can't be send to the Agent in a proper manner. This commit also: - Adds Unit Tests - Removes the dead IvsVifDriver Signed-off-by: Wido den Hollander <wido@widodh.nl>
|
@rhtyd I see! The file is back with a few modifications. @nvazquez I also took another look at your comments and they should be adressed now. |
| } | ||
| _ivsIfUpPath = Script.findScript(utilScriptsDir, "qemu-ivs-ifup"); | ||
|
|
||
| libvirtVersion = (Long) params.get("libvirtVersion"); |
There was a problem hiding this comment.
Looks like libvirtVersion was not being used on this class, is that right?
There was a problem hiding this comment.
Not being used indeed. Dead variable which was never called
| } | ||
|
|
||
| public static String getLinkLocalCIDR() { | ||
| return "169.254.0.0/16"; |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✖centos7 ✔debian. JID-179 |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-183 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-216)
|
Description
There are certain scenarios where the 169.254.0.0/16 subnet is used for different
purposes then CloudStack on a hypervisor.
Once of such scenarios is a BGP+EVPN+VXLAN setup using BGP Unnumbered where the
169.254.0.1 address is used by Frr/Zebra BGP routing to send traffic to the
neighboring router.
The following settings can be changed in the agent.properties (default values added):
control.cidr=169.254.0.0/16
Make sure the global setting 'control.cidr' matches the values defined in the agent.propeties!
In the future the mgmt server can send this parameter to a KVM Agent on startup, but at the moment
this framework is not in place and thus these values can't be send to the Agent in a proper manner.
Fixes: #3488
Types of changes
How Has This Been Tested?
Ran local test on our cloud environment and verified cloud0 now has a different address.
root@hv-138-a05-23:~# ip addr show cloud0 58: cloud0: mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether fe:00:a9:fe:f0:c9 brd ff:ff:ff:ff:ff:ff inet 169.254.240.1/20 scope global cloud0 valid_lft forever preferred_lft forever inet6 fe80::8c3c:82ff:fe5a:77c/64 scope link valid_lft forever preferred_lft forever root@hv-138-a05-23:~#