The baremetal role does not properly extend/override the docker systemd unit file

Bug #1654395 reported by David Moreau Simard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Wishlist
Chason Chan

Bug Description

The proper documented way of extending/customizing the docker daemon options through systemd is to use the EnvironmentFile directive:
https://docs.docker.com/engine/admin/systemd/#/custom-docker-daemon-options

Right now we pretty much hardcode the docker daemon options without leaving room for additional end-user customization: https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/baremetal/templates/docker_systemd_service.j2

An example use case of being more flexible in customization is this particular Docker issue: https://github.com/docker/docker/issues/22297
TL;DR: there can be a mismatch of MTU configuration between the host and the container -- say the host has a MTU of 1400, Docker defaults to 1500 anyway and this causes certain network transactions to fail.

Docker has a way to customize the MTU through the systemd unit file, as such:
ExecStart=/usr/bin/dockerd --mtu 1200

But I have no way to "hook" into that with the current way things work.

The way I would probably see this is when we set up the defaults file, here:
https://github.com/openstack/kolla-ansible/blob/49c0ca3a9cc5ba3874aeb7b5fd2215750a1e25bc/ansible/roles/baremetal/tasks/post-install.yml#L25-L30

First, drop that in /etc/default/docker for Ubuntu or /etc/sysconfig/docker for CentOS and then provide a variable to extend DOCKER_OPTS if need be.
So in the defaults template here: https://github.com/openstack/kolla-ansible/blob/7b5e5591fe7108117221eacfffe6e7edbd33ddfa/ansible/roles/baremetal/templates/docker_defaults.j2

Instead of doing: DOCKER_OPTS=""
I would do: DOCKER_OPTS="{{ custom_docker_opts }}".

This would allow someone to pass an extra variable:
kolla-ansible <...> -e "custom_docker_opts=--mtu 1200"

description: updated
Revision history for this message
Jeffrey Zhang (jeffrey4l) wrote :

@David Moreau Simard mind to push patch?

Changed in kolla-ansible:
milestone: none → pike-1
status: New → Confirmed
importance: Undecided → Low
Changed in kolla-ansible:
milestone: pike-2 → pike-3
Changed in kolla-ansible:
milestone: pike-3 → pike-rc1
Changed in kolla-ansible:
milestone: pike-rc1 → pike-rc2
milestone: pike-rc2 → queens-1
Changed in kolla-ansible:
milestone: queens-2 → queens-3
Changed in kolla-ansible:
milestone: queens-3 → queens-rc1
Changed in kolla-ansible:
milestone: queens-rc1 → rocky-1
Changed in kolla-ansible:
milestone: rocky-2 → rocky-3
Chason Chan (chen-xing)
Changed in kolla-ansible:
assignee: nobody → Chason Chan (chen-xing)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.openstack.org/577871

Changed in kolla-ansible:
status: Confirmed → In Progress
Changed in kolla-ansible:
importance: Low → Wishlist
Revision history for this message
Mark Goddard (mgoddard) wrote :

Now possible via docker_custom_config.

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla-ansible (master)

Change abandoned by "Michal Nasiadka <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/577871
Reason: No updates since 2018

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.