Ask Your Question

Fail Stack Creation if my resource creation fails

asked 2016-08-30 06:53:45 -0500

divinedragon gravatar image

I am creating a resource like below

    type: OS::Nova::Server
        name: ServerHeatTemplate
        image: { get_param: image }
        flavor: { get_param: flavor }
        admin_pass: { get_param: admin_pass }
            - network: { get_param : public_net }
        user_data_format: RAW
                    __db_root_password__ : { get_param : db_root_password }
                template: |

                    echo "DB Password - __db_root_password__" > /tmp/dbpassword.txt

Now, when I create this stack, I see the status of the stack is marked as Create Complete, but my VM is still coming up. Also, this is very naive example, but let's say I wanted to install some packages and they fail to install, I don't want my stack to show that resource provisioning was successful.

Here are my 2 questions:

  • How do I have the stack creation wait for the VM to successfully create and then show status as Create Complete?
  • Is there a way to notify the stack creation process that my VM creation has failed due to my failed packages, and correspondingly mark the stack creation as failed?
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-09-20 11:52:35 -0500

zaneb gravatar image

Use an OS::Heat::WaitCondition resource to wait for the server to boot. You can signal success or failure back to the resource from your user_data script.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-08-30 06:53:45 -0500

Seen: 134 times

Last updated: Sep 20 '16