8
HUAWEI TECHNOLOGIES CO., LTD. Security Level: www.huawei.com Solution for Sharing existing Node Instance

Solution for Sharing existing Node Instance

  • Upload
    dory

  • View
    33

  • Download
    0

Embed Size (px)

DESCRIPTION

Solution for Sharing existing Node Instance. Problem Statement. - PowerPoint PPT Presentation

Citation preview

Page 1: Solution for Sharing existing Node Instance

HUAWEI TECHNOLOGIES CO., LTD.

Security Level:

www.huawei.com

Solution for Sharing existing Node Instance

Page 2: Solution for Sharing existing Node Instance

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 2

Problem Statement TOSCA supports deployment of Apps in a cloud environment, and one

user can deploy many Apps which may be co-related with each

other. One of the way to co-relate one App with the other is that

the two Apps actually share one resource. Take database as an example, App1 and App2 can share one mySql

server instance with two separate DBs, or further, with the same

DB (but new tables may be created for the later App) This contribution will explain the solution of supporting two

Apps sharing the same resource with TOSCA: Assumption: For simplicity, App1 and App2 are deployed by the same user/deployer Problem to resolve: App1 and App2 share the same DB in one mySql server Extensions necessary to TOSCA Impacts/modifications to Plans of App1 and App2

Concrete proposal to TOSCA will be provided after discussion of

this contribution.

Page 3: Solution for Sharing existing Node Instance

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 3

App2 Shares existing DB Instance with App1

ServiceTemplate of App1

App 1

Apache

DB1

D- Artifacts

mySql

Instance of App1

DB: SugarCRMTables:• Employee• …

Step 0: Deploy App1 Instance of App1 is created A Database named i-DB1 is created

with tables such as Employee.

Now I want to deploy another application App2, which will reuse the database created for App1, and will add one more table named Customer in the database.

ServiceTemplate of App2

MySQL-CustomerTable

Referencing to existing node instance

Instance of App2

DB: SugarCRMTables:• Employee• Customer• …

A new table is created

Step 1: Modify the NodeTemplate of DB2 to reference to existing node instance i-DB1 of i-App1

i-App2 will reuse the database created for i-App1, and will create one more table named Customer

Step 2: Deploy App2 Instance of App2 is created, which is i-App2 The instance is connected to i-DB1, and further, a new table

named Customer is created

Step 0

Step 2

Step 1

HoseOn HoseOn

ConnectTo i-App 1

i-Apache

i-DB1

i-mySql

App 2

Apache

DB2

HoseOn

ConnectTo

i-App 2

i-Apache

i-DB1 ConnectTo

Reference to i-DB1 MySQL-CustomerTable

Page 4: Solution for Sharing existing Node Instance

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 4

Describe App2 With1. Define a new ArtifactType, which indicates an ArtifactTemplate of this type actually references to an existing Node instance

<ArtifactType name="ExistingResourceArtifact" targetNamespace="http://docs.oasisopen.org/tosca/ns/2011/12/Artifacts"/>

2. Define an ArtifactTemplate of this ArtifactType, referencing to existing node instance <ArtifactTemplate id="MySQLAT" type="ExistingResourceArtifact "> <ArtifactReferences> <ArtifactReference reference=“i-app1. i-DB1 "/> </ArtifactReferences> </ArtifactTemplate>

3. Modify NodeTemplate of AppB.DB2<NodeTemplate id=“MySql" nodeType="MySQLServer"><DeploymentArtifacts> <DeploymentArtifact name=" MySQLDA" artifactType=" ExistingResourceArtifact" artifactRef=" MySQLAT"/> <DeploymentArtifact name=" MySQL-CustomerTable" artifactType=" mySqlScript" artifactRef=" MySQL-CustomerTable .sql"/> </DeploymentArtifacts>… //other definitions </NodeTemplate>

Extension to TOSCA

Page 5: Solution for Sharing existing Node Instance

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 5

Further Modification to App2If App2 is developed with the idea to share an known existing instance node, then we can assume that App2 is ready for direct deployment.But if App2 is developed as a brand-new app, and only when deployment, the deployer hopes to make it share an existing instance node, then at least the following stuff should be modified. Build Plan

Not to create a new DB, but to connect to existing i-DB1 Remove Plan

Not to remove i-DB1, but only delete table Customer (which was created by the deployment artifact of App2.DB2

Page 6: Solution for Sharing existing Node Instance

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 6

Modification to App1

<Plan id=“remove“> <PreCondition expressionLanguage="www.example.com/text"> The state of app2 is REMOVED </PreCondition> </ Plan >

Since now App2 and App1 share the same database ( and are still two separate apps), it’s necessary to check the state of App2 before executing any operations of APP1 that will impact the database.For instance, the precondition to execute Remove operation of App1 is to check whether App2 is removed.

Page 7: Solution for Sharing existing Node Instance

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 7

Simplified Process FlowClient Container MySQL(VM)

1 Get id of node instance i-App1.i-DB1

2 Modify App2 ST

3 Deploy App2

4 Get connection information of MySQL

5 Execute MySQL-CustomerTable.sql, create Customer table in i-App1.i-DB1

6 OK

7 OK

Page 8: Solution for Sharing existing Node Instance

Thank youwww.huawei.com