You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "wido (via GitHub)" <gi...@apache.org> on 2026/08/05 04:59:47 UTC
[PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
wido opened a new pull request, #13795:
URL: https://github.com/apache/cloudstack/pull/13795
### Description
This PR enables IPv6 link-local addressing on the control (link-local) network of system VMs, alongside the existing 169.254.0.0/16 IPv4 addressing. With IPv6 explicitly enabled on the control network we can move our SSH commands (on at least KVM) to link local IPv6 and remove the 169.254.0.0/16 addressing in the future. That can significantly reduce the code-base inside CloudStack. That's not part of this PR yet.
The existing issue #9957 talks about this and this PR should be groundwork for that to be done in the future.
**System VM** (`common.sh`):
- The control NIC gets an IPv6 link-local address generated with EUI-64 (`addr_gen_mode=0`), so the address is deterministic and can be calculated from the NIC's MAC address
- Router Advertisements and SLAAC are disabled on the interface (`accept_ra=0`, `autoconf=0`); only the link-local address is configured
- `setup_sshd()` waits for Duplicate Address Detection to complete and adds a `ListenAddress fe80::...%ethX` entry to `sshd_config`, so sshd listens on both the IPv4 and IPv6 link-local addresses. The sed expressions are idempotent across reboots
- This works for all system VM types, as `setup_sshd()` is always handed the control interface (eth0 for CPVM/SSVM on KVM, eth1 for routers)
**Management Server / API**:
- `listSystemVms` now returns `linklocalip6`: the EUI-64 IPv6 link-local address calculated from the control NIC's MAC address using the existing (unit-tested) `NetUtils.ipv6LinkLocal()`. This performs the same U/L-bit flip + `ff:fe` expansion the kernel does, so the reported address always matches what the system VM configures
- New response field on `SystemVmResponse` (`since 4.23.0`)
**KVM agent**:
- When the control network is set up, the agent now enables IPv6 (link-local only, no RA/SLAAC) on the control bridge (`cloud0`) via a shared `enableBridgeIpv6LinkLocal()` helper in `VifDriverBase`, called from `BridgeVifDriver`, `OvsVifDriver` and `IvsVifDriver`
- This runs unconditionally on agent start, so hosts with a pre-existing `cloud0` bridge also get IPv6 enabled on it
- With this, the host can reach system VMs over the control network with e.g. `ssh -6 -p 3922 fe80::...%cloud0`
**UI**:
- The System VMs list and detail views show the new "Link-local/Control IPv6 address" field
This is a first step towards using IPv6 link-local instead of 169.254.0.0/16 on the control network. The Management Server still provisions system VMs over IPv4; nothing changes for existing deployments.
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [x] Minor
### How Has This Been Tested?
- `api`, `server` and `plugins/hypervisors/kvm` compile cleanly
- `bash -n` on `common.sh`
- `NetUtils.ipv6LinkLocal()` is covered by existing unit tests in `NetUtilsTest` (`testIpv6LinkLocal`), verifying the EUI-64 calculation matches the kernel's
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "wido (via GitHub)" <gi...@apache.org>.
wido commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6497592924
> Hi @wido is this PR ready for review or still in progress?
I just removed the WIP!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "blueorangutan (via GitHub) via commits" <co...@cloudstack.apache.org>.
blueorangutan commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6862489669
<b>[SF] Trillian test result (tid-17571)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 72437 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13795-t17571-kvm-ol8.zip
Smoke tests completed. 156 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
test_uservm_host_control_state | `Failure` | 17.12 | test_host_control_state.py
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "wido (via GitHub)" <gi...@apache.org>.
wido commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r3975691086
##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -1886,6 +1886,9 @@ public SystemVmResponse createSystemVmResponse(VirtualMachine vm) {
vmResponse.setLinkLocalIp(singleNicProfile.getIPv4Address());
vmResponse.setLinkLocalMacAddress(singleNicProfile.getMacAddress());
vmResponse.setLinkLocalNetmask(singleNicProfile.getIPv4Netmask());
+ if (singleNicProfile.getMacAddress() != null) {
+ vmResponse.setLinkLocalIp6(NetUtils.ipv6LinkLocal(singleNicProfile.getMacAddress()).toString());
Review Comment:
The calculated address is always the same. It never changes or will be different. This is an RFC for IPv6 where the link-local is persistent. That's the great thing about it.
Calculate instead of store. Saves a lot of code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "blueorangutan (via GitHub) via commits" <co...@cloudstack.apache.org>.
blueorangutan commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6746553122
@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] wip: systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r4158493317
##########
systemvm/debian/opt/cloud/bin/setup/common.sh:
##########
@@ -573,10 +573,42 @@ setup_dnsmasq() {
fi
}
+enable_ipv6_link_local() {
+ local eth=$1
+ log_it "Enabling IPv6 link-local on interface $eth"
+ # Generate the link-local address with EUI-64 based on the MAC address so
+ # the address can be calculated by the Management Server
+ sysctl -w net.ipv6.conf.${eth}.addr_gen_mode=0
+ # Only a link-local address is wanted, no SLAAC/RA configuration
+ sysctl -w net.ipv6.conf.${eth}.accept_ra=0
+ sysctl -w net.ipv6.conf.${eth}.autoconf=0
+ sysctl -w net.ipv6.conf.${eth}.disable_ipv6=0
+
+ # Wait for Duplicate Address Detection to complete so the address can be bound
+ LINK_LOCAL_IP6=""
+ local i
+ for i in $(seq 1 10); do
+ LINK_LOCAL_IP6=$(ip -6 addr show dev ${eth} scope link -tentative | grep -Po '(?<=inet6 )fe80:[0-9a-f:]+' | head -1)
+ [ -n "$LINK_LOCAL_IP6" ] && break
+ sleep 1
+ done
+
+ if [ -n "$LINK_LOCAL_IP6" ]; then
+ log_it "Interface $eth has IPv6 link-local address $LINK_LOCAL_IP6"
+ else
+ log_it "No IPv6 link-local address appeared on interface $eth"
+ fi
+}
+
setup_sshd(){
local ip=$1
local eth=$2
- [ -f /etc/ssh/sshd_config ] && sed -i -e "s/^[#]*ListenAddress.*$/ListenAddress $ip/" /etc/ssh/sshd_config
+ [ -f /etc/ssh/sshd_config ] && sed -i -e "/^ListenAddress fe80/d" -e "s/^[#]*ListenAddress.*$/ListenAddress $ip/" /etc/ssh/sshd_config
+ enable_ipv6_link_local $eth
+ if [ -n "$LINK_LOCAL_IP6" ]; then
+ log_it "Configuring sshd to also listen on ${LINK_LOCAL_IP6}%${eth}"
+ sed -i -e "/^ListenAddress $ip$/a ListenAddress ${LINK_LOCAL_IP6}%${eth}" /etc/ssh/sshd_config
Review Comment:
fair enough, ok to fix that separately
##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -1886,6 +1886,9 @@ public SystemVmResponse createSystemVmResponse(VirtualMachine vm) {
vmResponse.setLinkLocalIp(singleNicProfile.getIPv4Address());
vmResponse.setLinkLocalMacAddress(singleNicProfile.getMacAddress());
vmResponse.setLinkLocalNetmask(singleNicProfile.getIPv4Netmask());
+ if (singleNicProfile.getMacAddress() != null) {
+ vmResponse.setLinkLocalIp6(NetUtils.ipv6LinkLocal(singleNicProfile.getMacAddress()).toString());
Review Comment:
makes sense that it never changes. can we say in the field description that its calculated, so nobody reads it as the address being up?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "blueorangutan (via GitHub) via commits" <co...@cloudstack.apache.org>.
blueorangutan commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6836800956
@RosiKyu a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] wip: systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "wido (via GitHub)" <gi...@apache.org>.
wido commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r4163523947
##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -1886,6 +1886,9 @@ public SystemVmResponse createSystemVmResponse(VirtualMachine vm) {
vmResponse.setLinkLocalIp(singleNicProfile.getIPv4Address());
vmResponse.setLinkLocalMacAddress(singleNicProfile.getMacAddress());
vmResponse.setLinkLocalNetmask(singleNicProfile.getIPv4Netmask());
+ if (singleNicProfile.getMacAddress() != null) {
+ vmResponse.setLinkLocalIp6(NetUtils.ipv6LinkLocal(singleNicProfile.getMacAddress()).toString());
Review Comment:
Well, isn't this a basic IPv6 knowledge? Link Local IPv6 always exists and you don't need to do anything about it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r3974969703
##########
systemvm/debian/opt/cloud/bin/setup/common.sh:
##########
@@ -573,10 +573,42 @@ setup_dnsmasq() {
fi
}
+enable_ipv6_link_local() {
+ local eth=$1
+ log_it "Enabling IPv6 link-local on interface $eth"
+ # Generate the link-local address with EUI-64 based on the MAC address so
+ # the address can be calculated by the Management Server
+ sysctl -w net.ipv6.conf.${eth}.addr_gen_mode=0
+ # Only a link-local address is wanted, no SLAAC/RA configuration
+ sysctl -w net.ipv6.conf.${eth}.accept_ra=0
+ sysctl -w net.ipv6.conf.${eth}.autoconf=0
+ sysctl -w net.ipv6.conf.${eth}.disable_ipv6=0
+
+ # Wait for Duplicate Address Detection to complete so the address can be bound
+ LINK_LOCAL_IP6=""
+ local i
+ for i in $(seq 1 10); do
+ LINK_LOCAL_IP6=$(ip -6 addr show dev ${eth} scope link -tentative | grep -Po '(?<=inet6 )fe80:[0-9a-f:]+' | head -1)
+ [ -n "$LINK_LOCAL_IP6" ] && break
+ sleep 1
+ done
+
+ if [ -n "$LINK_LOCAL_IP6" ]; then
+ log_it "Interface $eth has IPv6 link-local address $LINK_LOCAL_IP6"
+ else
+ log_it "No IPv6 link-local address appeared on interface $eth"
+ fi
+}
+
setup_sshd(){
local ip=$1
local eth=$2
- [ -f /etc/ssh/sshd_config ] && sed -i -e "s/^[#]*ListenAddress.*$/ListenAddress $ip/" /etc/ssh/sshd_config
+ [ -f /etc/ssh/sshd_config ] && sed -i -e "/^ListenAddress fe80/d" -e "s/^[#]*ListenAddress.*$/ListenAddress $ip/" /etc/ssh/sshd_config
+ enable_ipv6_link_local $eth
+ if [ -n "$LINK_LOCAL_IP6" ]; then
+ log_it "Configuring sshd to also listen on ${LINK_LOCAL_IP6}%${eth}"
+ sed -i -e "/^ListenAddress $ip$/a ListenAddress ${LINK_LOCAL_IP6}%${eth}" /etc/ssh/sshd_config
Review Comment:
this writes the v6 ListenAddress but nothing rechecks the address is still there when sshd actually starts. on my lab it ended up pointing at an address that no longer existed:
```
$ grep -i ListenAddress /etc/ssh/sshd_config
ListenAddress 169.254.202.220
ListenAddress fe80::c00:a9ff:fefe:cadc%eth0
$ ss -tln | grep 3922
LISTEN 0 128 169.254.202.220:3922 0.0.0.0:*
```
sshd was fine with it and just bound v4, so no harm this time. but if it ever refused to start we'd have a systemvm with no way in.
worth only adding the line when the address is actually up at sshd start?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-5609846595
@Damans227 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-5610351427
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19191
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "wido (via GitHub)" <gi...@apache.org>.
wido commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r3975682080
##########
systemvm/debian/opt/cloud/bin/setup/common.sh:
##########
@@ -573,10 +573,42 @@ setup_dnsmasq() {
fi
}
+enable_ipv6_link_local() {
+ local eth=$1
+ log_it "Enabling IPv6 link-local on interface $eth"
+ # Generate the link-local address with EUI-64 based on the MAC address so
+ # the address can be calculated by the Management Server
+ sysctl -w net.ipv6.conf.${eth}.addr_gen_mode=0
+ # Only a link-local address is wanted, no SLAAC/RA configuration
+ sysctl -w net.ipv6.conf.${eth}.accept_ra=0
+ sysctl -w net.ipv6.conf.${eth}.autoconf=0
+ sysctl -w net.ipv6.conf.${eth}.disable_ipv6=0
Review Comment:
Thanks! I had a manual script checking a few things, didn't notice it was gone right after. Let me look into that, I now have a better lab to test this again.
My goal is to remove IPv4 entirely. We now have a complete allocation mechanism for IPv4 for this control cidr which is a lot of code and database entries which shouldn't be needed.
First step is adding IPv6, making sure its stable and then remove IPv4 in a future PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "blueorangutan (via GitHub) via commits" <co...@cloudstack.apache.org>.
blueorangutan commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6749400477
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19955
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] wip: systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6487493883
Hi @wido is this PR ready for review or still in progress?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-5187824778
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/13795?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 3.41%. Comparing base ([`4f11707`](https://app.codecov.io/gh/apache/cloudstack/commit/4f117071c9397b1e4714c8fb61c384883c872842?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`137b3da`](https://app.codecov.io/gh/apache/cloudstack/commit/137b3da610c1902b23afdb8271e64ddb825c9f6b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
> :exclamation: There is a different number of reports uploaded between BASE (4f11707) and HEAD (137b3da). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (4f11707) | HEAD (137b3da) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #13795 +/- ##
=============================================
- Coverage 19.65% 3.41% -16.24%
=============================================
Files 6368 487 -5881
Lines 574881 41867 -533014
Branches 70351 7912 -62439
=============================================
- Hits 112970 1429 -111541
+ Misses 449639 40238 -409401
+ Partials 12272 200 -12072
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/13795/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/13795/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.41% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/13795/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/13795?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "wido (via GitHub)" <gi...@apache.org>.
wido commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r3975688121
##########
systemvm/debian/opt/cloud/bin/setup/common.sh:
##########
@@ -573,10 +573,42 @@ setup_dnsmasq() {
fi
}
+enable_ipv6_link_local() {
+ local eth=$1
+ log_it "Enabling IPv6 link-local on interface $eth"
+ # Generate the link-local address with EUI-64 based on the MAC address so
+ # the address can be calculated by the Management Server
+ sysctl -w net.ipv6.conf.${eth}.addr_gen_mode=0
+ # Only a link-local address is wanted, no SLAAC/RA configuration
+ sysctl -w net.ipv6.conf.${eth}.accept_ra=0
+ sysctl -w net.ipv6.conf.${eth}.autoconf=0
+ sysctl -w net.ipv6.conf.${eth}.disable_ipv6=0
+
+ # Wait for Duplicate Address Detection to complete so the address can be bound
+ LINK_LOCAL_IP6=""
+ local i
+ for i in $(seq 1 10); do
+ LINK_LOCAL_IP6=$(ip -6 addr show dev ${eth} scope link -tentative | grep -Po '(?<=inet6 )fe80:[0-9a-f:]+' | head -1)
+ [ -n "$LINK_LOCAL_IP6" ] && break
+ sleep 1
+ done
+
+ if [ -n "$LINK_LOCAL_IP6" ]; then
+ log_it "Interface $eth has IPv6 link-local address $LINK_LOCAL_IP6"
+ else
+ log_it "No IPv6 link-local address appeared on interface $eth"
+ fi
+}
+
setup_sshd(){
local ip=$1
local eth=$2
- [ -f /etc/ssh/sshd_config ] && sed -i -e "s/^[#]*ListenAddress.*$/ListenAddress $ip/" /etc/ssh/sshd_config
+ [ -f /etc/ssh/sshd_config ] && sed -i -e "/^ListenAddress fe80/d" -e "s/^[#]*ListenAddress.*$/ListenAddress $ip/" /etc/ssh/sshd_config
+ enable_ipv6_link_local $eth
+ if [ -n "$LINK_LOCAL_IP6" ]; then
+ log_it "Configuring sshd to also listen on ${LINK_LOCAL_IP6}%${eth}"
+ sed -i -e "/^ListenAddress $ip$/a ListenAddress ${LINK_LOCAL_IP6}%${eth}" /etc/ssh/sshd_config
Review Comment:
Same goes for IPv4 ofcourse, we never check if the address exists, we assume it does. This needs fixing somewhere else.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "nvazquez (via GitHub) via commits" <co...@cloudstack.apache.org>.
nvazquez commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6746517058
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] wip: systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r4158493089
##########
systemvm/debian/opt/cloud/bin/setup/common.sh:
##########
@@ -573,10 +573,42 @@ setup_dnsmasq() {
fi
}
+enable_ipv6_link_local() {
+ local eth=$1
+ log_it "Enabling IPv6 link-local on interface $eth"
+ # Generate the link-local address with EUI-64 based on the MAC address so
+ # the address can be calculated by the Management Server
+ sysctl -w net.ipv6.conf.${eth}.addr_gen_mode=0
+ # Only a link-local address is wanted, no SLAAC/RA configuration
+ sysctl -w net.ipv6.conf.${eth}.accept_ra=0
+ sysctl -w net.ipv6.conf.${eth}.autoconf=0
+ sysctl -w net.ipv6.conf.${eth}.disable_ipv6=0
Review Comment:
sounds good, happy to test again once its updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-5609834690
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r3974968240
##########
systemvm/debian/opt/cloud/bin/setup/common.sh:
##########
@@ -573,10 +573,42 @@ setup_dnsmasq() {
fi
}
+enable_ipv6_link_local() {
+ local eth=$1
+ log_it "Enabling IPv6 link-local on interface $eth"
+ # Generate the link-local address with EUI-64 based on the MAC address so
+ # the address can be calculated by the Management Server
+ sysctl -w net.ipv6.conf.${eth}.addr_gen_mode=0
+ # Only a link-local address is wanted, no SLAAC/RA configuration
+ sysctl -w net.ipv6.conf.${eth}.accept_ra=0
+ sysctl -w net.ipv6.conf.${eth}.autoconf=0
+ sysctl -w net.ipv6.conf.${eth}.disable_ipv6=0
Review Comment:
tested this on a lab and it gets undone a few seconds later, so the feature doesnt survive a boot.
this sets the runtime value only. the template ships `net.ipv6.conf.all.disable_ipv6 = 1` in `/etc/sysctl.conf`, and `bootstrap.sh:104` runs `sysctl -p` after `setup_sshd`. boot order on the ssvm:
```
00:43:15 Configuring sshd
00:43:15 Enabling IPv6 link-local on interface eth0
00:43:17 Interface eth0 has IPv6 link-local address fe80::c00:a9ff:fefe:cadc
00:43:17 Configuring sshd to also listen on fe80::c00:a9ff:fefe:cadc%eth0
00:43:19 Executing cloud-early-config
00:43:20 Bootstrapping systemvm appliance <- sysctl -p in here
```
end state, address gone and sshd only on v4:
```
$ ip -6 addr show dev eth0
(nothing)
$ sysctl -n net.ipv6.conf.eth0.disable_ipv6
1
$ ss -tln | grep 3922
LISTEN 0 128 169.254.202.220:3922 0.0.0.0:*
```
showed it directly on the vm:
```
$ sysctl -qw net.ipv6.conf.eth0.disable_ipv6=0
$ ip -6 addr show dev eth0 scope link
inet6 fe80::c00:a9ff:fefe:cadc/64 scope link
$ sysctl -p
$ ip -6 addr show dev eth0 scope link
(gone)
```
so `listSystemVms` shows a `linklocalip6` that nothing answers on. ping6 and ssh to it both time out from the host.
the design is fine by the way, once i left ipv6 on and restarted sshd it worked end to end over `fe80::...%cloud0` on 3922.
can we clear the persistent one too? `common.sh:126-129` already does that for `net.ipv6.conf.all.disable_ipv6` including rewriting sysctl.conf.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#discussion_r3974973426
##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -1886,6 +1886,9 @@ public SystemVmResponse createSystemVmResponse(VirtualMachine vm) {
vmResponse.setLinkLocalIp(singleNicProfile.getIPv4Address());
vmResponse.setLinkLocalMacAddress(singleNicProfile.getMacAddress());
vmResponse.setLinkLocalNetmask(singleNicProfile.getIPv4Netmask());
+ if (singleNicProfile.getMacAddress() != null) {
+ vmResponse.setLinkLocalIp6(NetUtils.ipv6LinkLocal(singleNicProfile.getMacAddress()).toString());
Review Comment:
this is calculated from the mac, it never checks the vm actually has the address. so the field always shows something even when ipv6 is off on the systemvm.
on my lab both systemvms reported a `linklocalip6` while nothing was listening on it.
is that the intent, a value you can always compute? if so maybe say so in the field description, otherwise someone will read it as "this address works".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] systemvm: enable IPv6 link-local on the control network [cloudstack]
Posted by "RosiKyu (via GitHub) via commits" <co...@cloudstack.apache.org>.
RosiKyu commented on PR #13795:
URL: https://github.com/apache/cloudstack/pull/13795#issuecomment-6836765460
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org