kubevirt: create vmi failed with official cirros containerdisk

What happened: I apply a vmi yaml in k8s enviroment. the vmi PHRASE turns into “Failed” quickly in about 12 seconds. kubectl exec into the compute container in virt-launcher pod, I can not find disk_0.img file in /var/run/kubevirt/container-disks directory, there is only one disk_0.sock file there. the virt-handler and virt-launcher logs are as below: virt-launcher.txt virt-handler.txt

What you expected to happen: the vm can be created successfully.

How to reproduce it (as minimally and precisely as possible): Steps to reproduce the behavior.

Additional context: Add any other context about the problem here.

Environment:

  • KubeVirt version (use virtctl version): 0.56.0
  • Kubernetes version (use kubectl version): 1.23.6
  • container runtime: Docker
  • VM or VMI specifications: `apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachineInstance metadata: name: wq labels: debugLogs: “1” logVerbosity: “6” spec: terminationGracePeriodSeconds: 30 domain: resources: requests: memory: 1024M devices: disks: - name: containerdisk disk: bus: virtio volumes:
    • name: containerdisk containerDisk: image: kubevirt/cirros-container-disk-demo:latest `
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): CentOS Linux release 7.6.1810 (Core)
  • Kernel (e.g. uname -a): Linux phy0021.poc.3B405.guigu.yfcs 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools: N/A
  • Others: N/A

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 29 (21 by maintainers)

Most upvoted comments

I set the /var/lib/kubelet/pods link to /opt/kube-install/k8s/kubernetes/kubelet/pods, the error becomes different, the virt-handler log is below:

{“component”:“virt-handler”,“kind”:“”,“level”:“info”,“msg”:“VMI is in phase: Scheduled | Domain does not exist”,“name”:“wq”,“namespace”:“default”,“pos”:“vm.go:1633”,“timestamp”:“2022-09-09T08:18:38.617496Z”,“uid”:“751e0dbd-50ac-4961-8932-d8115d62f856”} {“component”:“virt-handler”,“kind”:“”,“level”:“info”,“msg”:“Processing vmi update”,“name”:“wq”,“namespace”:“default”,“pos”:“vm.go:1760”,“timestamp”:“2022-09-09T08:18:38.617617Z”,“uid”:“751e0dbd-50ac-4961-8932-d8115d62f856”} {“component”:“virt-handler”,“kind”:“”,“level”:“info”,“msg”:“Bind mounting container disk at root: /proc/1/root, relative: /opt/kube-install/k8s/runtime/containerd/overlay2/d2102f1da3e043ba5484f3b900c4ffd9e7777cbca212b494ab6604c342ca0334/merged/disk/downloaded to root: /var/lib/kubelet/pods/31307356-33bf-447d-93c5-2d1dc81ae0f6/volumes/kubernetes.io~empty-dir/container-disks, relative: /disk_0.img”,“name”:“wq”,“namespace”:“default”,“pos”:“mount.go:306”,“timestamp”:“2022-09-09T08:18:38.620156Z”,“uid”:“751e0dbd-50ac-4961-8932-d8115d62f856”} {“component”:“virt-handler”,“kind”:“”,“level”:“error”,“msg”:“Synchronizing the VirtualMachineInstance failed.”,“name”:“wq”,“namespace”:“default”,“pos”:“vm.go:1771”,“reason”:“failed to bindmount containerDisk containerdisk: Error: mount target invalid: not a directory\nUsage:\n virt-chroot mount [flags]\n\nFlags:\n -h, --help help for mount\n -o, --options string comma separated list of mount options\n -t, --type string fstype\n\nGlobal Flags:\n --cpu uint cpu time in seconds for the process\n --memory uint memory in bytes for the process\n --mount string mount namespace to use\n --user string switch to this targetUser to e.g. drop privileges\n\nmount target invalid: not a directory\n : exit status 1”,“timestamp”:“2022-09-09T08:18:38.658239Z”,“uid”:“751e0dbd-50ac-4961-8932-d8115d62f856”} {“component”:“virt-handler”,“kind”:“”,“level”:“info”,“msg”:“migration is block migration because of containerdisk volume”,“name”:“wq”,“namespace”:“default”,“pos”:“vm.go:2295”,“timestamp”:“2022-09-09T08:18:38.658407Z”,“uid”:“751e0dbd-50ac-4961-8932-d8115d62f856”} {“component”:“virt-handler”,“level”:“info”,“msg”:“re-enqueuing VirtualMachineInstance default/wq”,“pos”:“vm.go:1423”,“reason”:“failed to bindmount containerDisk containerdisk: Error: mount target invalid: not a directory\nUsage:\n virt-chroot mount [flags]\n\nFlags:\n -h, --help help for mount\n -o, --options string comma separated list of mount options\n -t, --type string fstype\n\nGlobal Flags:\n --cpu uint cpu time in seconds for the process\n --memory uint memory in bytes for the process\n --mount string mount namespace to use\n --user string switch to this targetUser to e.g. drop privileges\n\nmount target invalid: not a directory\n : exit status 1”,“timestamp”:“2022-09-09T08:18:38.658594Z”}