Description of problem: If a VM is not migratable because the access mode is not RWX, the messsage in VMI conditions only contains "cannot migrate VMI with non-shared PVCs", it does not tell user that the PVC's accessMode is not correct. $ oc get vmi testvm ``` Conditions: Last Probe Time: <nil> Last Transition Time: <nil> Message: cannot migrate VMI with non-shared PVCs Reason: DisksNotLiveMigratable Status: False Type: LiveMigratable Last Probe Time: <nil> Last Transition Time: 2020-11-04T08:28:03Z Status: True Type: Ready ``` Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create a VM with storage class nfs and access mode rwo. 2. Start the VM and try to migrate the VM 3. Actual results: VM cannot be migrated with message "cannot migrate VMI with non-shared PVCs" Expected results: The message should tell user that the PVC's accessMode should be RWX. Additional info:
I believe this is well documented in the openshift virtualization: https://docs.openshift.com/container-platform/4.5/virt/live_migration/virt-live-migration.html#virt-understanding-live-migration_virt-live-migration
Guohua, can you please take a look in comment 1 and if it's alright with you, we can close the bug.
The message also pop up on UI while the VM is not migratable, "cannot migrate VMI with non-shared PVCs" is vague. If the issue can be fixing in code base, I still prefer to enhance it to tell the exact error message. If it's hard to fix, I'm okay to close the bug.
Perhaps we should change the message to something like: "Cannot migrate VMI: Live migration requires that all PVCs must be shared (using RWX access mode)".
The fix was merged. I need to find to wich kubevirt release it needs to be backported to target 2.6.1
https://github.com/kubevirt/kubevirt/pull/4895
Hey Peter, can you grant blocker status for this bug? It's a doc fix and we are trying to get it out the door for 2.6.0.
Message is now: "cannot migrate VMI: PVC <NAME> is not shared, live migration requires that all PVCs must be shared (using ReadWriteMany access mode)" where <NAME> is the name of pvc.
Verified with the following code: ------------------------------------------ oc version Client Version: 4.7.0-202101300840.p0-ba6a9bd Server Version: 4.7.0-fc.4 Kubernetes Version: v1.20.0+f0a2ec9 oc get csv --all-namespaces NAMESPACE NAME DISPLAY VERSION REPLACES PHASE openshift-cnv kubevirt-hyperconverged-operator.v2.6.0 OpenShift Virtualization 2.6.0 kubevirt-hyperconverged-operator.v2.5.3 Succeeded openshift-local-storage local-storage-operator.4.6.0-202101230113.p0 Local Storage 4.6.0-202101230113.p0 local-storage-operator.4.6.0-202101160045.p0 Succeeded openshift-operator-lifecycle-manager packageserver Package Server 0.17.0 Succeeded openshift-storage ocs-operator.v4.7.0-241.ci OpenShift Container Storage 4.7.0-241.ci Succeeded Verified with the following scenario: ------------------------------------------- 1. Created a vm with the yaml below 2. Start the VM with virtcl start vm cirros-dv-2 3. Create a VirtualMachineInstanceMigration configuration file for the virtual machine instance to migrate using the yaml below: 4. Migrate the vm with 'oc create -f vm--migrate.yaml' >>>>> the following error is displayed correctly: Error from server: error when creating "vmi-migrate.yaml": admission webhook "migration-create-validator.kubevirt.io" denied the request: Cannot migrate VMI, Reason: DisksNotLiveMigratable, Message: cannot migrate VMI: PVC cirros-dv-2 is not shared, live migration requires that all PVCs must be shared (using ReadWriteMany access mode) Moving to VERIFIED! Additional information: ---------------------------------------------------- vm yaml: -------------------------------------- apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachine metadata: labels: kubevirt.io/vm: vm-cirros-dv-2 name: vm-cirros-dv-2 spec: dataVolumeTemplates: - metadata: annotations: kubevirt.io/provisionOnNode: "" name: cirros-dv-2 spec: pvc: accessModes: - ReadWriteOnce resources: requests: storage: 100M storageClassName: nfs source: http: url: "<URL of image>" running: false template: metadata: labels: kubevirt.io/vm: vm-datavolume spec: domain: devices: disks: - disk: bus: virtio name: datavolumevolume machine: type: "" resources: requests: memory: 64M terminationGracePeriodSeconds: 0 volumes: - dataVolume: name: cirros-dv-2 name: datavolumevolume vm-migrate yaml: ----------------------------- apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachineInstanceMigration metadata: name: migration-job spec: vmiName: vm-cirros-dv-2
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Virtualization 2.6.0 security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:0799