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 ...
Your snippet looks correct. What part is actually failing?
hi zaneb - thanks for the attention.
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.