Uploaded image for project: 'Migration Toolkit for Virtualization'
  1. Migration Toolkit for Virtualization
  2. MTV-4566

[CCLM] Migration fails if VM has DVTemplate with explicit namespace, and it's different from the target namespace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 2.10.0
    • CCLM
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • Moderate

      Description of problem:

      Target namespace is different from the source namespace,
      VM has dataVolumeTemplate with explicitly specified namespace,
      Getting this error on migration:
      
      $ oc get migration -n openshift-mtv migration-cclm-migration-plan-il2a -oyaml
      ...
        - completed: "2026-02-15T14:12:29Z"
          conditions:
          - category: Advisory
            durable: true
            lastTransitionTime: "2026-02-15T14:12:28Z"
            message: The VM migration has FAILED.
            status: "True"
            type: Failed
          error:
            phase: CreateTarget
            reasons:
            - 'admission webhook "virtualmachine-validator.kubevirt.io" denied the request:
              Embedded DataVolume namespace test-cclm-source-namespace-il2a differs from
              VM namespace cross-cluster-live-migration-test-cclm'
      

      Version-Release number of selected component (if applicable):

      2.10.0

      How reproducible:

      Always 
      

      Steps to Reproduce:

      1.
      2.
      3.
      

      Actual results:

      Migration fails

      Expected results:

      Migration succeeds - either 'namespace' field in dataVolumeTemplate updated to be the same as the VM target namespace, or 'namespace' field removed from the dataVolumeTemplate in target VM.

      Additional info:

      VM -oyaml:
      
      $ oc get vm -n test-cclm-source-namespace-il2a vm-from-template-and-imported-dv-1771164566-2293184 -oyaml
      apiVersion: kubevirt.io/v1
      kind: VirtualMachine
      metadata:
        annotations:
          kubemacpool.io/transaction-timestamp: "2026-02-15T14:10:30.075030093Z"
          kubevirt.io/latest-observed-api-version: v1
          kubevirt.io/storage-observed-api-version: v1
        creationTimestamp: "2026-02-15T14:09:27Z"
        finalizers:
        - kubevirt.io/virtualMachineControllerFinalize
        generation: 2
        name: vm-from-template-and-imported-dv-1771164566-2293184
        namespace: test-cclm-source-namespace-il2a
        resourceVersion: "95483721"
        uid: 5413ce34-3a58-4248-9115-1bb54726adb8
      spec:
        dataVolumeTemplates:
        - metadata:
            creationTimestamp: null
            name: dv-fedora-imported-cclm
            namespace: test-cclm-source-namespace-il2a
          spec:
            source:
              registry:
                url: docker://quay.io/openshift-cnv/qe-cnv-tests-fedora:41
            storage:
              resources:
                requests:
                  storage: 10Gi
              storageClassName: ocs-storagecluster-ceph-rbd-virtualization
        runStrategy: Always
        template:
          metadata:
            creationTimestamp: null
            labels:
              debugLogs: "true"
              kubevirt.io/domain: vm-from-template-and-imported-dv-1771164566-2293184
              kubevirt.io/vm: vm-from-template-and-imported-dv-1771164566-2293184
          spec:
            architecture: amd64
            domain:
              devices:
                disks:
                - disk:
                    bus: virtio
                  name: dv-disk
                - disk:
                    bus: virtio
                  name: cloudinitdisk
                rng: {}
              firmware:
                serial: e5978246-9c5e-4a96-8517-d4c01938da27
                uuid: d079482b-ad06-4a23-bedd-d9f9db7ae411
              machine:
                type: pc-q35-rhel9.6.0
              memory:
                guest: 1Gi
              resources: {}
            volumes:
            - dataVolume:
                name: dv-fedora-imported-cclm
              name: dv-disk
            - cloudInitNoCloud:
                userData: |-
                  #cloud-config
                  chpasswd:
                    expire: false
                  password: password
                  user: fedora
                  ssh_pwauth: true            ssh_authorized_keys:
                   [ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClr26FdYCxhE5fjQwy7oJ46Zwqi6CToHA8t/vUyQV6Ov+gTSdZVjqdyZt1OTXqUsfF5Cg24gdYPfgt8BJnVZqn/orcQ1GpEWAeiyJzu1yZynnl3PlG++ej3eM2h+Vx/RRXTb/K1InxvR1ViFNdFBGHLgKUrZawiplEoJizyUEteJzC91Dn9onbWf7eXnILxWeAem96uX3zMgx/FAN34BsyQd+VyaQGOYfWEfnj35dvVtdu1efo7vrWIL+6UK6wHS5A04u6/NAen6bN3GE8MroRIqIGpc4pET/rghdlsipIXsGgh1RYinQUVUjr4WXakPS4PekyaqRaQ0hdK1Yyze6t root@exec1.rdocloud]
                  runcmd: ['grep ssh-rsa /etc/crypto-policies/back-ends/opensshserver.config || sudo update-crypto-policies --set LEGACY || true', "sudo sed -i 's/^#\\?PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config", 'sudo systemctl enable sshd', 'sudo systemctl restart sshd']
              name: cloudinitdisk
      status:
        conditions:
        - lastProbeTime: null
          lastTransitionTime: "2026-02-15T14:10:41Z"
          status: "True"
          type: Ready
        - lastProbeTime: null
          lastTransitionTime: null
          message: All of the VMI's DVs are bound and ready
          reason: AllDVsReady
          status: "True"
          type: DataVolumesReady
        - lastProbeTime: null
          lastTransitionTime: null
          status: "True"
          type: LiveMigratable
        - lastProbeTime: null
          lastTransitionTime: null
          status: "True"
          type: StorageLiveMigratable
        - lastProbeTime: "2026-02-15T14:11:03Z"
          lastTransitionTime: null
          status: "True"
          type: AgentConnected
        created: true
        desiredGeneration: 2
        observedGeneration: 2
        printableStatus: Running
        ready: true
        runStrategy: Always
        volumeSnapshotStatuses:
        - enabled: true
          name: dv-disk
        - enabled: false
          name: cloudinitdisk
          reason: Snapshot is not supported for this volumeSource type [cloudinitdisk]
      
      Plan -oyaml:
      
      $ oc get plan -n openshift-mtv cclm-migration-plan-il2a -oyaml
      apiVersion: forklift.konveyor.io/v1beta1
      kind: Plan
      metadata:
        annotations:
          populatorLabels: "True"
        creationTimestamp: "2026-02-15T14:12:13Z"
        generation: 1
        name: cclm-migration-plan-il2a
        namespace: openshift-mtv
        resourceVersion: "40812468"
        uid: d971da4b-f687-4034-bef2-e4453b358d37
      spec:
        map:
          network:
            name: network-map
            namespace: openshift-mtv
          storage:
            name: storage-map-il2a
            namespace: openshift-mtv
        migrateSharedDisks: true
        preserveStaticIPs: true
        provider:
          destination:
            name: host
            namespace: openshift-mtv
          source:
            name: mtv-source-provider
            namespace: openshift-mtv
        pvcNameTemplateUseGenerateName: true
        runPreflightInspection: true
        skipGuestConversion: false
        targetNamespace: cross-cluster-live-migration-test-cclm
        targetPowerState: auto
        type: live
        useCompatibilityMode: true
        vms:
        - id: f8716fca-6e3b-43b5-abf1-33674d8a1f94
          name: vm-from-template-and-data-source-1771164565-0897048
          namespace: test-cclm-source-namespace-il2a
        - id: 5413ce34-3a58-4248-9115-1bb54726adb8
          name: vm-from-template-and-imported-dv-1771164566-2293184
          namespace: test-cclm-source-namespace-il2a
        - id: 9bfe682a-b0cc-4274-a4ab-b11eca3ed7d4
          name: vm-with-instance-type-1771164567-5791047
          namespace: test-cclm-source-namespace-il2a
        warm: false
      status:
        conditions:
        - category: Advisory
          durable: true
          lastTransitionTime: "2026-02-15T14:13:18Z"
          message: The plan execution has FAILED.
          status: "True"
          type: Failed
        - category: Critical
          lastTransitionTime: "2026-02-15T14:56:41Z"
          message: The source provider does not have the Ready condition.
          status: "True"
          type: SourceProviderNotReady
        migration:
          completed: "2026-02-15T14:13:18Z"
          history:
          - conditions:
            - category: Advisory
              durable: true
              lastTransitionTime: "2026-02-15T14:13:18Z"
              message: The plan execution has FAILED.
              status: "True"
              type: Failed
            map:
              network:
                generation: 1
                name: network-map
                namespace: openshift-mtv
                uid: d745587a-bc36-4f34-8937-52edbb69afd9
              storage:
                generation: 1
                name: storage-map-il2a
                namespace: openshift-mtv
                uid: d9c06a56-d102-4611-9d00-290a5328b2e1
            migration:
              generation: 1
              name: migration-cclm-migration-plan-il2a
              namespace: openshift-mtv
              uid: e53a6120-769c-4186-a63c-b98e1e855400
            plan:
              generation: 1
              name: cclm-migration-plan-il2a
              namespace: openshift-mtv
              uid: d971da4b-f687-4034-bef2-e4453b358d37
            provider:
              destination:
                generation: 1
                name: host
                namespace: openshift-mtv
                uid: e27b936c-24a7-4304-a3ab-e2d233b08f09
              source:
                generation: 1
                name: mtv-source-provider
                namespace: openshift-mtv
                uid: 44918e7c-3781-4e09-af0b-08394ca18da0
          started: "2026-02-15T14:12:16Z"
          vms:
          - completed: "2026-02-15T14:13:18Z"
            conditions:
            - category: Advisory
              durable: true
              lastTransitionTime: "2026-02-15T14:13:18Z"
              message: The VM migration has SUCCEEDED.
              status: "True"
              type: Succeeded
            id: f8716fca-6e3b-43b5-abf1-33674d8a1f94
            luks: {}
            name: vm-from-template-and-data-source-1771164565-0897048
            namespace: test-cclm-source-namespace-il2a
            phase: Completed
            pipeline:
            - completed: "2026-02-15T14:12:16Z"
              description: Initialize migration.
              name: Initialize
              phase: Completed
              progress:
                completed: 0
                total: 1
              started: "2026-02-15T14:12:16Z"
            - completed: "2026-02-15T14:12:29Z"
              description: Prepare target namespace.
              name: PrepareTarget
              phase: Completed
              progress:
                completed: 0
                total: 1
              started: "2026-02-15T14:12:29Z"
            - completed: "2026-02-15T14:13:18Z"
              description: Synchronize source and target VMs.
              name: Synchronization
              phase: Completed
              progress:
                completed: 0
                total: 1
              started: "2026-02-15T14:13:18Z"
            started: "2026-02-15T14:12:16Z"
          - completed: "2026-02-15T14:12:29Z"
            conditions:
            - category: Advisory
              durable: true
              lastTransitionTime: "2026-02-15T14:12:28Z"
              message: The VM migration has FAILED.
              status: "True"
              type: Failed
            error:
              phase: CreateTarget
              reasons:
              - 'admission webhook "virtualmachine-validator.kubevirt.io" denied the request:
                Embedded DataVolume namespace test-cclm-source-namespace-il2a differs from
                VM namespace cross-cluster-live-migration-test-cclm'
            id: 5413ce34-3a58-4248-9115-1bb54726adb8
            luks: {}
            name: vm-from-template-and-imported-dv-1771164566-2293184
            namespace: test-cclm-source-namespace-il2a
            phase: Completed
            pipeline:
            - completed: "2026-02-15T14:12:16Z"
              description: Initialize migration.
              name: Initialize
              phase: Completed
              progress:
                completed: 0
                total: 1
              started: "2026-02-15T14:12:16Z"
            - description: Prepare target namespace.
              error:
                phase: Running
                reasons:
                - 'admission webhook "virtualmachine-validator.kubevirt.io" denied the request:
                  Embedded DataVolume namespace test-cclm-source-namespace-il2a differs
                  from VM namespace cross-cluster-live-migration-test-cclm'
              name: PrepareTarget
              phase: Running
              progress:
                completed: 0
                total: 1
            - description: Synchronize source and target VMs.
              name: Synchronization
              phase: Pending
              progress:
                completed: 0
                total: 1
            started: "2026-02-15T14:12:16Z"
          - completed: "2026-02-15T14:13:15Z"
            conditions:
            - category: Advisory
              durable: true
              lastTransitionTime: "2026-02-15T14:13:15Z"
              message: The VM migration has SUCCEEDED.
              status: "True"
              type: Succeeded
            id: 9bfe682a-b0cc-4274-a4ab-b11eca3ed7d4
            luks: {}
            name: vm-with-instance-type-1771164567-5791047
            namespace: test-cclm-source-namespace-il2a
            phase: Completed
            pipeline:
            - completed: "2026-02-15T14:12:16Z"
              description: Initialize migration.
              name: Initialize
              phase: Completed
              progress:
                completed: 0
                total: 1
              started: "2026-02-15T14:12:16Z"
            - completed: "2026-02-15T14:12:29Z"
              description: Prepare target namespace.
              name: PrepareTarget
              phase: Completed
              progress:
                completed: 0
                total: 1
              started: "2026-02-15T14:12:29Z"
            - completed: "2026-02-15T14:13:15Z"
              description: Synchronize source and target VMs.
              name: Synchronization
              phase: Completed
              progress:
                completed: 0
                total: 1
              started: "2026-02-15T14:13:15Z"
            started: "2026-02-15T14:12:16Z"
        observedGeneration: 1
      
      
      

       

              slucidi@redhat.com Samuel Lucidi
              jpeimer@redhat.com Jenia Peimer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: