Moving from nova-network to Neutron

Heat CFN templates are updated to support usage of Neutron.
With this update Murano going to run only on OS deployment with Neutron.

Change-Id: I9a9427527b0df9ddc4fd6035be27a8907a34cd93
This commit is contained in:
Serg Melikyan 2013-09-16 17:35:30 +04:00
parent 912b5b8653
commit a5868516fc
6 changed files with 175 additions and 26 deletions

View File

@ -0,0 +1,54 @@
{
"Resources": {
"$instanceName": {
"Properties": {
"SecurityGroups": [
{
"Ref": "MsSqlSecurityGroup"
}
]
}
},
"$instancePort": {
"Properties": {
"allowed_address_pairs": [
{
"ip_address": "$clusterIp"
}
]
}
},
"MsSqlSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"SecurityGroupIngress": [
{
"ToPort": 4022,
"IpProtocol": "tcp",
"FromPort": 4022,
"CidrIp": "0.0.0.0/0"
},
{
"ToPort": 135,
"IpProtocol": "tcp",
"FromPort": 135,
"CidrIp": "0.0.0.0/0"
},
{
"ToPort": 1433,
"IpProtocol": "tcp",
"FromPort": 1433,
"CidrIp": "0.0.0.0/0"
},
{
"ToPort": 1434,
"IpProtocol": "tcp",
"FromPort": 1434,
"CidrIp": "0.0.0.0/0"
}
],
"GroupDescription": "Enable MS SQL access"
}
}
}
}

View File

@ -1,26 +1,50 @@
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Parameters" : {
"KeyName" : {
"Description" : "Key Pair name for Load Balancer",
"Type" : "String",
"Default" : "murano-lb-key"
}
},
"Resources" : {
"$instanceName": {
"Type" : "AWS::EC2::Instance",
"Properties": {
"InstanceType" : "$instanceType",
"ImageId" : "$imageName",
"AvailabilityZone" : "$availabilityZone",
"UserData": "$userData",
"SecurityGroups" : [ {"Ref" : "MuranoDefaultSecurityGroup"} ]
}
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"KeyName": {
"Description": "Key Pair name for Load Balancer",
"Type": "String",
"Default": "murano-lb-key"
}
},
"MuranoDefaultSecurityGroup": {
"Resources": {
"$instanceName": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType": "$instanceType",
"ImageId": "$imageName",
"AvailabilityZone": "$availabilityZone",
"UserData": "$userData",
"SecurityGroups": [
{
"Ref": "MuranoDefaultSecurityGroup"
}
],
"NetworkInterfaces": [
{
"Ref": "$instancePort"
}
]
}
},
"$instancePort": {
"Type": "OS::Neutron::Port",
"Properties": {
"network_id": {
"Ref": "network"
},
"fixed_ips": [
{
"subnet_id": {
"Ref": "subnet"
}
}
]
}
},
"MuranoDefaultSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"SecurityGroupIngress": [
@ -45,9 +69,45 @@
],
"GroupDescription": "Default security group for Murano Environments"
}
},
"network": {
"Type": "OS::Neutron::Net",
"Properties": {
"name": "$networkName"
}
},
"subnet": {
"Type": "OS::Neutron::Subnet",
"Properties": {
"network_id": {
"Ref": "network"
},
"ip_version": 4,
"cidr": "10.0.0.0/24",
"allocation_pools": [
{
"start": "10.0.0.20",
"end": "10.0.0.250"
}
]
}
},
"router": {
"Type": "OS::Neutron::Router"
},
"router_interface": {
"Type": "OS::Neutron::RouterInterface",
"Properties": {
"router_id": {
"Ref": "router"
},
"subnet_id": {
"Ref": "subnet"
}
}
}
},
"Outputs" : {
}
},
"Outputs": {
}
}

View File

@ -17,6 +17,8 @@
<parameter name="mappings">
<map>
<mapping name="instanceName"><select path="state.hostname"/></mapping>
<mapping name="instancePort">port-<select path="state.hostname"/></mapping>
<mapping name="networkName">network-<select path="/id"/></mapping>
<mapping name="userData">
<prepare-user-data>
<parameter name="hostname"><select path="state.hostname"/></parameter>

View File

@ -17,6 +17,8 @@
<parameter name="mappings">
<map>
<mapping name="instanceName"><select path="state.hostname"/></mapping>
<mapping name="instancePort">port-<select path="state.hostname"/></mapping>
<mapping name="networkName">network-<select path="/id"/></mapping>
<mapping name="userData">
<prepare-user-data>
<parameter name="hostname"><select path="state.hostname"/></parameter>

View File

@ -18,6 +18,8 @@
<parameter name="mappings">
<map>
<mapping name="instanceName"><select path="state.hostname"/></mapping>
<mapping name="instancePort">port-<select path="state.hostname"/></mapping>
<mapping name="networkName">network-<select path="/id"/></mapping>
<mapping name="userData">
<prepare-user-data>
<parameter name="hostname"><select path="state.hostname"/></parameter>
@ -45,6 +47,33 @@
<stop/>
</failure>
</update-cf-stack>
<report entity="unit">
<parameter name="id"><select path="id"/></parameter>
<parameter name="text">Applying address pair and opening SQL ports on <select path="state.hostname"/> (<select path="name"/>)</parameter>
</report>
<update-cf-stack template="SQLCluster" error="exception">
<parameter name="mappings">
<map>
<mapping name="instanceName"><select path="state.hostname"/></mapping>
<mapping name="instancePort">port-<select path="state.hostname"/></mapping>
<mapping name="clusterIp"><select path="::clusterIp"/></mapping>
</map>
</parameter>
<success>
<report entity="unit">
<parameter name="id"><select path="id"/></parameter>
<parameter name="text">Address pair and SQL ports are open on <select path="state.hostname"/> (<select path="name"/>)</parameter>
</report>
</success>
<failure>
<report entity="unit" level="error">
<parameter name="id"><select path="id"/></parameter>
<parameter name="text">Unable to assign address pair and open SQL ports on instance <select path="state.hostname"/> (<select path="name"/>) due to <select source="exception" path="message" default="unknown Heat error"/> </parameter>
</report>
<stop/>
</failure>
</update-cf-stack>
</rule>
<rule match="$.services[?(@.type == 'msSqlClusterServer' and @.domain and not @.domainAdminUserName and not @.domainAdminPassword)]"

View File

@ -17,6 +17,8 @@
<parameter name="mappings">
<map>
<mapping name="instanceName"><select path="state.hostname"/></mapping>
<mapping name="instancePort">port-<select path="state.hostname"/></mapping>
<mapping name="networkName">network-<select path="/id"/></mapping>
<mapping name="userData">
<prepare-user-data>
<parameter name="hostname"><select path="state.hostname"/></parameter>
@ -47,7 +49,7 @@
<report entity="unit">
<parameter name="id"><select path="id"/></parameter>
<parameter name="text">Openining SQL ports on <select path="state.hostname"/> (<select path="name"/>)</parameter>
<parameter name="text">Opening SQL ports on <select path="state.hostname"/> (<select path="name"/>)</parameter>
</report>
<update-cf-stack template="SQL-security" error="exception">
<parameter name="mappings">