Fixes for onboarding Monitoring service
Change-Id: I6dc97fce6406ce7c0e371c8d9c064ae85c5f37b8
diff --git a/xos/synchronizer/manifest b/xos/synchronizer/manifest
index c679225..806c96c 100644
--- a/xos/synchronizer/manifest
+++ b/xos/synchronizer/manifest
@@ -12,7 +12,8 @@
templates/ceilometer_proxy_server.py
templates/start_ceilometer_proxy
manifest
-monitoring_channel_synchronizer_config
+run.sh
+monitoring_synchronizer_config
steps/sync_sflowtenant.yaml
steps/sync_sflowtenant.py
steps/sync_monitoringchannel.yaml
@@ -22,5 +23,5 @@
files/vm-resolv.conf
files/docker.list
model-deps
-supervisor/monitoring_channel_observer.conf
-monitoring_channel_synchronizer.py
+supervisor/monitoring_observer.conf
+monitoring_synchronizer.py
diff --git a/xos/synchronizer/monitoring_channel_synchronizer.py b/xos/synchronizer/monitoring_synchronizer.py
similarity index 100%
rename from xos/synchronizer/monitoring_channel_synchronizer.py
rename to xos/synchronizer/monitoring_synchronizer.py
diff --git a/xos/synchronizer/monitoring_channel_synchronizer_config b/xos/synchronizer/monitoring_synchronizer_config
similarity index 65%
rename from xos/synchronizer/monitoring_channel_synchronizer_config
rename to xos/synchronizer/monitoring_synchronizer_config
index 8c6578f..5cfe5e3 100644
--- a/xos/synchronizer/monitoring_channel_synchronizer_config
+++ b/xos/synchronizer/monitoring_synchronizer_config
@@ -22,11 +22,11 @@
nova_enabled=True
[observer]
-name=monitoring_channel
-dependency_graph=/opt/xos/synchronizers/monitoring_channel/model-deps
-steps_dir=/opt/xos/synchronizers/monitoring_channel/steps
-sys_dir=/opt/xos/synchronizers/monitoring_channel/sys
-deleters_dir=/opt/xos/synchronizers/monitoring_channel/deleters
+name=monitoring_service
+dependency_graph=/opt/xos/synchronizers/monitoring/model-deps
+steps_dir=/opt/xos/synchronizers/monitoring/steps
+sys_dir=/opt/xos/synchronizers/monitoring/sys
+deleters_dir=/opt/xos/synchronizers/monitoring/deleters
log_file=console
driver=None
pretend=False
diff --git a/xos/synchronizer/run.sh b/xos/synchronizer/run.sh
new file mode 100755
index 0000000..5c9c2d6
--- /dev/null
+++ b/xos/synchronizer/run.sh
@@ -0,0 +1,6 @@
+#if [[ ! -e ./vcpe-observer.py ]]; then
+# ln -s ../../xos-observer.py vcpe-observer.py
+#fi
+
+export XOS_DIR=/opt/xos
+python monitoring_synchronizer.py -C $XOS_DIR/synchronizers/monitoring/monitoring_synchronizer_config
diff --git a/xos/synchronizer/steps/sync_monitoringchannel.py b/xos/synchronizer/steps/sync_monitoringchannel.py
index 2c0ba10..bf3390b 100644
--- a/xos/synchronizer/steps/sync_monitoringchannel.py
+++ b/xos/synchronizer/steps/sync_monitoringchannel.py
@@ -10,7 +10,7 @@
from synchronizers.base.ansible import run_template_ssh
from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
from core.models import Service, Slice
-from services.ceilometer.models import CeilometerService, MonitoringChannel
+from services.monitoring.models import CeilometerService, MonitoringChannel
from xos.logger import Logger, logging
parentdir = os.path.join(os.path.dirname(__file__),"..")
@@ -23,7 +23,7 @@
observes=MonitoringChannel
requested_interval=0
template_name = "sync_monitoringchannel.yaml"
- service_key_name = "/opt/xos/synchronizers/monitoring_channel/monitoring_channel_private_key"
+ service_key_name = "/opt/xos/synchronizers/monitoring/monitoring_channel_private_key"
def __init__(self, *args, **kwargs):
super(SyncMonitoringChannel, self).__init__(*args, **kwargs)
diff --git a/xos/synchronizer/steps/sync_monitoringchannel.yaml b/xos/synchronizer/steps/sync_monitoringchannel.yaml
index ca72c5f..ad9b062 100644
--- a/xos/synchronizer/steps/sync_monitoringchannel.yaml
+++ b/xos/synchronizer/steps/sync_monitoringchannel.yaml
@@ -26,14 +26,14 @@
{% if delete %}
- name: Remove tenant
# FIXME: Adding dummy template action to avoid "action attribute missing in task" error
- template: src=/opt/xos/synchronizers/monitoring_channel/templates/ceilometer_proxy_config.j2 dest=/usr/local/share/monitoring-channel-{{ unique_id }}_ceilometer_proxy_config mode=0777
+ template: src=/opt/xos/synchronizers/monitoring/templates/ceilometer_proxy_config.j2 dest=/usr/local/share/monitoring-channel-{{ unique_id }}_ceilometer_proxy_config mode=0777
notify:
- stop monitoring-channel
- remove container
{% else %}
{% if full_setup %}
# - name: Docker repository
-# copy: src=/opt/xos/synchronizers/monitoring_channel/files/docker.list
+# copy: src=/opt/xos/synchronizers/monitoring/files/docker.list
# dest=/etc/apt/sources.list.d/docker.list
#
# - name: Import the repository key
@@ -74,7 +74,7 @@
# - file: path=/usr/local/share/monitoring-channel-{{ unique_id }}_ceilometer_proxy_config state=absent
- name: ceilometer proxy config
- template: src=/opt/xos/synchronizers/monitoring_channel/templates/ceilometer_proxy_config.j2 dest=/usr/local/share/monitoring-channel-{{ unique_id }}_ceilometer_proxy_config mode=0777
+ template: src=/opt/xos/synchronizers/monitoring/templates/ceilometer_proxy_config.j2 dest=/usr/local/share/monitoring-channel-{{ unique_id }}_ceilometer_proxy_config mode=0777
notify:
- copy ceilo-config-file
- restart monitoring-channel container
@@ -83,10 +83,10 @@
# - start monitoring-channel
- name: Monitoring channel upstart
- template: src=/opt/xos/synchronizers/monitoring_channel/templates/monitoring-channel.conf.j2 dest=/etc/init/monitoring-channel-{{ unique_id }}.conf
+ template: src=/opt/xos/synchronizers/monitoring/templates/monitoring-channel.conf.j2 dest=/etc/init/monitoring-channel-{{ unique_id }}.conf
- name: Monitoring channel startup script
- template: src=/opt/xos/synchronizers/monitoring_channel/templates/start-monitoring-channel.sh.j2 dest=/usr/local/sbin/start-monitoring-channel-{{ unique_id }}.sh mode=0755
+ template: src=/opt/xos/synchronizers/monitoring/templates/start-monitoring-channel.sh.j2 dest=/usr/local/sbin/start-monitoring-channel-{{ unique_id }}.sh mode=0755
notify:
# - restart monitoring-channel
- stop monitoring-channel
diff --git a/xos/synchronizer/steps/sync_sflowservice.py b/xos/synchronizer/steps/sync_sflowservice.py
index 154c5ab..a3978ca 100644
--- a/xos/synchronizer/steps/sync_sflowservice.py
+++ b/xos/synchronizer/steps/sync_sflowservice.py
@@ -10,7 +10,7 @@
from synchronizers.base.ansible import run_template_ssh
from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
from core.models import Service, Slice
-from services.ceilometer.models import SFlowService
+from services.monitoring.models import SFlowService
from xos.logger import Logger, logging
# hpclibrary will be in steps/..
@@ -24,7 +24,7 @@
observes=SFlowService
requested_interval=0
template_name = "sync_sflowservice.yaml"
- service_key_name = "/opt/xos/synchronizers/monitoring_channel/monitoring_channel_private_key"
+ service_key_name = "/opt/xos/synchronizers/monitoring/monitoring_channel_private_key"
def __init__(self, *args, **kwargs):
super(SyncSFlowService, self).__init__(*args, **kwargs)
diff --git a/xos/synchronizer/steps/sync_sflowservice.yaml b/xos/synchronizer/steps/sync_sflowservice.yaml
index 8d853a2..a9df1e5 100644
--- a/xos/synchronizer/steps/sync_sflowservice.yaml
+++ b/xos/synchronizer/steps/sync_sflowservice.yaml
@@ -42,7 +42,7 @@
state=latest
- name: sflow pub-sub config
- template: src=/opt/xos/synchronizers/monitoring_channel/templates/sflow_pub_sub/sflow_pub_sub_config.j2 dest=/usr/local/share/sflow_pub_sub.conf mode=0777
+ template: src=/opt/xos/synchronizers/monitoring/templates/sflow_pub_sub/sflow_pub_sub_config.j2 dest=/usr/local/share/sflow_pub_sub.conf mode=0777
- name: Start SFLOW pub-sub container
docker:
diff --git a/xos/synchronizer/steps/sync_sflowtenant.py b/xos/synchronizer/steps/sync_sflowtenant.py
index a15fa54..18e5d48 100644
--- a/xos/synchronizer/steps/sync_sflowtenant.py
+++ b/xos/synchronizer/steps/sync_sflowtenant.py
@@ -13,7 +13,7 @@
from synchronizers.base.ansible import run_template_ssh
from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
from core.models import Service, Slice, ControllerSlice, ControllerUser
-from services.ceilometer.models import SFlowService, SFlowTenant
+from services.monitoring.models import SFlowService, SFlowTenant
from xos.logger import Logger, logging
# hpclibrary will be in steps/..
@@ -27,7 +27,7 @@
observes=SFlowTenant
requested_interval=0
template_name = "sync_sflowtenant.yaml"
- service_key_name = "/opt/xos/synchronizers/monitoring_channel/monitoring_channel_private_key"
+ service_key_name = "/opt/xos/synchronizers/monitoring/monitoring_channel_private_key"
def __init__(self, *args, **kwargs):
super(SyncSFlowTenant, self).__init__(*args, **kwargs)
diff --git a/xos/synchronizer/supervisor/monitoring_channel_observer.conf b/xos/synchronizer/supervisor/monitoring_channel_observer.conf
deleted file mode 100644
index 1c2dd42..0000000
--- a/xos/synchronizer/supervisor/monitoring_channel_observer.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-[program:monitoring_channel_observer]
-command=python /opt/xos/synchronizers/monitoring_channel/monitoring_channel_synchronizer.py -C /opt/xos/synchronizers/monitoring_channel/monitoring_channel_synchronizer_config
diff --git a/xos/synchronizer/supervisor/monitoring_observer.conf b/xos/synchronizer/supervisor/monitoring_observer.conf
new file mode 100644
index 0000000..38d417a
--- /dev/null
+++ b/xos/synchronizer/supervisor/monitoring_observer.conf
@@ -0,0 +1,2 @@
+[program:monitoring_service_observer]
+command=python /opt/xos/synchronizers/monitoring/monitoring_synchronizer.py -C /opt/xos/synchronizers/monitoring/monitoring_synchronizer_config