Ask Your Question

How to debug scripts at Heat's SoftwareConfig resource

asked 2014-07-15 15:54:31 -0500 gravatar image


I found it hard to debug scripts that were declared at SofewareConfig resource. I want to know what is the general practices to debug a user-provided script at SoftwareConfig. At least, I need to check the output of executing the script. Any help will be appreciated. Thanks.

edit retag flag offensive close merge delete



You can also go to the /var/lib/heat-config/heat-config-script and execute your script (it is visible in this directory as file (with ID as name) e.g. 6444.....

ZJ gravatar imageZJ ( 2014-12-12 01:56:42 -0500 )edit

4 answers

Sort by ยป oldest newest most voted

answered 2014-12-02 21:46:40 -0500

Steve Baker gravatar image

Currently if a deployment resource remains IN_PROGRESS (then times out) the only way to diagnose the issue is to ssh into your server and trigger os-collect-config manually to see what is actually happening. To do this, ssh into your server and run the following:

sudo service os-collect-config stop
sudo os-collect-config --force --one-time --debug

This will do a full metadata poll and then eventually run /usr/libexec/os-refresh-config/configure.d/55-heat-config which will in turn run the specified hook with your deployment data. Generally you should see if there is a problem with your config, or with the networking to signal back to heat.

Throughout the Kilo development cycle there will be many improvements to the debuggability of software deployment resources. Some of these improvements will happen in the hooks or python-heatclient, so they will also be available in Juno and Icehouse heat. I'll update this answer as they become available.

edit flag offensive delete link more


Thanks. The command is useful, but it is better to have the outputs logged somewhere in the OS. As a result, we don't need to manually re-run the command, which is impossible in a CI system (i.e. gate).

hongbin034 gravatar imagehongbin034 ( 2015-11-27 17:19:06 -0500 )edit

Thanks Steve. I found my problem with the deug command. Also, does the community have plans to save the debug information to a log file?

fengbeihong gravatar imagefengbeihong ( 2016-11-01 03:39:09 -0500 )edit

answered 2016-04-21 18:10:22 -0500

Generally scripts and yaml will be fine. Sometimes VM doesn't resolve the controller(heat-cfn) host name which is metadata url. So, either try to resolve that(using script by appending values to /etc/hosts) or change heat_metadata_server_url in /etc/heat/heat.conf and restart heat-api and heat-engine services. Re-deploy the start again.

To debug Login to VM sudo os-collect-config --force --one-time --debug

Above will generate a dump. look for phase configure. Pasting the logs snippet below. Just FYI

[2016-04-21 22:52:56,011] (os-refresh-config) [INFO] Completed phase pre-configure [2016-04-21 22:52:56,012] (os-refresh-config) [INFO] Starting phase configure dib-run-parts Thu Apr 21 22:52:56 UTC 2016 Running /usr/libexec/os-refresh-config/configure.d/20-os-apply-config [2016/04/21 10:52:56 PM] [INFO] writing /var/run/heat-config/heat-config [2016/04/21 10:52:56 PM] [INFO] writing /etc/os-collect-config.conf [2016/04/21 10:52:56 PM] [INFO] success dib-run-parts Thu Apr 21 22:52:56 UTC 2016 20-os-apply-config completed dib-run-parts Thu Apr 21 22:52:56 UTC 2016 Running /usr/libexec/os-refresh-config/configure.d/55-heat-config [2016-04-21 22:52:56,440] (heat-config) [WARNING] Skipping config 02fbc622-7fb8-482d-8bc1-9f64d7a96c33, already deployed [2016-04-21 22:52:56,440] (heat-config) [WARNING] To force-deploy, rm /var/lib/heat-config/deployed/02fbc622-7fb8-482d-8bc1-9f64d7a96c33.json dib-run-parts Thu Apr 21 22:52:56 UTC 2016 55-heat-config completed

Check content present in /var/run/heat-config/heat-config, If it's empty look the metadata in /etc/os-collect-config.conf

This must exactly point where the issue is

edit flag offensive delete link more

answered 2014-11-24 22:30:25 -0500

cmyster gravatar image

Depends on the type of the script. If it is a bash script for instance, you might want to add logs to various operations or just set +x inside the script and dump the output to a file. I guess I might be more helpful if I knew more about what you were trying to do.

edit flag offensive delete link more

answered 2015-06-18 04:12:26 -0500

matthieu jacquart gravatar image

I try to run tyou cmd, but i don't have this service in my server. What you call server ? The VM target of sofwareconfig or heat server ? For use software deployment , i need a specific VM iso ?

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2014-07-15 15:54:31 -0500

Seen: 5,241 times

Last updated: Apr 21 '16