getting-started issues

47 views
Skip to first unread message

Alexander Gallego

unread,
May 1, 2018, 5:11:59 PM5/1/18
to kubevirt-dev
Hello, 

I'm giving kubevirt a test on minikube using kvm2 driver and I'm having issues launching a console or attaching vnc to the vm or getting any VM to start including the demo project.

Things I've done:

1)

minikube start \
      --vm-driver kvm2 \
      --network-plugin cni

minikube dashboard shows up and everything is up and running. 


2)

First create the groups/etc via:

(tested 2 versions)

export VERSION=v0.4.1
#export VERSION=v0.5.0-alpha.1
kubectl create \


3) Created my own VM template via:


metadata:
  name: testvm-ephemeral
kind: VirtualMachine
spec:
  domain:
    devices:
      disks:
      - type: RegistryDisk:v1alpha
        source:
          name: senior7515/fedora27qcow2:latest
        target:
          dev: vda
        name: registrydisk
        volumeName: registryvolume
      interfaces:
      - source:
          network: default
        type: network
    memory:
      unit: MB
      value: 64
    os:
      type:
        os: hvm
    type: qemu


I notice a Pod gets created w/ the command:

compute
Image:
kubevirt/virt-launcher:v0.4.1
Environment variables:
-
Commands:
/entrypoint.sh
--qemu-timeout
5m
--name
testvm-ephemeral
--namespace
default
--kubevirt-share-dir
/var/run/kubevirt
--readiness-file
/tmp/healthy
--grace-period-seconds
45





4) 


I keep getting this issue: 

Readiness probe failed: cat: /tmp/healthy: No such file or directory
kubelet minikube
spec.containers{compute}
52018-05-01T19:30 UTC2018-05-01T19:30 UTC


5) 

virtctl shows an error (expected)


virtctl vnc testvm-ephemeral          
Error encountered: Can't connect to websocket (400): Unable to connect to VM because phase is Scheduled instead of Running


Thank you for any  help/tips/ pointers. 

I tried looking at kubevirt-ansible but didn't run it - it has a ton of openshift specific logic that I have not manage to fully grok. 




dvo...@redhat.com

unread,
May 1, 2018, 9:49:39 PM5/1/18
to kubevirt-dev
This spec doesn't look correct. I think this is an example of our old API. That won't work anymore.

Take a look at this spec for an example of how to run fedora with a registry disk. https://github.com/kubevirt/kubevirt/blob/master/cluster/examples/vm-fedora.yaml 
 
We just introduced spec validation recently. I don't believe that change has been picked up by a release yet though, which is why you were allowed to post an invalid spec to the cluster. 

Roman Mohr

unread,
May 2, 2018, 2:52:58 AM5/2/18
to kubevirt-dev
Yes seems to be a very old example. Alexander, could you point us to the location where you got that from, so that we can update it?

Best Regards,

Roman

Alexander Gallego

unread,
May 2, 2018, 12:55:00 PM5/2/18
to kubevirt-dev
Sure thing, it is in the README.md  in $root/cmd/registry-disk-v1alpha/README.md on the v0.4.1 release


## Assigning Ephemeral Disks to VMs

Assign an ephemeral disk backed by an image in the container registry by
adding a RegistryDisk:v1alpha disk to the VM definition and supplying
the container image as the disk's source name.

Example: Create a KubeVirt VM definition with container backed ephemeral disk.

```
cat << END > vm.yaml
metadata:
  name: testvm-ephemeral
kind: VirtualMachine
spec:
  domain:
    devices:
      disks:
      - type: RegistryDisk:v1alpha
        source:
          name: vmdisks/fedora25:devel
        target:
          dev: vda
      interfaces:
      - source:
          network: default
        type: network
    memory:
      unit: MB
      value: 64
    os:
      type:
        os: hvm
    type: qemu
END
```

After creating the VM definition, starting the VM is as simple starting a pod.
 
```
kubectl create -f vm.yaml
`
 
Best Regards,

Roman
 

Take a look at this spec for an example of how to run fedora with a registry disk. https://github.com/kubevirt/kubevirt/blob/master/cluster/examples/vm-fedora.yaml 
 

 
kind: VirtualMachine
metadata:
  creationTimestamp: null
  name: vm-ephemeral-2
spec:
  domain:
    devices:
      disks:
      - disk:
          bus: virtio
        name: registrydisk
        volumeName: registryvolume
    machine:
      type: ""
    resources:
      requests:
        memory: 256M
  terminationGracePeriodSeconds: 0
  volumes:
  - name: registryvolume
    registryDisk:
      image: senior7515/fedora27qcow2:latest
status: {}



@vossel is helping me on the IRC since the kubectl create -f vm.yml is still failing

Here is the log of the pod failure 

Reply all
Reply to author
Forward
0 new messages