Bug 1834671 - VM with runStrategy attribute (instead of 'running' attribute) has Status 'Stopping' in the UI
Summary: VM with runStrategy attribute (instead of 'running' attribute) has Status 'St...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Console Kubevirt Plugin
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.5.0
Assignee: Filip Krepinsky
QA Contact: Radim Hrazdil
URL:
Whiteboard:
Depends On:
Blocks: 1834717
TreeView+ depends on / blocked
 
Reported: 2020-05-12 07:40 UTC by Ruth Netser
Modified: 2020-07-13 17:37 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1834717 (view as bug list)
Environment:
Last Closed: 2020-07-13 17:37:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
VM overview page (62.49 KB, image/png)
2020-05-12 07:40 UTC, Ruth Netser
no flags Details
Stopped VM with runStrategy: Manual (58.77 KB, image/png)
2020-05-26 10:57 UTC, Ruth Netser
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 5405 0 None closed Bug 1834671: Check runStrategy when checking for running vm 2020-10-15 12:18:46 UTC
Github openshift console pull 5619 0 None closed Bug 1834671: Acknowledge strategies when computing if VM is running 2020-10-15 12:18:46 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:37:53 UTC

Description Ruth Netser 2020-05-12 07:40:43 UTC
Created attachment 1687555 [details]
VM overview page

Description of problem:
A running VM with runStrategy attribute (instead of 'running' attribute) has a running VMI but the VM status in the UI 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 runStrategy: Always (as an example, can be Manual/Halted and a started VM)
2. Check the VM status in the UI


Actual results:
While the VMI has 'phase: Running', in the UI - the VM status is 'Stopping'; see attached screenshot.


Expected results:
Correct VM status should be displayed (running).


Additional info:

========= VM yaml ===========
---
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
  labels:
    kubevirt.io/vm: vm-cirros
  name: vm-cirros
spec:
  runStrategy: Always
  template:
    metadata:
      labels:
        kubevirt.io/vm: vm-cirros
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: containerdisk
          - disk:
              bus: virtio
            name: cloudinitdisk
        machine:
          type: ""
        resources:
          requests:
            memory: 64M
      terminationGracePeriodSeconds: 0
      volumes:
      - containerDisk:
          image: kubevirt/cirros-container-disk-demo:latest
        name: containerdisk
      - cloudInitNoCloud:
          userData: |
            #!/bin/sh

            echo 'printed from cloud-init userdata'
        name: cloudinitdisk


=== VM spec ===
$ oc get vm vm-cirros -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-06T11:27:36Z"
  generation: 49
  labels:
    kubevirt.io/vm: vm-cirros
  name: vm-cirros
  namespace: default
  resourceVersion: "6312417"
  selfLink: /apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachines/vm-cirros
  uid: 1b72b78b-4e22-4268-9715-96f0fa84268c
spec:
  runStrategy: Always
  template:
    metadata:
      creationTimestamp: null
      labels:
        kubevirt.io/vm: vm-cirros
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: containerdisk
          - disk:
              bus: virtio
            name: cloudinitdisk
        machine:
          type: q35
        resources:
          requests:
            memory: 64M
      terminationGracePeriodSeconds: 0
      volumes:
      - containerDisk:
          image: kubevirt/cirros-container-disk-demo:latest
        name: containerdisk
      - cloudInitNoCloud:
          userData: |
            #!/bin/sh

            echo 'printed from cloud-init userdata'
        name: cloudinitdisk
status:
  created: true
  ready: true


=== VMI spec ===
$ oc get vmi vm-cirros -oyaml

apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachineInstance
metadata:
  annotations:
    kubevirt.io/latest-observed-api-version: v1alpha3
    kubevirt.io/storage-observed-api-version: v1alpha3
  creationTimestamp: "2020-05-12T07:08:14Z"
  finalizers:
  - foregroundDeleteVirtualMachine
  generateName: vm-cirros
  generation: 8
  labels:
    kubevirt.io/nodeName: host-172-16-0-22
    kubevirt.io/vm: vm-cirros
  name: vm-cirros
  namespace: default
  ownerReferences:
  - apiVersion: kubevirt.io/v1alpha3
    blockOwnerDeletion: true
    controller: true
    kind: VirtualMachine
    name: vm-cirros
    uid: 1b72b78b-4e22-4268-9715-96f0fa84268c
  resourceVersion: "6312414"
  selfLink: /apis/kubevirt.io/v1alpha3/namespaces/default/virtualmachineinstances/vm-cirros
  uid: 068eb3f7-c75b-454d-bb86-d35efaeb7531
spec:
  domain:
    devices:
      disks:
      - disk:
          bus: virtio
        name: containerdisk
      - disk:
          bus: virtio
        name: cloudinitdisk
      interfaces:
      - bridge: {}
        name: default
    features:
      acpi:
        enabled: true
    firmware:
      uuid: 0d2a2043-41c0-59c3-9b17-025022203668
    machine:
      type: q35
    resources:
      requests:
        cpu: 100m
        memory: 64M
  networks:
  - name: default
    pod: {}
  terminationGracePeriodSeconds: 0
  volumes:
  - containerDisk:
      image: kubevirt/cirros-container-disk-demo:latest
      imagePullPolicy: Always
    name: containerdisk
  - cloudInitNoCloud:
      userData: |
        #!/bin/sh

        echo 'printed from cloud-init userdata'
    name: cloudinitdisk
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: null
    message: cannot migrate VMI which does not use masquerade to connect to the pod
      network
    reason: InterfaceNotLiveMigratable
    status: "False"
    type: LiveMigratable
  - lastProbeTime: null
    lastTransitionTime: "2020-05-12T07:08:21Z"
    status: "True"
    type: Ready
  guestOSInfo: {}
  interfaces:
  - ipAddress: 10.131.1.79
    mac: 0a:58:0a:83:01:4f
    name: default
  migrationMethod: BlockMigration
  nodeName: host-172-16-0-22
  phase: Running
  qosClass: Burstable

(attached vm and vmi spec when running:true)

Comment 1 Ruth Netser 2020-05-12 07:43:10 UTC
Separated the UI issue from https://bugzilla.redhat.com/show_bug.cgi?id=1832179

Comment 2 Yaacov Zamir 2020-05-12 09:39:25 UTC
will copy a new bz and target to 4.4 because it happen also in 4.4

notes:
https://github.com/openshift/console/blob/master/frontend/packages/kubevirt-plugin/src/selectors/vm/selectors.ts#L73

Comment 6 Radim Hrazdil 2020-05-20 08:56:39 UTC
Verified in console release-4.5 branch commit: 5994c64ee529b650bae348ef78ebc23dca8db5c5

Comment 7 Ruth Netser 2020-05-26 10:57:26 UTC
Re-opening:
When a stopped VM which has runStrategy: Manual:
1. The VM cannot be started from the UI.
2. The VM status is either 'Unknown' or 'VM error' (see screenshot)

Comment 8 Ruth Netser 2020-05-26 10:57:51 UTC
Created attachment 1692230 [details]
Stopped VM with runStrategy: Manual

Comment 10 Radim Hrazdil 2020-06-01 11:20:54 UTC
According to https://kubevirt.io/user-guide/#/creation/run-strategies?id=run-strategies
it should be impossible to Start a VM that has runStrategy: RerunOnFailure

Only start and restart should be possible.

Comment 11 Filip Krepinsky 2020-06-01 15:13:42 UTC
Can you please specify?

If you create a VM with runStrategy: RerunOnFailure, it will go into running immediately. 

When you stop the VM the runStrategy will change to Halted. Which is valid strategy to start VM and will cause the VM to change to Always strategy.

When you restart the VM with RerunOnFailure it will stay in RerunOnFailure and will be running again.

Did I forgot about some state? Or what is wrongly handled by UI?

Comment 12 Yaacov Zamir 2020-06-02 04:38:19 UTC
Book keeping note: should be 4.6 at this point, see Samuel Padgett comment above, reverting back to 4.6

Comment 13 Radim Hrazdil 2020-06-02 05:56:37 UTC
@Filip apologies, I thought that it was possible to start the VM while in RerunOnFailure runStrategy, but it is indeed not possible.
Moving to verified, I believe we can change the target release to 4.5.0 again.

Comment 14 Yaacov Zamir 2020-06-02 06:22:08 UTC
> I believe we can change the target release to 4.5.0 again.

Thanks +1

Comment 15 errata-xmlrpc 2020-07-13 17:37:39 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, 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/RHBA-2020:2409


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