TOSCA Cloud Orchestration for Beginners
Get a beginner introduction to Topology and Orchestration Specification for Cloud Applications, its basic concepts, how it's used, and why it's important to Cloudify.
Join the DZone community and get the full member experience.
Join For FreeThis article aims to introduce TOSCA (Topology and Orchestration Specification for Cloud Applications) in the simplest of terms, so that users understand what it is, why it’s important to Cloudify, and some of its basic concepts.
What is TOSCA in a nutshell?
First, TOSCA is a specification that aims to standardize how we describe software applications and everything that is required for them to run in the “cloud”.
This means that TOSCA provides a way to describe not only an application, but also its dependencies and supporting (cloud) infrastructure.
What are the basic concepts of TOSCA?
There are two basic building blocks in TOSCA: nodes and relationships.
A node can be an infrastructure component, like a subnet, a network, a server (it can even represent a cluster of servers), or it can be a software component, like a service or a runtime environment.
Meanwhile, a relationship describes how nodes are connected to one another.
TOSCA has the notion of types.
For example, a “compute” node, which represents a resource with a CPU. These types can be used in “service templates”, or, as they are called in Cloudify, “blueprints”.
In the blueprint, a node type is used in a “node template”. So in Cloudify, a server could look like this:
some_virtual_host:
type: cloudify.nodes.Compute
This is a node template named “some_virtual_host”, and it is of the node type “cloudify.nodes.Compute”.
Both nodes and relationships may have programmable implementations, so that an orchestrator, such as Cloudify, can read their definition in the blueprint, and call certain actions.
So for example, in Cloudify, this can represented thusly:
some_virtual_host:
type: cloudify.nodes.Compute
interfaces:
cloudify.interfaces.lifecycle:
create: scripts/create.sh
Base types, whether they are node types or relationship types, can be derived by user to create new types. Here we demonstrate a hypothetical derivation of the Compute type into a “BladeServer” type.
node_types:
cloudify.nodes.BladeServer:
derived_from: cloudify.nodes.Compute
interfaces:
cloudify.interfaces.lifecycle:
create: scripts/automation/create.sh
How is Cloudify Related to TOSCA?
In a market of young cloud orchestration tools and products, Cloudify aims to be the best that is implementing this standard.
Cloudify’s DSL is based on TOSCA’s YAML Simple Profile, which his a way of writing TOSCA blueprints in YAML. (Originally, TOSCA is written in XML, but since XML has lots of unnecessary punctuation, the YAML profile is easier to use.)
Part of Cloudify’s core is the Cloudify DSL Parser, which aspires to read and validate TOSCA (YAML) blueprints, and provide a mechanism for mapping operations to Cloudify plugins.
All TOSCA blueprints specify the TOSCA definitions version adhered to in the blueprint. In Cloudify, we are currently using a specific Cloudify DSL version that looks for namespacing specific to Cloudify.
In the next few versions of Cloudify, the DSL will be expanded to include more features of TOSCA that have not been discussed here.
Even today, they are quite close. In this article, I’ve provided Cloudify code snippets, instead of TOSCA ones.
This snippet:
some_virtual_host:
type: cloudify.nodes.Compute
interfaces:
cloudify.interfaces.lifecycle:
create: scripts/create.sh
Could just as easily be:
some_virtual_host:
type: tosca.nodes.Compute
interfaces:
standard:
create: scripts/create.sh
A full discussion of where TOSCA and the Cloudify DSL align is beyond the scope of this article, as are the full features of Cloudify.
Instead, I’ve focused on outlining TOSCA basics. TOSCA is meant to be easy to adopt, and I hope that this article has helped in introducing the elementary concepts.
For further reading, I suggest the TOSCA Simple Profile doc.
I also recommend the documentation on Cloudify’s DSL for Cloudify version 3.2: Cloudify DSL
In my upcoming blog posts, I will begion to expand on TOSCA and Cloudify with more advanced examples.
Published at DZone with permission of Sharone Zitzman, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Writing a Vector Database in a Week in Rust
-
What Is React? A Complete Guide
-
Introduction To Git
-
Why You Should Consider Using React Router V6: An Overview of Changes
Comments