From 501610a70577921c4073e0592f730786e1d2b3fe Mon Sep 17 00:00:00 2001 From: weikeyou Date: Sun, 8 Apr 2018 17:26:43 +0800 Subject: [PATCH] Customizing the availability zone of each compute node is Ineffective Cloud administrators can customize the availability zone of each compute node by setting the following in the config file: [DEFAULT] default_availability_zone = my-zone When use "zun service-list", the availability-zone is always nova no matter what we set default_availability_zone to Change-Id: I3f1c8edd68ea089b7b40c30fac92d7dbbdf4fa59 Closes-Bug: #1762149 --- zun/servicegroup/zun_service_periodic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zun/servicegroup/zun_service_periodic.py b/zun/servicegroup/zun_service_periodic.py index 03720c63d..6e760bb77 100644 --- a/zun/servicegroup/zun_service_periodic.py +++ b/zun/servicegroup/zun_service_periodic.py @@ -32,6 +32,7 @@ class ZunServicePeriodicTasks(periodic_task.PeriodicTasks): self.zun_service_ref = None self.host = conf.host self.binary = binary + self.availability_zone = conf.default_availability_zone super(ZunServicePeriodicTasks, self).__init__(conf) @periodic_task.periodic_task(run_immediately=True) @@ -50,6 +51,7 @@ class ZunServicePeriodicTasks(periodic_task.PeriodicTasks): self.zun_service_ref = objects.ZunService( ctx, **zun_service_dict) self.zun_service_ref.create() + self.zun_service_ref.availability_zone = self.availability_zone self.zun_service_ref.report_state_up()