Bug 1785118 - Missing attributes when creating a VM from template using CLI
Summary: Missing attributes when creating a VM from template using CLI
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: SSP
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: ---
Assignee: sgott
QA Contact: Israel Pinto
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-19 08:15 UTC by Ruth Netser
Modified: 2021-10-15 08:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-20 14:33:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1753554 1 None None None 2021-10-15 08:54:11 UTC

Internal Links: 1753554 1929165

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.


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