0% found this document useful (0 votes)
102 views

How To Build Csars: For Opentosca

Uploaded by

Vaibhav Dafale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

How To Build Csars: For Opentosca

Uploaded by

Vaibhav Dafale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

How to Build CSARs

for OpenTOSCA

Gefördert durch:
University of Stuttgart Tim Waizenegger
Universitätsstr. 38
70569 Stuttgart
Germany Förderschwerpunkt:

Projektträger:

www.opentosca.org
Preface

2
Purpose of this Document

This How-To will explain the general steps involved in


creating a cloud service model in TOSCA and providing it
as a packaged CSAR file for OpenTOSCA
CloudCycle

© University of Stuttgart 3
Prerequisites

 A running instance of the Winery modeling tool


 See Installation Guide
 Existing NodeTypes
 See Winery Quick Start
CloudCycle

 Knowledge about the OpenTOSCA principles and


imperative provisioning
 See OpenTOSCA Presentation

© University of Stuttgart 4
Basics

5
TOSCA in one Slide

 TOSCA conceptually consists of two parts:


 Application Topologies
 Management Plans

Application Topology Management Plans


CloudCycle

Node X

Relationship

calls
Node
Management
Operation

© University of Stuttgart 6
Contents of a CSAR file

Type
X

Properties Interfaces
CloudCycle

Types Management
Topology Plans
(Templates)
Deployment Implementa-
Artifacts tion Artifacts

Images Services

Installables Scripts

Deployment Implementation
Artifacts Artifacts
Cloud Service Archive (CSAR)
© University of Stuttgart 7
Steps to create a CSAR

8
Process overview

1. Sketch the topology and orchestration


2. Decide on appropriate NodeTypes for your topology
3. Create a new ServiceTemplate in Winery
4. Model your previously sketched topology in winery using
CloudCycle

your NodeTypes as building blocks


5. Supply the necessary parameters to the NodeTemplates
6. Model and then import your complete Plan-Package
7. Supply the input/output message format of your plan
8. Define your default plan input message and further
selfservice information
9. Export your finished ServiceTemplate as CSAR file

© University of Stuttgart 9
1. Sketch the topology and orchestration

 For the purpose of this guide, we will model a cloud


service offering a MySQL Database
 We will use the amazon public cloud for hosting a
virtual machine
CloudCycle

 Which should run a linux operating system


 On which we then run the MySQL database system
 Our provisioning logic therefore needs to:
 Request a virtual machine with the appropriate operating
system
 Install the MySQL database
 And finally configure the MySQL instance

© University of Stuttgart 10
2. Decide on appropriate NodeTypes for your topology

Database I
( MySQL ) A

Configure instance
CloudCycle

Operating System I
( Ubuntu 12.04 ) A
Install MySQL

VM
( VirtualMachine )
Provision VM and OS

Amazon Public Cloud I


EC2 ( AmazonEC2 ) A

© University of Stuttgart 11
3. Create a new ServiceTemplate in Winery
CloudCycle

© University of Stuttgart 12
4. Model your topology
CloudCycle

© University of Stuttgart 13
4. Model your topology
CloudCycle

© University of Stuttgart 14
5. Supply parameters to the node templates
CloudCycle

© University of Stuttgart 15
6. Model & Import your plan package

 Since OpenTOSCA is an imperative container, you


need to provide the topology AND orchestration logic
 OpenTOSCA currently supports orchestration logic in
the form of BPEL workflows
CloudCycle

 You can use any BPEL modeling tool (e.g.


https://eclipse.org/bpel/) to develop your
orchestration plan
 An example plan can be found in the example CSAR
referenced on the very last slide of this document
 As the next step, import the finished plan package
into Winery

© University of Stuttgart 16
6. Model & Import your plan package
CloudCycle

© University of Stuttgart 17
6. Model & Import your plan package
CloudCycle

© University of Stuttgart 18
7. Supply plan input and output parameters

 The plan I/O parameters you supply to Winery will be


written to the TOSCA service template definition
 They have to match the input/output message
definition from the plan itself
CloudCycle

 It is good practice to copy the message definition


from the plan’s WSDL to the TOSCA definition

© University of Stuttgart 19
8. Provide Self-Service Information

 The OpenTOSCA ecosystem provides a Self-Service


Portal which
 Shows all CSARS available in the container with a
description
CloudCycle

 Allows starting the Build Plan execution by a single click by


passing a predefined (default) plan input message to the
plan
 Receives the callback from the plan to show the plan result
to the user
 To use this feature, you have to supply the following
as part of the CSAR:
 Service description/icon
 BuildPlan reference and default input message
© University of Stuttgart 20
8. Provide Self-Service Information
CloudCycle

© University of Stuttgart 21
9. Export finished CSAR file

 Now the finished CSAR can be exported from Winery


 It can be re-imported to different Winery instances
 A CSAR file is a ZIP file, it can be extracted, edited by
hand and re-packaged
CloudCycle

© University of Stuttgart 22
9. Export finished CSAR file
CloudCycle

© University of Stuttgart 23
Further Information

24
A simple example CSAR file
An example CSAR file can be found at:

https://github.com/timwaizenegger/CSAR_Template.git

 It contains a small topology consiting only of an OpenStack


virtual machine node and a linux operating system node
CloudCycle

 The OpenStack node has an attached implementation artifact for


calling the OpenStack API from within a build plan
 The linux node has an attached implementation artifact that allows
sending SSH-commands to the linux-VM from within a plan
 It contains an executable BPEL build plan which will provision a
single virtual machine running linux, and then execute a single
command on that machine via SSH
 It contains self-service data and can be used from the self-
service portal Vinothek
 It contains an ANT script for re-packaging the CSAR file after
manual extraction/modification
© University of Stuttgart 25

You might also like