X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=build%2Finstack.sh;h=52384689d8595b5de1709ec7e206b27b16a518cf;hb=3beba87a803197bc9651aa539474c1990fe3c646;hp=54f05d54ae9fe2baf1ece056da0fc81c8eb6f666;hpb=59fc6d84444d3d8a1b34938455af60c9f7b1b415;p=apex.git diff --git a/build/instack.sh b/build/instack.sh index 54f05d54..52384689 100755 --- a/build/instack.sh +++ b/build/instack.sh @@ -1,4 +1,12 @@ #!/bin/sh +############################################################################## +# Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## set -e declare -i CNT @@ -63,7 +71,7 @@ fi cat << 'EOF' | sudo tee /etc/yum.repos.d/opendaylight.repo [opendaylight] name=OpenDaylight $releasever - $basearch -baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-3-candidate/$basearch/os/ +baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-33-release/$basearch/os/ enabled=1 gpgcheck=0 EOF @@ -237,45 +245,160 @@ LIBGUESTFS_BACKEND=direct virt-customize --install $PACKAGES \ popd -#Adding OpenDaylight to overcloud pushd stack + +########################################################## +##### Prep initial overcloud image with common deps ##### +########################################################## + # make a copy of the cached overcloud-full image -cp overcloud-full.qcow2 overcloud-full-odl.qcow2 +cp overcloud-full.qcow2 overcloud-full-opendaylight.qcow2 +# Update puppet-aodh it's old +rm -rf aodh +git clone https://github.com/openstack/puppet-aodh aodh +pushd aodh +git checkout stable/liberty +popd +tar -czf puppet-aodh.tar.gz aodh + +# work around for XFS grow bug +# http://xfs.org/index.php/XFS_FAQ#Q:_Why_do_I_receive_No_space_left_on_device_after_xfs_growfs.3F +cat > /tmp/xfs-grow-remount-fix.service << EOF +[Unit] +Description=XFS Grow Bug Remount +After=network.target +Before=getty@tty1.service + +[Service] +Type=oneshot +ExecStart=/bin/bash -c "mount -o remount,inode64 /" +RemainAfterExit=no + +[Install] +WantedBy=multi-user.target +EOF -# remove unnecessary packages and install necessary packages -LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y openstack-neutron-openvswitch" \ +# Add epel, aodh and ceph, remove openstack-neutron-openvswitch +AODH_PKG="openstack-aodh-api,openstack-aodh-common,openstack-aodh-compat,openstack-aodh-evaluator,openstack-aodh-expirer" +AODH_PKG+=",openstack-aodh-listener,openstack-aodh-notifier" +LIBGUESTFS_BACKEND=direct virt-customize --upload "/tmp/xfs-grow-remount-fix.service:/usr/lib/systemd/system/xfs-grow-remount-fix.service" \ + --run-command "systemctl enable xfs-grow-remount-fix.service" \ + --upload puppet-aodh.tar.gz:/etc/puppet/modules/ \ + --run-command "cd /etc/puppet/modules/ && rm -rf aodh && tar xzf puppet-aodh.tar.gz" \ + --run-command "yum remove -y openstack-neutron-openvswitch" \ + --run-command "echo 'nf_conntrack_proto_sctp' > /etc/modules-load.d/nf_conntrack_proto_sctp.conf" \ --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ - --upload /etc/yum.repos.d/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \ - --install opendaylight,python-networking-odl,ceph \ - -a overcloud-full-odl.qcow2 + --install "$AODH_PKG,ceph" \ + -a overcloud-full-opendaylight.qcow2 + +############################################### +##### Adding OpenDaylight to overcloud ##### +############################################### + +cat > /tmp/opendaylight.repo << EOF +[opendaylight] +name=OpenDaylight \$releasever - \$basearch +baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-33-release/\$basearch/os/ +enabled=1 +gpgcheck=0 +EOF + +# install ODL packages +LIBGUESTFS_BACKEND=direct virt-customize \ + --upload /tmp/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \ + --install opendaylight,python-networking-odl \ + -a overcloud-full-opendaylight.qcow2 ## WORK AROUND ## when OpenDaylight lands in upstream RDO manager this can be removed # upload the opendaylight puppet module rm -rf puppet-opendaylight -git clone https://github.com/dfarrell07/puppet-opendaylight +git clone -b 2.2.0 https://github.com/dfarrell07/puppet-opendaylight pushd puppet-opendaylight git archive --format=tar.gz --prefix=opendaylight/ HEAD > ../puppet-opendaylight.tar.gz popd LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-opendaylight.tar.gz:/etc/puppet/modules/ \ - --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" -a overcloud-full-odl.qcow2 + --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" \ + --upload ../opendaylight-puppet-neutron.patch:/tmp \ + --run-command "cd /etc/puppet/modules/neutron && patch -Np1 < /tmp/opendaylight-puppet-neutron.patch" \ + -a overcloud-full-opendaylight.qcow2 # Patch in OpenDaylight installation and configuration LIBGUESTFS_BACKEND=direct virt-customize --upload ../opnfv-tripleo-heat-templates.patch:/tmp \ --run-command "cd /usr/share/openstack-tripleo-heat-templates/ && patch -Np1 < /tmp/opnfv-tripleo-heat-templates.patch" \ -a instack.qcow2 -LIBGUESTFS_BACKEND=direct virt-customize --upload ../opendaylight-puppet-neutron.patch:/tmp \ - --run-command "cd /etc/puppet/modules/neutron && patch -Np1 < /tmp/opendaylight-puppet-neutron.patch" \ - -a overcloud-full-odl.qcow2 -## END WORK AROUND + +# REMOVE ME AFTER Brahmaputra +LIBGUESTFS_BACKEND=direct virt-customize --upload ../puppet-neutron-force-metadata.patch:/tmp \ + --run-command "cd /etc/puppet/modules/neutron && patch -Np1 < /tmp/puppet-neutron-force-metadata.patch" \ + -a overcloud-full-opendaylight.qcow2 + +LIBGUESTFS_BACKEND=direct virt-customize --upload ../puppet-cinder-quota-fix.patch:/tmp \ + --run-command "cd /etc/puppet/modules/cinder && patch -Np1 < /tmp/puppet-cinder-quota-fix.patch" \ + -a overcloud-full-opendaylight.qcow2 + +LIBGUESTFS_BACKEND=direct virt-customize --upload ../aodh-puppet-tripleo.patch:/tmp \ + --run-command "cd /etc/puppet/modules/tripleo && patch -Np1 < /tmp/aodh-puppet-tripleo.patch" \ + -a overcloud-full-opendaylight.qcow2 + +# adds tripleoclient aodh workaround +# for keystone +LIBGUESTFS_BACKEND=direct virt-customize --upload ../aodh-tripleoclient.patch:/tmp \ + --run-command "cd /usr/lib/python2.7/site-packages/tripleoclient && patch -Np1 < /tmp/aodh-tripleoclient.patch" \ + --upload ../aodh-os-cloud-config.patch:/tmp \ + --run-command "cd /usr/lib/python2.7/site-packages/os_cloud_config && patch -Np1 < /tmp/aodh-os-cloud-config.patch" \ + -a instack.qcow2 +# END REMOVE ME AFTER Brahmaputra + +################################################ +##### Adding SFC+OpenDaylight overcloud ##### +################################################ + +cat > /tmp/opendaylight.repo << EOF +[opendaylight] +name=OpenDaylight \$releasever - \$basearch +baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-4-testing/\$basearch/os/ +enabled=1 +gpgcheck=0 +EOF + +#copy opendaylight overcloud full to isolate odl-sfc +cp overcloud-full-opendaylight.qcow2 overcloud-full-opendaylight-sfc.qcow2 + +# upload the opendaylight puppet module +rm -rf puppet-opendaylight +git clone -b 3.0.1 https://github.com/dfarrell07/puppet-opendaylight +pushd puppet-opendaylight +git archive --format=tar.gz --prefix=opendaylight/ HEAD > ../puppet-opendaylight.tar.gz popd +LIBGUESTFS_BACKEND=direct virt-customize \ + --install 'https://radez.fedorapeople.org/kernel-ml-3.13.7-1.el7.centos.x86_64.rpm' \ + --run-command 'grub2-set-default "\$(grep -P \"submenu|^menuentry\" /boot/grub2/grub.cfg | cut -d \"\\x27\" | head -n 1)"' \ + --install 'https://radez.fedorapeople.org/openvswitch-kmod-2.3.90-1.el7.centos.x86_64.rpm' \ + --run-command 'yum downgrade -y https://radez.fedorapeople.org/openvswitch-2.3.90-1.x86_64.rpm' \ + --run-command 'rm -f /lib/modules/3.13.7-1.el7.centos.x86_64/kernel/net/openvswitch/openvswitch.ko' \ + --run-command 'ln -s /lib/modules/3.13.7-1.el7.centos.x86_64/kernel/extra/openvswitch/openvswitch.ko /lib/modules/3.13.7-1.el7.centos.x86_64/kernel/net/openvswitch/openvswitch.ko' \ + --upload /tmp/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \ + --run-command "yum remove -y opendaylight" \ + --run-command "yum clean all" \ + --run-command "yum install -y opendaylight" \ + --run-command "rm -rf /etc/puppet/modules/opendaylight && rm -f /etc/puppet/modules/puppet-opendaylight.tar.gz " \ + --upload puppet-opendaylight.tar.gz:/etc/puppet/modules/ \ + --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" \ + -a overcloud-full-opendaylight-sfc.qcow2 + + + +############################################### +##### Adding ONOS to overcloud ##### +############################################### + ## WORK AROUND ## when ONOS lands in upstream OPNFV artifacts this can be removed # upload the onos puppet module -pushd stack rm -rf puppet-onos git clone https://github.com/bobzhouHW/puppet-onos.git @@ -286,12 +409,14 @@ curl ${onos_artifacts_uri}/jdk-8u51-linux-x64.tar.gz -o ./jdk-8u51-linux-x64.tar curl ${onos_artifacts_uri}/onos-1.3.0.tar.gz -o ./onos-1.3.0.tar.gz curl ${onos_artifacts_uri}/repository.tar -o ./repository.tar popd -git archive --format=tar.gz --prefix=onos/ HEAD > ../puppet-onos.tar.gz popd +mv puppet-onos onos +tar -czf puppet-onos.tar.gz onos LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-onos.tar.gz:/etc/puppet/modules/ \ - --run-command "cd /etc/puppet/modules/ && tar xzf puppet-onos.tar.gz" -a overcloud-full-odl.qcow2 + --run-command "cd /etc/puppet/modules/ && tar xzf puppet-onos.tar.gz" -a overcloud-full-opendaylight.qcow2 ## END WORK AROUND + popd # move and Sanitize private keys from instack.json file