crane icon indicating copy to clipboard operation
crane copied to clipboard

Researching Virtual Machine (kubevirt) migration with crane

Open djzager opened this issue 3 years ago • 7 comments

This issue is a means of documenting the effort of migrating Virtual Machine's using crane.

djzager avatar May 16 '22 16:05 djzager

The changes were made to the following projects as part of this effort:

  • crane - https://github.com/djzager/crane/tree/cnv-playground
  • cane-lib - https://github.com/djzager/crane-lib/tree/cnv-playground
  • cane-plugin-openshift - https://github.com/djzager/crane-plugin-openshift/tree/cnv-playground
  • crane-runner - https://github.com/djzager/crane-runner/tree/cnv-playground

Container Image: docker pull quay.io/djzager/crane-runner:cnv-playground .. this provides an image with all of the changes contained inside.

djzager avatar May 16 '22 17:05 djzager

Issues that I've found

This section isn't complete until the issues listed are linked to actual GH Issues.

  • Crane's transfer-pvc needs to support specifying pod mutations.
  • Konveyor needs a solution for migrating PVCs with volumeMode: block
  • Konveyor needs a story for dealing with VirtualMachineSnapshots, and necessarily, VolumeSnapshots.
  • Crane export fails when you specify KUBECONFIG=/some/kubeconfig:/another/kubeconfig
  • We need a net new crane plugin...crane-plugin-kubevirt that can handle the mutations necessary for VirtualMachines. Further conversation needed on all the ways to handle this.

djzager avatar May 16 '22 18:05 djzager

Environment Details

  • Using mig-agnosticd to provide two openshift 4.10 clusters (source cluster and destination cluster). The only thing that must be changed is the worker_instance_type must be m5.metal (related: OpenShift Virtualization on AWS).
  • Manually (via Console UI) installed the OpenShift Virtualization Operator and the HyperConverged CR in both source and destination clusters.
  • Mostly because writing Tekton Pipeline's is so much easier than having to write a shell script and just as portable (a file with .yaml or .sh), I also installed OpenShift Pipelines in the destination cluster.

djzager avatar May 16 '22 19:05 djzager

Demonstration: https://youtu.be/tvDYvfoHNxg

djzager avatar May 18 '22 04:05 djzager

PRs:

  • https://github.com/konveyor/crane-lib/pull/103 - updates crane-lib to drop default rbac and cabundles one would see in kube clusters, also cleans up managedFields from metadata as this isn't useful during migration
  • https://github.com/konveyor/crane-plugin-openshift/pull/11 - does similar things for openshift clusters

djzager avatar Jun 09 '22 20:06 djzager

@djzager I think we need to split this one into tractable issues in GH as features to get them onto the priority roadmap and potentially turn this into an epic. I'll hold off on triaging this into Jira until we have a conversation about how that should be done.

eriknelson avatar Jun 24 '22 16:06 eriknelson

/priority normal /kind feature

eriknelson avatar Jun 24 '22 16:06 eriknelson