ixdotai/qemu-ceph
A docker image, based on registry.gitlab.com/ix.ai/qemu:5.1.0, with added CEPH common tools
Multi-arch build: linux/amd64
, linux/arm64
, linux/arm/v7
Note: Make sure to read the README.md in ix.ai/docker-qemu>! All the environment variables are supported.
In addition, this image allows you to:
The following additional environment variables are implemented:
CEPH_CLIENT_ID
- the client id for authentication (default: admin
)CEPH_SNAP
- the snapshot to use as a base for the image (example: rbd/alpine@original
)CEPH_CLONE
- the name of the new clone (example: rbd/alpine-test
)CEPH_TRASH_CLONE
- set to 0
it will skip the trash command on exit (default: 1
)CEPH_TRASH_CLONE_IF_EXISTS
- set to 1
it will trash an existing clone on startup (default: 0
)CEPH_IGNORE_CLONE_EXISTS
- set to 1
it will re-use an existing clone (default: 0
)CEPH_SKIP_CREATE_CLONE
- set to 1
it will not create a clone at startup (default: 0
)Note: With registry.gitlab.com/ix.ai/qemu:v0.2.0 a new variable called QEMU_NO_QMP
was introduced. This variable is ignored by this image.
Warning: Modify the command below to suit your needs!
Assumptions:
ceph osd pool create rbd 64
)rbd pool init rbd
)qemu
with access to the pool (example: ceph auth caps client.qemu mon "profile rbd" osd "profile rbd pool=rbd"
)alpine
(and installed something bootable)alpine@3.12
Bonus: Mount a folder (example: /folder
), from the host, through docker, in the VM, as FAT. You can put, for example, scripts there.
CEPH_CLONE="rbd/alpine-test-044" docker run --rm --it \
-v /etc/ceph/ceph.client.qemu.keyring:/etc/ceph/ceph.client.qemu.keyring:ro \
-v /etc/ceph/ceph.conf:/etc/ceph/ceph.conf:ro \
-v /folder:/folder:rw \
-e CEPH_CLIENT_ID="qemu" \
-e CEPH_SNAP="rbd/alpine@3.12" \
-e CEPH_CLONE="${CEPH_CLONE}" \
--device /dev/kvm \
--device /dev/urandom \
registry.gitlab.com/ix.ai/qemu-ceph:latest \
-enable-kvm \
-smp 2 \
-m 4096 \
-device virtio-scsi-pci \
-drive format=rbd,file=rbd:${CEPH_CLONE}:id=qemu,id=drive1,cache=writeback,if=none \
-device driver=scsi-hd,drive=drive1,discard_granularity=512 \
-drive file=fat:rw:/folder,id=drive2,if=none \
-device driver=scsi-hd,drive=drive2 \
-netdev user,hostfwd=tcp::22-:22,id=net \
-device virtio-net-pci,netdev=net \
-vnc :0 \
-no-user-config \
-cpu max \
-object rng-random,filename=/dev/urandom,id=rng0 \
-usb \
-device usb-tablet,id=input0 \
-nodefaults \
-vga virtio \
-machine type=q35,accel=kvm \
-k de
bash
(bypass the entrypoint)docker run --rm --it \
-v /etc/ceph/ceph.client.qemu.keyring:/etc/ceph/ceph.client.qemu.keyring:ro \
-v /etc/ceph/ceph.conf:/etc/ceph/ceph.conf:ro \
-v /folder:/folder:rw \
--device /dev/kvm \
--device /dev/urandom \
--entrypoint "" \
registry.gitlab.com/ix.ai/qemu-ceph:latest \
bash
The following tag formats are used by this docker image:
v0.0.5-5.1.0-octopus
- the git tag, the QEMU version, the CEPH versionv0.0.5
- the git tagmaster
or dev
, are development tags5.1.0-octopus
- the QEMU version, the CEPH version5.1.0
- the QEMU version5.1
- shorter QEMU version5
- shortest QEMU versionlatest
docker pull ixdotai/qemu-ceph