This is bash script to fix non pristine issue with ceph-osd charm.
#!/bin/bash
for arg in "$@"
do
blk=`juju ssh ceph-osd/${arg} -- sudo lsblk /dev/vdb -J | jq '.blockdevices[] | select(.name=="vdb") | .children[0].name'`
juju ssh ceph-osd/$arg -- sudo dmsetup remove $blk
juju ssh ceph-osd/$arg -- sudo dd if=/dev/zero of=/dev/vdb bs=1G count=1 status=progress
done
juju run --application ceph-osd ./hooks/config-changed
Monitor if juju status for ceph-osd is fine.