diff --git a/infrastructure-playbooks/filestore-to-bluestore.yml b/infrastructure-playbooks/filestore-to-bluestore.yml index 40bd64969..ffd5eb7f6 100644 --- a/infrastructure-playbooks/filestore-to-bluestore.yml +++ b/infrastructure-playbooks/filestore-to-bluestore.yml @@ -44,7 +44,7 @@ - name: set_fact container_run_cmd set_fact: - container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --ulimit nofile=1024:4096 --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else '' }}" + container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else '' }}" - name: get ceph-volume lvm inventory data command: "{{ container_run_cmd }} --cluster {{ cluster }} inventory --format json" diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index 68aeb9a06..88f7de4c2 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -70,7 +70,7 @@ - name: set_fact container_run_cmd set_fact: - container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --ulimit nofile=1024:4096 --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else '' }}" + container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else '' }}" - name: exit playbook, if can not connect to the cluster command: "{{ container_exec_cmd }} timeout 5 ceph --cluster {{ cluster }} health" diff --git a/library/ceph_volume.py b/library/ceph_volume.py index b8f129947..33b56c54c 100644 --- a/library/ceph_volume.py +++ b/library/ceph_volume.py @@ -207,7 +207,6 @@ def container_exec(binary, container_image): container_binary = os.getenv('CEPH_CONTAINER_BINARY') command_exec = [container_binary, 'run', '--rm', '--privileged', '--net=host', '--ipc=host', - '--ulimit', 'nofile=1024:4096', '-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', diff --git a/roles/ceph-osd/tasks/start_osds.yml b/roles/ceph-osd/tasks/start_osds.yml index 3be380638..b3b99f4a6 100644 --- a/roles/ceph-osd/tasks/start_osds.yml +++ b/roles/ceph-osd/tasks/start_osds.yml @@ -21,7 +21,7 @@ - name: set_fact docker_exec_start_osd set_fact: - docker_exec_start_osd: "{{ '{{ container_binary }} run --rm --ulimit nofile=1024:4096 --net=host --privileged=true -v /var/run/udev/:/var/run/udev/:z -v /run/lvm/:/run/lvm/ -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: "{{ '{{ container_binary }} run --rm --net=host --privileged=true -v /var/run/udev/:/var/run/udev/:z -v /run/lvm/:/run/lvm/ -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 command: "{{ docker_exec_start_osd }} lvm list --format json" diff --git a/tests/library/test_ceph_volume.py b/tests/library/test_ceph_volume.py index fc39565a4..ccdc2795b 100644 --- a/tests/library/test_ceph_volume.py +++ b/tests/library/test_ceph_volume.py @@ -55,7 +55,6 @@ class TestCephVolumeModule(object): fake_binary = "ceph-volume" fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 - '--ulimit', 'nofile=1024:4096', '-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 @@ -72,7 +71,6 @@ class TestCephVolumeModule(object): fake_module.params = {'data': '/dev/sda'} fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 - '--ulimit', 'nofile=1024:4096', '-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 @@ -141,7 +139,6 @@ class TestCephVolumeModule(object): fake_module.params = {'cluster': 'ceph', 'data': '/dev/sda'} fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 - '--ulimit', 'nofile=1024:4096', '-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 @@ -174,7 +171,6 @@ class TestCephVolumeModule(object): fake_module = MagicMock() fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 - '--ulimit', 'nofile=1024:4096', '-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 @@ -198,7 +194,6 @@ class TestCephVolumeModule(object): fake_action = "create" fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 - '--ulimit', 'nofile=1024:4096', '-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 @@ -247,7 +242,6 @@ class TestCephVolumeModule(object): fake_action = "prepare" fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 - '--ulimit', 'nofile=1024:4096', '-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 @@ -297,7 +291,6 @@ class TestCephVolumeModule(object): fake_container_image = "docker.io/ceph/daemon:latest-luminous" expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 - '--ulimit', 'nofile=1024:4096', '-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