From 997667a8734eddaa616fe642e57f6378408736a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 26 Nov 2018 17:58:49 +0100 Subject: [PATCH] osd: expose udev into the container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to be able to retrieve udev information, we must expose its socket. As per, https://github.com/ceph/ceph/pull/25201 ceph-volume will start consuming udev output. Signed-off-by: Sébastien Han --- library/ceph_volume.py | 1 + library/test_ceph_volume.py | 6 ++++++ roles/ceph-osd/tasks/start_osds.yml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/library/ceph_volume.py b/library/ceph_volume.py index 43b3eebf7..bbee7b6c6 100644 --- a/library/ceph_volume.py +++ b/library/ceph_volume.py @@ -181,6 +181,7 @@ def container_exec(binary, container_image): command_exec = ['docker', 'run', '--rm', '--privileged', '--net=host', '-v', '/run/lock/lvm:/run/lock/lvm:z', + '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket', '-v', '/var/lib/ceph/:/var/lib/ceph/:z', diff --git a/library/test_ceph_volume.py b/library/test_ceph_volume.py index 87314c7b1..5863b5698 100644 --- a/library/test_ceph_volume.py +++ b/library/test_ceph_volume.py @@ -41,6 +41,7 @@ class TestCephVolumeModule(object): fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', + '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket', # noqa E501 '-v', '/var/lib/ceph/:/var/lib/ceph/:z', @@ -56,6 +57,7 @@ class TestCephVolumeModule(object): fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', + '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket', # noqa E501 '-v', '/var/lib/ceph/:/var/lib/ceph/:z', @@ -110,6 +112,7 @@ class TestCephVolumeModule(object): fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', + '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket', # noqa E501 '-v', '/var/lib/ceph/:/var/lib/ceph/:z', @@ -136,6 +139,7 @@ class TestCephVolumeModule(object): fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', + '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket', # noqa E501 '-v', '/var/lib/ceph/:/var/lib/ceph/:z', @@ -183,6 +187,7 @@ class TestCephVolumeModule(object): fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', + '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket', # noqa E501 '-v', '/var/lib/ceph/:/var/lib/ceph/:z', @@ -231,6 +236,7 @@ class TestCephVolumeModule(object): fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', + '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket', # noqa E501 '-v', '/var/lib/ceph/:/var/lib/ceph/:z', diff --git a/roles/ceph-osd/tasks/start_osds.yml b/roles/ceph-osd/tasks/start_osds.yml index 75349ad27..7ff0fdb49 100644 --- a/roles/ceph-osd/tasks/start_osds.yml +++ b/roles/ceph-osd/tasks/start_osds.yml @@ -26,7 +26,7 @@ - name: set_fact docker_exec_start_osd set_fact: - docker_exec_start_osd: "{{ 'docker run --rm --privileged=true -v /run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket -v /etc/ceph:/etc/ceph:z -v /dev:/dev --entrypoint=ceph-volume ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph-volume' }}" + docker_exec_start_osd: "{{ 'docker run --rm --privileged=true -v /run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket -v /var/run/udev/:/var/run/udev/:z -v /etc/ceph:/etc/ceph:z -v /dev:/dev --entrypoint=ceph-volume ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph-volume' }}" - name: collect osd ids shell: >