CORD-2385 Move profile-specific configuration to OpenCloud repo

Change-Id: I9660ae3ba3cb5abff71351205a6b50c094ddc293
diff --git a/management-net.yaml.j2 b/management-net.yaml.j2
new file mode 100644
index 0000000..9c7b03c
--- /dev/null
+++ b/management-net.yaml.j2
@@ -0,0 +1,97 @@
+
+{#
+Copyright 2017-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+   - custom_types/networktemplate.yaml
+   - custom_types/network.yaml
+   - custom_types/slice.yaml
+   - custom_types/site.yaml
+
+description: management network config, generated by platform-install
+
+topology_template:
+  node_templates:
+
+# site, fully created in deployment.yaml
+    {{ site_name }}:
+      type: tosca.nodes.Site
+      properties:
+        name: {{ site_name }}
+
+# management network
+    management_template:
+      type: tosca.nodes.NetworkTemplate
+      properties:
+        name: management_template
+        visibility: private
+        translation: none
+        vtn_kind: MANAGEMENT_LOCAL
+
+    management:
+      type: tosca.nodes.Network
+      properties:
+        name: management
+        # ip_version: 4
+        subnet: {{ management_network_cidr }}
+        permit_all_slices: true
+      requirements:
+        - template:
+            node: management_template
+            relationship: tosca.relationships.BelongsToOne
+        - owner:
+            node: slice#{{ site_name }}_management
+            relationship: tosca.relationships.BelongsToOne
+
+{% if use_management_hosts %}
+    management_hosts_template:
+      type: tosca.nodes.NetworkTemplate
+      properties:
+        name: management_hosts_template
+        visibility: private
+        translation: none
+        vtn_kind: MANAGEMENT_HOST
+
+    management_hosts:
+      type: tosca.nodes.Network
+      properties:
+        # ip_version: 4
+        subnet: {{ management_hosts_net_cidr }}
+        start_ip: {{ management_hosts_net_range_xos_low }}
+        end_ip: {{ management_hosts_net_range_xos_high }}
+      requirements:
+        - template:
+            node: management_hosts_template
+            relationship: tosca.relationships.BelongsToOne
+        - owner:
+            node: slice#{{ site_name }}_management
+            relationship: tosca.relationships.BelongsToOne
+{% endif %}
+
+    slice#{{ site_name }}_management:
+      description: This slice exists solely to own the management network
+      type: tosca.nodes.Slice
+      properties:
+        network: noauto
+        name: {{ site_name }}_management
+      requirements:
+        - site:
+            node: {{ site_name }}
+            relationship: tosca.relationships.BelongsToOne
+
diff --git a/opencloud.yml b/opencloud.yml
new file mode 100644
index 0000000..67b2251
--- /dev/null
+++ b/opencloud.yml
@@ -0,0 +1,217 @@
+---
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# profile_manifests/opencloud.yml
+# OpenCloud Profile Manifest
+
+# Profile info located in orchestration/profiles/<cord_use_case>
+cord_use_case: rcord
+
+# Site configuration
+site_name: generic-opencloud
+site_humanname: "Generic OpenCloud"
+site_suffix: "{{ site_name }}.opencloud.us"
+deployment_type: campus
+
+# Feature toggles
+use_maas: False
+
+# XOS config
+xos_new_tosca_config_templates:
+  - xos-gui-extensions.yml
+  - vtn-service.yaml
+  - management-net.yaml
+
+# GUI Config [new GUI], used in app.config.js.j2 and style.config.js.j2
+gui_project_name: "OpenCloud"
+gui_favicon: "opencloud-favicon.png"
+gui_background: "opencloud-bg.jpg"
+gui_payoff: "A Value-Added Cloud for the Internet2 Community"
+gui_logo: "opencloud-logo.png"
+
+# paths defined in manifest/default.xml
+xos_services:
+  - name: vtn
+    path: orchestration/xos_services/vtn-service
+    keypair: vsg_rsa
+  - name: openstack
+    path: orchestration/xos_services/openstack
+  - name: onos
+    path: orchestration/xos_services/onos-service
+    keypair: onos_rsa
+  - name: vrouter
+    path: orchestration/xos_services/vrouter
+
+enabled_gui_extensions: []
+
+# External interface name on compute nodes
+compute_external_interface: eth0
+
+# VTN network configuration
+management_network_cidr: 172.27.0.0/24
+management_network_ip: 172.27.0.1/24
+data_plane_ip: 10.168.0.253/24
+
+# Juju setup
+charm_versions:
+  ceilometer-agent: "cs:trusty/ceilometer-agent-13"
+  ceilometer: "cs:trusty/ceilometer-17"
+  glance: "cs:trusty/glance-28"
+  keystone: "cs:trusty/keystone-267"
+  mongodb: "cs:trusty/mongodb-33"
+  neutron-api: "cs:~cordteam/trusty/neutron-api-6"
+  nova-cloud-controller: "cs:trusty/nova-cloud-controller-64"
+  nova-compute: "cs:~cordteam/trusty/nova-compute-4"
+  ntp: "cs:trusty/ntp-14"
+  openstack-dashboard: "cs:trusty/openstack-dashboard-19"
+  percona-cluster: "cs:trusty/percona-cluster-31"
+  rabbitmq-server: "cs:trusty/rabbitmq-server-42"
+
+head_lxd_list:
+  - name: "juju-1"
+    service: "juju"
+    aliases:
+       - "juju"
+    ipv4_last_octet: 50
+
+  - name: "ceilometer-1"
+    service: "ceilometer"
+    aliases:
+      - "ceilometer"
+    ipv4_last_octet: 51
+    forwarded_ports:
+      - { ext: 8777, int: 8777 }
+
+  - name: "glance-1"
+    service: "glance"
+    aliases:
+      - "glance"
+    ipv4_last_octet: 52
+    forwarded_ports:
+      - { ext: 9292, int: 9292 }
+
+  - name: "keystone-1"
+    service: "keystone"
+    aliases:
+      - "keystone"
+    ipv4_last_octet: 53
+    forwarded_ports:
+      - { ext: 35357, int: 35357 }
+      - { ext: 4990, int: 4990 }
+      - { ext: 5000, int: 5000 }
+
+  - name: "percona-cluster-1"
+    service: "percona-cluster"
+    aliases:
+      - "percona-cluster"
+    ipv4_last_octet: 54
+
+  - name: "neutron-api-1"
+    service: "neutron-api"
+    aliases:
+      - "neutron-api"
+    ipv4_last_octet: 55
+    forwarded_ports:
+      - { ext: 9696, int: 9696 }
+
+  - name: "nova-cloud-controller-1"
+    service: "nova-cloud-controller"
+    aliases:
+      - "nova-cloud-controller"
+    ipv4_last_octet: 56
+    forwarded_ports:
+      - { ext: 8774, int: 8774 }
+
+  - name: "openstack-dashboard-1"
+    service: "openstack-dashboard"
+    aliases:
+      - "openstack-dashboard"
+    ipv4_last_octet: 57
+    forwarded_ports:
+      - { ext: 8080, int: 80 }
+
+  - name: "rabbitmq-server-1"
+    service: "rabbitmq-server"
+    aliases:
+      - "rabbitmq-server"
+    ipv4_last_octet: 58
+
+  - name: "mongodb-1"
+    service: "mongodb"
+    aliases:
+      - "mongodb"
+    ipv4_last_octet: 59
+
+lxd_service_list:
+  - ceilometer
+  - glance
+  - keystone
+  - mongodb
+  - neutron-api
+  - nova-cloud-controller
+  - openstack-dashboard
+  - percona-cluster
+  - rabbitmq-server
+
+standalone_service_list:
+  - ceilometer-agent
+  - ntp
+
+service_relations:
+  - name: keystone
+    relations: [ "percona-cluster", ]
+
+  - name: nova-cloud-controller
+    relations: [ "percona-cluster", "rabbitmq-server", "glance", "keystone", ]
+
+  - name: glance
+    relations: [ "percona-cluster", "keystone", ]
+
+  - name: neutron-api
+    relations: [ "keystone", "percona-cluster", "rabbitmq-server", "nova-cloud-controller", ]
+
+  - name: openstack-dashboard
+    relations: [ "keystone", ]
+
+  - name: ceilometer
+    relations: [ "mongodb", "rabbitmq-server" ]
+
+  - name: "ceilometer:identity-service"
+    relations: [ "keystone:identity-service", ]
+
+  - name: "ceilometer:ceilometer-service"
+    relations: [ "ceilometer-agent:ceilometer-service", ]
+
+
+compute_relations:
+  - name: nova-compute
+    relations: [ "ceilometer-agent", "glance", "nova-cloud-controller", ]
+
+  - name: "nova-compute:shared-db"
+    relations: [ "percona-cluster:shared-db", ]
+
+  - name: "nova-compute:amqp"
+    relations: [ "rabbitmq-server:amqp", ]
+
+  - name: ntp
+    relations: [ "nova-compute", ]
+
+
+xos_images:
+  - name: "trusty-server-multi-nic"
+    url: "https://github.com/opencord/platform-install/releases/download/vms/trusty-server-cloudimg-amd64-disk1.img.20170201"
+    checksum: "sha256:ebf007ba3ec1043b7cd011fc6668e2a1d1d4c69c41071e8513ab355df7a057cb"
+
diff --git a/podconfig/opencloud-local.yml b/podconfig/opencloud-local.yml
new file mode 100644
index 0000000..ae9c826
--- /dev/null
+++ b/podconfig/opencloud-local.yml
@@ -0,0 +1,23 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+---
+# local-opencloud Pod Config
+# Starts a OpenCloud container set in the local environment
+
+cord_scenario: local
+cord_profile: opencloud
+
diff --git a/podconfig/opencloud-mock.yml b/podconfig/opencloud-mock.yml
new file mode 100644
index 0000000..37f27b2
--- /dev/null
+++ b/podconfig/opencloud-mock.yml
@@ -0,0 +1,23 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+---
+# mock-opencloud Pod Config
+# Creates a single-node mock OpenCloud pod
+
+cord_scenario: mock
+cord_profile: opencloud
+
diff --git a/podconfig/opencloud-physical-example.yml b/podconfig/opencloud-physical-example.yml
new file mode 100644
index 0000000..76ffe3e
--- /dev/null
+++ b/podconfig/opencloud-physical-example.yml
@@ -0,0 +1,69 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+---
+# opencloud-physical Example Pod Config
+# Example Pod Config for a physical multi-node OpenCloud pod
+
+cord_scenario: opencloud
+cord_profile: opencloud
+
+config_cord_dir: /opt/cord
+config_cord_profile_dir: /opt/sites/az_site
+
+# No VM's, or prereqs
+vagrant_vms:
+vagrant_up_prereqs:
+
+buildnode: node01.opencloud.cs.arizona.edu
+headnode: "{{ buildnode }}"
+
+site_name: az
+site_suffix: "opencloud.cs.arizona.edu"
+site_humanname: "Arizona OpenCloud Site"
+
+mgmt_ipv4_first_octets: "10.10.40"
+
+physical_node_list:
+  - name: node01
+    ipv4_last_octet: 1
+    aliases:
+      - head
+      - head1
+  - name: node02
+    ipv4_last_octet: 2
+  - name: node03
+    ipv4_last_octet: 3
+  - name: node04
+    ipv4_last_octet: 4
+
+# Inventory for ansible, used to generate inventory.ini
+inventory_groups:
+
+  config:
+    localhost:
+      ansible_connection: local
+
+  build:
+    node01.opencloud.cs.arizona.edu:
+
+  head:
+    node01.opencloud.cs.arizona.edu:
+
+  compute:
+    node02.opencloud.cs.arizona.edu:
+    node03.opencloud.cs.arizona.edu:
+    node04.opencloud.cs.arizona.edu:
diff --git a/podconfig/opencloud-single.yml b/podconfig/opencloud-single.yml
new file mode 100644
index 0000000..2b82987
--- /dev/null
+++ b/podconfig/opencloud-single.yml
@@ -0,0 +1,23 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+---
+# opencloud-single Pod Config
+# Creates a single-node OpenCloud pod w/synchronizers
+
+cord_scenario: single
+cord_profile: opencloud
+
diff --git a/podconfig/opencloud-virtual.yml b/podconfig/opencloud-virtual.yml
new file mode 100644
index 0000000..e12ac17
--- /dev/null
+++ b/podconfig/opencloud-virtual.yml
@@ -0,0 +1,23 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+---
+# opencloud-virtual Pod Config
+# Creates a virtual multi-node OpenCloud pod
+
+cord_scenario: opencloud
+cord_profile: opencloud
+
diff --git a/vtn-service.yaml.j2 b/vtn-service.yaml.j2
new file mode 100644
index 0000000..6a2dbd6
--- /dev/null
+++ b/vtn-service.yaml.j2
@@ -0,0 +1,90 @@
+{#
+Copyright 2017-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+   - custom_types/onosapp.yaml
+   - custom_types/onosservice.yaml
+   - custom_types/serviceinstanceattribute.yaml
+   - custom_types/serviceinstancelink.yaml
+   - custom_types/vtnservice.yaml
+
+description: Configures the VTN ONOS service
+
+topology_template:
+  node_templates:
+
+    service#ONOS_CORD:
+      type: tosca.nodes.ONOSService
+      properties:
+          name: ONOS_CORD
+          kind: platform
+          no_container: true
+          rest_hostname: onos-cord.{{ site_suffix }}
+          rest_port: 8182
+
+    service#vtn:
+      type: tosca.nodes.VTNService
+      properties:
+          name: vtn
+          kind: platform
+          view_url: /admin/vtn/vtnservice/$id$/
+          privateGatewayMac: 00:00:00:00:00:01
+          localManagementIp: {{ management_network_ip }}
+          ovsdbPort: 6641
+          sshUser: root
+          sshKeyFile: /root/node_key
+          sshPort: 22
+          xosEndpoint: xos-chameleon.{{ site_suffix }}:{{ xos_chameleon_port }}
+          xosUser: {{ xos_admin_user }}
+          xosPassword: {{ xos_admin_pass }}
+          vtnAPIVersion: 2
+          controllerPort: onos-cord.{{ site_suffix }}:6654
+          resync: false
+
+    VTN_ONOS_app:
+      type: tosca.nodes.ONOSApp
+      requirements:
+          - owner:
+              node: service#ONOS_CORD
+              relationship: tosca.relationships.BelongsToOne
+      properties:
+          name: VTN_ONOS_app
+          install_dependencies: {{ onos_mavenrepo_url }}/repository/org/opencord/cord-config/{{ cord_config_app_version }}/cord-config-{{ cord_config_app_version }}.oar, {{ onos_mavenrepo_url }}/repository/org/opencord/vtn/{{ cord_vtn_app_version }}/vtn-{{ cord_vtn_app_version }}.oar
+          dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp
+          # autogenerate: vtn-network-cfg
+
+    VTN_ONOS_app_autogenerate:
+        type: tosca.nodes.ServiceInstanceAttribute
+        requirements:
+          - service_instance:
+              node: VTN_ONOS_app
+              relationship: tosca.relationships.BelongsToOne
+        properties:
+            name: autogenerate
+            value: vtn-network-cfg
+
+    VTN_ONOS_app_VTN_Service:
+        type: tosca.nodes.ServiceInstanceLink
+        requirements:
+          - provider_service_instance:
+              node: VTN_ONOS_app
+              relationship: tosca.relationships.BelongsToOne
+          - subscriber_service:
+              node: service#vtn
+              relationship: tosca.relationships.BelongsToOne
+
diff --git a/xos-gui-extensions.yml.j2 b/xos-gui-extensions.yml.j2
new file mode 100644
index 0000000..f10c695
--- /dev/null
+++ b/xos-gui-extensions.yml.j2
@@ -0,0 +1,37 @@
+
+{#
+Copyright 2017-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Persist xos-sample-gui-extension
+
+imports:
+   - custom_types/xosguiextension.yaml
+
+topology_template:
+  node_templates:
+
+    # UI Extension
+{% for ext in enabled_gui_extensions %}
+    {{ext.name}}:
+      type: tosca.nodes.XOSGuiExtension
+      properties:
+        name: {{ext.name}}
+        files: /xos/extensions/{{ext.name}}/vendor.js, /xos/extensions/{{ext.name}}/app.js {% if ext.extra_files is defined %}{% for file in ext.extra_files%}, /xos/extensions/{{ext.name}}/{{file}} {% endfor %}{% endif %}
+
+{% endfor %}