Skip to content

[Backport release-1.6] feat(kubevirt): expose migration configuration through platform values - #4339

Closed
europrinter (yankawai) wants to merge 2 commits into
cozystack:release-1.6from
yankawai:backport-4254-release-1.6
Closed

europrinter (yankawai) wants to merge 2 commits into
cozystack:release-1.6from
yankawai:backport-4254-release-1.6

Conversation

@yankawai

@yankawai europrinter (yankawai) commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Manual backport of #4254 to release-1.6.

The automated backport, #4322, stopped with conflict markers in four files as its only commit, so it is red on DCO and unmergeable as it stands.

Every conflict has the same cause: the kubevirt.disabledFeatureGates work landed on main after 1.6 was cut, and the cherry-pick carried it into hunks this line does not have. Four differences follow:

  • platform values gains a kubevirt block holding migrations alone, and the iaas bundle gains only the migrations hop;
  • the wiring test takes the four migrations cases and the case for a null kubevirt block, without the assertions that belong to disabledFeatureGates cases this line does not have;
  • update_idempotency_test.sh gains run_update_logged, a four-line helper that arrived on main with that work and the new cases need;
  • the kubevirt Makefile header counts six sed patches rather than five.

Verified on this branch: 9 kubevirt chart tests, 31 platform wiring tests (102 across the platform suite), and update_idempotency_test PASS under GNU make and sed. Removing the new awk guard from the Makefile turns that test red naming the migrations block, so the ported guard is doing work. On this line (.Values.kubevirt).migrations is the only reader of .Values.kubevirt; rewriting it as .Values.kubevirt.migrations turns the null-block case red with a nil pointer.

Feature summary, unchanged from #4254: cluster-wide migration settings could only be applied by patching the KubeVirt CR, because the kubevirt chart did not render migrations and the platform bundle did not forward it. kubevirt.migrations now passes through the generated Package to spec.configuration.migrations. A hand patch of that Package is undone on the next platform render, so this hop is the only supported setter.

kubevirt:
  migrations:
    bandwidthPerMigration: 625M
    parallelMigrationsPerCluster: 2
    parallelOutboundMigrationsPerNode: 1

Close #4322 in favour of this one, or tell me to take a different route and I will.

CI follow-up: the run on the maintainer copy #4402 stopped the Kafka PVC check after 4.5 seconds of its two-minute budget. Chainsaw 0.2.15 can hide an API read error behind the previous resource matches expectation message; this path reproduces locally, but the original API error was not preserved in the run. The added test-only commit uses deletion watches for both PVCs, retaining their earlier Bound assertions and the same timeout. Verified with Chainsaw 0.2.15 and kubectl 1.33.13 against a loopback API: delayed/already-completed deletion and a watch reconnect pass; retained PVCs and forbidden reads fail. Chainsaw lint passes. A full E2E rerun on the new head still needs workflow approval.

Screenshots

Not a UI change.

Downstream repositories

Walked the trigger map against the diff: platform values, the iaas bundle and the kubevirt chart. The v1.6 reference page of the platform values had no kubevirt section, so the row goes there as a follow-up that should land with this backport.

Release note

feat(kubevirt): expose `kubevirt.migrations` in the platform values and forward it to `spec.configuration.migrations` on the KubeVirt CR, so live-migration bandwidth and parallelism can be set without patching a Package that the platform re-renders.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f047363f-e4fa-4b32-9f6d-42423fbd7817

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/virtualization Issues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import) size/L This PR changes 100-499 lines, ignoring generated files kind/feature Categorizes issue or PR as related to a new feature labels Sep 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

europrinter (@yankawai) NOT LGTM because of one test case the backport dropped. Everything else matches #4254, and an existing 1.6 install renders exactly as before.

What I checked, against the current release-1.6 tip (8a6ce81):

  • The diff differs from #4254's merge only where release-1.6 forces it. Platform values gain the kubevirt: key with its header, and the hop in iaas.yaml gets a reworded copy of the comment that sits over the disabledFeatureGates hop on main. The test script gains run_update_logged, and the Makefile header says "six". Main's rewording of a Makefile comment is left out, because release-1.6 doesn't have that paragraph. Nothing from the disabledFeatureGates work comes along, and the rest is line for line the same as main.
  • make update from this branch, run on the release-1.6 CR, produces the committed CR byte for byte. A second run changes nothing. Without the new awk check, update_idempotency_test.sh goes red on the missing-key case, as the description says.
  • With default values the rendered output is byte-identical between the base and this head. That covers the platform chart with values.yaml alone and with each of the isp-full, isp-full-generic and isp-hosted files, and the kubevirt chart with defaults and with a GPU-style set of forwarded values. I dropped templates/repository.yaml on both sides, since its lookup fails offline.
  • With migrations set, the Package values and the rendered spec.configuration.migrations are the same as on main. I tried limits, false/0, {}, null, and kubevirt: null.
  • kubevirt runs 9 tests (5 on the base), platform runs 101 in 24 suites (97 on the base), and the idempotency script passes. CI hasn't run any of this yet. The Pull Request, Pre-Commit Checks and API Review Gate runs on this head are waiting for workflow approval.

The blocker is a null-block test that was dropped together with the disabledFeatureGates tests around it. On main, #4254 added a notExists on spec.components.kubevirt.values.migrations to "renders the kubevirt Package without a nil-pointer error when the whole kubevirt block is set to null". That test came with the disabledFeatureGates work, so release-1.6 doesn't have it, and the assertion went with it. But on this branch (.Values.kubevirt).migrations is the only reader of .Values.kubevirt, so here the test belongs to this change.

Nothing on this branch catches a regression there. I changed iaas.yaml:17 to {{- with .Values.kubevirt.migrations -}}. The platform suite stays at 101/101, while helm template with kubevirt: null fails with nil pointer evaluating interface {}.migrations. The same edit on main turns that test red. The comment this PR adds over the hop says the walk is nil-safe for the reason the gpu block gives, and the gpu block says its null cases are pinned by tests. This one isn't.

The fix is to restore the case without its disabledFeatureGates assertion, next to the new migrations cases in bundles_gpu_kubevirt_wiring_test.yaml:

  - it: renders the kubevirt Package without a nil-pointer error when the whole kubevirt block is set to null
    set:
      bundles:
        system:
          enabled: true
          variant: isp-full
        iaas:
          enabled: true
        enabledPackages: []
      kubevirt: null
    documentSelector:
      path: metadata.name
      value: cozystack.kubevirt
    asserts:
      - equal:
          path: kind
          value: Package
      - notExists:
          path: spec.components.kubevirt.values.migrations

With it the suite passes at 102, and the flattened walk turns it red. The platform-defaults assertion dropped the same way doesn't need to come back. The default is {}, and "omits empty kubevirt.migrations" already fails if the hop forwards it. The wiring-test bullet in the commit message and in the description will need a small edit afterwards, since the description becomes the merge commit message on release-1.6.

Two things that don't block. The commit lists me as its author. It was cherry-picked from the merge commit of #4254, which I made, and cherry-pick keeps the author of that commit. You wrote the change and you sign it off, so git commit --amend --reset-author while you're amending puts your name on it.

The other is docs. The website's 1.6 page content/en/docs/v1.6/operations/configuration/platform-package.md is the table of platform values keys, and it has no kubevirt.* row. website#697 only touched next. The trigger map in docs/agents/contributing.md ties platform values.yaml to the next copy of that page, and says a docs change gets backported once it matters for a released version, which this one now does. A one-row follow-up there, linked from the description, fits better than the "no downstream repository" tick.

Backport of cozystack#4254 to release-1.6.

Cluster-wide migration settings could only be applied by patching the KubeVirt
CR: the kubevirt chart did not render `migrations`, and the platform bundle did
not forward it. The optional `kubevirt.migrations` platform value now passes
through the generated Package to `spec.configuration.migrations`, and a hand
patch of that Package is undone on the next platform render, so this hop is the
only supported setter.

Four differences from main, all from release-1.6 predating the
disabledFeatureGates work:

- platform values gains a `kubevirt` block holding `migrations` alone, and the
  iaas bundle gains only the migrations hop;
- the wiring test takes the four migrations cases and the case for a null
  `kubevirt` block, without the assertions that belong to disabledFeatureGates
  cases absent here;
- update_idempotency_test.sh gains `run_update_logged`, which arrived on main
  alongside that work and the new cases need;
- the kubevirt Makefile header counts six sed patches rather than five.

Verified on this branch: 9 kubevirt chart tests, 31 platform wiring tests (102
across the platform suite), and update_idempotency_test PASS under GNU make and
sed. Removing the new awk guard from the Makefile turns that test red naming the
migrations block, so the ported guard is not decorative. On this line
(.Values.kubevirt).migrations is the only reader of .Values.kubevirt, and
rewriting it as .Values.kubevirt.migrations turns the null-block case red with a
nil pointer.

The automated backport in cozystack#4322 stopped with conflict markers in four files as
its only commit, which is why this exists.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <[email protected]>
@yankawai

Copy link
Copy Markdown
Contributor Author

Restored the null-block case: the platform suite is at 102, and rewriting the hop as .Values.kubevirt.migrations turns it red with a nil pointer. The commit is amended with the updated wiring-test bullet and my authorship, and the description matches. The v1.6 reference row is cozystack/website#705.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

europrinter (@yankawai) LGTM. The test for a null kubevirt block is back, and it can go red.

It keeps the notExists check on migrations that #4254 has on main and drops only the disabledFeatureGates one, which has nothing to check on this line. I removed the parentheses at iaas.yaml:17, and only that test failed, with nil pointer evaluating interface {}.migrations. With the parentheses back the platform suite passes, 102 tests.

The rebuilt commit sits on the same release-1.6 base, and the author field is now yours.

Replace negative Chainsaw assertions with deletion watches, keeping the
two-minute timeout and the preceding Bound assertions for both PVCs.

Chainsaw 0.2.15 can abort polling on an API read error and report its
previous "resource matches expectation" instead. The failed cozystack#4402 run
ended this check after 4.5 seconds, not its two-minute budget.

Verified with Chainsaw 0.2.15 and kubectl 1.33.13 against a loopback API:
delayed deletion, already absent, a read failure on the old polling path,
and watch reconnect succeed; retained PVCs and forbidden reads fail.
Chainsaw lint passes. The original CI API error was not preserved; a
full E2E rerun is still needed.

Signed-off-by: Yan Bondarenko <[email protected]>
myasnikovdaniil added a commit that referenced this pull request Sep 25, 2026
… through platform values (#4402)

This reopens a fork backport from a branch in this repository so its CI
can run. The commit is the one from #4339 by @yankawai, unchanged. On
release-1.6 the pull-request CI pushes the images it builds, and a run
from a fork has no registry credentials, so #4339 stopped at the build
jobs and never reached e2e. The description below is the author's.

## What this PR does

Manual backport of #4254 to `release-1.6`.

The automated backport, #4322, stopped with conflict markers in four
files as its only commit, so it is red on DCO and unmergeable as it
stands.

Every conflict has the same cause: the `kubevirt.disabledFeatureGates`
work landed on main after 1.6 was cut, and the cherry-pick carried it
into hunks this line does not have. Four differences follow:

- platform values gains a `kubevirt` block holding `migrations` alone,
and the iaas bundle gains only the migrations hop;
- the wiring test takes the four migrations cases and the case for a
null `kubevirt` block, without the assertions that belong to
disabledFeatureGates cases this line does not have;
- `update_idempotency_test.sh` gains `run_update_logged`, a four-line
helper that arrived on main with that work and the new cases need;
- the kubevirt Makefile header counts six sed patches rather than five.

Verified on this branch: 9 kubevirt chart tests, 31 platform wiring
tests (102 across the platform suite), and `update_idempotency_test`
PASS under GNU make and sed. Removing the new awk guard from the
Makefile turns that test red naming the migrations block, so the ported
guard is doing work. On this line `(.Values.kubevirt).migrations` is the
only reader of `.Values.kubevirt`; rewriting it as
`.Values.kubevirt.migrations` turns the null-block case red with a nil
pointer.

Feature summary, unchanged from #4254: cluster-wide migration settings
could only be applied by patching the KubeVirt CR, because the kubevirt
chart did not render `migrations` and the platform bundle did not
forward it. `kubevirt.migrations` now passes through the generated
Package to `spec.configuration.migrations`. A hand patch of that Package
is undone on the next platform render, so this hop is the only supported
setter.

```yaml
kubevirt:
  migrations:
    bandwidthPerMigration: 625M
    parallelMigrationsPerCluster: 2
    parallelOutboundMigrationsPerNode: 1
```

### Screenshots

Not a UI change.

### Downstream repositories

Walked the trigger map against the diff: platform values, the iaas
bundle and the kubevirt chart. The v1.6 reference page of the platform
values had no `kubevirt` section, so the row goes there as a follow-up
that should land with this backport.

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: cozystack/website#705

### Release note

```release-note
feat(kubevirt): expose `kubevirt.migrations` in the platform values and forward it to `spec.configuration.migrations` on the KubeVirt CR, so live-migration bandwidth and parallelism can be set without patching a Package that the platform re-renders.
```
@myasnikovdaniil

Copy link
Copy Markdown
Contributor

Closing in favour of #4402, same backport of #4254, rebased on current release-1.6 and green on the E2E lane. Thanks for putting this one together.

Aleksei Sviridkin (lexfrei) added a commit that referenced this pull request Sep 25, 2026
This reopens a fork pull request from a branch in this repository so its
CI can run. The commit is the one from #4481 by @yankawai, unchanged. On
release-1.6 the pull-request CI pushes the images it builds, and a run
from a fork has no registry credentials, so #4481 could never get past
the build jobs to e2e. The description below is the author's.

## What this PR does

Wait for both ZooKeeper PVCs to disappear after Kafka deletion. Negative
assertions can stop on an API read error before their timeout; deletion
watches wait for the resource to be removed. The existing Bound and
KafkaTopic checks are unchanged.

Carries the test-only change from c92828c in #4339, which was not
included in #4402. This targets `release-1.6`; the Kafka suite on `main`
uses KRaft without ZooKeeper.

Validated with Chainsaw 0.2.15: delayed deletion, an already absent PVC,
an interrupted watch, and the read-error fixture pass. A retained PVC
and forbidden access fail. The full Kafka E2E run remains for CI.

### Screenshots

Not applicable.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:

### Release note

```release-note
NONE
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/virtualization Issues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import) kind/feature Categorizes issue or PR as related to a new feature size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants