-
Bug
-
Resolution: Done-Errata
-
Normal
-
None
-
False
-
-
False
-
CLOSED
-
---
-
---
-
-
-
Medium
-
None
+++ This bug was initially created as a clone of Bug #2181432 +++
+++ This bug was initially created as a clone of Bug #2159715 +++
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
— Additional comment from Guohua Ouyang on 2023-03-14 13:32:43 CST —
— Additional comment from Guohua Ouyang on 2023-03-14 13:36:41 CST —
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.
— Additional comment from Lee Yarwood on 2023-03-14 23:11:55 CST —
(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
— Additional comment from Sarah Bennert on 2023-03-15 02:35:26 CST —
@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
— Additional comment from Guohua Ouyang on 2023-03-21 09:56:06 CST —
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.
— Additional comment from Guohua Ouyang on 2023-03-21 10:01:58 CST —
(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
— Additional comment from Ugo Palatucci on 2023-03-22 16:58:12 CST —
Aviv has a fix for that here
https://github.com/kubevirt-ui/kubevirt-plugin/pull/1174/
— Additional comment from Ugo Palatucci on 2023-03-22 23:46:58 CST —
Solution merged in the pr above
— Additional comment from errata-xmlrpc on 2023-03-24 13:32:27 CST —
This bug has been added to advisory RHEA-2022:101182 by CPaaS, owned by Greg Allen (contra-dev/pipeline@REDHAT.COM)
— Additional comment from Guohua Ouyang on 2023-03-24 13:39:52 CST —
The issue still happens when logged in with a non-priv user.
— Additional comment from Guohua Ouyang on 2023-03-29 08:23:30 CST —
verified on upstream latest
- is blocked by
-
CNV-27337 [2181432] [Nonpriv] VM Memory does not show in details card of overview or details tab
- Closed
- external trackers