Migrate for Anthos YAML reference

You configure migrations with Migrate for Anthos are configured using Kubernetes YAML files. This topic describes the Migrate for Anthos annotations present in those YAML files. It is organized by annotations to Kubernetes Objects that Migrate for Anthos adds.

Standard Kubernetes Objects that are not extended by Migrate for Anthos are not described here. See Kubernetes Concepts for further descriptions.

YAML downloads

Example YAML files are available for download.

PersistentVolumeClaim

A PersistentVolumeClaim defines storage volumes migrated and exported using Migrate for Anthos.

Key Possible Values Value definition
metadata.annotations.pvc.csi.kubernetes.io/vlsVmMoref vm-[INTEGER] The VMware VM-id.
metadata.annotations.pvc.csi.kubernetes.io/vlsVmDataAccessMode Either
Streaming or
FullyCached

If set to Streaming, when starting the container Migrate for Anthos will stream data from the source VM.

If set to FullyCached, Migrate for Anthos will start the container in streaming mode while caching all of the VM's data on GKE. A fully cached workload does not rely on on-premises storage and helps to speed storage export.

metadata.annotations.pvc.csi.kubernetes.io/vlsRunMode Either
Normal or
TestClone

If set to Normal, Migrate for Anthos will shut the source VM down before migrating it.

If set to TestClone, Migrate for Anthos will take a snapshot of the VM's storage and leave the VM running. The container will be launched from the VM's snapshot.

spec.storageClassName [STRING] Name of the StorageClass defined when you installed Migrate for Anthos.

Example PersistentVolumeClaim YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: csi-vlsdisk-suitecrm-app
  annotations:
    pvc.csi.kubernetes.io/vlsVmMoref: "vm-1" # Replace with application's VM ID
    pvc.csi.kubernetes.io/vlsVmDataAccessMode: "Streaming"
    pvc.csi.kubernetes.io/vlsRunMode: "TestClone"
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: vls-storage-class # Replace with your Storage Class name
  resources:
    requests:
      storage: 1Gi

StatefulSet (for migrations)

Key Optional Possible Values Value definition
spec.template.metadata.annotations.anthos-migrate.gcr.io/action No run

If set to run and used within a StatefulSet, Migrate for Anthos will start the container normally.

spec.template.metadata.annotations.anthos-migrate.gcr.io/source-type No Either
vlsdisk or
exported

If set to vlsdisk, the StatefulSet uses the Migrate for Anthos CSI driver for storage.

If set to exported, the StatefulSet will mount the exported PersistentVolumeClaim.

spec.template.metadata.annotations.anthos-migrate.gcr.io/source-pvc No [STRING] The name of the PersistentVolumeClaim to mount to the StatefulSet.

Example StatefulSet YAML

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: suitecrm-app
  namespace: default
spec:
  serviceName: "suitecrm-app-svc"
  replicas: 1
  selector:
    matchLabels:
      app: suitecrm-app
  template:
    metadata:
      labels:
        app: suitecrm-app
      annotations:
        anthos-migrate.gcr.io/action: run
        anthos-migrate.gcr.io/source-type: vlsdisk
        anthos-migrate.gcr.io/source-pvc: csi-vlsdisk-suitecrm-app # This needs to match the name of the PVC declared above.
    spec:
      containers:
      - name: suitecrm-app
        image: anthos-migrate.gcr.io/v2k-run:v0.9.6 # The image for the Migrate for Anthos system container.

Jobs (for storage export)

Key Optional Possible Values Value definition
spec.template.metadata.annotations.anthos-migrate.gcr.io/action No export

If set to export and used within a Job, Migrate for Anthos will export the PersistentVolume's data to a Compute Engine Persistent Disk.

spec.template.metadata.annotations.anthos-migrate.gcr.io/source-type No vlsdisk

The type of storage to export to a new PersistentVolumeClaim

spec.template.metadata.annotations.anthos-migrate.gcr.io/source-pvc No [STRING] The name of the PersistentVolumeClaim to export.
spec.template.metadata.annotations.anthos-migrate.gcr.io/target-pvc Required for storage export [STRING] The name of the PersistentVolumeClaim where data is exported.
spec.template.metadata.annotations.anthos-migrate.gcr.io/config Required for storage export exporter-sample-config Named storage exported configuration.

Example Storage Exporter Job YAML

# Storage Exporter Jobs

apiVersion: batch/v1
kind: Job
metadata:
  name: exporter-sample-demo-app
spec:
  template:
    metadata:
      annotations:
        anthos-migrate.gcr.io/action: export
        anthos-migrate.gcr.io/source-type: vlsdisk
        anthos-migrate.gcr.io/source-pvc: csi-vlsdisk-demo-app
        anthos-migrate.gcr.io/target-pvc: gce-pd-claim-demo-app
        anthos-migrate.gcr.io/config: exporter-sample-config
        sidecar.istio.io/inject: "false"
    spec:
      restartPolicy: OnFailure
      containers:
      - name: exporter-sample
        image: anthos-migrate.gcr.io/v2k-run:v0.9.6

ConfigMap

The Migrate for Anthos storage exporter uses a ConfigMap to specify filename patterns to ignore during storage export.

Key Possible Values Value definition
data.config.appSpec.dataFilter List of file patterns Wildcard filename patterns to exclude from export. For more information on pattern formatting, see the rsync man page.

Example ConfigMap YAML

#Storage Exporter configuration:

apiVersion: v1
kind: ConfigMap
metadata:
  name: exporter-sample-config
data:
  config: |-
    appSpec:
      dataFilter:
      - "- *.swp"
      - "- /etc/fstab"
      - "- /boot/"
      - "- /tmp/"
本頁內容對您是否有任何幫助?請提供意見:

傳送您對下列選項的寶貴意見...

這個網頁
Migrate for Anthos Documentation