# Copyright (c) 2026 VirtRigaud Creators
# SPDX-License-Identifier: Apache-2.0

# Basic VM Migration Example
# Migrates a VM from one provider to another with minimal configuration

apiVersion: infra.virtrigaud.io/v1beta1
kind: VMMigration
metadata:
  name: basic-migration
  namespace: default
spec:
  # Source VM to migrate
  source:
    vmRef:
      name: my-source-vm
    createSnapshot: true  # Create snapshot before migration
  
  # Target configuration
  target:
    name: my-target-vm
    providerRef:
      name: target-provider
      namespace: virtrigaud-system
    classRef:
      name: standard-vm
    networks:
      - name: default
  
  # PVC-backed intermediate storage (only supported type in v0.3.6).
  # Requires a ReadWriteMany StorageClass (NFS, CephFS, etc.).
  storage:
    type: pvc
    pvc:
      storageClassName: nfs-migration-storage
      size: 100Gi
      accessMode: ReadWriteMany

  # Migration options with sensible defaults
  options:
    diskFormat: qcow2
    compress: false
    verifyChecksums: true

