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

No VolumeSnapshotClass: Volume snapshots are not configured for this StorageClass #11933

Closed
SoaringAnecdotalBear opened this issue May 16, 2024 · 3 comments
Labels

Comments

@SoaringAnecdotalBear
Copy link

SoaringAnecdotalBear commented May 16, 2024

I have deployed a ceph cluster with a CephBlockPool(whose name is replicapool) in k8s, and I uploaded a qcow2 to the blockpool:

test@gpu11:~/yixiang/ceph-config$ rbd --conf ceph.conf --keyring ceph.key info -p replicapool debian2.qcow2
rbd image 'debian2.qcow2':
        size 318 MiB in 80 objects
        order 22 (4 MiB objects)
        snapshot_count: 0
        id: fcaa1d2eaae4
        block_name_prefix: rbd_data.fcaa1d2eaae4
        format: 2
        features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
        op_features:
        flags:
        create_timestamp: Tue May 14 13:14:05 2024
        access_timestamp: Tue May 14 13:14:05 2024
        modify_timestamp: Tue May 14 13:14:05 2024

My pv/pvc/vm are define as follows:

pv:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: ceph-block-debian-qcow2-pv
spec:
  capacity:
    storage: 20Gi
  volumeMode: Block
  storageClassName: rook-ceph-block
  accessModes:
  - ReadWriteOnce
  rbd:
    monitors:
    - 10.100.212.168:6789
    pool: replicapool
    image: debian2.qcow2
    user: admin
    keyring: /home/test/yixiang/ceph-config/ceph.key
    readOnly: false
    fsType: ext4
  persistentVolumeReclaimPolicy: Retain

pvc:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ceph-block-debian-qcow2-pvc
  namespace: default
spec:
  accessModes: ["ReadWriteOnce"]
  storageClassName: rook-ceph-block
  volumeName: ceph-block-debian-qcow2-pv
  volumeMode: Block
  resources:
    requests:
      storage: 10Gi

vm:

apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
  labels:
    kubevirt.io/vm: vm-ceph
  name: vm-ceph
spec:
  running: false
  template:
    metadata:
      labels:
        kubevirt.io/vm: vm-ceph
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            bootOrder: 1
            name: root-disk
          - disk:
              bus: virtio
            bootOrder: 2
            name: cloudinit
        resources:
          requests:
            memory: 2G
      terminationGracePeriodSeconds: 0
      volumes:
      - persistentVolumeClaim:
          claimName: ceph-block-debian-qcow2-pvc
        name: root-disk
      - cloudInitNoCloud:
          userData: |
            #cloud-config
            password: changeme
            chpasswd: { expire: False }
        name: cloudinit

After i create the vm, and its status is kepping staring.So i describe it and get:

Status:
  Conditions:
    Last Probe Time:       2024-05-16T13:24:22Z
    Last Transition Time:  2024-05-16T13:24:22Z
    Message:               Guest VM is not reported as running
    Reason:                GuestNotRunning
    Status:                False
    Type:                  Ready
    Last Probe Time:       <nil>
    Last Transition Time:  <nil>
    Status:                True
    Type:                  Initialized
  Created:                 true
  Desired Generation:      2
  Observed Generation:     2
  Printable Status:        Starting
  Volume Snapshot Statuses:
    Enabled:  false
    Name:     root-disk
    Reason:   No VolumeSnapshotClass: Volume snapshots are not configured for this StorageClass [rook-ceph-block] [root-disk]
    Enabled:  false
    Name:     cloudinit
    Reason:   Snapshot is not supported for this volumeSource type [cloudinit]
Events:
  Type    Reason            Age   From                       Message
  ----    ------            ----  ----                       -------
  Normal  SuccessfulCreate  10m   virtualmachine-controller  Started the virtual machine by creating the new virtual machine instance vm-ceph
@alicefr
Copy link
Member

alicefr commented May 17, 2024

@SoaringAnecdotalBear I haven't quite understood what is the problem here. Is your VM starting up?
Otherwise, as far as it regards the volume snapshot class, have you installed the crd? This is separated from kubevirt and it is more related to ceph, but my guess is that you haven't created the volume snapshot storage class for ceph.

@awels
Copy link
Member

awels commented May 17, 2024

So you made a pretty strange storage setup. There is a CSI driver for ceph, and we highly suggest you use that. Secondly KubeVirt expects all the images stored in a Persistent Volume are in RAW format, not qcow2. Especially since you are using block volumes it should be a RAW image before you upload it to the ceph cluster.

I highly suggest you use the CSI driver for ceph since that will help with getting to configuration correct. Then you can use CDI to upload/import images and have it converted to the correct format automatically.

@SoaringAnecdotalBear
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants