Skip to content

feat(vm): allow detach cloud-init volumes without restart#2583

Draft
loktev-d wants to merge 7 commits into
mainfrom
feat/vm/remove-provisioning-without-restart
Draft

feat(vm): allow detach cloud-init volumes without restart#2583
loktev-d wants to merge 7 commits into
mainfrom
feat/vm/remove-provisioning-without-restart

Conversation

@loktev-d

@loktev-d loktev-d commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Allows removing a cloudinit initialization script from a running virtual machine without a restart. Removing .spec.provisioning (type UserData/UserDataRef) is now applied live: the cloud-init disk is hot-detached from the running VM, after which the referenced Secret can be deleted.'

Module-side changes:

  • vmchange comparator (compareProvisioning): removal of a cloudinit provisioning block is downgraded to ActionApplyImmediate (no restart). Any add or change of provisioning, still require a restart (ActionRestart), because that data is consumed only at VM startup.
  • kvbuilder.KVVM.SetProvisioning + new RemoveDisk: the KubeVirt VM template now correctly drops the cloud-init/sysprep disk and volume when provisioning is removed or the provisioning type is switched. This also fixes a latent bug where a stale provisioning disk was left in the template on removal.

Why do we need it, and what problem does it solve?

What is the expected result?

  1. Create a running VM with provisioning.type: UserData (or UserDataRef).
  2. Remove the .spec.provisioning block.
  3. The VM stays Running (same VMI, no restart), the AwaitingRestartToApplyConfiguration condition does not appear, the cloudinit disk/volume disappears from the running VMI, and a UserDataRef Secret can be deleted.
  4. Removing a Sysprep provisioning block instead sets AwaitingRestartToApplyConfiguration: True and keeps the disk until the VM is restarted.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: feature
type: vm
summary: allow detach cloud-init volumes without restart

Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d marked this pull request as draft July 2, 2026 15:25
loktev-d added 2 commits July 2, 2026 18:27
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d changed the title feat(vm): allow provisioning volume removal without restart feat(vm): allow detach cloud-init volumes without restart Jul 3, 2026
loktev-d and others added 3 commits July 6, 2026 11:29
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <70405899+loktev-d@users.noreply.github.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
@deckhouse-BOaTswain

deckhouse-BOaTswain commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
Signed-off-by: Daniil Loktev <70405899+loktev-d@users.noreply.github.com>
@loktev-d loktev-d added e2e/run Run e2e test on cluster of PR author and removed e2e/run Run e2e test on cluster of PR author labels Jul 6, 2026
@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
@deckhouse-BOaTswain

deckhouse-BOaTswain commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Jul 6, 2026
@loktev-d loktev-d added this to the v1.10.0 milestone Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants