From 0f5e065855903a7ce68c27f0504388e4ee31b46d Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Sat, 7 Sep 2019 20:34:58 +0000 Subject: [PATCH] Configure Zun for Placement (Train+) After the integration with placement [1], we need to configure how zun-compute is going to work with nova-compute. * If zun-compute and nova-compute run on the same compute node, we need to set 'host_shared_with_nova' as true so that Zun will use the resource provider (compute node) created by nova. In this mode, containers and VMs could claim allocations against the same resource provider. * If zun-compute runs on a node without nova-compute, no extra configuration is needed. By default, each zun-compute will create a resource provider in placement to represent the compute node it manages. [1] https://blueprints.launchpad.net/zun/+spec/use-placement-resource-management Change-Id: I2d85911c4504e541d2994ce3d48e2fbb1090b813 --- ansible/roles/zun/templates/zun.conf.j2 | 3 +++ doc/source/reference/compute/zun-guide.rst | 1 + tests/templates/globals-default.j2 | 1 + 3 files changed, 5 insertions(+) diff --git a/ansible/roles/zun/templates/zun.conf.j2 b/ansible/roles/zun/templates/zun.conf.j2 index 8d179a994c..d38b3c90af 100644 --- a/ansible/roles/zun/templates/zun.conf.j2 +++ b/ansible/roles/zun/templates/zun.conf.j2 @@ -98,6 +98,9 @@ lock_path = /var/lib/zun/tmp policy_file = {{ zun_policy_file }} {% endif %} +[compute] +host_shared_with_nova = {{ inventory_hostname in groups['compute'] and enable_nova | bool and not enable_nova_fake | bool }} + [websocket_proxy] wsproxy_host = {{ api_interface_address }} wsproxy_port = {{ zun_wsproxy_port }} diff --git a/doc/source/reference/compute/zun-guide.rst b/doc/source/reference/compute/zun-guide.rst index 17e9b34c9e..d0252fa82c 100644 --- a/doc/source/reference/compute/zun-guide.rst +++ b/doc/source/reference/compute/zun-guide.rst @@ -20,6 +20,7 @@ following variables: enable_zun: "yes" enable_kuryr: "yes" enable_etcd: "yes" + enable_placement: "yes" docker_configure_for_zun: "yes" Docker reconfiguration requires reboostrapping before deploy. diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 1de1708595..37d86ac5eb 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -67,6 +67,7 @@ enable_cinder_backend_lvm: "yes" enable_zun: "yes" enable_kuryr: "yes" enable_etcd: "yes" +enable_placement: "yes" docker_configure_for_zun: "yes" {% endif %}