kubevirt / demo

Easy to use KubeVirt demo based on minikube.
Apache License 2.0
109 stars 59 forks source link

minishift based demo with PVC does not work #62

Closed fabiand closed 5 years ago

fabiand commented 6 years ago

Using kubevirt v0.7.0-alpha,1

I've pushed the fedora 28 cloud image to a PVC f28cloud, and changed th ownership of the disk.img to 107:107.

I also added SCCs:

oc adm policy add-scc-to-user privileged -n kube-system -z kubevirt-privileged  
oc adm policy add-scc-to-user privileged -n kube-system -z kubevirt-controller  
oc adm policy add-scc-to-user privileged -n kube-system -z kubevirt-apiserver

# ALSO after the err below I tried:
oc adm policy add-scc-to-user privileged -z default

Then I created a VM with:

apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachine
metadata:
  name: f28cloud
spec:
  running: false
  selector:
    matchLabels:
      guest: f28cloud
  template:
    metadata:
      labels: 
        guest: f28cloud
        kubevirt.io/size: medium
    spec:
      domain:
        devices:
          disks:
            - name: rootfs
              volumeName: f28cloud
              disk:
                bus: virtio
            - name: cloudinitdisk
              volumeName: cloudinitvolume
              disk:
                bus: virtio
      volumes:
        - name: f28cloud
          persistentVolumeClaim:
            claimName: f28cloud
        - name: cloudinitvolume
          cloudInitNoCloud:
            userDataBase64: SGkuXG4= 
---
apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachineInstancePreset
metadata:
  name: medium 
spec:
  selector:
    matchLabels:
      kubevirt.io/size: medium
  domain:
    resources:
      requests:
        memory: 1G
    devices: {}

When launching the VM on minishisft 1.18 I get:

$ oc describe vmi f28cloud
Name:         f28cloud
Namespace:    myproject
Labels:       guest=f28cloud
              kubevirt.io/nodeName=localhost
              kubevirt.io/size=medium
Annotations:  presets.virtualmachines.kubevirt.io/presets-applied=kubevirt.io/v1alpha2
              virtualmachinepreset.kubevirt.io/medium=kubevirt.io/v1alpha2
API Version:  kubevirt.io/v1alpha2
Kind:         VirtualMachineInstance
Metadata:
  Cluster Name:                   
  Creation Timestamp:             2018-06-18T22:18:42Z
  Deletion Grace Period Seconds:  0
  Deletion Timestamp:             2018-06-18T22:18:57Z
  Finalizers:
    foregroundDeleteVirtualMachine
  Generate Name:  f28cloud
  Generation:     0
  Owner References:
    API Version:           kubevirt.io/v1alpha2
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  VirtualMachine
    Name:                  f28cloud
    UID:                   082e0af0-7331-11e8-87ce-d6808e47f6cd
  Resource Version:        30978
  Self Link:               /apis/kubevirt.io/v1alpha2/namespaces/myproject/virtualmachineinstances/f28cloud
  UID:                     8f2441ba-7345-11e8-9f7e-ea3e142a42df
Spec:
  Domain:
    Devices:
      Disks:
        Disk:
          Bus:        virtio
        Name:         rootfs
        Volume Name:  f28cloud
        Disk:
          Bus:        virtio
        Name:         cloudinitdisk
        Volume Name:  cloudinitvolume
      Interfaces:
        Bridge:
        Name:  default
    Features:
      Acpi:
        Enabled:  true
    Firmware:
      Uuid:  3ef8dbb0-2876-554f-87df-f5684818bbed
    Machine:
      Type:  q35
    Resources:
      Requests:
        Memory:  1G
  Networks:
    Name:  default
    Pod:
  Volumes:
    Name:  f28cloud
    Persistent Volume Claim:
      Claim Name:  f28cloud
    Cloud Init No Cloud:
      User Data Base 64:  SGkuXG4=
    Name:                 cloudinitvolume
Status:
  Interfaces:
    Ip Address:  172.17.0.9
  Node Name:     localhost
  Phase:         Failed
Events:
  Type     Reason              Age   From                       Message
  ----     ------              ----  ----                       -------
  Normal   SuccessfulCreate    15s   virtualmachine-controller  Created virtual machine pod virt-launcher-f28cloud-92jlx
  Normal   SuccessfulHandOver  2s    virtualmachine-controller  Pod owner ship transferred to the node virt-launcher-f28cloud-92jlx
  Warning  SyncFailed          1s    virt-handler, localhost    server error. command Launcher.Sync failed: virError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2018-06-18T22:18:56.053734Z qemu-system-x86_64: -drive file=/var/run/kubevirt-private/vmi-disks/f28cloud/disk.img,format=raw,if=none,id=drive-virtio-disk0: Could not open '/var/run/kubevirt-private/vmi-disks/f28cloud/disk.img': Permission denied')
  Normal   Started             1s    virt-handler, localhost    VirtualMachineInstance started.
  Warning  SyncFailed          1s    virt-handler, localhost    server error. command Launcher.Sync failed: virError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2018-06-18T22:18:56.348489Z qemu-system-x86_64: -drive file=/var/run/kubevirt-private/vmi-disks/f28cloud/disk.img,format=raw,if=none,id=drive-virtio-disk0: Could not open '/var/run/kubevirt-private/vmi-disks/f28cloud/disk.img': Permission denied')
  Warning  SyncFailed          1s    virt-handler, localhost    server error. command Launcher.Sync failed: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: 2018-06-18T22:18:56.620449Z qemu-system-x86_64: -drive file=/var/run/kubevirt-private/vmi-disks/f28cloud/disk.img,format=raw,if=none,id=drive-virtio-disk0: Could not open '/var/run/kubevirt-private/vmi-disks/f28cloud/disk.img': Permission denied')
  Warning  SyncFailed          1s    virt-handler, localhost    server error. command Launcher.Sync failed: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: ot-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 -device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 -device nec-usb-xhci,id=usb,bus=pci.2,addr=0x0 -drive file=/var/run/kubevirt-private/vmi-disks/f28cloud/disk.img,format=raw,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.3,addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/var/run/libvirt/kubevirt-ephemeral-disk/cloud-init-data/myproject/f28cloud/noCloud.iso,format=raw,if=none,id=drive-virtio-disk1 -device virtio-blk-pci,scsi=off,bus=pci.4,addr=0x0,drive=drive-virtio-disk1,id=virtio-disk1 -netdev tap,fd=23,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:46:42:b7,bus=pci.1,addr=0x0 -chardev socket,id=charserial0,path=/var/run/kubevirt-private/myproject/f28cloud/virt-serial0,server,nowait -device isa-serial,chardev=charserial0,id=serial0 -vnc vnc=unix:/var/run/kubevirt-private/myproject/f28cloud/virt-vnc -devic')
  Warning  SyncFailed          0s    virt-handler, localhost    server error. command Launcher.Sync failed: virError(Code=38, Domain=10, Message='failed to connect to monitor socket: No such process')
  Warning  SyncFailed          0s    virt-handler, localhost    unexpected EOF
  Warning  Stopped             0s    virt-handler, localhost    The VirtualMachineInstance crashed.
  Normal   SuccessfulDelete    0s    virtualmachine-controller  Deleted virtual machine pod virt-launcher-f28cloud-92jlx

The image itself is mounted successfully.

aglitke commented 6 years ago

SELinux?

fabiand commented 6 years ago

SELinux?

Permissive mode.

fabiand commented 6 years ago

This is minishift specific. I was able to launch a VM on a bare metal cluster and local PVs.

kubevirt-bot commented 5 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot commented 5 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

fabiand commented 5 years ago

Is working these days.

/close

kubevirt-bot commented 5 years ago

@fabiand: Closing this issue.

In response to [this](https://github.com/kubevirt/demo/issues/62#issuecomment-435844970): >Is working these days. > >/close > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.