Uploaded image for project: 'OpenShift Migration Toolkit for Containers'
  1. OpenShift Migration Toolkit for Containers
  2. MIG-1751

Storage Class Migration: VM's dataVolumeTemplate holds the old storage class name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Minor Minor
    • MTC 1.8.9
    • MTC 1.8.7
    • pvc-migrate
    • None

      Description of problem:

      After a successful Storage Class Migration, VM.spec.dataVolumeTemplates[0].spec.storage.storageClassName stays the same as it was, while the DV name gets changed to <old-name>-mig-suffix
      
      It may be an issue for the flows when users delete the DV and expect it to recreate. The recreated DV will use an old storage class. (Possibly it preserved the volume mode and access mode as well, just my DV didn't have it specified)

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

      4.19

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create a VM with dataVolumeTemplate with storage class A
      2. Migrate a VM to storage class B (I used MTC MigPlan + MigMigration)
      3. Migration succeeded, but the VM spec holds the storage class A name 

      Actual results:

      $ oc get vm -n test-ns4 fedora-chocolate-quokka-44 -oyaml
      apiVersion: kubevirt.io/v1
      kind: VirtualMachine
      metadata:
        annotations:
          kubemacpool.io/transaction-timestamp: "2025-04-23T12:00:30.878352057Z"
          kubevirt.io/latest-observed-api-version: v1
          kubevirt.io/storage-observed-api-version: v1
        creationTimestamp: "2025-04-23T11:51:55Z"
        finalizers:
        - kubevirt.io/virtualMachineControllerFinalize
        generation: 2
        name: fedora-chocolate-quokka-44
        namespace: test-ns4
        resourceVersion: "6659325"
        uid: 1af8d178-3f4e-4c57-a397-39139dfaacb4
      spec:
        dataVolumeTemplates:
        - metadata:
            creationTimestamp: null
            name: fedora-chocolate-quokka-44-volume-mig-skbm
          spec:
            sourceRef:
              kind: DataSource
              name: fedora
              namespace: openshift-virtualization-os-images
            storage:
              resources:
                requests:
                  storage: 30Gi
              storageClassName: hostpath-csi-basic
        instancetype:
          kind: virtualmachineclusterinstancetype
          name: u1.small
        preference:
          kind: virtualmachineclusterpreference
          name: fedora
        runStrategy: Always
        template:
          metadata:
            creationTimestamp: null
            labels:
              network.kubevirt.io/headlessService: headless
          spec:
            architecture: amd64
            domain:
              devices:
                autoattachPodInterface: false
                interfaces:
                - macAddress: 02:a2:9f:00:00:0b
                  masquerade: {}
                  name: default
              machine:
                type: pc-q35-rhel9.4.0
              resources: {}
            networks:
            - name: default
              pod: {}
            subdomain: headless
            volumes:
            - dataVolume:
                name: fedora-chocolate-quokka-44-volume-mig-skbm
              name: rootdisk
            - cloudInitNoCloud:
                userData: |
                  #cloud-config
                  chpasswd:
                    expire: false
                  password: kd9i-tfux-8teh
                  user: fedora
              name: cloudinitdisk
        updateVolumesStrategy: Migration
      status:
        conditions:
        - lastProbeTime: null
          lastTransitionTime: "2025-04-23T12:01:38Z"
          status: "True"
          type: Ready
        - lastProbeTime: null
          lastTransitionTime: null
          message: All of the VMI's DVs are bound and not running
          reason: AllDVsReady
          status: "True"
          type: DataVolumesReady
        - lastProbeTime: null
          lastTransitionTime: null
          status: "True"
          type: LiveMigratable
        - lastProbeTime: null
          lastTransitionTime: null
          status: "True"
          type: StorageLiveMigratable
        - lastProbeTime: "2025-04-23T11:54:51Z"
          lastTransitionTime: null
          status: "True"
          type: AgentConnected
        created: true
        desiredGeneration: 2
        instancetypeRef:
          controllerRevisionRef:
            name: fedora-chocolate-quokka-44-u1.small-v1beta1-f26bbe8f-d791-4229-9011-ea3ccea531b5-1
          kind: virtualmachineclusterinstancetype
          name: u1.small
        observedGeneration: 1
        preferenceRef:
          controllerRevisionRef:
            name: fedora-chocolate-quokka-44-fedora-v1beta1-98bee0f3-9aa8-40cc-a486-1b1bc64125b1-1
          kind: virtualmachineclusterpreference
          name: fedora
        printableStatus: Running
        ready: true
        runStrategy: Always
        volumeSnapshotStatuses:
        - enabled: true
          name: rootdisk
        - enabled: false
          name: cloudinitdisk
          reason: Snapshot is not supported for this volumeSource type [cloudinitdisk]
        volumeUpdateState:
          volumeMigrationState:
            migratedVolumes:
            - destinationPVCInfo:
                claimName: fedora-chocolate-quokka-44-volume-mig-skbm
                volumeMode: Block
              sourcePVCInfo:
                claimName: fedora-chocolate-quokka-44-volume
                volumeMode: Filesystem
              volumeName: rootdisk
      Old PVC uses hpp, new PVC uses OCS:  $ oc get pvc -A 
      NAMESPACE           NAME                                                          STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                                 VOLUMEATTRIBUTESCLASS   AGE
      test-ns4            fedora-chocolate-quokka-44-volume                             Bound    pvc-39e09ff3-fdfc-46f9-8de2-40accce61bf6   149Gi      RWO            hostpath-csi-basic                           <unset>                 10m
      test-ns4            fedora-chocolate-quokka-44-volume-mig-skbm                    Bound    pvc-84f9f788-a494-4f29-b602-4494da25b2a8   30Gi       RWX            ocs-storagecluster-ceph-rbd-virtualization   <unset>                 2m30s
      

      Expected results:

      VM spec dataVolumeTemplates will be updated with the new values: 
      storageClassName, volueMode, accessMode

      Additional info:

       

              rhn-support-awels Alexander Wels
              jpeimer@redhat.com Jenia Peimer
              Jenia Peimer Jenia Peimer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: