You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "nagaboinaramgopal (via GitHub)" <gi...@apache.org> on 2026/09/11 16:07:28 UTC
[PR] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
nagaboinaramgopal opened a new pull request, #14153:
URL: https://github.com/apache/cloudstack/pull/14153
### Description
cloudstack-setup-agent sets up live migration on Debian and Ubuntu by writing `libvirtd_opts='-l'` to /etc/default/libvirtd and masking the libvirtd sockets. The libvirtd.service unit on current releases reads `LIBVIRTD_ARGS` from that file instead (Debian 12 and 13: `ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS` with `--timeout 120` as the default), so after adding a host libvirtd runs without `--listen`, nothing listens on 16509/16514 and live migration fails. This also sets `LIBVIRTD_ARGS="--listen"`, and keeps `libvirtd_opts` for older units that still read it.
Related: #9802 and #12374.
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] 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
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
N/A
### How Has This Been Tested?
Live tested on two fresh Debian 13 KVM hosts (libvirt 11.3, QEMU 10.0) added to a cluster with addHost, with NFS primary storage, and a VM live migrated between them with migrateVirtualMachine.
Before this change, right after addHost:
/etc/default/libvirtd libvirtd_opts='-l'
libvirtd process /usr/sbin/libvirtd --timeout 120
ports 16509/16514 nothing listening
15:51:27 GET command=migrateVirtualMachine&virtualmachineid=...&hostid=...
15:51:28 ERROR [LibvirtMigrateCommandWrapper] Can't migrate domain due to: [unable to connect to server at '<destination host>:16509': Connection refused]
15:51:28 Complete async job-1640, jobStatus: FAILED, resultCode: 530, "Failed to migrate domain"
With this change, same hosts reset to the distro defaults and added again:
/etc/default/libvirtd libvirtd_opts='-l'
LIBVIRTD_ARGS="--listen"
libvirtd process /usr/sbin/libvirtd --listen
port 16514 listening
15:58:25 GET command=migrateVirtualMachine&virtualmachineid=...&hostid=...
15:58:28 Complete async job-1653, jobStatus: SUCCEEDED
Debian 12 (libvirt 9.0) uses the same unit layout.
#### How did you try to break this feature and the system with this change?
Older units that read libvirtd_opts still get it. replace_or_add_line replaces an existing or commented LIBVIRTD_ARGS line, so adding a host again does not duplicate it. The RHEL and SUSE paths are unchanged.
--
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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6472946661
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19805
--
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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6504642585
@rootnomad , could you submit an ICLA with the ASF? you are contributing a lot of code in a short time, which is very much appreciated. Submitting an ICLA would help with legal matters a lot.
--
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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "blueorangutan (via GitHub) via commits" <co...@cloudstack.apache.org>.
blueorangutan commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6752517334
<b>[SF] Trillian Build Failed (tid-17521)<b/>
--
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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "nvazquez (via GitHub) via commits" <co...@cloudstack.apache.org>.
nvazquez commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6750570373
@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
Re: [PR] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "nagaboinaramgopal (via GitHub)" <gi...@apache.org>.
nagaboinaramgopal commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-5682739214
Thanks @weizhouapache for the review. This needs a second review and a package and smoke test run. The red Simulator CI job stopped at a Maven lock timeout during the build, before any tests ran.
--
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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "blueorangutan (via GitHub) via commits" <co...@cloudstack.apache.org>.
blueorangutan commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6750586458
@nvazquez 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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "rootnomad (via GitHub)" <gi...@apache.org>.
rootnomad commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6473425340
> a smoke test run would not prove anything here as the ansible example he gave is in place. Would be nice if someone else could test it.
Good call @DaanHoogland, did exactly that on a Debian 12 (bookworm) KVM host without the ansible workaround.
On stock Debian systemd, libvirtd.service runs `ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS` sourced from /etc/default/libvirtd, with libvirtd.socket masked. So only LIBVIRTD_ARGS takes effect and libvirtd_opts is ignored by systemd.
- Before the fix (old code sets `libvirtd_opts='-l'` only): libvirtd starts with empty args and does not listen, nothing on the migration port.
- After the fix (adds `LIBVIRTD_ARGS="--listen"`): libvirtd listens.
These hosts have listen_tls=1, so it binds 16514 rather than 16509, but it's the same mechanism. Host restored afterwards. So on a Debian/Ubuntu host without that ansible workaround, this is the line that actually gets libvirtd listening for live migration.
--
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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6470989136
@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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-5644886908
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/14153?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 4.16%. Comparing base ([`8261bec`](https://app.codecov.io/gh/apache/cloudstack/commit/8261beca2fb4415015450f78fbf24c6c679abce3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e31f9a0`](https://app.codecov.io/gh/apache/cloudstack/commit/e31f9a06af074399a66c66d5cfb2d074e8764e06?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 (8261bec) and HEAD (e31f9a0). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (8261bec) | HEAD (e31f9a0) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 4.20 #14153 +/- ##
=============================================
- Coverage 16.38% 4.16% -12.23%
=============================================
Files 5669 405 -5264
Lines 501561 33107 -468454
Branches 60922 5903 -55019
=============================================
- Hits 82168 1378 -80790
+ Misses 410185 31553 -378632
+ Partials 9208 176 -9032
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/14153/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/14153/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.16% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/14153/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/14153?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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6471023857
@weizhouapache mentioned, a smoke test run would not prove anything here as the ansible example he gave is in place. Would be nioce if someone else could test 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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "rootnomad (via GitHub)" <gi...@apache.org>.
rootnomad commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6473307163
Gave this an independent test on a Debian 12 (bookworm) KVM host, since as you noted Trillian can't show it (those hosts already set LIBVIRTD_ARGS via ansible).
On stock Debian systemd, libvirtd.service runs `ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS` sourced from /etc/default/libvirtd, with libvirtd.socket masked. So only LIBVIRTD_ARGS takes effect and libvirtd_opts is ignored by systemd.
- Before the fix (old code sets `libvirtd_opts='-l'` only): libvirtd starts with empty args and does not listen, nothing on the migration port.
- After the fix (adds `LIBVIRTD_ARGS="--listen"`): libvirtd listens.
These hosts have listen_tls=1, so it binds 16514 rather than 16509, but it's the same mechanism. Host restored afterwards. So on a Debian/Ubuntu host without that ansible workaround in place, this is the line that actually gets libvirtd listening for live migration.
--
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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6471007889
@DaanHoogland 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] kvm: set LIBVIRTD_ARGS so libvirtd listens on Debian and Ubuntu hosts [cloudstack]
Posted by "rootnomad (via GitHub)" <gi...@apache.org>.
rootnomad commented on PR #14153:
URL: https://github.com/apache/cloudstack/pull/14153#issuecomment-6504746394
> @rootnomad , could you submit an ICLA with the ASF? you are contributing a lot of code in a short time, which is very much appreciated. Submitting an ICLA would help with legal matters a lot.
Thanks @DaanHoogland , that genuinely means a lot. Happy to, I'll get the ICLA filed with the ASF.
--
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