Mappings define the critical relationships between source and target resources, ensuring VMs are migrated to appropriate networks and storage systems. This chapter covers comprehensive mapping management for both network and storage resources.
Mappings define source-to-target resource relationships for migration:
Network Mappings: Define how source VM networks map to target Kubernetes/OpenShift networks
Storage Mappings: Define how source storage systems map to target StorageClasses
Why Mappings are Essential
Resource Translation: Convert source virtualization concepts to Kubernetes resources
Policy Enforcement: Ensure VMs land on appropriate networks and storage classes
Performance Optimization: Route workloads to optimal target resources
Security Compliance: Maintain network isolation and storage encryption requirements
Mapping Types Supported
Mapping Type
Source Resources
Target Resources
Network
VM Networks, Port Groups, VLANs
Pod networking, Multus networks, Default networking
Storage
Datastores, Storage Domains, Volumes
StorageClasses with volume modes and access patterns
Note: All source providers support automatic mapping generation during plan creation. Provider-specific mappers intelligently match source networks and storage to appropriate target resources.
Listing, Viewing, and Deleting Mappings
List Mappings
1
2
3
4
5
6
7
8
9
10
11
# List all network mappings
kubectl mtv get mappings network
# List all storage mappings
kubectl mtv get mappings storage
# List mappings in specific namespace
kubectl mtv get mappings network --namespace migration-namespace
# List mappings across all namespaces
kubectl mtv get mappings storage --all-namespaces
View Mapping Details
1
2
3
4
5
6
7
8
9
# Describe network mapping
kubectl mtv describe mapping network --name my-network-mapping
# Describe storage mapping
kubectl mtv describe mapping storage --name my-storage-mapping
# View mapping in YAML format
kubectl get networkmapping my-network-mapping -o yaml
kubectl get storagemapping my-storage-mapping -o yaml
Delete Mappings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Delete specific network mapping
kubectl mtv delete mapping network --name my-network-mapping
# Delete specific storage mapping
kubectl mtv delete mapping storage --name my-storage-mapping
# Delete multiple mappings
kubectl mtv delete mapping network --name mapping1,mapping2,mapping3
# Delete all network mappings in namespace (use with caution)
kubectl mtv delete mapping network --all# Delete all storage mappings in namespace (use with caution)
kubectl mtv delete mapping storage --all
How-To: Creating Mappings
Network Mapping Creation
Network mappings translate source VM networks to target Kubernetes networking:
Basic Network Mapping Syntax
1
2
3
4
kubectl mtv create mapping network --name NAME \--source SOURCE_PROVIDER \--target TARGET_PROVIDER \--network-pairs"source1:target1,source2:target2,..."
Network Mapping Pairs Format
kubectl-mtv supports four network mapping formats verified from the command code:
Format
Description
Example
source:target-namespace/target-network
Multus network with namespace
'VM Network:multus-system/bridge-network'
source:target-network
Multus network in same namespace
'Management Network:mgmt-network'
source:default
Default pod networking
'VM Network:default'
source:ignored
Ignore/skip network
'Backup Network:ignored'
UDN note: In namespaces with a primary User-Defined Network (UDN), the default pod network target maps to the UDN. When --preserve-static-ips is enabled, Forklift assigns the source VM’s static IPs to the default interface on the target VM. This requires the controller_static_udn_ip_addresses setting to be enabled (it is by default on OCP 4.20+).
Network Mapping Examples
Basic Network Mapping
1
2
3
4
5
# Simple network mapping for vSphere to OpenShift
kubectl mtv create mapping network --name prod-network-mapping \--source vsphere-prod \--target openshift-target \--network-pairs"VM Network:default,Management Network:multus-system/mgmt-net"
Uses VAAI/XCOPY via a VolumePopulator pod to clone VMFS disks directly on the storage array
All supported vendors
vsphereNfs
Asks the storage array to copy a VMDK between its own NFS exports. Destination volume mode is Filesystem. Dedicated ESXi migration hosts are not used
pureFlashArray
csiVolumeImport
Uses the CSI driver’s native import capability to migrate VVol/RDM disks. No populator pod is launched – the controller creates a PVC with import annotations and the CSI driver clones the source volume
primera3par, ontap
Enhanced Storage Options
Volume Modes
Mode
Description
Use Case
Filesystem
Traditional file system access
General application storage
Block
Raw block device access
Databases, high-performance applications
Access Modes
Mode
Description
Use Case
ReadWriteOnce
Read-write by single node
Single-instance applications
ReadWriteMany
Read-write by multiple nodes
Shared file systems
ReadOnlyMany
Read-only by multiple nodes
Shared configuration, content
Offload Vendors (Storage Array Integration)
Verified vendor list from command code:
flashsystem - IBM FlashSystem
vantara - Hitachi Vantara
ontap - NetApp ONTAP
primera3par - HPE Primera/3PAR
pureFlashArray - Pure Storage FlashArray
powerflex - Dell PowerFlex
powermax - Dell PowerMax
powerstore - Dell PowerStore
infinibox - Infinidat InfiniBox
Storage Mapping Examples
Basic Storage Mapping
1
2
3
4
5
# Simple storage mapping for vSphere to OpenShift
kubectl mtv create mapping storage --name basic-storage-mapping \--source vsphere-prod \--target openshift-target \--storage-pairs"datastore1:fast-ssd,datastore2:standard-storage"
Advanced Storage Mapping with Enhanced Options
1
2
3
4
5
# Storage mapping with volume modes and access patterns
kubectl mtv create mapping storage --name advanced-storage \--source vsphere-prod \--target openshift-target \--storage-pairs"fast-datastore:premium-ssd;volumeMode=Block;accessMode=ReadWriteOnce,shared-datastore:shared-storage;volumeMode=Filesystem;accessMode=ReadWriteMany,archive-datastore:backup-storage;accessMode=ReadOnlyMany"
For environments using HPE Primera or 3PAR with a compatible CSI driver, you can use the csiVolumeImport plugin instead of the vsphere XCOPY populator. This approach does not launch a populator pod – the CSI driver handles the volume clone directly:
1
2
3
4
5
# CSI volume import offloading with HPE Primera
kubectl mtv create mapping storage --name csi-import-primera \--source vsphere-prod \--target openshift-target \--storage-pairs"hpe-datastore:hpe-sc;offloadPlugin=csiVolumeImport;offloadVendor=primera3par;offloadSecret=hpe-creds"
NFS Array Offload (Pure FlashArray)
vsphereNfs copies a VMDK from a vSphere NFS datastore into an NFS export on the same Pure FlashArray. The source datastore must be NFS, the vendor must be pureFlashArray, and volumeMode must be Filesystem when set. Secret keys are the same as Pure XCOPY (STORAGE_HOSTNAME, STORAGE_USERNAME, STORAGE_PASSWORD, STORAGE_TOKEN, PURE_CLUSTER_PREFIX). Do not set offloadMigrationHosts for this plugin.
# Check network availability in target
kubectl get networks -A | grep-E"(prod-net|mgmt-net|dmz-network)"# Verify Multus network definitions
kubectl get network-attachment-definitions -A# Test network connectivity
kubectl mtv get inventory network --provider openshift-target