[CORD-2349] Migrating REM-CORD
Change-Id: Iae573428e3bee89026262055263f24a32dd12183
diff --git a/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2 b/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2
index f9c093b..e8eafb0 100644
--- a/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2
+++ b/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2
@@ -19,7 +19,9 @@
tosca_definitions_version: tosca_simple_yaml_1_0
imports:
- - custom_types/xos.yaml
+ - custom_types/onosservice.yaml
+ - custom_types/node.yaml
+ - custom_types/node.yaml
description: Configures VTN networking for OpenStack compute nodes
@@ -30,18 +32,16 @@
service#ONOS_CORD:
type: tosca.nodes.ONOSService
properties:
- no-delete: true
- no-create: true
- no-update: true
+ name: ONOS_CORD
+ must-exist: true
{% if use_fabric %}
# Fabric, fully defined in fabric.yaml
service#ONOS_Fabric:
type: tosca.nodes.ONOSService
properties:
- no-delete: true
- no-create: true
- no-update: true
+ name: ONOS_Fabric
+ must-exist: true
{% endif %}
# VTN networking for OpenStack Compute Nodes
@@ -55,8 +55,8 @@
{{ hostvars[node]['ansible_hostname'] }}:
type: tosca.nodes.Node
properties:
- no-delete: true
- no-create: true
+ must-exist: true
+ name: {{ hostvars[node]['ansible_hostname'] }}
bridgeId: of:0000{{ node_interface['macaddress'] | hwaddr('bare') }}
dataPlaneIntf: fabric
dataPlaneIp: {{ ( node_interface['ipv4']['address'] ~ '/' ~ node_interface['ipv4']['netmask'] ) | ipaddr('cidr') }}
diff --git a/roles/compute-node-config/templates/openstack-compute.yaml.j2 b/roles/compute-node-config/templates/openstack-compute.yaml.j2
index 6a77a43..d5340f7 100644
--- a/roles/compute-node-config/templates/openstack-compute.yaml.j2
+++ b/roles/compute-node-config/templates/openstack-compute.yaml.j2
@@ -19,7 +19,10 @@
tosca_definitions_version: tosca_simple_yaml_1_0
imports:
- - custom_types/xos.yaml
+ - custom_types/deployment.yaml
+ - custom_types/node.yaml
+ - custom_types/site.yaml
+ - custom_types/sitedeployment.yaml
description: Adds OpenStack compute nodes
@@ -30,16 +33,14 @@
{{ site_name }}:
type: tosca.nodes.Site
properties:
- no-delete: true
- no-create: true
- no-update: true
+ name: {{ site_name }}
+ must-exist: true
{{ deployment_type }}:
type: tosca.nodes.Deployment
properties:
- no-delete: true
- no-create: true
- no-update: true
+ name: {{ deployment_type }}
+ must-exist: true
# OpenStack compute nodes
{% for node in groups['compute'] %}
@@ -51,13 +52,22 @@
# Compute node: {{ node }}, with interface {{ ansible_ext_if }}
{{ hostvars[node]['ansible_hostname'] }}:
type: tosca.nodes.Node
+ properties:
+ name: {{ hostvars[node]['ansible_hostname'] }}
+ requirements:
+ - site_deployment:
+ node: {{ site_name }}_{{ deployment_type }}
+ relationship: tosca.relationships.BelongsToOne
+
+ {{ site_name }}_{{ deployment_type }}:
+ type: tosca.nodes.SiteDeployment
requirements:
- site:
node: {{ site_name }}
- relationship: tosca.relationships.MemberOfSite
+ relationship: tosca.relationships.BelongsToOne
- deployment:
node: {{ deployment_type }}
- relationship: tosca.relationships.MemberOfDeployment
+ relationship: tosca.relationships.BelongsToOne
{% endif %}
{% endfor %}