]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
osd: fix osd restart when dmcrypt
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 8 Feb 2018 12:27:45 +0000 (13:27 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 9 Feb 2018 13:08:24 +0000 (14:08 +0100)
commitbbf8caaaf1dcf4e430ca11fc75f57b4f88804e18
treee8391107306e927d181464d5c1039bbead966a9c
parente2ed2bceee5a599deb3b8898fb9e8e24222deab8
osd: fix osd restart when dmcrypt

This commit fixes a bug that occurs especially for dmcrypt scenarios.

There is an issue where the 'disk_list' container can't reach the ceph
cluster because it's not launched with `--net=host`.

If this container can't reach the cluster, it will hang on this step
(when trying to retrieve the dm-crypt key) :

```
+common_functions.sh:448: open_encrypted_part(): ceph --cluster abc12 --name \
client.osd-lockbox.9138767f-7445-49e0-baad-35e19adca8bb --keyring \
/var/lib/ceph/osd-lockbox/9138767f-7445-49e0-baad-35e19adca8bb/keyring \
config-key get dm-crypt/osd/9138767f-7445-49e0-baad-35e19adca8bb/luks
+common_functions.sh:452: open_encrypted_part(): base64 -d
+common_functions.sh:452: open_encrypted_part(): cryptsetup --key-file \
-luksOpen /dev/sdb1 9138767f-7445-49e0-baad-35e19adca8bb
```

It means the `ceph-run-osd.sh` script won't be able to start the
`osd_disk_activate` process in ceph-container because he won't have
filled the `$DOCKER_ENV` environment variable properly.

Adding `--net=host` to the 'disk_list' container fixes this issue.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1543284
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e537779bb3cf73c569ce6c29ab8b20169cc5ffae)
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-osd/templates/ceph-osd-run.sh.j2