Bug 1565480

Summary: Web doesn't support creating VirtualMachine
Product: OpenShift Container Platform Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED WORKSFORME QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.10.0CC: aos-bugs, jniederm, jokerman, mmccomas, spadgett, wsun, yapei
Target Milestone: ---   
Target Release: 3.10.0   
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: 2018-04-17 12:43:57 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 Yadan Pei 2018-04-10 06:14:31 UTC
Description of problem:
As title

Version-Release number of selected component (if applicable):
v3.10.0-0.16.0

How reproducible:
ALways

Steps to Reproduce:
1.Create VirtualMachine in CLI
cat > vm.yaml << EOF
apiVersion: kubevirt.io/v1alpha1
kind: VirtualMachine
metadata:
  name: testvm
spec:
  terminationGracePeriodSeconds: 0
  domain:
    devices:
      graphics:
      - type: spice
      interfaces:
      - type: network
        source:
          network: default
      video:
      - type: qxl
      disks:
      - type: network
        snapshot: external
        device: disk
        driver:
          name: qemu
          type: raw
          cache: none
        source:
          host:
            name: iscsi-demo-target.kube-system
            port: "3260"
          protocol: iscsi
          name: iqn.2017-01.io.kubevirt:sn.42/2
        target:
          dev: vda
      consoles:
      - type: pty
    memory:
      unit: MB
      value: 64
    os:
      type:
        os: hvm
    type: qemu
EOF
$ oc create -f vm.yaml 
virtualmachine "testvm" created
2.Try to create VirtualMachine on web console using Import YAML/JSON
3.

Actual results:
2.Error reported
Failed to process the resource.
The API version kubevirt.io/v1alpha1 for kind VirtualMachine is not supported by this server

Expected results:
2.Should support creating VirtualMachine via web console

Additional info:

Comment 1 Samuel Padgett 2018-04-10 12:56:42 UTC
I'm not able to reproduce. It looks like you haven't set up Kubevirt on this cluster, or you haven't refreshed the web console since adding it. What do you see if you run...?

oc get --raw /apis/kubevirt.io/v1alpha1

Comment 2 Yadan Pei 2018-04-11 03:00:10 UTC
Could not launch env today, will double confirm when I have

Comment 3 Yadan Pei 2018-04-17 07:18:11 UTC
Today tried again on 
OpenShift Master: v3.10.0-0.21.0
OpenShift Web Console: v3.10.0-0.22.0

kubevirt was set following blog at https://blog.openshift.com/a-first-look-at-kubevirt

# oc get pods -n kube-system
NAME                                      READY     STATUS    RESTARTS   AGE
haproxy-7cc87f54d-7t85x                   1/1       Running   1          6m
iscsi-demo-target-tgtd-5b696945c6-tmbfk   0/1       Pending   0          5m
libvirt-f66sf                             2/2       Running   0          6m
libvirt-m2ggt                             2/2       Running   0          6m
spice-proxy-6649b98d46-52dss              1/1       Running   0          6m
virt-api-5f59d87445-wjf6x                 1/1       Running   0          4m
virt-controller-85d86c55c6-fzxkb          0/1       Running   0          4m
virt-controller-85d86c55c6-pttc4          1/1       Running   0          4m
virt-handler-8psgh                        1/1       Running   0          6m
virt-handler-cvj57                        1/1       Running   0          6m

# oc get virtualmachine -n default
NAME      AGE
testvm    4m

# oc get --raw /apis/kubevirt.io/v1alpha1
{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"kubevirt.io/v1alpha1","resources":[{"name":"virtualmachines","singularName":"virtualmachine","namespaced":true,"kind":"VirtualMachine","verbs":["delete","deletecollection","get","list","patch","create","update","watch"],"shortNames":["vm","vms"]},{"name":"migrations","singularName":"migration","namespaced":true,"kind":"Migration","verbs":["delete","deletecollection","get","list","patch","create","update","watch"]},{"name":"virtualmachinereplicasets","singularName":"virtualmachinereplicaset","namespaced":true,"kind":"VirtualMachineReplicaSet","verbs":["delete","deletecollection","get","list","patch","create","update","watch"],"shortNames":["vmrs","vmrss"]}]}

I could not reproduce this time and vm could be created successfully

Comment 5 Yadan Pei 2018-04-17 07:27:09 UTC
Above

Comment 6 Samuel Padgett 2018-04-17 12:43:57 UTC
jniederm Can you answer the question above?

I'm going to close this bug because that is a separate issue.

Comment 7 jniederm 2018-04-17 14:17:17 UTC
Hi,

as mentioned in the PR description [1] the UI currently only lists offline VMs (ovm) [2]. Both running and off. If the ovm is running, corresponding VM is created details of which are shown in Overview page.

Starting an ovm is expected to be the most common scenario to create actual VM entity.

[1]: https://github.com/openshift/origin-web-console/pull/2929#issue-178375503
[2]: https://github.com/kubevirt/kubevirt/blob/9bd858d7c33b520ad231a1c8dbc66cff8355b29a/docs/devel/offline-virtual-machine.md

Comment 8 Yadan Pei 2018-04-18 00:53:07 UTC
Thanks for your reply!