Since it probably takes a while until the PR is merged here is my script to "modify" the ceph docker image:
```
#!/bin/bash
# Use this file to create a patched ceph docker image
# Usage: ./patch_ceph_image.sh <ceph_version>
# Example: ./patch_ceph_image.sh v16.2.7
#
# Relevant pull request: https://github.com/ceph/ceph/pull/46043
#
# After creating the patched image, you most likely want to upload it to a docker registry
CEPH_VERSION_TAG=$1
CEPH_IMAGE_SOURCE="quay.io/ceph/ceph"
CONTAINER_NAME=ceph_custom_$CEPH_VERSION_TAG
docker pull $CEPH_IMAGE_SOURCE:$CEPH_VERSION_TAG
IMAGE_ID=`docker images | grep -E "$CEPH_IMAGE_SOURCE|$CEPH_VERSION_TAG" | awk -F ' ' '{print \$3}'`
docker create --name $CONTAINER_NAME $IMAGE_ID
# And directly exit the container
docker cp $CONTAINER_NAME:/usr/lib/python3.6/site-packages/ceph_volume/util/system.py .
patch system.py -p0 -c --fuzz=3 --ignore-whitespace --output system_$CEPH_VERSION_TAG.py --verbose << 'EOF'
*** system.py 2021-12-07 17:15:49.000000000 +0100
--- system_n.py 2022-06-02 13:25:32.579878573 +0200
***************
*** 287,293 **** device = fields[0]
path = os.path.realpath(fields[1])
# only care about actual existing devices
if not os.path.exists(device) or not device.startswith('/'):
! if device not in do_not_skip: continue
if device in devices_mounted.keys():
--- 287,294 ---- device = fields[0]
path = os.path.realpath(fields[1])
+ filesystem = fields[2]
# only care about actual existing devices
if not os.path.exists(device) or not device.startswith('/'):
! if device not in do_not_skip and filesystem != 'zfs': continue
if device in devices_mounted.keys():
EOF
# Verify
diff -u system.py system_$CEPH_VERSION_TAG.py
read -p "Is the diff correct? (y/N)" CONT
if [ "$CONT" = "y" ]; then
docker cp system_$CEPH_VERSION_TAG.py $CONTAINER_NAME:/usr/lib/python3.6/site-packages/ceph_volume/util/system.py
MOD_CONTAINER_ID=`docker ps -a | grep $CONTAINER_NAME | cut -d' ' -f 1`
docker commit $MOD_CONTAINER_ID ceph-oep-patched:$CEPH_VERSION_TAG
docker rm $CONTAINER_NAME
else
docker rm $CONTAINER_NAME
exit
fi
```
Related pull request: https:/ /github. com/ceph/ ceph/pull/ 46043
## Edit
Since it probably takes a while until the PR is merged here is my script to "modify" the ceph docker image:
``` ceph_image. sh <ceph_version> ceph_image. sh v16.2.7 /github. com/ceph/ ceph/pull/ 46043 SOURCE= "quay.io/ ceph/ceph" NAME=ceph_ custom_ $CEPH_VERSION_ TAG SOURCE: $CEPH_VERSION_ TAG IMAGE_SOURCE| $CEPH_VERSION_ TAG" | awk -F ' ' '{print \$3}'` NAME:/usr/ lib/python3. 6/site- packages/ ceph_volume/ util/system. py . $CEPH_VERSION_ TAG.py --verbose << 'EOF'
device = fields[0] realpath( fields[ 1]) exists( device) or not device. startswith( '/'):
continue mounted. keys():
device = fields[0] realpath( fields[ 1]) exists( device) or not device. startswith( '/'):
continue mounted. keys(): $CEPH_VERSION_ TAG.py $CEPH_VERSION_ TAG.py $CONTAINER_ NAME:/usr/ lib/python3. 6/site- packages/ ceph_volume/ util/system. py _ID=`docker ps -a | grep $CONTAINER_NAME | cut -d' ' -f 1` patched: $CEPH_VERSION_ TAG
#!/bin/bash
# Use this file to create a patched ceph docker image
# Usage: ./patch_
# Example: ./patch_
#
# Relevant pull request: https:/
#
# After creating the patched image, you most likely want to upload it to a docker registry
CEPH_VERSION_TAG=$1
CEPH_IMAGE_
CONTAINER_
docker pull $CEPH_IMAGE_
IMAGE_ID=`docker images | grep -E "$CEPH_
docker create --name $CONTAINER_NAME $IMAGE_ID
# And directly exit the container
docker cp $CONTAINER_
patch system.py -p0 -c --fuzz=3 --ignore-whitespace --output system_
*** system.py 2021-12-07 17:15:49.000000000 +0100
--- system_n.py 2022-06-02 13:25:32.579878573 +0200
***************
*** 287,293 ****
path = os.path.
# only care about actual existing devices
if not os.path.
! if device not in do_not_skip:
if device in devices_
--- 287,294 ----
path = os.path.
+ filesystem = fields[2]
# only care about actual existing devices
if not os.path.
! if device not in do_not_skip and filesystem != 'zfs':
if device in devices_
EOF
# Verify
diff -u system.py system_
read -p "Is the diff correct? (y/N)" CONT
if [ "$CONT" = "y" ]; then
docker cp system_
MOD_CONTAINER
docker commit $MOD_CONTAINER_ID ceph-oep-
docker rm $CONTAINER_NAME
else
docker rm $CONTAINER_NAME
exit
fi
```