Changing Container Image for Running Cephadm Daemon
Problem
Change the container image for a single running cephadm daemon or downgrade the container image for a cephadm daemon.
Cephadm does not support upgrading daemons out of order, for good reason. However, if you need to change the container image for a running cephadm daemon, you can do so by editing the unit.run file on the host of the daemon.
Solution
This example is for an osd daemon, but the same applies to any cephadm daemon like the mgr or mon.
- Bring down the daemon
systemctl stop ceph-fsid@osd.1.service
- Edit the unit.run on the host of the daemon located at /var/lib/ceph/fsid/osd.1 and change the CONTAINER_IMAGE variable to the new image.
Change it in both places CONTAINER_IMAGE= variable appears in the unit.run file.
Example of the command to change the image to my.new.image:tag
when inside the daemon's directory:
sed -i 's|CONTAINER_IMAGE=[^ ]*|CONTAINER_IMAGE=my.new.image:tag|g' unit.run
- Start the daemon again
systemctl start ceph-fsid@osd.1.service
. This will also pull the image if it is not already present on the host.
$ ceph versions
{
"mon": {
"ceph version 18.2.6 (ff498e17d264a1a4d588c361cbce9cc65afa2327) reef (stable)": 3
},
"mgr": {
"ceph version 18.2.6 (ff498e17d264a1a4d588c361cbce9cc65afa2327) reef (stable)": 3
},
"osd": {
"ceph version 18.2.6 (ff498e17d264a1a4d588c361cbce9cc65afa2327) reef (stable)": 7,
"ceph version 18.2.5 (a5b0e13f9c96f3b45f596a95ad098f51ca0ccce1) reef (stable)": 1
},
"overall": {
"ceph version 18.2.6 (ff498e17d264a1a4d588c361cbce9cc65afa2327) reef (stable)": 14,
}
}