Bug 2159715 - VM Memory does not show in details card of overview or details tab
Summary: VM Memory does not show in details card of overview or details tab
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.12.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.13.0
Assignee: Ugo Palatucci
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-10 13:00 UTC by Sarah Bennert
Modified: 2023-05-18 02:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2181432 (view as bug list)
Environment:
Last Closed: 2023-05-18 02:56:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CNV-24172 0 None None None 2023-01-10 13:05:48 UTC
Red Hat Product Errata RHSA-2023:3205 0 None None None 2023-05-18 02:57:04 UTC

Description Sarah Bennert 2023-01-10 13:00:00 UTC
Description of problem:

In UI:

VM Memory does not show in details card of overview or details tab. 


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

How reproducible:
100%

Steps to Reproduce:
1. Create VM w/ VirtualMachineInstancetype specifying CPU/Memory
2. View VM in UI

Actual results:

1 CPU | Memory

Expected results:

1 CPU | 2 GiB Memory

Additional info:

---
apiVersion: instancetype.kubevirt.io/v1alpha2
kind: VirtualMachineInstancetype
metadata:
  name: fedora
spec:
  cpu:
    guest: 1
  memory:
    guest: 2Gi

---
apiVersion: instancetype.kubevirt.io/v1alpha2
kind: VirtualMachinePreference
metadata:
  name: fedora
spec:
  devices:
    preferredDiskBus: virtio
    preferredInterfaceModel: virtio
    preferredRng: {}
    preferredNetworkInterfaceMultiQueue: true
  machine:
    preferredMachineType: q35
  cpu:
    preferredCPUTopology: preferSockets
  features:
    preferredSmm: {}
  firmware:
    preferredUseEfi: true
    preferredUseSecureBoot: true

---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: test-vm-instancetype-containerdisk
  namespace: default
  labels:
    app: test-vm-instancetype-containerdisk
spec:
  running: false
  instancetype:
    kind: VirtualMachineInstancetype
    name: fedora
  preference:
    kind: VirtualMachinePreference
    name: fedora
  template:
    metadata:
      labels:
        kubevirt.io/domain: test-vm-instancetype-containerdisk
    spec:
      evictionStrategy: LiveMigrate
      domain:
        devices:
          disks:
            - disk:
              name: containerdisk
            - disk:
              name: cloudinitdisk
          interfaces:
            - masquerade: {}
              name: default
      networks:
      - name: default
        pod: {}
      terminationGracePeriodSeconds: 0
      volumes:
        - containerDisk:
            image: quay.io/containerdisks/fedora:latest
          name: containerdisk
        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              user: fedora
              password: fedora
              chpasswd: { expire: False }
          name: cloudinitdisk

Comment 2 Guohua Ouyang 2023-03-14 05:36:41 UTC
There is an error while editing the CPU|Memory if the VM is created from instanceTypes:
Error "VM field conflicts with selected Instancetype" for field "spec.template.spec.domain.cpu".

I think it should be caused by the same reason as this bug, so update it here.

Comment 3 Lee Yarwood 2023-03-14 15:11:55 UTC
(In reply to Sarah Bennert from comment #0)
> Description of problem:
> 
> In UI:
> 
> VM Memory does not show in details card of overview or details tab. 

This sounds like a valid UI bug, this value should come from the associated instance type.

(In reply to Guohua Ouyang from comment #2)
> There is an error while editing the CPU|Memory if the VM is created from
> instanceTypes:
> Error "VM field conflicts with selected Instancetype" for field
> "spec.template.spec.domain.cpu".
> 
> I think it should be caused by the same reason as this bug, so update it
> here.

This isn't a bug. You can't edit (update/patch) the CPU or Memory of the VM when using instance types, see the following docs for more details:

https://kubevirt.io/user-guide/virtual_machines/instancetypes/#virtualmachineinstancetype

Comment 4 Sarah Bennert 2023-03-14 18:35:26 UTC
@Guohua

When the VirtualMachine resource is created, the spec is updated with the calculated ControllerRevision references.

apiVersion: kubevirt.io/v1
kind: VirtualMachine
  metadata:
    name: vm-instancetype-0-0
    namespace: default
spec:
  instancetype:
    kind: VirtualMachineInstancetype
    name: server.small
    revisionName: vm-instancetype-0-0-server.small-17f33b62-d43f-43a4-ad32-f0d178a672d8-1    # New field added after VM creation
  preference:
    kind: VirtualMachinePreference
    name: fedora
    revisionName: vm-instancetype-0-0-fedora-13275565-0963-4b65-82eb-5bac6875f9b6-1    # New field added after VM creation


The ControllerRevision(s) will contain the relevant data the UI needs to pick up for display, it will not be shown in the VM for reasons stated above by Lee.

apiVersion: apps/v1
kind: ControllerRevision
data:
  apiVersion: instancetype.kubevirt.io/v1alpha2
  kind: VirtualMachineInstancetype
  metadata:
    name: server.small
    namespace: default
  spec:
    cpu:
      guest: 1
    memory:
      guest: 2Gi

Comment 5 Guohua Ouyang 2023-03-21 01:56:06 UTC
The message "CPU and Memory can not be edited if the VirtualMachine is created from InstanceType" is added to VM details tab.

But on VM overview tab, the CPU|Memory field is keeping in loading, maybe we should just leave it blank.

Comment 6 Guohua Ouyang 2023-03-21 02:01:58 UTC
(In reply to Guohua Ouyang from comment #5)
> The message "CPU and Memory can not be edited if the VirtualMachine is
> created from InstanceType" is added to VM details tab.
> 
> But on VM overview tab, the CPU|Memory field is keeping in loading, maybe we
> should just leave it blank.
It should show the same number we see in catalog -> instanceTypes -> VM details

Comment 7 Ugo Palatucci 2023-03-22 08:58:12 UTC
Aviv has a fix for that here
https://github.com/kubevirt-ui/kubevirt-plugin/pull/1174/

Comment 8 Ugo Palatucci 2023-03-22 15:46:58 UTC
Solution merged in the pr above

Comment 10 errata-xmlrpc 2023-05-18 02:56:40 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 4.13.0 Images security, bug fix, and enhancement 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-2023:3205


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