From 17e6e629f5660a364498b2bfd2f5aa6aede79859 Mon Sep 17 00:00:00 2001 From: xionglingfeng Date: Sat, 13 Feb 2016 23:50:46 -0330 Subject: Allow cinder-volume to be configured to use NFS Allow cinder-volume, nova-compute and nova-libvirtd to be configured to use NFS. In order to mount and work with NFS shares, several containers needed the NFS packages installed during build time. One somewhat significant change is the addition of an explicit bind volume for nova-compute that has shared mounts enabled. According to docker-run(1), the shared mount propagation flag can only be specified for bind mounted Docker volumes and not named volumes. In an NFS setup, cinder-volume mounts the NFS shares so that it can create and manage the Cinder volumes. When a new instance is created with a Cinder volume or a Cinder volume is attached to an existing instance, nova-compute mounts the Cinder volume from the NFS share for nova-libvirtd. In order for nova-libvirtd to then see those Cinder volumes the shared mounts flag must be enabled for the Docker volume. Remove the rpcbind container as it is only necessary for operators who are using NFSv3 or lower. There is no known need for this currently however, this container can be added in the future should an operator require it. Co-authored-by: Ryan Hallisey Co-authored-by: Andrew Widdersheim Change-Id: Iad77c05bce8876bdcc69b7ec22edd50e3bf48b9f Closes-Bug: #1530515 Partially implements: blueprint nfs-support-in-cinder --- docker/cinder/cinder-rpcbind/Dockerfile.j2 | 29 ----------------------------- docker/cinder/cinder-volume/Dockerfile.j2 | 5 +++-- docker/nova/nova-compute/Dockerfile.j2 | 4 ++++ 3 files changed, 7 insertions(+), 31 deletions(-) delete mode 100644 docker/cinder/cinder-rpcbind/Dockerfile.j2 (limited to 'docker') diff --git a/docker/cinder/cinder-rpcbind/Dockerfile.j2 b/docker/cinder/cinder-rpcbind/Dockerfile.j2 deleted file mode 100644 index 60eb8672b..000000000 --- a/docker/cinder/cinder-rpcbind/Dockerfile.j2 +++ /dev/null @@ -1,29 +0,0 @@ -FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} -MAINTAINER {{ maintainer }} - -{% block cinder_rpcbind_header %}{% endblock %} - -{% import "macros.j2" as macros with context %} - -{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} - - {% set cinder_rpcbind_packages = [ - 'nfs-utils', - 'nfs-utils-lib' - ] %} - -{% elif base_distro in ['ubuntu', 'debian'] %} - - {% set cinder_rpcbind_packages = [ - 'rpcbind' - ] %} - -{% endif %} - -{{ macros.install_packages(cinder_rpcbind_packages | customizable("packages")) }} - -{% block cinder_rpcbind_footer %}{% endblock %} -{% block footer %}{% endblock %} -{{ include_footer }} - -USER cinder diff --git a/docker/cinder/cinder-volume/Dockerfile.j2 b/docker/cinder/cinder-volume/Dockerfile.j2 index 11cd55c7b..ef90fcd91 100644 --- a/docker/cinder/cinder-volume/Dockerfile.j2 +++ b/docker/cinder/cinder-volume/Dockerfile.j2 @@ -8,6 +8,7 @@ MAINTAINER {{ maintainer }} {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} {% set cinder_volume_packages = [ + 'nfs-utils', 'scsi-target-utils' ] %} @@ -35,11 +36,11 @@ RUN sed -i '1 i include /var/lib/cinder/volumes/*' /etc/tgt/targets.conf {% if base_distro in ['ubuntu', 'debian'] %} {% set cinder_volume_packages = [ - 'cinder-volume' + 'cinder-volume', + 'nfs-common' ] %} {{ macros.install_packages(cinder_volume_packages | customizable("packages")) }} - {% endif %} {% endif %} diff --git a/docker/nova/nova-compute/Dockerfile.j2 b/docker/nova/nova-compute/Dockerfile.j2 index 461f8b155..46e280a5f 100644 --- a/docker/nova/nova-compute/Dockerfile.j2 +++ b/docker/nova/nova-compute/Dockerfile.j2 @@ -15,6 +15,7 @@ MAINTAINER {{ maintainer }} 'ceph-common', 'genisoimage', 'iscsi-initiator-utils', + 'nfs-utils', 'targetcli', 'python-rtslib' ] %} @@ -32,6 +33,7 @@ MAINTAINER {{ maintainer }} 'ironic-common', 'python-ironicclient', 'genisoimage', + 'nfs-common', 'open-iscsi', 'targetcli', 'python-rtslib' @@ -53,6 +55,7 @@ RUN rm -f /etc/nova/nova-compute.conf 'ceph-common', 'genisoimage', 'iscsi-initiator-utils', + 'nfs-utils', 'targetcli', 'python-rtslib' ] %} @@ -64,6 +67,7 @@ RUN rm -f /etc/nova/nova-compute.conf 'qemu-utils', 'ceph-common', 'genisoimage', + 'nfs-common', 'open-iscsi', 'targetcli', 'python-rtslib' -- cgit v1.2.3