For a Linux migration, applying a Migration .yaml creates a migration resource and a GenerateArtifactsFlow .yaml (a Windows migration creates a WindowsGenerateArtifacts .yaml).
You should review and update the GenerateArtifactsFlow .yaml before executing the migration. See Customizing a migration plan for more.
The GenerateArtifactsFlow .yaml has the following format:
apiVersion: anthos-migrate.cloud.google.com/v1beta2 kind: GenerateArtifactsFlow metadata: name: generate-artifacts-flow-id namespace: v2k-system annotations: # See below for an example. anthos-migrate.cloud.google.com/always-retake-snapshot: "false" ownerReferences: - apiVersion: anthos-migrate.cloud.google.com/v1beta2 blockOwnerDeletion: true controller: true kind: Migration name: migration-name uid: id spec: intent: "Image | ImageAndData | Data" global: filters: - '- *.swp' - '- /etc/fstab' - '- /boot/' - '- /tmp/*' - '- /var/log/*.log*' - '- /var/log/*/*.log*' - '- /var/cache/*' image: # imageRepository is optional. imageRepository: name: name of image repo spec base: "string" name: "name" dataVolumes: - pvc: name: "name" --or-- spec: PVC inline Spec folders: - /folder-name deployment: appName: app-centos-mini # artifactsRepository is optional. artifactsRepository: spec: bucket: bucket_name credentials: type: gcs secret: secret folder: storage-folder-name/
Setting the always-retake-snapshot annotation
By default, always-retake-snapshot
is set to false
.
If true
, any previous disk snapshots of the migrated VM are deleted, and new snapshots
are taken, when you apply a GenerateArtifactsTask .yaml
that references this GenerateArtifactsFlow.
This setting can be useful if you want to perform a data sync before the final cut-over
to the migrated workload. For example, you might have additional data to sync from
the source VM since you last generated the migration artifacts.
The always-retake-snapshot
annotation lets you take a fresh snapshot to contain that data.
Because Migrate for Anthos optimizes the files needed to be copied,
files which did not change since the last sync are not be copied again.
Only files which have changed are copied.