Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow Docs for Kubevirt + CDI and Document any gotchas #7

Open
hh opened this issue Mar 13, 2024 · 12 comments
Open

Follow Docs for Kubevirt + CDI and Document any gotchas #7

hh opened this issue Mar 13, 2024 · 12 comments
Assignees

Comments

@hh
Copy link
Member

hh commented Mar 13, 2024

Ideally we should be able to use KubeVirt as part of CAPI to deploy Talos

@BobyMCbobs
Copy link
Member

got KubeVirt Operator installed and KubeVirt should come up after that.
VM creation process will be with a VirtualMachine resource, like

https://kubevirt.io/labs/manifests/vm.yaml

this can be performed in Terraform or in the Flux portions of the repo

@hh
Copy link
Member Author

hh commented Mar 13, 2024

@heyste can you add information on one of the kids day QEMU or similar images so @BobyMCbobs can make them boot tomorrow?

@hh
Copy link
Member Author

hh commented Mar 13, 2024

@hh
Copy link
Member Author

hh commented Mar 13, 2024

Debugging here:

kubectl describe dv fedora  | grep Events: -A5
Events:
  Type     Reason            Age                 From                          Message
  ----     ------            ----                ----                          -------
  Normal   ErrClaimNotValid  93s                 datavolume-import-controller  no accessMode defined DV nor on StorageProfile for longhorn StorageClass
  Warning  ErrClaimNotValid  37s (x17 over 93s)  datavolume-import-controller  DataVolume.storage spec is missing accessMode and volumeMode, cannot get access mode from StorageProfile longhorn

@hh
Copy link
Member Author

hh commented Mar 13, 2024

Hitting this issue: kubevirt/kubevirt#7078 (comment)

$ kubectl explain dv.spec.storage.volumeMode
GROUP:      cdi.kubevirt.io
KIND:       DataVolume
VERSION:    v1beta1

FIELD: volumeMode <string>

DESCRIPTION:
    volumeMode defines what type of volume is required by the claim. Value of
    Filesystem is implied when not included in claim spec.
$ kubectl explain dv.spec.storage.accessModes
GROUP:      cdi.kubevirt.io
KIND:       DataVolume
VERSION:    v1beta1

FIELD: accessModes <[]string>

DESCRIPTION:
    AccessModes contains the desired access modes the volume should have. More
    info:
    https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1

@hh
Copy link
Member Author

hh commented Mar 13, 2024

https://kubevirt.io/user-guide/operations/containerized_data_importer/#supported-image-formats

CDI supports the raw and qcow2 image formats which are supported by qemu. See the qemu documentation for more details. Bootable ISO images can also be used and are treated like raw images. Images may be compressed with either the gz or xz format.

@hh
Copy link
Member Author

hh commented Mar 13, 2024

Looks like spec.accessModes is required, going with ReadWriteOnce

metadata:
  name: "fedora"
spec:
  storage:
    volumeMode: block # or filesystem
    accessModes:
      - ReadWriteOnce # Necessary as it's no longer has a default
    resources:
      requests:
        storage: 5Gi
  source:
    http:
      url: "https://download.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/x86_64/images/Fedora-Cloud-Base-37-1.7.x86_64.raw.xz"

@hh
Copy link
Member Author

hh commented Mar 13, 2024

Still having trouble connecting via ssh:

ii@cloudnative-paris:~$ kubectl get vmi
NAME     AGE     PHASE     IP            NODENAME                          READY
testvm   42m     Running   10.244.1.30   cloudnative-coop-bursting-krill   True
vm1      2m53s   Running   10.244.0.33   cloudnative-coop-quick-eft        True
ii@cloudnative-paris:~$ ssh -v [email protected]
OpenSSH_9.3p1 Ubuntu-1ubuntu3.2, OpenSSL 3.0.10 1 Aug 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 10.244.0.33 [10.244.0.33] port 22.
debug1: connect to address 10.244.0.33 port 22: No route to host
ssh: connect to host 10.244.0.33 port 22: No route to host

@hh
Copy link
Member Author

hh commented Mar 13, 2024

Let's chat with @usrbinkat at KubCon, she's dig this I think.

@usrbinkat
Copy link

@hh did someone say kubevirt? :)

@hh
Copy link
Member Author

hh commented May 4, 2024

@usrbinkat hello lovely human!

I'm working on a system that will use kubevirt to help contributors develop and demo CNCF projects. I'm just now looping back to this after migrating the sharing.io cluster over to Hong Kong.

I'd like to integrate these with cloud / web based collaborative environments.

I think I am just running into learning curve issues with KubeVirt, getting a bit stuck in lab2:

https://kubevirt.io/labs/kubernetes/lab2

The docs probably need to be updated to reflect the need for spec.storage accessMode and volumeMode, but I figured I'd try to get through to a working VM using CDI before I went that route.

Probably needing to look at some logs for cdi, though initial glances through logs don't see any issues.

ii@sharingio:~/infra/vm$ kubectl describe datavolumes.cdi.kubevirt.io fedora 
Name:         fedora
Namespace:    default
Labels:       <none>
Annotations:  cdi.kubevirt.io/storage.usePopulator: true
API Version:  cdi.kubevirt.io/v1beta1
Kind:         DataVolume
Metadata:
  Creation Timestamp:  2024-05-04T20:57:58Z
  Generation:          1
  Resource Version:    748172
  UID:                 aae59fea-ca3e-4f3c-b127-56fec0075888
Spec:
  Source:
    Http:
      URL:  https://download.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/x86_64/images/Fedora-Cloud-Base-37-1.7.x86_64.raw.xz
  Storage:
    Access Modes:
      ReadWriteOnce
    Resources:
      Requests:
        Storage:  5Gi
    Volume Mode:  block
Status:
  Conditions:
    Last Heartbeat Time:   2024-05-04T20:57:58Z
    Last Transition Time:  2024-05-04T20:57:58Z
    Message:               No PVC found
    Reason:                NotFound
    Status:                Unknown
    Type:                  Bound
    Last Heartbeat Time:   2024-05-04T20:57:58Z
    Last Transition Time:  2024-05-04T20:57:58Z
    Status:                False
    Type:                  Ready
    Last Heartbeat Time:   2024-05-04T20:57:58Z
    Last Transition Time:  2024-05-04T20:57:58Z
    Status:                False
    Type:                  Running
  Phase:                   Pending
Events:
  Type    Reason    Age    From                          Message
  ----    ------    ----   ----                          -------
  Normal  NotFound  7m29s  datavolume-import-controller  No PVC found

@hh
Copy link
Member Author

hh commented May 4, 2024

Note the minor updates we needed to get past the first errors. Now we are trying to debug the CDI import. This is a slightly modified version of the here-doc from https://kubevirt.io/labs/kubernetes/lab2:

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: "fedora"
spec:
  storage:
    volumeMode: block # or filesystem -- not in labs walkthrough, but seems required
    accessModes: # -- also not in labs walkthrough, but required
      - ReadWriteOnce # Necessary as it's no longer has a default
    resources:
      requests:
        storage: 5Gi
  source:
    http:
      url: "https://download.fedoraproject.org/pub/fedora/linux/releases/37/Cloud/x86_64/images/Fedora-Cloud-Base-37-1.7.x86_64.raw.xz"

@hh hh changed the title deploy kubevirt and document creation & access of VM Deploy kubevirt and document creation & access of VM May 4, 2024
@hh hh changed the title Deploy kubevirt and document creation & access of VM Follow Docs for Kubevirt + CDI and Document any gotchas May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants