Merge "[CORD-1259] Adding xos_dynamic_services list for services that can be dynamically loaded]"
diff --git a/podconfig/rcord-controlkube.yml b/podconfig/rcord-controlkube.yml
new file mode 100644
index 0000000..fbe4598
--- /dev/null
+++ b/podconfig/rcord-controlkube.yml
@@ -0,0 +1,28 @@
+---
+# 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.
+
+# rcord-controlkube Pod Config
+# Creates a kubernetes enabled controlpod
+
+cord_scenario: controlkube
+cord_profile: rcord
+
+# copy kubespray config and kubectl to VM host
+kubeconfig_localhost: true
+kubectl_localhost: true
+
+# enable helm in kubespray
+helm_enabled: true
+
diff --git a/podconfig/rcord-preppedpod.yml b/podconfig/rcord-preppedpod.yml
new file mode 100644
index 0000000..db975c8
--- /dev/null
+++ b/podconfig/rcord-preppedpod.yml
@@ -0,0 +1,21 @@
+---
+# 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.
+
+# rcord-preppedpod POD Config
+# Creates a multi-node POD on pre-prepared systems (OS installed) with R-CORD services
+
+cord_scenario: preppedpod
+cord_profile: rcord
+
diff --git a/rcord.yml b/rcord.yml
index 6f96c75..8e42343 100644
--- a/rcord.yml
+++ b/rcord.yml
@@ -54,6 +54,8 @@
 
 # paths defined in manifest/default.xml
 xos_services:
+  - name: rcord
+    path: orchestration/profiles/rcord
   - name: volt
     path: orchestration/xos_services/olt-service
     keypair: volt_rsa
@@ -91,8 +93,6 @@
 # service graph gui constraints
 xos_gui_service_graph_constraints: '[[null, "rcord"], [null, "volt"], ["addressmanager", "vsg"], [null, "vrouter"]]'
 
-profile_library: "rcord"
-
 # VTN network configuration
 management_network_cidr: 172.27.0.0/24
 management_network_ip: 172.27.0.1/24
diff --git a/templates/addressmanager-service.yaml.j2 b/templates/addressmanager-service.yaml.j2
index aae46f2..cb27ef7 100644
--- a/templates/addressmanager-service.yaml.j2
+++ b/templates/addressmanager-service.yaml.j2
@@ -1,4 +1,3 @@
-
 {#
 Copyright 2017-present Open Networking Foundation
 
@@ -32,9 +31,9 @@
       type: tosca.nodes.AddressPool
       properties:
         name: addresses_vsg
-        addresses: 10.7.1.0/24
-        gateway_ip: 10.7.1.1
-        gateway_mac: a4:23:05:06:01:01
+        addresses: {{ addresspool_vsg_cidr }}
+        gateway_ip: {{ addresspool_vsg_cidr | ipaddr('1') | ipaddr('address') }}
+        gateway_mac:  {{ ( vtn_net_public_hwaddr_prefix ~ ( vtn_net_public_cidr | ipaddr('1') | ipaddr('address') | ip4_hex )) | hwaddr('unix') }}
       requirements:
         - service:
             node: service#addressmanager
@@ -44,9 +43,9 @@
       type: tosca.nodes.AddressPool
       properties:
         name: addresses_public
-        addresses: 10.8.1.0/24
-        gateway_ip: 10.8.1.1
-        gateway_mac: a4:23:05:06:01:01
+        addresses: {{ addresspool_public_cidr }}
+        gateway_ip: {{ addresspool_public_cidr | ipaddr('1') | ipaddr('address') }}
+        gateway_mac:  {{ ( vtn_net_public_hwaddr_prefix ~ ( vtn_net_public_cidr | ipaddr('1') | ipaddr('address') | ip4_hex )) | hwaddr('unix') }}
       requirements:
         - service:
             node: service#addressmanager
diff --git a/templates/cord-services.yaml.j2 b/templates/cord-services.yaml.j2
index 0fb5171..8a6a168 100644
--- a/templates/cord-services.yaml.j2
+++ b/templates/cord-services.yaml.j2
@@ -1,4 +1,4 @@
-
+---
 {#
 Copyright 2017-present Open Networking Foundation
 
@@ -15,10 +15,9 @@
 limitations under the License.
 #}
 
-
 tosca_definitions_version: tosca_simple_yaml_1_0
 
-description: Just enough Tosca to get the vSG slice running on the CORD POD, created by platform-install
+description: Just enough Tosca to get the vSG slice running on the CORD POD, created by rcord profile
 
 imports:
   - custom_types/addressmanagerservice.yaml
@@ -62,10 +61,11 @@
         name: management
         must-exist: true
 
-{% if use_management_hosts %}
-    management_hosts:
+{% if use_vtn_net_management_host %}
+    management_host:
       type: tosca.nodes.Network
       properties:
+        name: management_host
         must-exist: true
 {% endif %}
 
@@ -127,13 +127,14 @@
             node: service#vsg
             relationship: tosca.relationships.BelongsToOne
 
+
     addresses_vsg:
       type: tosca.nodes.AddressPool
       properties:
         name: addresses_vsg
-        addresses: 10.7.1.0/24
-        gateway_ip: 10.7.1.1
-        gateway_mac: a4:23:05:06:01:01
+        addresses: {{ addresspool_vsg_cidr }}
+        gateway_ip: {{ addresspool_vsg_cidr | ipaddr('1') | ipaddr('address') }}
+        gateway_mac:  {{ ( vtn_net_public_hwaddr_prefix ~ ( vtn_net_public_cidr | ipaddr('1') | ipaddr('address') | ip4_hex )) | hwaddr('unix') }}
       requirements:
         - service:
             node: service#addressmanager
@@ -143,9 +144,9 @@
       type: tosca.nodes.AddressPool
       properties:
         name: addresses_public
-        addresses: 10.8.1.0/24
-        gateway_ip: 10.8.1.1
-        gateway_mac: a4:23:05:06:01:01
+        addresses: {{ addresspool_public_cidr }}
+        gateway_ip: {{ addresspool_public_cidr | ipaddr('1') | ipaddr('address') }}
+        gateway_mac:  {{ ( vtn_net_public_hwaddr_prefix ~ ( vtn_net_public_cidr | ipaddr('1') | ipaddr('address') | ip4_hex )) | hwaddr('unix') }}
       requirements:
         - service:
             node: service#addressmanager
@@ -233,10 +234,10 @@
               node: service#vrouter
               relationship: tosca.relationships.BelongsToOne
 
-    template#vsg:
+    vsg_template:
       type: tosca.nodes.NetworkTemplate
       properties:
-        name: vsg
+        name: vsg_template
         visibility: private
         translation: none
         vtn_kind: VSG
@@ -249,7 +250,7 @@
         # ip_version: 4
       requirements:
         - template:
-            node: template#vsg
+            node: vsg_template
             relationship: tosca.relationships.BelongsToOne
         - owner:
             node: {{ site_name }}_vsg
@@ -272,7 +273,7 @@
       properties:
         network: noauto
         name: {{ site_name }}_vsg
-      requirements: 
+      requirements:
         - service:
             node: service#vsg
             relationship: tosca.relationships.BelongsToOne
@@ -293,18 +294,18 @@
               node: {{ site_name }}_vsg
               relationship: tosca.relationships.BelongsToOne
 
-{% if use_management_hosts %}
-    networkslice#management_hosts_to_{{ site_name }}_vsg:
+{% if use_vtn_net_management_host %}
+    networkslice#management_host_to_{{ site_name }}_vsg:
         type: tosca.nodes.NetworkSlice
         requirements:
           - network:
-              node: management_hosts
+              node: management_host
               relationship: tosca.relationships.BelongsToOne
           - slice:
-            node: {{ site_name }}_vsg
-            relationship: tosca.relationships.BelongsToOne
+              node: {{ site_name }}_vsg
+              relationship: tosca.relationships.BelongsToOne
 {% endif %}
-    
+
     # TODO: migrate interfaces when we'll start using them
     # in#lanside:
     #   type: tosca.nodes.InterfaceType
@@ -364,4 +365,5 @@
     #         relationship: tosca.relationships.MemberOfService
     #     - interface:
     #         node: in#wanside
-    #         relationship: tosca.relationships.IsType
\ No newline at end of file
+    #         relationship: tosca.relationships.IsType
+
diff --git a/templates/fabric-service.yaml.j2 b/templates/fabric-service.yaml.j2
index e28d5ea..77ed898 100644
--- a/templates/fabric-service.yaml.j2
+++ b/templates/fabric-service.yaml.j2
@@ -25,7 +25,7 @@
    - custom_types/onosapp.yaml
    - custom_types/serviceinstancelink.yaml
 
-description: fabric services, generated by platform-install
+description: fabric services, generated by rcord profile
 
 topology_template:
   node_templates:
diff --git a/templates/management-net.yaml.j2 b/templates/management-net.yaml.j2
index 9c7b03c..cbef35c 100644
--- a/templates/management-net.yaml.j2
+++ b/templates/management-net.yaml.j2
@@ -24,7 +24,7 @@
    - custom_types/slice.yaml
    - custom_types/site.yaml
 
-description: management network config, generated by platform-install
+description: management network config, generated by rcord profile
 
 topology_template:
   node_templates:
@@ -35,7 +35,7 @@
       properties:
         name: {{ site_name }}
 
-# management network
+# management (vtn: MANAGEMENT_LOCAL) network
     management_template:
       type: tosca.nodes.NetworkTemplate
       properties:
@@ -59,33 +59,37 @@
             node: slice#{{ site_name }}_management
             relationship: tosca.relationships.BelongsToOne
 
-{% if use_management_hosts %}
-    management_hosts_template:
+{% if use_vtn_net_management_host %}
+# management_host (vtn: MANAGEMENT_HOST) network
+    management_host_template:
       type: tosca.nodes.NetworkTemplate
       properties:
-        name: management_hosts_template
+        name: management_host_template
         visibility: private
         translation: none
         vtn_kind: MANAGEMENT_HOST
 
-    management_hosts:
+    management_host:
       type: tosca.nodes.Network
       properties:
+        name: management_host
         # ip_version: 4
-        subnet: {{ management_hosts_net_cidr }}
-        start_ip: {{ management_hosts_net_range_xos_low }}
-        end_ip: {{ management_hosts_net_range_xos_high }}
+        subnet: {{ vtn_net_management_host_cidr }}
+        start_ip: {{ vtn_net_management_host_range_xos_low }}
+        end_ip: {{ vtn_net_management_host_range_xos_high }}
+        permit_all_slices: true
       requirements:
         - template:
-            node: management_hosts_template
+            node: management_host_template
             relationship: tosca.relationships.BelongsToOne
         - owner:
             node: slice#{{ site_name }}_management
             relationship: tosca.relationships.BelongsToOne
 {% endif %}
 
+# Slice to own management networks
     slice#{{ site_name }}_management:
-      description: This slice exists solely to own the management network
+      description: This slice exists solely to own the management network(s)
       type: tosca.nodes.Slice
       properties:
         network: noauto
diff --git a/templates/public-net.yaml.j2 b/templates/public-net.yaml.j2
index 610c58b..cc30e71 100644
--- a/templates/public-net.yaml.j2
+++ b/templates/public-net.yaml.j2
@@ -1,4 +1,3 @@
-
 {#
 Copyright 2017-present Open Networking Foundation
 
@@ -15,7 +14,6 @@
 limitations under the License.
 #}
 
-
 tosca_definitions_version: tosca_simple_yaml_1_0
 
 imports:
@@ -29,21 +27,30 @@
   - custom_types/site.yaml
   - custom_types/slice.yaml
 
-description: public network config, generated by platform-install
+description: public network config, generated by rcord profile
 
 topology_template:
   node_templates:
 
-# site, fully created in deployment.yaml
+# site, fully created in deployment.yaml.j2
     {{ site_name }}:
       type: tosca.nodes.Site
       properties:
         name: {{ site_name }}
         must-exist: true
 
+    {{ site_name }}_public:
+      description: This slice exists solely to own the public network
+      type: tosca.nodes.Slice
+      properties:
+        network: noauto
+        name: {{ site_name }}_public
+      requirements:
+        - site:
+            node: {{ site_name }}
+            relationship: tosca.relationships.BelongsToOne
 
-
-# Address Manager service, fully created in cord-service.yaml
+# Address Manager service, fully created in cord-services.yaml.j2
     service#addressmanager:
       type: tosca.nodes.AddressManagerService
       properties:
@@ -51,31 +58,30 @@
         must-exist: true
 
 # public network
-
     public_template:
       type: tosca.nodes.NetworkTemplate
       properties:
-          name: public_template
-          visibility: public
-          translation: none
-          vtn_kind: PUBLIC
+        name: public_template
+        visibility: public
+        translation: none
+        vtn_kind: PUBLIC
 
     public:
       type: tosca.nodes.Network
       properties:
-          name: public
-          permit_all_slices: true
-          subnet: 10.8.1.0/24 # NOTE same as AddressPool#addresses_public
-          # ip_version: 4
+        name: public
+        permit_all_slices: true
+        subnet: {{ addresspool_public_cidr }}
+        # ip_version: 4
       requirements:
-          - template:
-              node: public_template
-              relationship: tosca.relationships.BelongsToOne
-          - owner:
-              node: {{ site_name }}_public
-              relationship: tosca.relationships.BelongsToOne
+        - template:
+            node: public_template
+            relationship: tosca.relationships.BelongsToOne
+        - owner:
+            node: {{ site_name }}_public
+            relationship: tosca.relationships.BelongsToOne
 
-    # Created in cord-services.yaml.j2
+# Created in cord-services.yaml.j2
     addresses_public:
       type: tosca.nodes.AddressPool
       properties:
@@ -85,33 +91,22 @@
     AddressManagerServiceInstancePublicNetwork:
       type: tosca.nodes.AddressManagerServiceInstance
       requirements:
-          - owner:
-              node: service#addressmanager
-              relationship: tosca.relationships.BelongsToOne
-          - address_pool:
-              node: addresses_public
-              relationship: tosca.relationships.BelongsToOne
+        - owner:
+            node: service#addressmanager
+            relationship: tosca.relationships.BelongsToOne
+        - address_pool:
+            node: addresses_public
+            relationship: tosca.relationships.BelongsToOne
       properties:
-          name: AM_public_net
+        name: AM_public_net
 
     public_to_address_manager:
-        type: tosca.nodes.ServiceInstanceLink
-        requirements:
-          - provider_service_instance:
-              node: AddressManagerServiceInstancePublicNetwork
-              relationship: tosca.relationships.BelongsToOne
-          - subscriber_network:
-              node: public
-              relationship: tosca.relationships.BelongsToOne
-
-    {{ site_name }}_public:
-      description: This slice exists solely to own the public network
-      type: tosca.nodes.Slice
-      properties:
-          network: noauto
-          name: {{ site_name }}_public
+      type: tosca.nodes.ServiceInstanceLink
       requirements:
-          - site:
-              node: {{ site_name }}
-              relationship: tosca.relationships.BelongsToOne
+        - provider_service_instance:
+            node: AddressManagerServiceInstancePublicNetwork
+            relationship: tosca.relationships.BelongsToOne
+        - subscriber_network:
+            node: public
+            relationship: tosca.relationships.BelongsToOne
 
diff --git a/templates/vsg-net.yaml.j2 b/templates/vsg-net.yaml.j2
index 9bcf397..ef5787e 100644
--- a/templates/vsg-net.yaml.j2
+++ b/templates/vsg-net.yaml.j2
@@ -6,7 +6,7 @@
   - custom_types/slice.yaml
   - custom_types/site.yaml
 
-description: vsg network config, generated by platform-install
+description: vsg network config, generated by rcord profile
 
 topology_template:
   node_templates:
@@ -31,7 +31,7 @@
       type: tosca.nodes.Network
       properties:
           name: vsg_network
-          subnet: 101.0.0.0/24
+          subnet: {{ addresspool_vsg_cidr }}
       requirements:
           - template:
               node: vsg_template
@@ -51,4 +51,3 @@
               node: {{ site_name }}
               relationship: tosca.relationships.BelongsToOne
 
-
diff --git a/templates/vtn-service.yaml.j2 b/templates/vtn-service.yaml.j2
index 6a2dbd6..4f5a419 100644
--- a/templates/vtn-service.yaml.j2
+++ b/templates/vtn-service.yaml.j2
@@ -44,7 +44,7 @@
           kind: platform
           view_url: /admin/vtn/vtnservice/$id$/
           privateGatewayMac: 00:00:00:00:00:01
-          localManagementIp: {{ management_network_ip }}
+          localManagementIp: {{ vtn_net_management_local_cidr | ipaddr('1') }}
           ovsdbPort: 6641
           sshUser: root
           sshKeyFile: /root/node_key
diff --git a/xos/admin.py b/xos/admin.py
deleted file mode 100644
index 526fe61..0000000
--- a/xos/admin.py
+++ /dev/null
@@ -1,85 +0,0 @@
-
-# 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.
-
-
-from django.contrib import admin
-
-#from services.volt.models import *
-from services.rcord.models import *
-from django import forms
-from django.utils.safestring import mark_safe
-from django.contrib.auth.admin import UserAdmin
-from django.contrib.admin.widgets import FilteredSelectMultiple
-from django.contrib.auth.forms import ReadOnlyPasswordHashField
-from django.contrib.auth.signals import user_logged_in
-from django.utils import timezone
-from django.contrib.contenttypes import generic
-from suit.widgets import LinkedSelect
-from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline
-from core.middleware import get_request
-
-from functools import update_wrapper
-from django.contrib.admin.views.main import ChangeList
-from django.core.urlresolvers import reverse
-from django.contrib.admin.utils import quote
-
-#class VOLTTenantInline(XOSTabularInline):
-#    model = VOLTTenant
-#    fields = ['provider_service', 'subscriber_root', 'service_specific_id']
-#    readonly_fields = ['provider_service', 'subscriber_root', 'service_specific_id']
-#    extra = 0
-#    max_num = 0
-#    suit_classes = 'suit-tab suit-tab-volttenants'
-#    fk_name = 'subscriber_root'
-#    verbose_name = 'subscribed tenant'
-#    verbose_name_plural = 'subscribed tenants'
-#
-#    @property
-#    def selflink_reverse_path(self):
-#        return "admin:cord_volttenant_change"
-
-class CordSubscriberRootForm(forms.ModelForm):
-    def __init__(self,*args,**kwargs):
-        super (CordSubscriberRootForm,self ).__init__(*args,**kwargs)
-        self.fields['kind'].widget.attrs['readonly'] = True
-        if (not self.instance) or (not self.instance.pk):
-            # default fields for an 'add' form
-            self.fields['kind'].initial = CORD_SUBSCRIBER_KIND
-
-    def save(self, commit=True):
-        return super(CordSubscriberRootForm, self).save(commit=commit)
-
-    class Meta:
-        model = CordSubscriberRoot
-        fields = '__all__'
-
-class CordSubscriberRootAdmin(ReadOnlyAwareAdmin):
-    list_display = ('backend_status_icon', 'id',  'name', )
-    list_display_links = ('backend_status_icon', 'id', 'name', )
-    fieldsets = [ (None, {'fields': ['backend_status_text', 'kind', 'name', 'service_specific_id', # 'service_specific_attribute',
-                                     'url_filter_level', "uplink_speed", "downlink_speed", "status", "enable_uverse", "cdn_enable"],
-                          'classes':['suit-tab suit-tab-general']})]
-    readonly_fields = ('backend_status_text', 'service_specific_attribute',)
-    form = CordSubscriberRootForm
-
-    suit_form_tabs =(('general', 'Cord Subscriber Root Details'),
-#        ('volttenants','VOLT Tenancy'),
-#        ('tenantrootprivileges','Privileges')
-    )
-
-    def get_queryset(self, request):
-        return CordSubscriberRoot.get_tenant_objects_by_user(request.user)
-
-admin.site.register(CordSubscriberRoot, CordSubscriberRootAdmin)
diff --git a/xos/header.py b/xos/header.py
deleted file mode 120000
index 721b5c0..0000000
--- a/xos/header.py
+++ /dev/null
@@ -1 +0,0 @@
-attic/header.py
\ No newline at end of file
diff --git a/xos/rcord-onboard.yaml b/xos/rcord-onboard.yaml
index d71b90e..e4d8384 100644
--- a/xos/rcord-onboard.yaml
+++ b/xos/rcord-onboard.yaml
@@ -29,5 +29,3 @@
           base_url: file:///opt/cord/orchestration/profiles/rcord/xos/
           # The following will concatenate with base_url automatically, if
           # base_url is non-null.
-          xproto: ./
-          admin: admin.py
diff --git a/xos/synchronizer/Dockerfile.synchronizer b/xos/synchronizer/Dockerfile.synchronizer
new file mode 100644
index 0000000..fb7438d
--- /dev/null
+++ b/xos/synchronizer/Dockerfile.synchronizer
@@ -0,0 +1,55 @@
+
+# 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.
+
+
+# xosproject/rcord-synchronizer
+FROM xosproject/xos-synchronizer-base:candidate
+
+COPY . /opt/xos/synchronizers/rcord
+
+ENTRYPOINT []
+
+WORKDIR "/opt/xos/synchronizers/rcord"
+
+# Label image
+ARG org_label_schema_schema_version=1.0
+ARG org_label_schema_name=rcord-synchronizer
+ARG org_label_schema_version=unknown
+ARG org_label_schema_vcs_url=unknown
+ARG org_label_schema_vcs_ref=unknown
+ARG org_label_schema_build_date=unknown
+ARG org_opencord_vcs_commit_date=unknown
+ARG org_opencord_component_chameleon_version=unknown
+ARG org_opencord_component_chameleon_vcs_url=unknown
+ARG org_opencord_component_chameleon_vcs_ref=unknown
+ARG org_opencord_component_xos_version=unknown
+ARG org_opencord_component_xos_vcs_url=unknown
+ARG org_opencord_component_xos_vcs_ref=unknown
+
+LABEL org.label-schema.schema-version=$org_label_schema_schema_version \
+      org.label-schema.name=$org_label_schema_name \
+      org.label-schema.version=$org_label_schema_version \
+      org.label-schema.vcs-url=$org_label_schema_vcs_url \
+      org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
+      org.label-schema.build-date=$org_label_schema_build_date \
+      org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \
+      org.opencord.component.chameleon.version=$org_opencord_component_chameleon_version \
+      org.opencord.component.chameleon.vcs-url=$org_opencord_component_chameleon_vcs_url \
+      org.opencord.component.chameleon.vcs-ref=$org_opencord_component_chameleon_vcs_ref \
+      org.opencord.component.xos.version=$org_opencord_component_xos_version \
+      org.opencord.component.xos.vcs-url=$org_opencord_component_xos_vcs_url \
+      org.opencord.component.xos.vcs-ref=$org_opencord_component_xos_vcs_ref
+
+CMD bash -c "cd /opt/xos/synchronizers/rcord; ./run-from-api.sh"
diff --git a/xos/synchronizer/model-deps b/xos/synchronizer/model-deps
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/xos/synchronizer/model-deps
@@ -0,0 +1 @@
+{}
diff --git a/xos/attic/cordsubscriberroot_bottom.py b/xos/synchronizer/models/attic/cordsubscriberroot_bottom.py
similarity index 100%
rename from xos/attic/cordsubscriberroot_bottom.py
rename to xos/synchronizer/models/attic/cordsubscriberroot_bottom.py
diff --git a/xos/attic/cordsubscriberroot_model.py b/xos/synchronizer/models/attic/cordsubscriberroot_model.py
similarity index 100%
rename from xos/attic/cordsubscriberroot_model.py
rename to xos/synchronizer/models/attic/cordsubscriberroot_model.py
diff --git a/xos/attic/header.py b/xos/synchronizer/models/attic/header.py
similarity index 100%
rename from xos/attic/header.py
rename to xos/synchronizer/models/attic/header.py
diff --git a/xos/rcord.xproto b/xos/synchronizer/models/rcord.xproto
similarity index 100%
rename from xos/rcord.xproto
rename to xos/synchronizer/models/rcord.xproto
diff --git a/xos/synchronizer/rcord-synchronizer.py b/xos/synchronizer/rcord-synchronizer.py
new file mode 100644
index 0000000..4e11e6d
--- /dev/null
+++ b/xos/synchronizer/rcord-synchronizer.py
@@ -0,0 +1,32 @@
+
+# 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.
+
+
+#!/usr/bin/env python
+
+# This imports and runs ../../xos-observer.py
+
+import importlib
+import os
+import sys
+from xosconfig import Config
+
+config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/rcord_config.yaml')
+Config.init(config_file, 'synchronizer-config-schema.yaml')
+
+observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/new_base")
+sys.path.append(observer_path)
+mod = importlib.import_module("xos-synchronizer")
+mod.main()
diff --git a/xos/synchronizer/rcord_config.yaml b/xos/synchronizer/rcord_config.yaml
new file mode 100644
index 0000000..a8729e0
--- /dev/null
+++ b/xos/synchronizer/rcord_config.yaml
@@ -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.
+
+
+name: rcord
+accessor:
+  username: xosadmin@opencord.org
+  password: "@/opt/xos/services/rcord/credentials/xosadmin@opencord.org"
+dependency_graph: "/opt/xos/synchronizers/rcord/model-deps"
+sys_dir: "/opt/xos/synchronizers/rcord/sys"
+models_dir: "/opt/xos/synchronizers/rcord/models"
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
new file mode 100755
index 0000000..1d936f7
--- /dev/null
+++ b/xos/synchronizer/run-from-api.sh
@@ -0,0 +1,17 @@
+
+# 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.
+
+
+python rcord-synchronizer.py