wetopi / docker-volume-rbd

Docker Engine managed plugin to manage RBD volumes.
MIT License
72 stars 18 forks source link

fstype xfs not supported #23

Closed Besstheone closed 7 months ago

Besstheone commented 2 years ago

Hello, when creating a new volume with fstype xfs, the volume is not created with the error : Create Message=unable to create ceph rbd image: exit status 1

PS: it is working with ext4

sitamet commented 2 years ago

Hi, What are your config vars? you should set this two:

fstype: optional, defauls to ext4
mkfsOptions: optional, defaults to '-O mmp' (Multiple Mount Protection)
Mantrain commented 10 months ago

I have the same issue, its rather unclear how to use another FS.

    driver: wetopi/rbd:latest
    driver_opts:
      size: 20000
      fstype: xfs

My issue stems from trying to create a mysql database, which fails because of the folder not being because of lost+found.

Atari365 commented 10 months ago

I am also not able to create xfs volume. The command is docker volume create -d wetopi/rbd -o fstype=xfs rbd_vol. Error is the same: Error response from daemon: create rbd_vol: VolumeDriver.Create: volume-rbd Name=rbd_vol Request=Create Message=unable to create ceph rbd image: exit status 1. If I replace xfs with ext4 the volume is created just fine.

Here is the log with LOG_LEVEL=3:

level=error msg="2023/12/12 14:47:22 Entering go-plugins-helpers capabilitiesPath" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=info msg=\"volume-rbd Request=Capabilities\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="2023/12/12 14:47:22 Entering go-plugins-helpers getPath" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=info msg=\"volume-rbd Name=rbd_vol Request=Get\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Message=connect to ceph pool(docker)\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Name=rbd_vol Message=checking if exists rbd image in pool(docker)\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Message=connection shutdown from ceph\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="2023/12/12 14:47:22 Entering go-plugins-helpers createPath" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=info msg=\"volume-rbd Name=rbd_vol Request=Create\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Message=connect to ceph pool(docker)\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Name=rbd_vol Message=checking if exists rbd image in pool(docker)\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Name=rbd_vol Message=create image in pool(docker) with size(512MB) and fstype(xfs)\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Name=rbd_vol Message=rbd map\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Name=rbd_vol Message=rbd unmap\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:22Z\" level=debug msg=\"volume-rbd Name=rbd_vol Message=remove rbd image\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:23Z\" level=debug msg=\"volume-rbd Message=connection shutdown from ceph\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="2023/12/12 14:47:23 Entering go-plugins-helpers capabilitiesPath" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="time=\"2023-12-12T14:47:23Z\" level=info msg=\"volume-rbd Request=Capabilities\"" plugin=3cf25eb6a68bed16aa7ff76b157ec8969cf56f9ec2247e4e0710a2297156151a
level=error msg="Handler for POST /v1.43/volumes/create returned error: create rbd_vol: VolumeDriver.Create: volume-rbd Name=rbd_vol Request=Create Message=unable to create ceph rbd image: exit status 1"
Atari365 commented 10 months ago

Ok, the solution is to set the custom mkfsOptions with xfs. There are no -O option in mkfs.xfs, so it complains about it.

mkfs.xfs: invalid option -- 'O'
unknown option -O
Usage: mkfs.xfs
sitamet commented 7 months ago

Fixed on release 4.1.0 Moved hard-coded defaults to config vars:

LOG_LEVEL=[0:ErrorLevel; 1:WarnLevel; 2:InfoLevel; 3:DebugLevel] defaults to 0

RBD_CONF_DEVICE_MAP_ROOT="/dev/rbd"
RBD_CONF_POOL="ssd"
RBD_CONF_CLUSTER=ceph
RBD_CONF_KEYRING_USER=client.admin
RBD_CONF_NAMESPACE=""

Mount options defaults to "--options=noatime" (extended syntax with no spaces)
MOUNT_OPTIONS="--options=noatime"

VOLUME_FSTYPE="ext4"
VOLUME_MKFS_OPTIONS="-O mmp"
VOLUME_SIZE="512"
VOLUME_ORDER="22"

now you can install the plugin and set the conf, e.g.

docker plugin install --grant-all-permissions wetopi/rbd:4.1.0 \
--alias=wetopi/rbd \
LOG_LEVEL=1 \
RBD_CONF_POOL="ssd" \
RBD_CONF_CLUSTER=ceph \
RBD_CONF_KEYRING_USER=client.admin \
VOLUME_ORDER=20 \
VOLUME_MKFS_OPTIONS=""
GiamBoscaro commented 7 months ago

Hello, I have the same problem creating the xfs image. I have installed the plugin using these settings:

Fixed on release 4.1.0 Moved hard-coded defaults to config vars:

LOG_LEVEL=[0:ErrorLevel; 1:WarnLevel; 2:InfoLevel; 3:DebugLevel] defaults to 0

RBD_CONF_DEVICE_MAP_ROOT="/dev/rbd"
RBD_CONF_POOL="ssd"
RBD_CONF_CLUSTER=ceph
RBD_CONF_KEYRING_USER=client.admin
RBD_CONF_NAMESPACE=""

Mount options defaults to "--options=noatime" (extended syntax with no spaces)
MOUNT_OPTIONS="--options=noatime"

VOLUME_FSTYPE="ext4"
VOLUME_MKFS_OPTIONS="-O mmp"
VOLUME_SIZE="512"
VOLUME_ORDER="22"

now you can install the plugin and set the conf, e.g.

docker plugin install --grant-all-permissions wetopi/rbd:4.1.0 \
--alias=wetopi/rbd \
LOG_LEVEL=1 \
RBD_CONF_POOL="ssd" \
RBD_CONF_CLUSTER=ceph \
RBD_CONF_KEYRING_USER=client.admin \
VOLUME_ORDER=20 \
VOLUME_MKFS_OPTIONS=""

Hello, I have the same problem creating the xfs image. I have installed the plugin using your settings, then I try to create the volume with:

docker volume create -d wetopi/rbd -o size=1024 -o fstype=xfs my_rbd_volume

but I get:

Error response from daemon: create my_rbd_volume: VolumeDriver.Create: volume-rbd Name=my_rbd_volume Request=Create Message=unable to create ceph rbd image: exit status 1

What am I doing wrong?

GiamBoscaro commented 7 months ago

Hello, I have the same problem creating the xfs image. I have installed the plugin using these settings:

Fixed on release 4.1.0 Moved hard-coded defaults to config vars:

LOG_LEVEL=[0:ErrorLevel; 1:WarnLevel; 2:InfoLevel; 3:DebugLevel] defaults to 0

RBD_CONF_DEVICE_MAP_ROOT="/dev/rbd"
RBD_CONF_POOL="ssd"
RBD_CONF_CLUSTER=ceph
RBD_CONF_KEYRING_USER=client.admin
RBD_CONF_NAMESPACE=""

Mount options defaults to "--options=noatime" (extended syntax with no spaces)
MOUNT_OPTIONS="--options=noatime"

VOLUME_FSTYPE="ext4"
VOLUME_MKFS_OPTIONS="-O mmp"
VOLUME_SIZE="512"
VOLUME_ORDER="22"

now you can install the plugin and set the conf, e.g.

docker plugin install --grant-all-permissions wetopi/rbd:4.1.0 \
--alias=wetopi/rbd \
LOG_LEVEL=1 \
RBD_CONF_POOL="ssd" \
RBD_CONF_CLUSTER=ceph \
RBD_CONF_KEYRING_USER=client.admin \
VOLUME_ORDER=20 \
VOLUME_MKFS_OPTIONS=""

Hello, I have the same problem creating the xfs image. I have installed the plugin using your settings, then I try to create the volume with:

docker volume create -d wetopi/rbd -o size=1024 -o fstype=xfs my_rbd_volume

but I get:

Error response from daemon: create my_rbd_volume: VolumeDriver.Create: volume-rbd Name=my_rbd_volume Request=Create Message=unable to create ceph rbd image: exit status 1

What am I doing wrong?

Solved by adding a random options even if I didn't need one, like:

docker volume create -d wetopi/rbd -o size=1024 -o fstype=xfs -o mkfsOptions="-L my_label" my_rbd_volume