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

Clint Byrum clint at fewbar.com
Fri Jan 31 16:31:57 UTC 2014


Excerpts from Hugh Brock's message of 2014-01-31 04:53:11 -0800:
> > On Jan 31, 2014, at 1:30 AM, Clint Byrum <clint at fewbar.com> wrote:
> > 
> > Excerpts from Zane Bitter's message of 2014-01-30 19:30:40 -0800:
> >>> 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?
> > 
> > No, not as such. However I have also discussed with other users having
> > an OS::Heat::TemporaryServer which is deleted after a wait condition is
> > signaled (resurrected on each update). This would be useful for hosting
> > workflow code as the workflow doesn't actually need to be running all
> > the time. It would also be useful for heat resources that want to run
> > code that needs to be contained into their own VM/network such as the
> > port probe thing that came up a few weeks ago.
> > 
> > Good idea? I don't know. But it is the next logical step my brain keeps
> > jumping to for things like this.
> > 
> >> (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.
> > 
> > Totally agree. I think workflow and orchestration have an unusual
> > relationship though, because orchestration has its own workflow that
> > users will sometimes need to defer to. This is why we use wait
> > conditions, right?
> > 
> >> 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.
> > 
> > I think you've nudged me away from "optimistic" at least closer to
> > "ambivalent" as well.
> 
> We (RH tripleo folks) were having a similar conversation around Heat and stack upgrades the other day. There is unquestionably a workflow involving stack updates when a user goes to upgrade their overcloud, and it's awkward trying to shoehorn it into Heat (Steve Dake agreed). Our first thought was "Tuskar should do that," but our second thought was "Whatever the workflow service is should do that, and Tuskar should maybe provide a shorthand API for it."
> 
> I feel like we (tripleo) need to take a harder look at getting a working workflow thing available for our needs, soon...
> 

I agree that is a thought that enters my mind as well.

However, I don't know if we're so much shoe-horning the upgrade workflow
into Heat as we are making sure Heat's internal workflow is useful so
that users don't have to write their own workflow to make the expressed
stack a reality.

I'll be starting work on rolling updates for Heat soon. That will provide
users with a way to express that they'd like parallelizable updates to
a certain group to be controlled by a certain waitcondition state. That
feels like workflow because we know the implementation is definitely a
workflow. However, to the user it is just declaring the rules, they're
not actually deciding how to do it.

I would hope that having generic workflows inside heat would free users
from drudgery, and they can write workflows when the flow is sufficiently
complex.



More information about the OpenStack-dev mailing list