Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot! Eric

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot! Eric

snippet as below:

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            /usr/bin/cfn-signal -s SUCCESS $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot! Eric

I tried snippet as below:below:

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            /usr/bin/cfn-signal -s SUCCESS $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

It is not working as

DEBUG [2014-07-09 10:34:53,303] Return code of 7 after executing: '['su', 'root', '-c', 'curl -X PUT -H \'Content-Type:\' --data-binary \'{"Status": "FAILURE", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}\' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2Faf53f4d2-f9b7-47c1-94c4-c1106a9c568d%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T14%3A33%3A49Z"']'

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot! Eric

I tried snippet as below:

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            /usr/bin/cfn-signal -s SUCCESS true $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

It is the user data execution yield no error but the VM "second" can not working as the instantiate.

/usr/bin/cfn-signal -s true http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=1d9b6cc686994b569c78401989f377b8&SignatureVersion=2&Signature=aJeIaDcktR2uUPpb6BLqvVA3jVGCBTw364FxxWGXa%2Bk%3D 
echo $?
DEBUG [2014-07-09 10:34:53,303] Return code of 7 after executing: '['su', 'root', '-c', 'curl 15:33:43,807] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code=None, reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z') 
DEBUG [2014-07-09 15:33:43,807] Running command: curl -X PUT -H \'Content-Type:\' 'Content-Type:' --data-binary \'{"Status": "FAILURE", '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}\' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2Faf53f4d2-f9b7-47c1-94c4-c1106a9c568d%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T14%3A33%3A49Z"']'
"00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z"

Provision done: 2014-07-09 15:33:43.959063

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).sequence).

THANKS A lot! Eric

I tried snippet as below:

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            **# TIME-CONSUMING TASKS here**
            /usr/bin/cfn-signal -s true $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

the user data execution yield no error but the VM "second" can not the instantiate.

/usr/bin/cfn-signal -s true http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=1d9b6cc686994b569c78401989f377b8&SignatureVersion=2&Signature=aJeIaDcktR2uUPpb6BLqvVA3jVGCBTw364FxxWGXa%2Bk%3D 
echo $?
DEBUG [2014-07-09 15:33:43,807] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code=None, reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z') 
DEBUG [2014-07-09 15:33:43,807] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z"

Provision done: 2014-07-09 15:33:43.959063

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot! Eric

I tried snippet as below: Not working for me. From the log seem the signal/curl did not yield any error. Though "first_wait" can not finish the instantiation and "second" never get instantiated.

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            **# TIME-CONSUMING TASKS here**
            /usr/bin/cfn-signal -s true $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

the user data execution yield no error but the VM "second" can not the instantiate.

/usr/bin/cfn-signal -s true http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=1d9b6cc686994b569c78401989f377b8&SignatureVersion=2&Signature=aJeIaDcktR2uUPpb6BLqvVA3jVGCBTw364FxxWGXa%2Bk%3D 
echo $?
DEBUG [2014-07-09 15:33:43,807] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code=None, reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z') 
DEBUG [2014-07-09 15:33:43,807] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z"

Provision done: 2014-07-09 15:33:43.959063

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot! lot!

Eric

I tried snippet as below: Not working for me. From the log seem the signal/curl did not yield any error. Though "first_wait" can not finish the instantiation and "second" never get instantiated.

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            **# TIME-CONSUMING TASKS here**
            /usr/bin/cfn-signal -s true $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

the user data execution yield no error but the VM "second" can not the instantiate.

/usr/bin/cfn-signal -s true http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=1d9b6cc686994b569c78401989f377b8&SignatureVersion=2&Signature=aJeIaDcktR2uUPpb6BLqvVA3jVGCBTw364FxxWGXa%2Bk%3D 
echo $?
DEBUG [2014-07-09 15:33:43,807] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code=None, reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z') 
DEBUG [2014-07-09 15:33:43,807] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z"

Provision done: 2014-07-09 15:33:43.959063

If I manually run the command in the vm... Same result.

[root@h01-first-4uc2my6jgaxh /]# /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60&SignatureVersion=2&Signature=fXdSTNue0kH8OCjAdU%2BGR72uQacMIsgA7sjWImDegw8%3D
[1] 4817
[2] 4818
[3] 4819
[4] 4820
[root@h01-first-4uc2my6jgaxh /]# DEBUG [2014-07-22 10:36:30,191] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code='0', reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z')
DEBUG [2014-07-22 10:36:30,191] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z"

[1]   Done                    /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z
[2]   Done                    SignatureMethod=HmacSHA256
[3]-  Done                    AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60
[4]+  Done                    SignatureVersion=2
[root@h01-first-4uc2my6jgaxh /]# echo $?
0

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot!

Eric

I tried snippet as below: Not working for me. From the log seem the signal/curl did not yield any error. Though "first_wait" can not finish the instantiation and "second" never get instantiated.

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            **# TIME-CONSUMING TASKS here**
            /usr/bin/cfn-signal -s true $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

the user data execution yield no error but the VM "second" can not the instantiate.

/usr/bin/cfn-signal -s true http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=1d9b6cc686994b569c78401989f377b8&SignatureVersion=2&Signature=aJeIaDcktR2uUPpb6BLqvVA3jVGCBTw364FxxWGXa%2Bk%3D 
echo $?
DEBUG [2014-07-09 15:33:43,807] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code=None, reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z') 
DEBUG [2014-07-09 15:33:43,807] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z"

Provision done: 2014-07-09 15:33:43.959063

If I manually run the command in the vm... Same result.result. http://152.148.165.80:8000/v1 is Cloudformation address

[root@h01-first-4uc2my6jgaxh /]# /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60&SignatureVersion=2&Signature=fXdSTNue0kH8OCjAdU%2BGR72uQacMIsgA7sjWImDegw8%3D
[1] 4817
[2] 4818
[3] 4819
[4] 4820
[root@h01-first-4uc2my6jgaxh /]# DEBUG [2014-07-22 10:36:30,191] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code='0', reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z')
DEBUG [2014-07-22 10:36:30,191] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z"

[1]   Done                    /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z
[2]   Done                    SignatureMethod=HmacSHA256
[3]-  Done                    AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60
[4]+  Done                    SignatureVersion=2
[root@h01-first-4uc2my6jgaxh /]# echo $?
0

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot!

Eric

I tried snippet as below: Not working for me. From the log seem the signal/curl did not yield any error. Though "first_wait" can not finish the instantiation and "second" never get instantiated.

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            **# TIME-CONSUMING TASKS here**
            /usr/bin/cfn-signal -s true $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

the user data execution yield no error but the VM "second" can not the instantiate.

/usr/bin/cfn-signal -s true http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=1d9b6cc686994b569c78401989f377b8&SignatureVersion=2&Signature=aJeIaDcktR2uUPpb6BLqvVA3jVGCBTw364FxxWGXa%2Bk%3D 
echo $?
DEBUG [2014-07-09 15:33:43,807] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code=None, reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z') 
DEBUG [2014-07-09 15:33:43,807] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z"

Provision done: 2014-07-09 15:33:43.959063

If I manually run the command in the vm... Same result. (please note that http://152.148.165.80:8000/v1 is Cloudformation address address)

[root@h01-first-4uc2my6jgaxh /]# /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60&SignatureVersion=2&Signature=fXdSTNue0kH8OCjAdU%2BGR72uQacMIsgA7sjWImDegw8%3D
[1] 4817
[2] 4818
[3] 4819
[4] 4820
[root@h01-first-4uc2my6jgaxh /]# DEBUG [2014-07-22 10:36:30,191] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code='0', reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z')
DEBUG [2014-07-22 10:36:30,191] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z"

[1]   Done                    /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z
[2]   Done                    SignatureMethod=HmacSHA256
[3]-  Done                    AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60
[4]+  Done                    SignatureVersion=2
[root@h01-first-4uc2my6jgaxh /]# echo $?
0

wait condition in HOT heat template

Hi all,

Anyone kindly send me one copy of HOT heat template that utilize the wait conditions (to control the boot sequence).

THANKS A lot!

Eric

I tried snippet as below: Not working for me. From the log seem the signal/curl did not yield any error. Though "first_wait" can not finish the instantiation and "second" never get instantiated.

 first:
    type: OS::Nova::Server
    properties:
      key_name: PCM-I
      flavor: m1.small
      user_data:
        str_replace:
          template: |
            #!/bin/bash -v
            **# TIME-CONSUMING TASKS here**
            /usr/bin/cfn-signal -s true $wait_handle
          params:
            $wait_handle: {get_resource: first_wait_handle}
  first_wait_handle:
    type: AWS::CloudFormation::WaitConditionHandle
  first_wait:
    type: AWS::CloudFormation::WaitCondition
    depends_on: first
    properties:
      Handle: {get_resource: first_wait_handle}
      Timeout: 1000
  second:
    type: OS::Nova::Server
    depends_on: first_wait
    properties:
      key_name: PCM-I
      image: v37
      flavor: m1.small
      networks:
        - port: { get_resource: server2_port }
      user_data: |
        #!/bin/bash
        echo "second is up"

the user data execution yield no error but the VM "second" can not the instantiate.

/usr/bin/cfn-signal -s true http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=1d9b6cc686994b569c78401989f377b8&SignatureVersion=2&Signature=aJeIaDcktR2uUPpb6BLqvVA3jVGCBTw364FxxWGXa%2Bk%3D 
echo $?
DEBUG [2014-07-09 15:33:43,807] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code=None, reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z') 
DEBUG [2014-07-09 15:33:43,807] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F2502b22d-68fa-4f11-9db3-fdd157ba6df7%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-09T19%3A32%3A57Z"

Provision done: 2014-07-09 15:33:43.959063

If I manually run the command in the vm... Same result. (please note that http://152.148.165.80:8000/v1 is Cloudformation address)

[root@h01-first-4uc2my6jgaxh /]# /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60&SignatureVersion=2&Signature=fXdSTNue0kH8OCjAdU%2BGR72uQacMIsgA7sjWImDegw8%3D
[1] 4817
[2] 4818
[3] 4819
[4] 4820
[root@h01-first-4uc2my6jgaxh /]# DEBUG [2014-07-22 10:36:30,191] cfn-signal called Namespace(data='Application has completed configuration.', exit=None, exit_code='0', reason='Configuration Complete', success='true', unique_id='00000', url='http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z')
DEBUG [2014-07-22 10:36:30,191] Running command: curl -X PUT -H 'Content-Type:' --data-binary '{"Status": "SUCCESS", "Reason": "Configuration Complete", "Data": "Application has completed configuration.", "UniqueId": "00000"}' "http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z"

[1]   Done                    /usr/bin/cfn-signal -e 0 http://152.148.165.80:8000/v1/waitcondition//arn%3Aopenstack%3Aheat%3A%3A782fc66f9e654fc887ff8c41f0539125%3Astacks%2Fh01%2F92dc4efb-2372-4f09-93cf-79cd6efbc69c%2Fresources%2Ffirst_wait_handle?Timestamp=2014-07-22T13%3A41%3A49Z
[2]   Done                    SignatureMethod=HmacSHA256
[3]-  Done                    AWSAccessKeyId=656537dd84064705a73a8e9bb9c5dd60
[4]+  Done                    SignatureVersion=2
[root@h01-first-4uc2my6jgaxh /]# echo $?
0

Some further information:

I tried the code in another lab that I have the admin privilege and the access to the heat log. here is what I got in the log. Any hints/clue?

2014-07-25 01:59:49.541 718 DEBUG heat.api.middleware.version_negotiation [-] Processing request: PUT /v1/waitcondition/arn:openstack:heat::857a11548061407da9bf9b67fa97577e:stacks/h02/e5574f56-d0bb-4615-a9ec-f3fdf947923f/resources/first_wait_handle Accept: */* process_request /usr/lib/python2.7/dist-packages/heat/api/middleware/version_negotiation.py:53
2014-07-25 01:59:49.542 718 DEBUG heat.api.middleware.version_negotiation [-] Matched versioned URI. Version: 1.0 process_request /usr/lib/python2.7/dist-packages/heat/api/middleware/version_negotiation.py:68
2014-07-25 01:59:49.542 718 INFO heat.api.aws.ec2token [-] Checking AWS credentials..
2014-07-25 01:59:49.542 718 INFO heat.api.aws.ec2token [-] No AWS Signature found.
2014-07-25 01:59:49.543 718 DEBUG root [-] XML response : <ErrorResponse><Error><Message>The request signature does not conform to AWS standards</Message><Code>IncompleteSignature</Code><Type>Sender</Type></Error></ErrorResponse> to_xml /usr/lib/python2.7/dist-packages/heat/common/wsgi.py:619