Created attachment 1685606 [details] VM overview screen Description of problem: A VM with runStrategy=Always has a running VMI but: 1. In cli 'RUNNING' column is empty 2. In the UI - the VM status is 'Stopping' Version-Release number of selected component (if applicable): OCP 4.4, CNV 2.3 How reproducible: 100% Steps to Reproduce: 1. Create a VM with container disk and runStrategy: Always 2. Check VM status in CLI 3.Check VM status in UI Actual results: 1. In cli 'RUNNING' column is empty $ oc get vm,vmi -A NAMESPACE NAME AGE RUNNING VOLUME virt-general-vm-lifecycle-test-vm-run-strateg virtualmachine.kubevirt.io/vm-with-container-disk 20m NAMESPACE NAME AGE PHASE IP NODENAME virt-general-vm-lifecycle-test-vm-run-strateg virtualmachineinstance.kubevirt.io/vm-with-container-disk 20m Running 10.0.2.2/24 host-172-16-0-22 2. In the UI - the VM status is 'Stopping'; see attached screenshot Expected results: Correct VM status should be displayed (running). Additional info: I guess that this is caused by the fact that the information is extracted from 'running' element in the VM (?) If so, this is problematic as 'runStrategy' and 'running' cannot coexist. =========== VM yaml =========== $ oc get vm vm-with-container-disk -n virt-general-vm-lifecycle-test-vm-run-strateg -oyaml apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachine metadata: annotations: kubevirt.io/latest-observed-api-version: v1alpha3 kubevirt.io/storage-observed-api-version: v1alpha3 creationTimestamp: "2020-05-06T09:10:35Z" generation: 6 labels: kubevirt.io/vm: vm-with-container-disk name: vm-with-container-disk namespace: virt-general-vm-lifecycle-test-vm-run-strateg resourceVersion: "1561505" selfLink: /apis/kubevirt.io/v1alpha3/namespaces/virt-general-vm-lifecycle-test-vm-run-strateg/virtualmachines/vm-with-container-disk uid: a5ba4d57-18e5-4db9-9e99-e6520702edf8 spec: runStrategy: Always template: metadata: annotations: ansible: '{"ansible_user": "fedora", "ansible_ssh_pass": "fedora", "ansible_become": true, "ansible_become_method": "sudo"}' creationTimestamp: null labels: kubevirt.io/domain: vm-with-container-disk kubevirt.io/vm: vm-with-container-disk spec: domain: cpu: cores: 1 devices: disks: - disk: bus: virtio name: containerdisk interfaces: - masquerade: {} name: default rng: {} machine: type: q35 resources: requests: memory: 1Gi networks: - name: default pod: {} terminationGracePeriodSeconds: 0 volumes: - containerDisk: image: quay.io/redhat/cnv-tests-fedora-staging:31 name: containerdisk status: created: true
Tomas, I suspect two similar bugs got rolled into one here. How does the UI obtain/determine the status of a VM? Igor, I can reproduce this on the command line. It seems to apply with RunStrategy is used as the client is literally reporting "Running" (which is in fact nil). Can you take a look at that?
> Tomas, I suspect two similar bugs got rolled into one here. How does the UI obtain/determine the status of a VM? a long answer is in code: https://github.com/openshift/console/blob/master/frontend/packages/kubevirt-plugin/src/statuses/vm/vm-status.ts#L308 the tl;dr version is status.phase
OK, looks like we have 2 different issues. Following my conversation with David Vossel I will bind the RUNNING column to the status.ready field of the VM resource. Currently the problem is that the status field is not immediately created upon VM instance creation. I will try to figure that out.
I created https://bugzilla.redhat.com/show_bug.cgi?id=1834671 for the UI
Submitted PR in U/S https://github.com/kubevirt/kubevirt/pull/3414
We have made a decision to remove the RUNNING column from the output of `oc get vm` Later on we will introduce a proper column. Currently you can rely on the status of the corresponding VMI of the created VM. If VMI does not exist for the VM then you can assume the VM is stopped. If you will run `oc get wm -owide` you will notice the CREATED column which indicates whether the VMI was created for the particular VM.
To add mote info: A stopped VM with runStrategy: Manual cannot be started from the UI. The VM status is either 'Unknown' or 'VM error'
(In reply to Ruth Netser from comment #7) > To add mote info: > A stopped VM with runStrategy: Manual cannot be started from the UI. > The VM status is either 'Unknown' or 'VM error' Please ignore my last comment
Upstream PR that needs to be merged to release-0.29 : https://github.com/kubevirt/kubevirt/pull/3467
Verify no RUNNING status on VM # oc get vm -n default NAME AGE VOLUME fedora31 42h fedora31-1 41h vk-fedora-sriov 21h vk-fedora-sriov-1 19h vm-fedora-cdisk 46h Kubevirt: v0.30.1
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, 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-2020:3194