Update new TOSCA recipes
Change-Id: I02b903c65ba2c79c8b42aaf49b4f1c834b44db44
diff --git a/profile_manifests/mcord.yml b/profile_manifests/mcord.yml
index 6e9725f..83e0bcb 100644
--- a/profile_manifests/mcord.yml
+++ b/profile_manifests/mcord.yml
@@ -48,7 +48,7 @@
- sgi-net.yaml
- mcord-services.yml
- internet-emulator-service.yaml
-# - sdn-controller-service.yaml
+ - sdn-controller-service.yaml
xos_other_templates:
- fabric-network-cfg.json
diff --git a/roles/cord-profile/templates/internet-emulator-service.yaml.j2 b/roles/cord-profile/templates/internet-emulator-service.yaml.j2
index bd382cb..8b56bf6 100644
--- a/roles/cord-profile/templates/internet-emulator-service.yaml.j2
+++ b/roles/cord-profile/templates/internet-emulator-service.yaml.j2
@@ -27,6 +27,7 @@
- custom_types/image.yaml
- custom_types/flavor.yaml
- custom_types/network.yaml
+ - custom_types/networkslice.yaml
- custom_types/internetemulatorservice.yaml
- custom_types/internetemulatorserviceinstance.yaml
@@ -64,7 +65,7 @@
type: tosca.nodes.Network
properties:
must-exist: true
- name: management
+ name: management_hosts
{% endif %}
# sgi_network is for connectivity between VMs, fully created in sgi-net.yaml
@@ -86,12 +87,13 @@
pubkey: /opt/cord_profile/key_import/mcord_rsa.pub
# CORD Slices
- mysite_internetemulator:
+ {{ site_name }}_internetemulator:
description: Internet Emulator Slice
type: tosca.nodes.Slice
properties:
name: {{ site_name }}_internetemulator
default_isolation: vm
+ network: noauto
requirements:
- site:
node: mysite
@@ -106,13 +108,33 @@
node: m1.small
relationship: tosca.relationships.BelongsToOne
-# TODO: will refactor this part later
# CORD Service Instances
-# serviceinstance#internetemulator_instance:
-# type: tosca.nodes.InternetEmulatorServiceInstance
-# properties:
-# name: internetemulator_instance
-# requirements:
-# - owner:
-# node: service#internetemulator
-# relationship: tosca.relationships.BelongsToOne
+ serviceinstance#internetemulator_instance:
+ type: tosca.nodes.InternetEmulatorServiceInstance
+ properties:
+ name: internetemulator_instance
+ requirements:
+ - owner:
+ node: service#internetemulator
+ relationship: tosca.relationships.BelongsToOne
+
+# CORD NetworkSlices
+ internetemulator_slice_management_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: management
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_internetemulator
+ relationship: tosca.relationships.BelongsToOne
+
+ internetemulator_slice_sgi_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: sgi_network
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_internetemulator
+ relationship: tosca.relationships.BelongsToOne
\ No newline at end of file
diff --git a/roles/cord-profile/templates/mcord-services.yml.j2 b/roles/cord-profile/templates/mcord-services.yml.j2
index 63f8bcb..a5730d0 100644
--- a/roles/cord-profile/templates/mcord-services.yml.j2
+++ b/roles/cord-profile/templates/mcord-services.yml.j2
@@ -82,7 +82,7 @@
type: tosca.nodes.Network
properties:
must-exist: true
- name: management
+ name: management_hosts
{% endif %}
# s1u_network is for connectivity between VMs, fully created in s1u-net.yaml
@@ -115,6 +115,12 @@
properties:
must-exist: true
name: sgi_network
+# s1mme_network is for connectivity between VMs, fully created in s1mme-net.yaml
+ s1mme_network:
+ type: tosca.nodes.Network
+ properties:
+ must-exist: true
+ name: s1mme_network
@@ -174,6 +180,7 @@
properties:
name: {{ site_name }}_vmme
default_isolation: vm
+ network: noauto
requirements:
- site:
node: mysite
@@ -188,13 +195,32 @@
node: m1.small
relationship: tosca.relationships.BelongsToOne
-# will enable this part after sapan fix the obj issue
-# mme_slice_s11_network:
-# type: tosca.nodes.NetworkSlice
-# requirements:
-# - network:
-# node: s11_network
-# relationship: tosca.relationships.BelongsToOne
-# - slice:
-# node: {{ site_name }}_vmme
-# relationship: tosca.relationships.BelongsToOne
+ mme_slice_management_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: management
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_vmme
+ relationship: tosca.relationships.BelongsToOne
+
+ mme_slice_s11_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: s11_network
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_vmme
+ relationship: tosca.relationships.BelongsToOne
+
+ mme_slice_s1mme_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: s1mme_network
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_vmme
+ relationship: tosca.relationships.BelongsToOne
diff --git a/roles/cord-profile/templates/nbi-net.yaml.j2 b/roles/cord-profile/templates/nbi-net.yaml.j2
index a568f3b..edc649a 100644
--- a/roles/cord-profile/templates/nbi-net.yaml.j2
+++ b/roles/cord-profile/templates/nbi-net.yaml.j2
@@ -33,6 +33,7 @@
properties:
name: nbi_network
subnet: 113.0.0.0/24
+ permit_all_slices: true
requirements:
- template:
node: nbi_template
@@ -47,6 +48,7 @@
properties:
name: {{ site_name }}_nbi
default_isolation: vm
+ network: noauto
requirements:
- site:
node: {{ site_name }}
diff --git a/roles/cord-profile/templates/s11-net.yaml.j2 b/roles/cord-profile/templates/s11-net.yaml.j2
index b60182c..f44b0fd 100644
--- a/roles/cord-profile/templates/s11-net.yaml.j2
+++ b/roles/cord-profile/templates/s11-net.yaml.j2
@@ -33,6 +33,7 @@
properties:
name: s11_network
subnet: 112.0.0.0/24
+ permit_all_slices: true
requirements:
- template:
node: s11_template
@@ -47,6 +48,7 @@
properties:
name: {{ site_name }}_s11
default_isolation: vm
+ network: noauto
requirements:
- site:
node: {{ site_name }}
diff --git a/roles/cord-profile/templates/s1mme-net.yaml.j2 b/roles/cord-profile/templates/s1mme-net.yaml.j2
index f18659c..b0300ee 100644
--- a/roles/cord-profile/templates/s1mme-net.yaml.j2
+++ b/roles/cord-profile/templates/s1mme-net.yaml.j2
@@ -33,6 +33,7 @@
properties:
name: s1mme_network
subnet: 116.0.0.0/24
+ permit_all_slices: true
requirements:
- template:
node: s1mme_template
@@ -47,6 +48,7 @@
properties:
name: {{ site_name }}_s1mme
default_isolation: vm
+ network: noauto
requirements:
- site:
node: {{ site_name }}
diff --git a/roles/cord-profile/templates/s1u-net.yaml.j2 b/roles/cord-profile/templates/s1u-net.yaml.j2
index 90d2962..e2bb51c 100644
--- a/roles/cord-profile/templates/s1u-net.yaml.j2
+++ b/roles/cord-profile/templates/s1u-net.yaml.j2
@@ -33,6 +33,7 @@
properties:
name: s1u_network
subnet: 111.0.0.0/24
+ permit_all_slices: true
requirements:
- template:
node: s1u_template
@@ -47,6 +48,7 @@
properties:
name: {{ site_name }}_s1u
default_isolation: vm
+ network: noauto
requirements:
- site:
node: {{ site_name }}
diff --git a/roles/cord-profile/templates/sbi-net.yaml.j2 b/roles/cord-profile/templates/sbi-net.yaml.j2
index cd8605a..fe56d4c 100644
--- a/roles/cord-profile/templates/sbi-net.yaml.j2
+++ b/roles/cord-profile/templates/sbi-net.yaml.j2
@@ -33,6 +33,7 @@
properties:
name: sbi_network
subnet: 114.0.0.0/24
+ permit_all_slices: true
requirements:
- template:
node: sbi_template
@@ -47,6 +48,7 @@
properties:
name: {{ site_name }}_sbi
default_isolation: vm
+ network: noauto
requirements:
- site:
node: {{ site_name }}
diff --git a/roles/cord-profile/templates/sdn-controller-service.yaml.j2 b/roles/cord-profile/templates/sdn-controller-service.yaml.j2
index d76df34..e0f4b36 100644
--- a/roles/cord-profile/templates/sdn-controller-service.yaml.j2
+++ b/roles/cord-profile/templates/sdn-controller-service.yaml.j2
@@ -21,7 +21,15 @@
imports:
- custom_types/xos.yaml
- - custom_types/sdncontroller.yaml
+ - custom_types/slice.yaml
+ - custom_types/site.yaml
+ - custom_types/image.yaml
+ - custom_types/flavor.yaml
+ - custom_types/network.yaml
+ - custom_types/networkslice.yaml
+ - custom_types/sdncontrollerservice.yaml
+ - custom_types/sdncontrollervendor.yaml
+ - custom_types/sdncontrollerserviceinstance.yaml
topology_template:
node_templates:
@@ -29,58 +37,58 @@
# site, image, fully created in deployment.yaml
{{ site_name }}:
type: tosca.nodes.Site
+ properties:
+ must-exist: true
+ name: {{ site_name }}
m1.small:
type: tosca.nodes.Flavor
- m1.large:
- type: tosca.nodes.Flavor
- m1.medium:
- type: tosca.nodes.Flavor
- m1.xlarge:
- type: tosca.nodes.Flavor
+ properties:
+ name: m1.small
+ must-exist: true
trusty-server-multi-nic:
type: tosca.nodes.Image
+ properties:
+ name: trusty-server-multi-nic
+ must-exist: true
# management networks, fully created in management-net.yaml
management:
- type: tosca.nodes.network.Network.XOS
+ type: tosca.nodes.Network
properties:
- no-create: true
- no-delete: true
- no-update: true
+ must-exist: true
+ name: management
{% if use_management_hosts %}
management_hosts:
- type: tosca.nodes.network.Network.XOS
+ type: tosca.nodes.Network
properties:
- no-create: true
- no-delete: true
- no-update: true
+ must-exist: true
+ name: management_hosts
{% endif %}
-# sbi_network
+# sbi_network is for connectivity between VMs, fully created in sbi-net.yaml
sbi_network:
- type: tosca.nodes.network.Network.XOS
+ type: tosca.nodes.Network
properties:
- no-create: true
- no-delete: true
- no-update: true
+ must-exist: true
+ name: sbi_network
-# nbi_network
+# nbi_network is for connectivity between VMs, fully created in nbi-net.yaml
nbi_network:
- type: tosca.nodes.network.Network.XOS
+ type: tosca.nodes.Network
properties:
- no-create: true
- no-delete: true
- no-update: true
+ must-exist: true
+ name: nbi_network
# CORD Services
service#sdncontroller:
type: tosca.nodes.SDNControllerService
properties:
- public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE] }
+ name: sdncontroller
+ public_key: {{ lookup('file', config_cord_profile_dir + '/key_import/mcord_rsa.pub') }}
private_key_fn: /opt/xos/services/sdncontroller/keys/mcord_rsa
artifacts:
pubkey: /opt/cord_profile/key_import/mcord_rsa.pub
@@ -90,26 +98,76 @@
description: SDN controller slice
type: tosca.nodes.Slice
properties:
+ name: {{ site_name }}_sdncontroller
+ default_isolation: vm
network: noauto
requirements:
- site:
node: mysite
- relationship: tosca.relationships.MemberOfSite
- - sdncontroller_service:
+ relationship: tosca.relationships.BelongsToOne
+ - service:
node: service#sdncontroller
- relationship: tosca.relationships.MemberOfService
+ relationship: tosca.relationships.BelongsToOne
- default_image:
node: trusty-server-multi-nic
- relationship: tosca.relationships.DefaultImage
+ relationship: tosca.relationships.BelongsToOne
- default_flavor:
node: m1.small
- relationship: tosca.relationships.DefaultFlavor
- - connection_to_management:
- node: management
- relationship: tosca.relationships.ConnectsToNetwork
- - connection_to_sbi_network:
- node: sbi_network
- relationship: tosca.relationships.ConnectsToNetwork
- - connection_to_nbi_network:
- node: nbi_network
- relationship: tosca.relationships.ConnectsToNetwork
\ No newline at end of file
+ relationship: tosca.relationships.BelongsToOne
+
+# CORD Service Instances
+
+ intel_sdncontroller:
+ type: tosca.nodes.SDNControllerVendor
+ properties:
+ name: intel_sdncontroller
+ requirements:
+ - image:
+ node: trusty-server-multi-nic
+ relationship: tosca.relationships.BelongsToOne
+ - flavor:
+ node: m1.small
+ relationship: tosca.relationships.BelongsToOne
+
+ serviceinstance#sdncontroller_instance:
+ type: tosca.nodes.SDNControllerServiceInstance
+ properties:
+ name: sdncontroller_instance1
+ requirements:
+ - sdncontroller_vendor:
+ node: intel_sdncontroller
+ relationship: tosca.relationships.BelongsToOne
+ - owner:
+ node: service#sdncontroller
+ relationship: tosca.relationships.BelongsToOne
+
+# CORD NetworkSlices
+ sdncontroller_slice_management_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: management
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_sdncontroller
+ relationship: tosca.relationships.BelongsToOne
+
+ sdncontroller_slice_sbi_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: sbi_network
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_sdncontroller
+ relationship: tosca.relationships.BelongsToOne
+
+ sdncontroller_slice_nbi_network:
+ type: tosca.nodes.NetworkSlice
+ requirements:
+ - network:
+ node: nbi_network
+ relationship: tosca.relationships.BelongsToOne
+ - slice:
+ node: {{ site_name }}_sdncontroller
+ relationship: tosca.relationships.BelongsToOne
diff --git a/roles/cord-profile/templates/sgi-net.yaml.j2 b/roles/cord-profile/templates/sgi-net.yaml.j2
index c38a561..db2779e 100644
--- a/roles/cord-profile/templates/sgi-net.yaml.j2
+++ b/roles/cord-profile/templates/sgi-net.yaml.j2
@@ -33,6 +33,7 @@
properties:
name: sgi_network
subnet: 115.0.0.0/24
+ permit_all_slices: true
requirements:
- template:
node: sgi_template
@@ -47,6 +48,7 @@
properties:
name: {{ site_name }}_sgi
default_isolation: vm
+ network: noauto
requirements:
- site:
node: {{ site_name }}
diff --git a/roles/test-mcord-base/tasks/main.yml b/roles/test-mcord-base/tasks/main.yml
index 8bdeb89..970aeb5 100644
--- a/roles/test-mcord-base/tasks/main.yml
+++ b/roles/test-mcord-base/tasks/main.yml
@@ -29,6 +29,8 @@
- sgi_network
- s11_network
- s1mme_network
+ - sbi_network
+ - nbi_network
tags:
- skip_ansible_lint # running a sub job
@@ -41,5 +43,6 @@
with_items:
- internetemulator
- vmme
+ - sdncontroller
tags:
- skip_ansible_lint # running a sub job