From a425ae02af7a25aa3654e644dc966d07f408a60c Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Mon, 12 Nov 2012 18:31:16 +0000 Subject: [PATCH] heat engine : append watch server url to instance userdata Append url for watch server to instance userdata, which avoids post-install sed mangling in the template, and will make it easier to transparently switch to a different metric service Change-Id: I59b9b7efcd75d44e88ebe0a116a9ce1e3ef20c14 Signed-off-by: Steven Hardy --- docs/GettingStarted.rst | 1 + etc/heat/heat-engine.conf | 8 ++++++++ heat/common/config.py | 3 +++ heat/engine/resources/instance.py | 3 +++ 4 files changed, 15 insertions(+) diff --git a/docs/GettingStarted.rst b/docs/GettingStarted.rst index e59e41b9..b630b4e7 100644 --- a/docs/GettingStarted.rst +++ b/docs/GettingStarted.rst @@ -194,6 +194,7 @@ The heat engine configuration file should be updated with the address of the bri :: sudo sed -i -e "/heat_metadata_server_url/ s/127\.0\.0\.1/${BRIDGE_IP}/" /etc/heat/heat-engine.conf sudo sed -i -e "/heat_waitcondition_server_url/ s/127\.0\.0\.1/${BRIDGE_IP}/" /etc/heat/heat-engine.conf + sudo sed -i -e "/heat_watch_server_url/ s/127\.0\.0\.1/${BRIDGE_IP}/" /etc/heat/heat-engine.conf Launch the Heat services ------------------------ diff --git a/etc/heat/heat-engine.conf b/etc/heat/heat-engine.conf index 462835be..172aa244 100644 --- a/etc/heat/heat-engine.conf +++ b/etc/heat/heat-engine.conf @@ -29,6 +29,14 @@ heat_metadata_server_url = http://127.0.0.1:8000 # NOTE : change this from 127.0.0.1 !! heat_waitcondition_server_url = http://127.0.0.1:8002 +# URL for instances to connect for publishing metric +# data (ie via cfn-push-stats) +# e.g the IP of the bridge device connecting the +# instances with the host and the bind_port of +# the heat-api-cloudwatch API +# NOTE : change this from 127.0.0.1 !! +heat_watch_server_url = http://127.0.0.1:8003 + # Log to this file. Make sure the user running heat-api has # permissions to write to this file! log_file = /var/log/heat/engine.log diff --git a/heat/common/config.py b/heat/common/config.py index abd0c04a..a89ea9bc 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -83,6 +83,9 @@ cfg.StrOpt('heat_metadata_server_url', cfg.StrOpt('heat_waitcondition_server_url', default="", help='URL of the Heat waitcondition server'), +cfg.StrOpt('heat_watch_server_url', + default="", + help='URL of the Heat cloudwatch server'), cfg.StrOpt('heat_stack_user_role', default="heat_stack_user", help='Keystone role for heat template-defined users'), diff --git a/heat/engine/resources/instance.py b/heat/engine/resources/instance.py index 2f2422e6..6ffc8dda 100644 --- a/heat/engine/resources/instance.py +++ b/heat/engine/resources/instance.py @@ -181,6 +181,9 @@ class Instance(resource.Resource): attachments.append((json.dumps(self.metadata), 'cfn-init-data', 'x-cfninitdata')) + attachments.append((cfg.CONF.heat_watch_server_url, + 'cfn-watch-server', 'x-cfninitdata')) + attachments.append((cfg.CONF.heat_metadata_server_url, 'cfn-metadata-server', 'x-cfninitdata')) -- 2.45.2