A kubectl plugin for migrating virtual machines to KubeVirt using Forklift.
kubectl-mtv helps migrate VMs from vSphere, oVirt, OpenStack, and OVA to Kubernetes/OpenShift using KubeVirt. It's a command-line interface for the Forklift project.
# Using krew
kubectl krew install mtv
# Or download from releases
# https://github.com/yaacov/kubectl-mtv/releases
See Installation Guide for more options.
It is posible to add kubectl-mtv specific MCP server for AI client that support MCP addons, for example cursor IDE and claude desktop.
# Installing the MCP servers
pip install mtv-mcp
# Or download from releases
# https://github.com/yaacov/kubectl-mtv/releases
# MTV read-only server (recommended for most users)
claude mcp add kubectl-mtv-mcp
# MTV write server (USE WITH CAUTION - can modify/delete resources)
claude mcp add kubectl-mtv-write-mcp
See MCP Guid
kubectl mtv create provider vsphere-01 --type vsphere \
--url https://vcenter.example.com \
-u admin --password secret --cacert @ca.cert
# Network mapping
kubectl mtv create mapping network prod-net \
--source vsphere-01 --target openshift \
--network-pairs "VM Network:default,Management:openshift-sdn/mgmt"
# Storage mapping with enhanced features
kubectl mtv create mapping storage prod-storage \
--source vsphere-01 --target openshift \
--storage-pairs "datastore1:standard;volumeMode=Block;accessMode=ReadWriteOnce,datastore2:fast;volumeMode=Filesystem" \
--default-offload-plugin vsphere --default-offload-vendor vantara
# Using system defaults for best network and storage mapping
kubectl mtv create plan migration-1 \
--source vsphere-01 \
--vms vm1,vm2,vm3
# Using existing mappings
kubectl mtv create plan migration-1 \
--source vsphere-01 \
--network-mapping prod-net \
--storage-mapping prod-storage \
--vms vm1,vm2,vm3
kubectl mtv start plan migration-1
kubectl mtv get plan --watch
For a complete walkthrough, see the Migration Demo Tutorial.
Query and explore provider resources before migration:
# List VMs
kubectl mtv get inventory vms vsphere-01
# Filter VMs by criteria
kubectl mtv get inventory vms vsphere-01 -q "where memoryMB > 4096"
# List networks and storage
kubectl mtv get inventory networks vsphere-01
kubectl mtv get inventory storage vsphere-01
See Inventory Commands Tutorial for advanced queries and filtering.
For optimal VMware disk transfer performance, build a VDDK image from VMware's VDDK SDK:
# Build VDDK image
kubectl mtv create vddk-image \
--tar VMware-vix-disklib-8.0.1.tar.gz \
--tag quay.io/myorg/vddk:8.0.1
# Use it when creating a provider
kubectl mtv create provider vsphere-01 --type vsphere \
--url https://vcenter.example.com \
--vddk-init-image quay.io/myorg/vddk:8.0.1
See VDDK Setup Guide for detailed instructions.
- Multi-Platform Support: Migrate from vSphere, oVirt, OpenStack, and OVA
- Flexible Mapping: Use existing mappings, inline pairs, or automatic defaults
- Advanced Queries: Filter and search inventory with powerful query language
- VDDK Support: Optimized VMware disk transfers
- Real-time Monitoring: Track migration progress live
- Timezone-Aware Display: View timestamps in local time or UTC with
--use-utc
flag
- Installation Guide
- Usage Guide
- Migration Demo
- Migration Hooks
- Inventory Queries
- Mapping Configuration
- Creating Mappings
- Patching Mappings
- Patching Providers
- Patching Plans
- Creating Migration Hosts
- Development Guide
MTV_VDDK_INIT_IMAGE
: Default VDDK init image for VMware providersMTV_INVENTORY_URL
: Base URL for inventory service
Apache-2.0