[openstack-dev] [Heat] How to model resources in Heat

Zane Bitter zbitter at redhat.com
Fri Jan 31 03:30:40 UTC 2014

On 30/01/14 16:54, Clint Byrum wrote:
> I'm pretty sure it is useful to model images in Heat.
> Consider this scenario:
> resources:
>    build_done_handle:
>      type: AWS::CloudFormation::WaitConditionHandle
>    build_done:
>      type: AWS::CloudFormation::WaitCondition
>      properties:
>        handle: {Ref: build_done_handle}
>    build_server:
>      type: OS::Nova::Server
>      properties:
>        image: build-server-image
>        userdata:
>          join [ "",
>            - "#!/bin/bash\n"
>            - "build_an_image\n"
>            - "cfn-signal -s SUCCESS "
>            - {Ref: build_done_handle}
>            - "\n"]
>    built_image:
>      type: OS::Glance::Image
>      depends_on: build_done
>      properties:
>        fetch_url: join [ "", ["http://", {get_attribute: [ build_server, fixed_ip ]}, "/image_path"]]
>    actual_server:
>      type: OS::Nova::Server
>      properties:
>        image: {Ref: built_image}
> Anyway, seems rather useful. Maybe I'm reaching.

Well, consider that when this build is complete you'll still have the 
server you used to build the image still sitting around. Of course you 
can delete the stack to remove it - and along with it will go the image 
in Glance. Still seem useful?

(I'm conveniently ignoring the fact that you could have set 
DeletionPolicy: Retain on the image to hack your way around this.)

What you're looking for is a workflow service (I think it's called 
Mistral this week?). A workflow service would be awesome, and Heat is 
pretty awesome, but Heat is not a workflow service.

So yeah, Glance images in Heat might be kinda useful, but at best as a 
temporary hack to fill in a gap because the Right Place to implement it 
doesn't exist yet. That's why I feel ambivalent about it.


More information about the OpenStack-dev mailing list