[openstack-dev] [Heat] Long-term, how do we make heat image/flavor name agnostic?

Steve Baker sbaker at redhat.com
Wed Jul 17 22:00:40 UTC 2013

On 07/18/2013 08:53 AM, Gabriel Hurley wrote:
> I spent a bunch of time working with and understanding Heat in H2, and I find myself with one overarching question which I wonder if anyone's thought about or even answered already...
> At present, the CloudFormation template format is the first-class means of doing things in Heat. CloudFormation was created for Amazon, and Amazon has this massive convenience of having a (more or less) static list of images and flavors that they control. Therefore in CloudFormation everything is specified by a unique, specific name.
> OpenStack doesn't have this luxury. We have as many image and flavor names as we have deployments. Now, there are simple answers...
>   1. Name everything the way Amazon does, or
>   2. Alter your templates.
> But personally, I don't like either of these options. I think in the long term we win at platform/ecosystem by making it possible to take a template off the internet and having it work on *any* OpenStack cloud.
> To get there, we need a system that chooses images based on metadata (platform, architecture, distro) and flavors based on actual minimum requirements.
> Has anyone on the Heat team thought about this? Are there efforts in the works to alleviate this? Am I missing something obvious?
Yes, each openstack cloud could have completely different flavors and
images available. My current approach is to not have a Mappings section
at all and just specify the flavor and image on launch, ie:

    Type: String
    Type: String
    Type: String
    Type: AWS::EC2::Instance
      ImageId: {Ref: ImageId}
      InstanceType: {Ref: InstanceType}
      KeyName: {Ref: KeyName}

InstanceType and ImageId could even be specified in the environment file
that is specified on launch, so they don't need to be specified in the
launch command, ie env.yaml:
  KeyName: heat_key
  InstanceType: m1.micro
  ImageId: ubuntu-vm-heat-cfntools-tempest

heat stack-create mystack -e env.yaml --template-file=mytemplate.yaml

More information about the OpenStack-dev mailing list