summaryrefslogtreecommitdiff
path: root/compose
diff options
context:
space:
mode:
authorSteven Dake <stdake@cisco.com>2015-03-21 15:13:32 -0700
committerSteven Dake <stdake@cisco.com>2015-03-22 08:54:53 -0700
commitf4fd47dc2cdb5eee6ac366788c25c2a6a21ca362 (patch)
treeca1db3dd254958b8dc6e289e6ce93a28ed866e37 /compose
parent3f036e3f9355aca39e4a28b74740df5342481920 (diff)
downloadkolla-f4fd47dc2cdb5eee6ac366788c25c2a6a21ca362.tar.gz
kolla-f4fd47dc2cdb5eee6ac366788c25c2a6a21ca362.zip
Make nova-compute-network use a data volume container
A data volume container is far superior to bind mounting the host's shared directories. It preserves the idempotency, immutability and declarative properties of the containers. The way this works in practice is that a data volume container is created. Then when the containers start they use LVM to access the filesystem where /var/lib/docker is contained. Then the container startup logic bindmounts the data volume stored on the host filesystem in /var/lib/docker/vfs/dir/ID. This prevents people with access to the host operating system from damaging the contents of the data container. It does mean that now we must use tools/stop to stop our containers rather than tools/cleanup-containers -f. This is a containers best practice. For more details see: https://docs.docker.com/userguide/dockervolumes/ Big credit goes to Danyeon Hansen for seeding this idea in the mariadb containers. Note occasionally docker-compose start/stop seems to not want to stop a container. This bug needs to be addressed upstream separately from our utilization of this best practice. Change-Id: Iaa1419f606e1b1b7a7560a095c49e79d643164f1
Diffstat (limited to 'compose')
-rw-r--r--compose/nova-compute-network.yml18
1 files changed, 10 insertions, 8 deletions
diff --git a/compose/nova-compute-network.yml b/compose/nova-compute-network.yml
index c9efa5fb2..299573ae4 100644
--- a/compose/nova-compute-network.yml
+++ b/compose/nova-compute-network.yml
@@ -1,3 +1,7 @@
+computedata:
+ image: kollaglue/centos-rdo-nova-compute-data
+ name: computedata
+
libvirt:
image: kollaglue/centos-rdo-nova-libvirt
name: libvirt
@@ -10,9 +14,8 @@ libvirt:
volumes:
- /run:/run
- /sys/fs/cgroup:/sys/fs/cgroup
- - /var/lib/nova:/var/lib/nova
- - /var/lib/libvirt:/var/lib/libvirt
- - /etc/libvirt/qemu:/etc/libvirt/qemu
+ volumes_from:
+ - computedata
novanetwork:
image: kollaglue/centos-rdo-nova-network
@@ -25,8 +28,8 @@ novanetwork:
volumes:
- /run:/run
- /sys/fs/cgroup:/sys/fs/cgroup
- - /var/lib/nova:/var/lib/nova
- - /var/lib/libvirt:/var/lib/libvirt
+ volumes_from:
+ - computedata
novacompute:
image: kollaglue/centos-rdo-nova-compute
@@ -39,6 +42,5 @@ novacompute:
volumes:
- /run:/run
- /sys/fs/cgroup:/sys/fs/cgroup
- - /var/lib/nova:/var/lib/nova
- - /var/lib/libvirt:/var/lib/libvirt
- - /etc/libvirt/qemu:/etc/libvirt/qemu
+ volumes_from:
+ - computedata