Bug 1785118

Summary: Missing attributes when creating a VM from template using CLI
Product: Container Native Virtualization (CNV) Reporter: Ruth Netser <rnetser>
Component: SSPAssignee: sgott
Status: CLOSED DEFERRED QA Contact: Israel Pinto <ipinto>
Severity: unspecified Docs Contact:
Priority: high    
Version: 2.2.0CC: cnv-qe-bugs, dholler, msivak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-20 14:33:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ruth Netser 2019-12-19 08:15:13 UTC
Description of problem:

A VM created from common templates via CLI is missing attributes which are added when a VM is created from the UI (using templates).
From the CLI we use oc process.

The following attributes are missing:

metadata:
  annotations:
    name.os.template.kubevirt.io/win2k16: Microsoft Windows Server 2016
  labels:
    flavor.template.kubevirt.io/medium: 'true'
    os.template.kubevirt.io/win2k16: 'true'
    vm.kubevirt.io/template-namespace: openshift
    workload.template.kubevirt.io/server: 'true'
spec:
  template:
    metadata:
      labels:
        vm.kubevirt.io/name: win16
    spec:
        devices:
          disks:
            - bootOrder: 1
          interfaces:
            - bootOrder: 2

Version-Release number of selected component (if applicable):
$ oc get csv -n openshift-cnv
NAME                                      DISPLAY                                    VERSION   REPLACES                                  PHASE
kubevirt-hyperconverged-operator.v2.2.0   Container-native virtualization Operator   2.2.0     kubevirt-hyperconverged-operator.v2.1.0   Succeeded


How reproducible:
100%

Steps to Reproduce:
1. Create a Windows DV
2. Create a Windows VM through the CLI

oc process -n openshift win2k12r2-server-medium-v0.7.0 -p NAME="win16" -p PVCNAME="win-16" | oc create -n default  -f -

Actual results:
- VM is created, however the yaml is missing the above-mentioned attributes.


Expected results:
CLI and UI should create identical VMs (unless modified by the user).

Additional info:

Comment 2 sgott 2019-12-19 18:32:55 UTC
Tomas, is there a requirement that the VMs created by the UI be identical to VMs created via common-templates?

Comment 3 sgott 2019-12-19 18:33:49 UTC
Martin, are you aware either?

Comment 4 Martin Sivák 2019-12-20 07:23:42 UTC
This is not a bug. CLI is not fully supported, the UI indeed has a lot more logic. The oc process tool is pretty "dumb" and does not understand the CNV annotations.

Comment 6 sgott 2019-12-20 14:33:56 UTC
The currently supported workflow is to use the UI. I agree that it's not nice that the UI and CLI differ--and that's being tracked in the long run in Jira. Closing this issue as there's no short-term solution, and we're working on a long term fix.