If you wanted to build a house, a block, or a neighborhood, you’d start with a blueprint. Some authoritative document that you rely on to determine how each component should look and operate to turn your vision into a bustling neighborhood with houses, cafes, pizzerias, schools, and businesses. The complexity of working with OpenStack Orchestration (Heat) templates often keeps people away from them. In this multipart series on Heat Orchestration templates (also known as “Heat Stacks”), we’re going to peel the onion one layer at a time and demystify some of the capabilities of using Heat Stacks. We will create blueprints for those houses, blocks and neighborhoods, and then we’ll build them. If you are already familiar with Red Hat OpenStack Platform, have an operating OpenStack environment of any size, and are generally familiar with how it works, this is for you.
Let’s feel the heat:
Simply put, Heat Orchestration templates are architectural visions or plans for building a house, a block, or an entire neighborhood. The yaml formatted text document used for defining this is called a Heat template.
Heat templates can define as little, or as much as you wish them to. They are a blank canvas upon which you will draft the plans. It’s important to note that it’s up to you to define the scale and complexity. A Heat template can define a single server that joins an existing OpenStack Networking (Neutron), or it can define hundreds of them, each with encrypted cinder volumes, connected to distinct networks and routers, and invoke features of OpenStack APIs such as LBaaSv2 or FWaaS. It can also manage the lifecycle of these entities, and modify or destroy them as a set.
Taking a look at a Heat template:
-- It’s always better to approach a porcupine from the front.
A Heat template has three basic sections:
-
Version - Defined as heat_template_version, this looks very much like a date, because it is. As the Heat specification matured, newer versions were cut that contain more and more functionality. If you attempt to use a feature that didn’t exist in that version, the orchestration engine will bark about it and send you back to the drawing board.
-
Parameters - This is an area for variables that you want to define. Our template has two: key_name is a definition of what ssh key to build the server with, and network_name is which neutron network to put the server on.
-
Resources - The resources section defines the objects or assets to be created. Here you define the type of object (OS::Nova::Server) and at least the minimum required pieces of information to build it. The Heat specification can tell you what is required or available. There are many different resource types available. Check out the full list of resource types.
-
In our example, we are specifying the minimum for flavor, image, and network. We went beyond that and included an ssh key, which we defined as a parameter. It is called by the parameter name here:
key_name: {get_param: key_name}
That’s a basic template. Now let’s run it and observe the result:
[root@osp11 heat(p)]# openstack stack create -t single_server.yaml SINGLE_SERVER
You’ll see the server appear inside the assigned network, after which we will open up a console and show it booting. This animated gif is how it looks in real time.
In summary, a Heat template is a document that acts as a blueprint for creating what is called a stack in the parlance of OpenStack. A stack can contain and use any entity type that can live in OpenStack, including servers, networks, subnets, routers, LBaaSv2 components and even single network interfaces. Heat is even used by Red Hat OpenStack Platform director to deploy the overcloud.
This demonstration teased out a simple example of a Heat template, and in the next example, I will demonstrate a more realistic use case. As a TAM, I often have to reproduce my customer’s issues to analyze technical problems or prove solutions for them. This can require a huge variety of Red Hat Enterprise Linux instances, all at different versions and configurations. Let’s take a look at how I use a single Heat template to spin up an entire ecosystem of reproducers off a single heat template and be ready to work in a short period of time. You’ll see several versions of Red Hat Enterprise Linux, Fedora, and even a Windows Server materialize.
At 365 lines, this Heat template is much more robust, and exercises a lot of extended functionality such as assigning floating IP addresses and including user data to configure each server as my use cases demand. However, it still exercises the same fundamental concepts. Actually, it exercises a lot of them.
Imagine the benefits of your application deploying this way instead of being handcrafted in the “old world style” each and every deployment. The overarching principle of Heat is that it is definable the first time, and repeatable as many times as you want. See the full template for this example here.
Please join me on our next adventure, which will exercise more advanced components of Red Hat OpenStack Platform through Heat templates.
Freddy Wissing is a senior Cloud and Platform Technical Account Manager (TAM) in the Northeast region. He has expertise in Red Hat Enterprise Linux and OpenStack. Find more posts by Freddy at https://www.redhat.com/en/blog/authors/freddy-wissing
A Red Hat TAM is a specialized product expert who works collaboratively with IT organizations to strategically plan for successful deployments and help realize optimal performance and growth. The TAM is part of Red Hat’s world-class Customer Experience and Engagement organization and provides proactive advice and guidance to help you identify and address potential problems before they occur. Should a problem arise, your TAM will own the issue and engage the best resources to resolve it as quickly as possible with minimal disruption to your business.
Connect with TAMs at a Red Hat Convergence event near you! Red Hat Convergence is a free, invitation-only event offering technical users an opportunity to deepen their Red Hat product knowledge and discover new ways to apply open source technology to meet their business goals. These events travel to cities around the world to provide you with a convenient, local one-day experience to learn and connect with Red Hat experts and industry peers.
저자 소개
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.