Is there any examples for using a Block pvc as root disk? #50
Replies: 9 comments 3 replies
-
I tried to use FROM ubuntu:jammy AS rootfs
RUN apt-get update -y && \
apt-get install -y --no-install-recommends systemd-sysv udev lsb-release cloud-init sudo openssh-server && \
rm -rf /var/lib/apt/lists/* to build a docker image
which After doing this, this Block PVC should be used in the VM. Could I open a PR for adding it into the docs? On the other hand, the rootfs disk type seems does not support
Could virtink or cloud-hypervisor support |
Beta Was this translation helpful? Give feedback.
-
The kernel As for using PVC (both FS mode and block mode) as the root disk, I'd recommend you packing and publishing your rootfs as a QCOW2 image and then using CDI datavolume to import it. This is a more general and automated way. |
Beta Was this translation helpful? Give feedback.
-
But I could not use a CDI datavolume by using direct kernel boot. I only successfully in the docker create --name ubuntu-rootfs ubuntu-rootfs
docker export ubuntu-rootfs | tar -xvf - -C ./my-rootfs-pvc-mount-dir I think this method may be added in the docs. |
Beta Was this translation helpful? Give feedback.
-
Direct kernel boot should work with CDI data volumes. Could you share steps to reproduce it if it didn't work? @weixiao-huang |
Beta Was this translation helpful? Give feedback.
-
I tried to start vm with pvc, but I get an error: My steps:
run the commands:
Thanks for your reply. |
Beta Was this translation helpful? Give feedback.
-
@wavemomo Although you specified
Importing a rootfs into a PV manually is a non-trivial task. That's why we recommend users to first pack the rootfs as a QCOW2 image and then use CDI to import it. To pack a rootfs into a QCOW2 image, you need to:
|
Beta Was this translation helpful? Give feedback.
-
I use Ceph RBD to use |
Beta Was this translation helpful? Give feedback.
-
@wavemomo Your Dockerfile is not correct. The Dockerfile I used is FROM ubuntu:jammy AS rootfs
RUN apt-get update -y && \
apt-get install -y --no-install-recommends systemd-sysv udev lsb-release cloud-init sudo openssh-server && \
rm -rf /var/lib/apt/lists/* |
Beta Was this translation helpful? Give feedback.
-
@fengye87 @weixiao-huang I used CDI to do it. But I still had some problem.
|
Beta Was this translation helpful? Give feedback.
-
I try to write a
vm.yaml
belowand have a PVC
test-vm
likeAnd I want to use the pvc
test-vm
as root disk for vm. Is there any examples for how to import rootfs into this block pvc device?Beta Was this translation helpful? Give feedback.
All reactions