PVC cannot be migrated with Direct Volume Migration (MTC) if its name exceeds 63 characters
Issue
- When migrating namespaces with pvc name is larger than 63 characters, the DVM controller uses the name of the PVC as-is in the
spec.volumes[*].name
field. However, the volume mount name should be a valid DNS label. This results in apiserver giving an error when trying the create the pod with PVC names that are larger than 63 characters, i.e. invalid DNS label. - Migration fails with the following error in the log message.
{"level":"info","ts":1619047379.2630444,"logger":"migration|k2jjz","msg":"CR","migration":"openshift-migration/int-nonprod-pv-4212317-1-4212318-stage","conditions":{"conditions":[{"type":"Running","status":"True","reason":"WaitForDirectVolumeMigrationToComplete","category":"Advisory","message":"Step: 32/37","lastTransitionTime":"2021-04-21T23:18:56Z"},{"type":"Ready","status":"True","category":"Required","message":"The migration is ready.","lastTransitionTime":"2021-04-21T23:18:45Z"}]}}
{"level":"info","ts":1619047379.7179217,"logger":"direct|llwmt","msg":"","direct":"openshift-migration/int-nonprod-pv-4212317-1-4212318-stage-h4lmf","error":"Pod "directvolumemigration-rsync-transfer" is invalid: [spec.volumes[4].name: Invalid value: "prometheus-kafka-t4-3x-prometheus-db-prometheus-kafka-t4-3x-prometheus-0": must be no more than 63 characters, spec.containers[0].volumeMounts[0].name: Not found: "prometheus-kafka-t4-3x-prometheus-db-prometheus-kafka-t4-3x-prometheus-0"]","stacktrace":"\ngithub.com/konveyor/mig-controller/pkg/controller/directvolumemigration.(*Task).Run()\n\t/remote-source/app/pkg/controller/directvolumemigration/task.go:314\ngithub.com/konveyor/mig-controller/pkg/controller/directvolumemigration.(*ReconcileDirectVolumeMigration).migrate()\n\t/remote-source/app/pkg/controller/directvolumemigration/migrate.go:40\ngithub.com/konveyor/mig-controller/pkg/controller/directvolumemigration.(*ReconcileDirectVolumeMigration).Reconcile()\n\t/remote-source/app/pkg/controller/dire...
{"level":"info","ts":1619047379.8413618,"logger":"direct|lv2fs","msg":"[RUN]","direct":"openshift-migration/int-nonprod-pv-4212317-1-4212318-stage-h4lmf","phase":"CreateRsyncTransferPods"}
Environment
- Red Hat Openshift Container Platform
- Migration Toolkit for Containers (MTC)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.