Merge "Increase memory size for virt-customize"
[apex.git] / build / barometer-install.sh
index a6b3f91..15753a4 100755 (executable)
 # limitations under the License.
 
 # Get and install packages needed for Barometer service.
-# These are: collectd rpm's and dependencies, collectd-ceilometer-plugin,
+# These are: collectd rpm's and dependencies, collectd-openstack-plugins,
 # puppet-barometer module.
+source ./variables.sh
 
 # Versions/branches
-COLLECTD_CEILOMETER_PLUGIN_BRANCH="stable/ocata"
+COLLECTD_OPENSTACK_PLUGINS_BRANCH="stable/pike"
 
 ARCH="6.el7.centos.x86_64.rpm"
 # don't fail because of missing certificate
@@ -27,7 +28,7 @@ GETFLAG="--no-check-certificate"
 
 # Locations of repos
 ARTIFACTS_BAROM="artifacts.opnfv.org/barometer"
-COLLECTD_CEILOMETER_REPO="https://github.com/openstack/collectd-ceilometer-plugin"
+COLLECTD_OPENSTACK_REPO="https://github.com/openstack/collectd-ceilometer-plugin"
 PUPPET_BAROMETER_REPO="https://github.com/johnhinman/puppet-barometer"
 
 # upload barometer packages tar, extract, and install
@@ -76,12 +77,12 @@ function barometer_pkgs {
   cp collectd.tar.gz ${BUILD_DIR}
   popd > /dev/null
 
-  # get collectd-ceilometer-plugin and tar it
-  rm -rf collectd-ceilometer-plugin
-  git clone https://github.com/openstack/collectd-ceilometer-plugin
-  pushd collectd-ceilometer-plugin
-  git checkout -b $COLLECTD_CEILOMETER_PLUGIN_BRANCH
-  git archive --format=tar.gz HEAD > ${BUILD_DIR}/collectd-ceilometer-plugin.tar.gz
+  # get collectd-openstack-plugins and tar it
+  rm -rf collectd-openstack-plugins
+  git clone $COLLECTD_OPENSTACK_REPO collectd-openstack-plugins
+  pushd collectd-openstack-plugins
+  git checkout $COLLECTD_OPENSTACK_PLUGINS_BRANCH
+  git archive --format=tar.gz HEAD > ${BUILD_DIR}/collectd-openstack-plugins.tar.gz
   popd > /dev/null
 
   # get the barometer puppet module and tar it
@@ -101,9 +102,9 @@ function barometer_pkgs {
   # Upload tar files to image
   # untar collectd packages
   # install dependencies
-  LIBGUESTFS_BACKEND=direct virt-customize \
+  LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
     --upload ${BUILD_DIR}/collectd.tar.gz:/opt/ \
-    --upload ${BUILD_DIR}/collectd-ceilometer-plugin.tar.gz:/opt/ \
+    --upload ${BUILD_DIR}/collectd-openstack-plugins.tar.gz:/opt/ \
     --upload ${BUILD_DIR}/puppet-barometer.tar.gz:/etc/puppet/modules/ \
     --run-command 'tar xfz /opt/collectd.tar.gz -C /opt' \
     --install libstatgrab,log4cplus,rrdtool,rrdtool-devel \
@@ -111,12 +112,12 @@ function barometer_pkgs {
     --install libvirt,libvirt-devel,gcc \
     -a $OVERCLOUD_IMAGE
 
-  LIBGUESTFS_BACKEND=direct virt-customize \
+  LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
     --run-command 'python3.4 /opt/get-pip.py' \
     --run-command 'pip3 install requests libvirt-python pbr babel future six' \
     -a $OVERCLOUD_IMAGE
 
-  LIBGUESTFS_BACKEND=direct virt-customize \
+  LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
     --run-command "yum install -y \
     /opt/libcollectdclient-${SUFFIX} \
     /opt/libcollectdclient-devel-${SUFFIX} \
@@ -133,18 +134,18 @@ function barometer_pkgs {
     /opt/collectd-virt-${SUFFIX}" \
     -a $OVERCLOUD_IMAGE
 
-  # install collectd-ceilometer plugin
+  # install collectd-openstack-plugins
   # install puppet-barometer module
   # make directories for config files and mibs
-  LIBGUESTFS_BACKEND=direct virt-customize \
-    --run-command 'mkdir /opt/stack/collectd-ceilometer' \
-    --run-command "tar xfz /opt/collectd-ceilometer-plugin.tar.gz -C /opt/stack/collectd-ceilometer" \
+  LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
+    --run-command 'mkdir /opt/stack/collectd-openstack' \
+    --run-command "tar xfz /opt/collectd-openstack-plugins.tar.gz -C /opt/stack/collectd-openstack" \
     --run-command "cd /etc/puppet/modules/ && mkdir barometer && \
       tar xzf puppet-barometer.tar.gz -C barometer" \
     --run-command 'mkdir /usr/share/mibs/' \
-    --run-command 'mkdir /usr/share/mibs/ietf' \
-    --upload ${BUILD_DIR}/mibs.tar.gz:/usr/share/mibs/ietf/ \
-    --run-command 'tar xfz /usr/share/mibs/ietf/mibs.tar.gz -C /usr/share/mibs/ietf' \
+    --upload ${BUILD_DIR}/mibs.tar.gz:/usr/share/snmp/mibs/ \
+    --run-command 'tar xfz /usr/share/snmp/mibs/mibs.tar.gz -C /usr/share/snmp/mibs/' \
+    --run-command 'ln -s /usr/share/snmp/mibs/ /usr/share/mibs/ietf' \
     --run-command 'mkdir -p /etc/collectd/collectd.conf.d' \
     -a $OVERCLOUD_IMAGE
 }