A kubectl plugin for migrating virtual machines to KubeVirt using Forklift.
kubectl-mtv helps migrate VMs from vSphere, oVirt, OpenStack, EC2, 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/releasesSee Installation Guide for more options.
kubectl-mtv includes a built-in MCP (Model Context Protocol) server for AI agents that support MCP add‑ons, such as Cursor IDE and Claude Desktop.
See MCP Server Guide for detailed setup instructions and usage examples.
# vSphere
kubectl mtv create provider vsphere-01 --type vsphere \
--url https://vcenter.example.com \
-u admin --password secret --cacert @ca.cert
# EC2 (URL is optional, auto-generated from region)
kubectl mtv create provider ec2-01 --type ec2 \
--region us-east-1 \
--access-key-id AKIA... --secret-access-key secret# 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 flashsystem# 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,vm3kubectl mtv start plan migration-1# Interactive TUI with scrolling, help panel, and adjustable refresh
kubectl mtv get plan --watchNEW: Watch mode now features an interactive Terminal UI with:
- Smooth screen updates without flickering
- Scrollable output (arrow keys, pgup/pgdn)
- Interactive help panel (press ?)
- Adjustable refresh interval (+/- keys)
- Manual refresh (press r)
For a complete walkthrough, see the Quick Start Guide.
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-01See Inventory Management Guide 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.1See VDDK Setup Guide for detailed instructions.
- Multi-Platform Support: Migrate from vSphere, oVirt, OpenStack, EC2, and OVA
- Auto-Mapping: Automatic network and storage mapping for all source providers
- 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-utcflag
Complete Technical Guide - Comprehensive documentation covering all features and use cases
- Installation & Prerequisites
- Quick Start Tutorial
- Provider Management
- Inventory Management
- Mapping Management
- Migration Plan Creation
- Migration Hooks
- MCP Server Integration
- Command Reference
MTV_VDDK_INIT_IMAGE: Default VDDK init image for VMware providersMTV_INVENTORY_URL: Base URL for inventory serviceMTV_INVENTORY_INSECURE_SKIP_TLS: Skip TLS verification for inventory service connections (set to "true" to enable)
Apache-2.0