34
Apache Stratos Hangout III Information Model of Cloud Controller

Apache stratos hangout 3

Embed Size (px)

Citation preview

Page 1: Apache stratos hangout   3

Apache Stratos Hangout III

Information Model of Cloud Controller

Page 2: Apache stratos hangout   3

Outline

● What are the configuration files used by Cloud Controller and where are they reside?

● Explain each configuration file in detail.

● Explain the information model of CC.

● Does Cloud Controller supports hot update and hot deployment of its configuration files?

Page 3: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml

● This is the main configuration file of CC.

● Resides in {$CC_HOME}/repository/conf folder.

● Any CC specific configuration should ideally be added to this file.

Page 4: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml

● Currently consists of 3 main parts.

○ Iaas Providers related common configurations

○ Topology Sync related configurations

○ Data Publishing related configurations

Page 5: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml

● Currently consists of 3 main parts.○ Iaas Providers related common configurations

<iaasProviders> <iaasProvider type="openstack" name="openstack specific details"> <className>org.apache.stratos.cloud.controller.iaases.XIaas</className> <provider>openstack-nova</provider> <identity>demo:demo</identity> <credential>openstack</credential> <scaleUpOrder>1</scaleUpOrder> <scaleDownOrder>2</scaleDownOrder> <maxInstanceLimit>5</maxInstanceLimit> <property name="region" value="x" />

<property name="jclouds.endpoint" value="http://172.17.0.1:5000/" /> <property name="jclouds.api-version" value="2.0/" /> <property name="Y" value="y" /> </iaasProvider></iaasProviders>

Page 6: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml● Iaas Providers - common configurations

<scaleUpOrder>1</scaleUpOrder>

● When you work with multiple IaaS providers, you should order those IaaS providers according to your preference or else we will follow a random order.

● Defines the look-up order of this particular IaaS configuration.

● Priority order: 1 > 2 > ...

Page 7: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml● Iaas Providers - common configurations

<maxInstanceLimit>5</maxInstanceLimit>

● Do you want to limit the number of EC2 instances that can be spawned by your PaaS?

● Default value of this element is -1. Yes! It’s is -1, because;"Spawning a new VM means money and if you really want to spawn

instances you should specify a max limit, otherwise we don't want to spend your money without your approval"

Page 8: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml

● Currently consists of 3 main parts.○ Topology Sync related configurations

<topologySync enable="true"> <!-- properties related to topology syncher --> <property name="className" value="org.apache.stratos.cloud.controller.ABC"/> <property name="mbServerUrl" value="localhost:5674"/> <property name="cron" value="1 * * * * ? *"/> </topologySync>

Page 9: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml● Currently consists of 3 main parts.

○ Topology Sync related configurations

<topologySync enable="true"> ■ ‘enable’ attribute of topologySync element allows you to

enable/disable topology synchronization. Topology synchronization should be enabled in Apache Stratos.

<property name="className" value="org.apache.stratos.cloud.controller.ABC"/>

■ If you plan to use a custom implementation of topology syncher, you should specify this property.

■ You can add any number of property elements as and when necessary.

Page 10: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml● Currently consists of 3 main parts.

○ Data Publishing related configurations

<dataPublisher enable="true">

<!-- properties related to data publisher implementation -->

<property name="className" value="org.apache.stratos.cloud.

controller.ABC"/>

<property name="bamServerUserName" value="admin"/>

<property name="bamServerPassword" value="admin"/>

<property name="cron" value="1 * * * * ? *"/>

</dataPublisher>

Page 11: Apache stratos hangout   3

Configuration files used by CC

cloud-controller.xml● Currently consists of 3 main parts.

○ Data Publishing related configurations<dataPublisher enable="true"> ■ ‘enable’ attribute of dataPublisher element allows you to

enable/disable publishing the data collected by CC. Data publishing is not a mandatory feature in most use-cases of Apache Stratos.

<property name="className" value="org.apache.stratos.cloud.controller.ABC"/>

■ If you plan to use a custom implementation of data publisher, you should specify this property.

■ You can add any number of property elements as and when necessary.

Page 12: Apache stratos hangout   3

How does cloud-controller.xml file get deployed?● We use an Apache Axis2 deployer called

“CloudControllerDeployer”.● Underneath there is a listener get registered

to the {CC_HOME}/repository/conf folder and then “CloudControllerDeployer” get triggered whenever a xml file dropped into this folder or an existing xml file got changed.

● “CloudControllerDeployer” filter outs all the other xml files but cloud-controller.xml.

Page 13: Apache stratos hangout   3

Does it make sense to hot update /deploy cloud-controller.xml ?● Well, it is not.

● cloud-controller xml file does not provide any artifact that is directly referenced by CC’s information model.

Page 14: Apache stratos hangout   3

Information model get built after deploying cloud-controller.xml file?

● Upon a successful deployment, CC starts to build up its information model.

FasterLookUpDataHolder

IaasProviders <<List>>

TopologyConfig <<Object>>

DataPublisherConfig <<Object>>

Page 15: Apache stratos hangout   3

What is FasterLookUpDataHolder?

● For faster and easy access of its data, CC uses this object.

● This will reduce lot of processing at the time of critical operations like instance spawning, terminating etc.

● Well, I’m not good at names, so do not hesitate to suggest a new name for this object :-)

Page 16: Apache stratos hangout   3

Information model of CC

FasterLookUpDataHolder

Descriptive

IaasProviders <<List>>

TopologyConfig <<Object>>

DataPublisherConfig <<Object>>

Contextual

Page 17: Apache stratos hangout   3

Configuration files used by CC

<cartridge>.xml

● This is the configuration file which defines the properties of a Cartridge.

● Upon a successful deployment of such a file, you register a new Cartridge with CC.

Page 18: Apache stratos hangout   3

Configuration files used by CC<cartridge>.xml<cartridges> <!-- You can have 1..n cartridge elements. --> <cartridge type="php" host="php.stratos.com" provider="zend-provider" version="5.5" multiTenant="false"> <displayName>PHP</displayName> <description>PHP Cartridge</description> <!-- A cartridge element should add a reference to an existing IaaS provider or it can create a completely new IaaS Provider (which should have a unique "type" attribute.) --> <iaasProvider type="ec2" >

<imageId>ap-southeast-1/ami-57cf8105</imageId><property name="instanceType" value="t1.micro"/>

</iaasProvider> <deployment baseDir="/var/www"> <dir>www=copy#app#files#here</dir> <dir>simplesamlphp=copy#saml#libraries#here</dir>

<dir>sql=copy#saml#libraries#here</dir> </deployment>

<portMapping> <http port="80" proxyPort="8280"/> <https port="443" proxyPort="8243"/> </portMapping>

<!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties specified under iaasProvider child elements of cartridge element. →

<property name="ss" value="slsls"/></cartridge>

</cartridges>

Page 19: Apache stratos hangout   3

How does <cartridge>.xml file get deployed?● We use an Apache Axis2 deployer called

“CartridgeDeployer”.

● Underneath there is a listener get registered to the {CC_HOME}/repository/deployment/server/cartridges folder and then “CartridgeDeployer” get triggered whenever a xml file dropped into this folder (hot deployment) or an existing xml file got changed (hot update).

Page 20: Apache stratos hangout   3

<cartridge>.xml file deployment process?● Cartridge definition file will be validated

before its deployment.

● On a successful validation, deployer will start updating the information model of CC.

● Cartridge objects, IaaS related objects, jclouds related objects etc. will get built as part of the deployment process.

Page 21: Apache stratos hangout   3

Information model get built after deploying <cartridge>.xml file?

● Upon a successful deployment, CC continues to build up its information model.

FasterLookUpDataHolder

IaasProviders <<List>>

TopologyConfig <<Object>>

DataPublisherConfig <<Object>>

Cartridges <<List>>

Page 22: Apache stratos hangout   3

Information model of CC

FasterLookUpDataHolder

Descriptive

IaasProviders <<List>>

TopologyConfig <<Object>>

DataPublisherConfig <<Object>>

Contextual

Cartridges <<List>>

Page 23: Apache stratos hangout   3

What is the relationship between a Cartridge and an IaaS Provider?

IaaS Provider I

IaaS Provider II

IaaS Provider III

IaaS Provider IV

Cartridge I

Cartridge II

Cartridge III

Page 24: Apache stratos hangout   3

Who should configure Cartridges?

● Usually when you set up the PaaS, you are required to write Cartridge definition files.

● It’s not a frequent process.

Page 25: Apache stratos hangout   3

Configuration files used by CC

<service>.xml

● This is the configuration file which defines the properties of a Service Cluster.

● Upon a successful deployment of such a file, you register a new Service Cluster with CC.

Page 26: Apache stratos hangout   3

Configuration files used by CC<service>.xml<service domain="abc.php.domain" subDomain="__$default" tenantRange="*"> <cartridge type="php"/> <host>abc.php.com</host>

<payload>pathToPayload</payload> <property name="alarming_lower_rate" value="0.2"/> <property name="rounds_to_average" value="2"/> <property name="alarming_upper_rate" value="0.7"/> <property name="max_app_instances" value="1"/> <property name="min_app_instances" value="1"/> <property name="scale_down_factor" value="0.25"/> <property name="max_requests_per_second" value="

5"/></service>

Page 27: Apache stratos hangout   3

How does <service>.xml file get deployed?● We use an Apache Axis2 deployer called

“ServiceDeployer”.

● Underneath there is a listener get registered to the {CC_HOME}/repository/deployment/server/services folder and then “ServiceDeployer” get triggered whenever a xml file dropped into this folder (hot deployment) or an existing xml file got changed (hot update).

Page 28: Apache stratos hangout   3

<service>.xml file deployment process?● Service definition file will be validated before

its deployment.

● On a successful validation, deployer will start updating the information model of CC.

● Service Context objects will get built as part of the deployment process.

Page 29: Apache stratos hangout   3

Information model get built after deploying <service>.xml file?

● Upon a successful deployment, CC continues to build up its information model.

FasterLookUpDataHolder

IaasProviders <<List>>

TopologyConfig <<Object>>

DataPublisherConfig <<Object>>

Cartridges <<List>> ServiceContexts <<List>>

IaasContexts <<Map>>

Page 30: Apache stratos hangout   3

Information model of CC

FasterLookUpDataHolder

Descriptive

IaasProviders <<List>>

TopologyConfig <<Object>>

DataPublisherConfig <<Object>>

Contextual

Cartridges <<List>>

ServiceContexts <<List>>

IaasContexts <<Map>>

Page 31: Apache stratos hangout   3

What is the relationship between a Service Context and a Cartridge?

Cartridge I

Cartridge II

ServiceContext I

ServiceContext II

ServiceContext III

Page 32: Apache stratos hangout   3

Who should configure Services?

● I’m afraid, no one.

● Apache Stratos would automatically do that for you!! :-) You just need to subscribe to an available Cartridge via the easy to use UI.

Page 33: Apache stratos hangout   3

?

Page 34: Apache stratos hangout   3

For more information …..

http://stratos.incubator.apache.org/

Follow us on Twitter: https://twitter.com/ApacheStratos