Bug 1894428 - Message for VMI not migratable is not clear enough
Summary: Message for VMI not migratable is not clear enough
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 2.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.6.0
Assignee: Bartosz Rybacki
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-04 09:14 UTC by Guohua Ouyang
Modified: 2021-03-10 11:19 UTC (History)
6 users (show)

Fixed In Version: 0.36.1-13-g4526ed5-162
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-10 11:18:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 4848 0 None closed Clean error message for not migratable VMI 2021-02-14 12:10:12 UTC
Red Hat Product Errata RHSA-2021:0799 0 None None None 2021-03-10 11:19:51 UTC

Description Guohua Ouyang 2020-11-04 09:14:39 UTC
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:

Comment 1 Natalie Gavrielov 2020-11-11 13:43:31 UTC
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

Comment 2 Natalie Gavrielov 2020-11-25 13:41:17 UTC
Guohua, can you please take a look in comment 1 and if it's alright with you, we can close the bug.

Comment 3 Guohua Ouyang 2020-11-26 00:22:53 UTC
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.

Comment 4 Adam Litke 2021-01-12 14:50:19 UTC
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)".

Comment 5 Bartosz Rybacki 2021-01-25 14:30:51 UTC
The fix was merged. I need to find to wich kubevirt release it needs to be backported to target 2.6.1

Comment 6 Bartosz Rybacki 2021-01-26 14:29:14 UTC
https://github.com/kubevirt/kubevirt/pull/4895

Comment 7 Adam Litke 2021-01-28 15:54:07 UTC
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.

Comment 8 Bartosz Rybacki 2021-02-04 15:14:16 UTC
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.

Comment 9 Kevin Alon Goldblatt 2021-02-07 13:17:32 UTC
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

Comment 12 errata-xmlrpc 2021-03-10 11:18:59 UTC
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


Note You need to log in before you can comment on or make changes to this bug.