Bug 1642231 - Check preset conflict doesn't work
Summary: Check preset conflict doesn't work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 1.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabian Deutsch
QA Contact: zhe peng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-24 05:41 UTC by zhe peng
Modified: 2018-11-26 13:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-24 09:23:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhe peng 2018-10-24 05:41:58 UTC
Description of problem:


Version-Release number of selected component (if applicable):
OCP 3.11
CNV 1.3

How reproducible:
always

Steps to Reproduce:
1. create a preset with label and set memory to 64M
$ cat vmi-preset-small.yaml 
apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachineInstancePreset
metadata:
  creationTimestamp: null
  name: vmi-preset-small
spec:
  domain:
    devices: {}
    machine:
      type: ""
    resources:
      requests:
        memory: 64M
  selector:
    matchLabels:
      kubevirt.io/vmPreset: vmi-preset-small

2.create vmi with label and set memory to 128M: 
apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachineInstance
metadata:
  creationTimestamp: null
  labels:
    special: vmi-preset
    kubevirt.io/vmPreset: vmi-preset-small
  name: vmi-preset
spec:
  domain:
    devices:
      disks:
      - disk:
          bus: virtio
        name: registrydisk
        volumeName: registryvolume
    machine:
      type: ""
    resources:
      requests:
        memory: 128M
  terminationGracePeriodSeconds: 0
  volumes:
  - name: registryvolume
    registryDisk:
      image: kubevirt/cirros-registry-disk-demo:latest
status: {}


3.when vmi running, check status of vmi
$kubectl describe vmi vmi-preset

Actual results:
$kubectl describe vmi vmi-preset
Name:         vmi-preset
Namespace:    default
Labels:       kubevirt.io/nodeName=cnv-executor-zpengds13-node1.example.com
              kubevirt.io/vmPreset=vmi-preset-small
              special=vmi-preset
Annotations:  <none>
API Version:  kubevirt.io/v1alpha2
Kind:         VirtualMachineInstance
Metadata:
  Creation Timestamp:  2018-10-24T05:37:54Z
  Finalizers:
    foregroundDeleteVirtualMachine
  Generation:        1
.....

and run kubectl get event
no log like this:
Unable to apply VirtualMachineInstancePreset 'vmi-preset-small': spec.resources.requests[memory]: {{64 6} {<nil>} 64M DecimalSI} != {{128 6} {<nil>} 128M

Expected results:
in vmi should have:
Annotations:  virtualmachinepreset.kubevirt.io/vmi-preset-small=kubevirt.io/v1alpha2

in event log should have:
Unable to apply VirtualMachineInstancePreset 'vmi-preset-small': spec.resources.requests[memory]: {{64 6} {<nil>} 64M DecimalSI} != {{128 6} {<nil>} 128M

Additional info:

Comment 1 Fabian Deutsch 2018-10-24 09:23:45 UTC
In it's current form, presets do not conflict.
On epreset will win.

However, we plan to change the behavior to follow the PodPreset behavior, this however is a feature, rather than a bug.

Comment 2 zhe peng 2018-10-24 10:29:06 UTC
(In reply to Fabian Deutsch from comment #1)
> In it's current form, presets do not conflict.
> On epreset will win.
> 
> However, we plan to change the behavior to follow the PodPreset behavior,
> this however is a feature, rather than a bug.

get it, so i thought we need to update related doc in user-guide, right?
https://kubevirt.io/user-guide/#/workloads/virtual-machines/presets


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