Ceph RBD on Windows

Having disk images available on Windows is very convenient, you can add storage to a system but keep the actual data safe within a Ceph pool block device that is stored on your distributed Ceph cluster. That block device can be expanded later and the filesystem expanded to provide more storage space as needed.

Documentation on installing

Start by reading the existing documentation and the link to download the Windows installer for the version of Ceph you’re using. At this time of writing, I’m using Ceph Reef.

https://docs.ceph.com/en/latest/install/windows-install

https://docs.ceph.com/en/latest/rbd/rbd-windows

Configuration

The ‘keyring’ and ‘mon-host’ part might be confusing.

Keyring refers to the file on /etc/pve/priv/ceph/<pool name>.keyring for the pool you’re wanting to connect to.

The monitor hosts (mon-hosts) are a space separated list of the IP addresses of your Ceph monitors.

Once you have that all in place and reboot, you should be able to go to an admin shell and type

rbd ls <pool name>-metadata

Note the ‘-metadata’ part being what you see in the Ceph config as the replicated metadata pool. For instance, my Ceph pool was created called ‘blockdev’. I have a ‘blockdev-data’ and a ‘blockdev-metadata’ available when I look at my Ceph configuration within the cluster under ‘Pools’. It is the metadata one you want to refer to on the command line.

So, when I ran:

rbd ls blockdev-metadata

I saw my image name of ‘ceres’ (my computer).

Remounting a previously existing image

If you have an image already made and you reinstall the Windows OS you might wonder how to get that mounted image back and usable again. Once you have the RBD service installed again along with the configuration and keyring you will need to do the following in an admin shell:

rbd device map <pool name>-metadata/<image name> -onon-persistent

So, for my computer in the pool I’m using as above I entered:

rbd device map blockdev-metadata/ceres -onon-persistent

And the drive was mapped and available within Windows once more.