Skip to content

A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes.

License

Notifications You must be signed in to change notification settings

yaacov/kubectl-mtv

Repository files navigation

kubectl-mtv

A kubectl plugin for migrating virtual machines to KubeVirt using Forklift.

kubectl-mtv logo

Overview

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.

Installation

# Using krew
kubectl krew install mtv

# Or download from releases
# https://github.com/yaacov/kubectl-mtv/releases

See Installation Guide for more options.

MCP support

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

Quick Start

1. Create Provider

kubectl mtv create provider vsphere-01 --type vsphere \
  --url https://vcenter.example.com \
  -u admin --password secret --cacert @ca.cert

2. Create Mappings (Optional)

# 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

3. Create Migration Plan

# 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

4. Start Migration

kubectl mtv start plan migration-1

5. Monitor Progress

kubectl mtv get plan --watch

For a complete walkthrough, see the Migration Demo Tutorial.

Inventory Management

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.

VDDK Support

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.

Features

  • 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

Documentation

Environment Variables

  • MTV_VDDK_INIT_IMAGE: Default VDDK init image for VMware providers
  • MTV_INVENTORY_URL: Base URL for inventory service

License

Apache-2.0

About

A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published