New Question
0

Sending a signal to OS::Heat::WaitCondition does not appear to work

asked 2016-11-23 20:50:04 +0300

ks gravatar image

I am attempting to spawn Windows instances via HEAT template and trying to trigger the wait condition from userdata. It does not matter what timeout value I set for the waitcondition, it still times out with

Resource CREATE failed: WaitConditionTimeout: resources.win10.resources.wait_condition: 0 of 1 received

Looking at the logs, the signal does appear to be sent correctly. Here is the relevant bit

Init\Python27\lib\site-packages\cloudbaseinit\plugins\common\userdata.py:43
2016-11-23 18:10:23.539 1748 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2016-11-23 18:12:33.683 1748 DEBUG cloudbaseinit.plugins.common.userdatautils [-] User_data stdout:


StatusCode        : 200
StatusDescription : OK
Content           : null
RawContent        : HTTP/1.1 200 OK
                    X-Openstack-Request-Id: req-c269e8bf-ccc6-4cfc-82c3-5b4787164902
                    Connection: close
                    Content-Length: 4
                    Content-Type: application/json; charset=UTF-8
                    Date: Wed, 23 Nov 2016 18:12:33 ...
Forms             : 
Headers           : {[X-Openstack-Request-Id, req-c269e8bf-ccc6-4cfc-82c3-5b4787164902], [Connection, close], 
                    [Content-Length, 4], [Content-Type, application/json; charset=UTF-8]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : 
RawContentLength  : 4

Here is what my HEAT template looks like.

resources:
  wait_condition:
    type: OS::Heat::WaitCondition
    properties:
      handle: {get_resource: wait_handle}
      count: 1
      timeout: 600

  wait_handle:
    type: OS::Heat::WaitConditionHandle

  port:
    type: OS::Neutron::Port
    properties:
      network: { get_param: private_network }

  server1:
    type: OS::Nova::Server
    properties:
      availability_zone: nova
      name: win10
      flavor: {get_param: flavor }
      image: { get_param: image }
      key_name: { get_param: key_name }
      networks:
        - port: { get_resource: port }
      user_data_format: RAW
      user_data:
        str_replace:
          template: |
            #ps1_sysnative
            Invoke-WebRequest -Uri "$wc_endpoint" -Headers @{"X-Auth-Token" = "$wc_token"} -ContentType "application/json" -Body '{"Status" : "SUCCESS"}' -Method "POST" -UseBasicPa    rsing
          params:
            $wc_endpoint: { get_attr: [wait_handle, endpoint] }
            $wc_token: { get_attr: [wait_handle, token] }

Any idea why it's not working?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2016-11-24 02:06:01 +0300

avladu gravatar image

updated 2016-11-24 02:08:39 +0300

Hello,

here you have some extensive examples on how to make heat signal work from PowerShell: https://github.com/openstack/heat-tem...

https://github.com/openstack/heat-tem...

Thanks,

Adrian Vladu

edit flag offensive delete link more

Comments

Well, I had looked at those examples. Granted, I am not super versed in PowerShell but the Invoke-WebRequest in my example should just work, no?

ks gravatar imageks ( 2016-11-30 02:19:26 +0300 )edit

Hello, yes, it should work as long as you create the http payload accordingly.

avladu gravatar imageavladu ( 2016-12-06 10:17:41 +0300 )edit

Your Answer

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

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2016-11-23 20:50:04 +0300

Seen: 201 times

Last updated: Nov 24 '16