Skip to content

feat(cozystack): add vm-tenant-move skill - #28

Draft
Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
feat/vm-tenant-move
Draft

Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
feat/vm-tenant-move

Conversation

@kvaps

Copy link
Copy Markdown
Member

Adds cozystack:vm-tenant-move. It moves a VM (VMInstance and its VMDisks) to another tenant namespace without copying disk data: the PV is re-bound to a new PVC in the target namespace, and the DataVolume is re-created over it.

CDI adopts the PVC through cdi.kubevirt.io/storage.populatedFor, so there is no need to touch the CDI webhooks or feature gates. allowClaimAdoption on a PVC does nothing in CDI v1.66.1 (CDI reads it from the DataVolume only), that's why migration 29 had to disable the webhooks. IP and MAC are kept by moving the ip.kubeovn.io record, the same way migration 29 does it.

Checked against the code (cozystack main, CDI v1.66.1, KubeVirt v1.9.0), but not run on a live cluster yet, so keeping it as a draft.

Moving a VM between tenants has no documented procedure, and copying
large disks through backups is slow. Add a skill that moves a
VMInstance and its VMDisks without copying data: the PersistentVolume
is re-bound to a PVC in the target namespace and CDI adopts it through
the storage.populatedFor annotation, which works without disabling
CDI webhooks or enabling claim adoption. The kube-ovn IP record is
moved the way platform migration 29 does it, so the VM keeps its IP
and MAC. Backup restore into another namespace is kept as the
fallback.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.

1 participant