diff options
-rw-r--r-- | build/Makefile | 57 | ||||
-rw-r--r-- | build/network-environment.yaml | 17 | ||||
-rw-r--r-- | build/nics-template.yaml.jinja2 | 6 | ||||
-rwxr-xr-x | build/overcloud-full.sh | 8 | ||||
-rw-r--r-- | build/rpm_specs/openstack-tacker.spec | 39 | ||||
-rw-r--r-- | build/rpm_specs/opnfv-apex-release.spec | 30 | ||||
-rw-r--r-- | build/rpm_specs/python-tackerclient.spec | 6 | ||||
-rw-r--r-- | build/variables.sh | 11 | ||||
-rwxr-xr-x | ci/build.sh | 12 | ||||
-rw-r--r-- | config/network/network_settings.yaml | 2 | ||||
-rw-r--r-- | config/network/network_settings_v6.yaml | 2 | ||||
-rw-r--r-- | config/network/network_settings_vlans.yaml | 2 | ||||
-rw-r--r-- | config/yum.repos.d/opnfv-apex.repo | 6 | ||||
-rw-r--r-- | docs/installationprocedure/baremetal.rst | 38 | ||||
-rw-r--r-- | docs/installationprocedure/requirements.rst | 2 | ||||
-rw-r--r-- | docs/releasenotes/release-notes.rst | 1 | ||||
-rwxr-xr-x | lib/post-install-functions.sh | 19 | ||||
-rw-r--r-- | lib/python/apex/deploy_settings.py | 2 | ||||
-rw-r--r-- | lib/python/apex/inventory.py | 2 | ||||
-rw-r--r-- | lib/python/apex/network_environment.py | 41 | ||||
-rw-r--r-- | lib/python/apex/network_settings.py | 28 | ||||
-rwxr-xr-x | lib/undercloud-functions.sh | 2 |
22 files changed, 221 insertions, 112 deletions
diff --git a/build/Makefile b/build/Makefile index a542279b..88a6e962 100644 --- a/build/Makefile +++ b/build/Makefile @@ -14,8 +14,9 @@ export RELEASE = "0" export ISO = $(shell pwd)/release/OPNFV-CentOS-7-x86_64-${RELEASE}.iso export RPM_DIST = $(shell rpm -E %dist) -export TACKER_REPO = "http://github.com/trozet/tacker" -export TACKER_BRANCH = "SFC_colorado" + +export TACKER_REPO := $(shell awk -F\= '/^tacker_repo/ {print $$2}' variables.sh ) +export TACKER_BRANCH := $(shell awk -F\= '/^tacker_branch/ {print $$2}' variables.sh ) export TACKER_COMMIT := $(shell git ls-remote $(TACKER_REPO) $(TACKER_BRANCH) | awk '{print substr($$1,1,7)}') export TACKERCLIENT_REPO := $(shell awk -F\= '/^tackerclient_repo/ {print $$2}' variables.sh ) @@ -31,7 +32,9 @@ export NETVPP_REPO := $(shell awk -F\= '/^netvpp_repo/ {print $$2}' variables.sh export NETVPP_BRANCH := $(shell awk -F\= '/^netvpp_branch/ {print $$2}' variables.sh ) export NETVPP_COMMIT := $(shell git ls-remote $(NETVPP_REPO) $(NETVPP_BRANCH) | awk '{print substr($$1,1,7)}') +export RELRPMVERS = $(shell grep Version $(shell pwd)/rpm_specs/opnfv-apex-release.spec | head -n 1 | awk '{ print $$2 }') export RPMVERS = $(shell grep Version $(shell pwd)/rpm_specs/opnfv-apex.spec | head -n 1 | awk '{ print $$2 }') +export RPMREL = $(shell pwd)/noarch/opnfv-apex-release-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMCOM = $(shell pwd)/noarch/opnfv-apex-common-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMUDR = $(shell pwd)/noarch/opnfv-apex-undercloud-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMODL = $(shell pwd)/noarch/opnfv-apex-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm @@ -54,13 +57,33 @@ images-clean: undercloud-clean overcloud-full-clean overcloud-opendaylight-clean rpms: common-rpm undercloud-rpm opendaylight-rpm onos-rpm .PHONY: rpms-check -rpms-check: common-rpm-check undercloud-rpm-check opendaylight-rpm-check onos-rpm-check +rpms-check: release-rpm-check common-rpm-check undercloud-rpm-check opendaylight-rpm-check onos-rpm-check .PHONY: rpms-clean -rpms-clean: common-rpm-clean undercloud-rpm-clean opendaylight-rpm-clean onos-rpm-clean +rpms-clean: release-rpm-clean common-rpm-clean undercloud-rpm-clean opendaylight-rpm-clean onos-rpm-clean rm -rf noarch rm -rf BUILDROOT +opnfv-apex-release.tar.gz: + pushd ../ && git archive --format=tar.gz --prefix=opnfv-apex-release-$(RELRPMVERS)/ HEAD > build/opnfv-apex-release.tar.gz + +.PHONY: release-rpm-check +release-rpm-check: opnfv-apex-release.tar.gz + rpmbuild --clean -bi -bl rpm_specs/opnfv-apex-release.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D "release $(shell echo $(RELEASE) | tr -d '_-')" + +.PHONY: release-rpm +release-rpm: opnfv-apex-release.tar.gz $(RPMREL) + +$(RPMREL): + @echo "Building the Apex Release RPM" + # build the release RPM + rpmbuild --clean -ba rpm_specs/opnfv-apex-release.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D "release $(shell echo $(RELEASE) | tr -d '_-')" + +.PHONY: release-rpm-clean +release-rpm-clean: + rm -rf opnfv-apex-release-$(RPMVERS) + rm -rf opnfv-apex-release.tar.gz + opnfv-apex-common.tar.gz: pushd ../ && git archive --format=tar.gz --prefix=opnfv-apex-common-$(RPMVERS)/ HEAD > build/opnfv-apex-common.tar.gz @@ -113,20 +136,20 @@ python-pep8-check: .PHONY: tacker-clean tacker-clean: - rm -rf openstack-tacker-2015.2 + rm -rf openstack-tacker-2016.2 rm -f openstack-tacker.tar.gz openstack-tacker.tar.gz: @echo "Preparing the Tacker RPM prerequisites" - git clone $(TACKER_REPO) -b $(TACKER_BRANCH) openstack-tacker-2015.2 - tar czf openstack-tacker.tar.gz openstack-tacker-2015.2 + git clone $(TACKER_REPO) -b $(TACKER_BRANCH) openstack-tacker-2016.2 + tar czf openstack-tacker.tar.gz openstack-tacker-2016.2 .PHONY: tacker-rpm -tacker-rpm: openstack-tacker.tar.gz noarch/openstack-tacker-2015.2-1.trozetgit$(TACKER_COMMIT).noarch.rpm +tacker-rpm: openstack-tacker.tar.gz noarch/openstack-tacker-2016.2-1.git$(TACKER_COMMIT).noarch.rpm -noarch/openstack-tacker-2015.2-1.trozetgit$(TACKER_COMMIT).noarch.rpm: +noarch/openstack-tacker-2016.2-1.git$(TACKER_COMMIT).noarch.rpm: @echo "Building the Tacker RPM" - rpmbuild --clean -ba --target noarch rpm_specs/openstack-tacker.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D 'git .trozetgit$(TACKER_COMMIT)' + rpmbuild --clean -ba --target noarch rpm_specs/openstack-tacker.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D 'git .git$(TACKER_COMMIT)' ################# # TACKERCLIENT # @@ -134,20 +157,20 @@ noarch/openstack-tacker-2015.2-1.trozetgit$(TACKER_COMMIT).noarch.rpm: .PHONY: tackerclient-clean tackerclient-clean: - rm -rf python-tackerclient-2015.2 + rm -rf python-tackerclient-2016.2 rm -f python-tackerclient.tar.gz python-tackerclient.tar.gz: @echo "Preparing the TackerClient RPM prerequisites" - git clone $(TACKERCLIENT_REPO) -b $(TACKERCLIENT_BRANCH) python-tackerclient-2015.2 - tar czf python-tackerclient.tar.gz python-tackerclient-2015.2 + git clone $(TACKERCLIENT_REPO) -b $(TACKERCLIENT_BRANCH) python-tackerclient-2016.2 + tar czf python-tackerclient.tar.gz python-tackerclient-2016.2 .PHONY: tackerclient-rpm -tackerclient-rpm: python-tackerclient.tar.gz noarch/python-tackerclient-2015.2-1.trozetgit$(TACKERCLIENT_COMMIT).noarch.rpm +tackerclient-rpm: python-tackerclient.tar.gz noarch/python-tackerclient-2016.2-1.git$(TACKERCLIENT_COMMIT).noarch.rpm -noarch/python-tackerclient-2015.2-1.trozetgit$(TACKERCLIENT_COMMIT).noarch.rpm: +noarch/python-tackerclient-2016.2-1.git$(TACKERCLIENT_COMMIT).noarch.rpm: @echo "Building the TackerClient RPM" - rpmbuild --clean -ba --target noarch rpm_specs/python-tackerclient.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D 'git .trozetgit$(TACKERCLIENT_COMMIT)' + rpmbuild --clean -ba --target noarch rpm_specs/python-tackerclient.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D 'git .git$(TACKERCLIENT_COMMIT)' ############### # CONGRESS # @@ -252,7 +275,7 @@ overcloud-full-clean: .PHONY: overcloud-full overcloud-full: images/overcloud-full.qcow2 -images/overcloud-full.qcow2: congress-rpm networking-vpp-rpm +images/overcloud-full.qcow2: congress-rpm tacker-rpm networking-vpp-rpm @echo "Building the Apex Base Overcloud Image" @./overcloud-full.sh diff --git a/build/network-environment.yaml b/build/network-environment.yaml index bd65dd9d..8367371b 100644 --- a/build/network-environment.yaml +++ b/build/network-environment.yaml @@ -46,24 +46,7 @@ resource_registry: parameter_defaults: NeutronExternalNetworkBridge: 'br-ex' - ControlPlaneSubnetCidr: "24" - ControlPlaneDefaultRoute: 192.0.2.1 - ExternalNetCidr: 192.168.37.0/24 - ExternalAllocationPools: [{'start': '192.168.37.50', 'end': '192.168.37.99'}] - ExternalInterfaceDefaultRoute: 192.168.37.1 - EC2MetadataIp: 192.0.2.1 - DnsServers: ["8.8.8.8","8.8.4.4"] - TenantNetCidr: 172.17.0.0/24 - TenantAllocationPools: [{'start': '172.17.0.10', 'end': '172.17.0.200'}] - StorageNetCidr: 172.18.0.0/24 - StorageAllocationPools: [{'start': '172.18.0.10', 'end': '172.18.0.200'}] - # Customize the VLAN IDs to match the local environment - InternalApiNetworkVlanID: 10 # usually collapsed onto Admin/Provisioning - StorageNetworkVlanID: 20 - # StorageMgmtNetworkVlanID: 30 # NOT IMPLEMENTED - TenantNetworkVlanID: 40 - ExternalNetworkVlanID: 50 ServiceNetMap: NeutronTenantNetwork: tenant CeilometerApiNetwork: internal_api diff --git a/build/nics-template.yaml.jinja2 b/build/nics-template.yaml.jinja2 index ee830114..c7d0a1b8 100644 --- a/build/nics-template.yaml.jinja2 +++ b/build/nics-template.yaml.jinja2 @@ -85,13 +85,13 @@ resources: os_net_config: network_config: - - {%- if nets['tenant']['nic_mapping'][role]['vlan'] is number or nets['storage']['nic_mapping'][role]['vlan'] is number or nets['api']['nic_mapping'][role]['vlan'] is number or nets['external'][0]['nic_mapping'][role]['vlan'] is number %} + {%- if not nets['external'][0]['enabled'] or nets['tenant']['nic_mapping'][role]['vlan'] is number or nets['storage']['nic_mapping'][role]['vlan'] is number or nets['api']['nic_mapping'][role]['vlan'] is number or nets['external'][0]['nic_mapping'][role]['vlan'] is number %} type: ovs_bridge name: {get_input: bridge_name} members: - type: interface - name: {{ nets[role]['admin']['members'][0] }} + name: {{ nets['admin']['nic_mapping'][role]['members'][0] }} # force the MAC address of the bridge to this interface primary: true {%- if nets['external'][0]['enabled'] and nets['external'][0]['nic_mapping'][role]['vlan'] is number %} @@ -147,7 +147,7 @@ resources: - ip_netmask: 169.254.169.254/32 next_hop: {get_param: EC2MetadataIp} - {%- if external_net_af == 6 or role == 'compute' %} + {%- if external_net_af == 6 or role == 'compute' or not nets['external'][0]['enabled'] %} - default: true next_hop: {get_param: ControlPlaneDefaultRoute} diff --git a/build/overcloud-full.sh b/build/overcloud-full.sh index a50200bb..d08c4115 100755 --- a/build/overcloud-full.sh +++ b/build/overcloud-full.sh @@ -75,8 +75,7 @@ tar czf vsperf.tar.gz vsperf # tar up the tacker puppet module rm -rf puppet-tacker -# TODO move this back to radez puppet-tacker after PR is accepted -git clone -b fix_db_sync https://github.com/trozet/puppet-tacker +git clone https://github.com/openstack/puppet-tacker pushd puppet-tacker > /dev/null git archive --format=tar.gz --prefix=tacker/ HEAD > ../puppet-tacker.tar.gz popd > /dev/null @@ -105,6 +104,7 @@ qemu-img resize overcloud-full_build.qcow2 +500MB # upload puppet fdio # git clone vsperf into the overcloud image # upload the tacker puppet module and untar it +# install tacker LIBGUESTFS_BACKEND=direct virt-customize \ --run-command "xfs_growfs /dev/sda" \ --upload ../opnfv-puppet-tripleo.tar.gz:/etc/puppet/modules \ @@ -145,6 +145,10 @@ LIBGUESTFS_BACKEND=direct virt-customize \ --run-command "cd /var/opt && tar xzf vsperf.tar.gz" \ --upload puppet-tacker.tar.gz:/etc/puppet/modules/ \ --run-command "cd /etc/puppet/modules/ && tar xzf puppet-tacker.tar.gz" \ + --upload ../noarch/$tacker_pkg:/root/ \ + --install /root/$tacker_pkg \ + --upload ../noarch/$tackerclient_pkg:/root/ \ + --install /root/$tackerclient_pkg \ --run-command "pip install python-senlinclient" \ --upload ../neutron/agent/interface/interface.py:/usr/lib/python2.7/site-packages/neutron/agent/linux/ \ --run-command "mkdir /root/fdio_neutron_l3" \ diff --git a/build/rpm_specs/openstack-tacker.spec b/build/rpm_specs/openstack-tacker.spec index b491cd1e..7ed5cbdb 100644 --- a/build/rpm_specs/openstack-tacker.spec +++ b/build/rpm_specs/openstack-tacker.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: openstack-tacker -Version: 2015.2 +Version: 2016.2 Release: 1%{?git} Summary: OpenStack servicevm/device manager @@ -12,11 +12,6 @@ Source0: openstack-tacker.tar.gz BuildArch: noarch BuildRequires: python-setuptools -#Requires: pbr>=0.8 Paste PasteDeploy>=1.5.0 Routes>=1.12.3!=2.0 anyjson>=0.3.3 argparse -#Requires: Babel>=1.3 eventlet>=0.16.1!=0.17.0 greenlet>=0.3.2 httplib2>=0.7.5 requests>=2.2.0!=2.4.0 -#Requires: iso8601>=0.1.9 kombu>=2.5.0 netaddr>=0.7.12 SQLAlchemy<1.1.0>=0.9.7 -#Requires: WebOb>=1.2.3 python-heatclient>=0.3.0 python-keystoneclient>=1.1.0 alembic>=0.7.2 six>=1.9.0 -#Requires: stevedore>=1.5.0 http oslo.config>=1.11.0 oslo.messaging!=1.17.0!=1.17.1>=1.16.0 oslo.rootwrap>=2.0.0 python-novaclient>=2.22.0 %description OpenStack servicevm/device manager @@ -31,11 +26,14 @@ rm requirements.txt %install -/usr/bin/python setup.py install --prefix=%{buildroot} --install-lib=%{buildroot}/usr/lib/python2.7/site-packages +/usr/bin/python setup.py install --root=%{buildroot} #remove tests rm -rf %{buildroot}/usr/lib/python2.7/site-packages/tacker/tests - -install -p -D -m 644 apex/systemd/openstack-tacker.service %{buildroot}%{_unitdir}/openstack-tacker.service +# Move config files from /usr/etc/ to /etc +mv %{buildroot}/usr/etc %{buildroot} +#install -p -D -m 644 apex/systemd/openstack-tacker.service %{buildroot}%{_unitdir}/openstack-tacker.service +# Remove egg-info +rm -rf %{buildroot}/usr/lib/python2.7/site-packages/*egg-info install -d -m 755 %{buildroot}%{_localstatedir}/cache/tacker install -d -m 755 %{buildroot}%{_sharedstatedir}/tacker @@ -58,17 +56,24 @@ exit 0 %systemd_postun_with_restart openstack-tacker %files -/bin/tacker-server -/bin/tacker-db-manage -/bin/tacker-rootwrap -/etc/init.d/tacker-server -%{_unitdir}/openstack-tacker.service -/etc/rootwrap.d/servicevm.filters -%config(noreplace) %attr(-, root, tacker) %{_sysconfdir}/tacker/* +/usr/bin/tacker-server +/usr/bin/tacker-db-manage +/usr/bin/tacker-rootwrap +#%{_unitdir}/openstack-tacker.service /usr/lib/python2.7/site-packages/tacker/* -/usr/lib/python2.7/site-packages/tacker-* +#%config(noreplace) %attr(-, root, tacker) %{_sysconfdir}/tacker/tacker.conf` +%{_sysconfdir}/init.d/tacker-server +%{_sysconfdir}/rootwrap.d/tacker.filters +%{_sysconfdir}/tacker/api-paste.ini +%{_sysconfdir}/tacker/policy.json +%{_sysconfdir}/tacker/rootwrap.conf %dir %attr(0750, tacker, root) %{_localstatedir}/cache/tacker %dir %attr(0750, tacker, root) %{_sharedstatedir}/tacker %dir %attr(0750, tacker, root) %{_localstatedir}/log/tacker %changelog +* Wed Nov 30 2016 Dan Radez <dradez@redhat.com> - 2016.2-1 +- Version update for Newton + +* Mon Jul 25 2016 Tim Rozet <trozet@redhat.com> - 2015.2-1 +- Initial Commit diff --git a/build/rpm_specs/opnfv-apex-release.spec b/build/rpm_specs/opnfv-apex-release.spec new file mode 100644 index 00000000..7dd43d93 --- /dev/null +++ b/build/rpm_specs/opnfv-apex-release.spec @@ -0,0 +1,30 @@ +Name: opnfv-apex-release +Version: danube +Release: %{release} +Summary: RPM Release file + +Group: System Environment +License: Apache 2.0 +URL: https://gerrit.opnfv.org/gerrit/apex.git +Source0: opnfv-apex-release.tar.gz + +BuildArch: noarch +Requires: rdo-release = newton epel-release libvirt-python + +%description +RPM Release file that provides a yum repo file to install OPNFV Apex + +%prep +%setup -q + +%install +mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d/ +install config/yum.repos.d/opnfv-apex.repo %{buildroot}%{_sysconfdir}/yum.repos.d/ + +%files +%defattr(644, root, root, -) +%{_sysconfdir}/yum.repos.d/opnfv-apex.repo + +%changelog +* Wed Nov 23 2016 Dan Radez <dradez@redhat.com> - 3.0-1 +- Initial Packaging diff --git a/build/rpm_specs/python-tackerclient.spec b/build/rpm_specs/python-tackerclient.spec index aa379361..5758f7c0 100644 --- a/build/rpm_specs/python-tackerclient.spec +++ b/build/rpm_specs/python-tackerclient.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: python-tackerclient -Version: 2015.2 +Version: 2016.2 Release: 1%{?git} Summary: CLI and Client Library for OpenStack Networking @@ -37,4 +37,8 @@ rm requirements.txt /usr/lib/python2.7/site-packages/python_tackerclient-* %changelog +* Wed Nov 30 2016 Dan Radez <dradez@redhat.com> - 2016.2-1 +- Version update for Newton +* Mon Jul 25 2016 Tim Rozet <trozet@redhat.com> - 2015.2-1 +- Initial Commit diff --git a/build/variables.sh b/build/variables.sh index c8754379..0c938775 100644 --- a/build/variables.sh +++ b/build/variables.sh @@ -27,10 +27,15 @@ dpdk_rpms=( 'ovs4opnfv-e8acab14-openvswitch-2.5.90-0.12032.gitc61e93d6.1.el7.centos.x86_64.rpm' ) -tackerclient_repo="http://github.com/trozet/python-tackerclient" -tackerclient_branch="SFC_refactor" +tacker_repo="http://github.com/openstack/tacker" +tacker_branch="stable/newton" +tacker_commit=$(git ls-remote ${tacker_repo} ${tacker_branch} | awk '{print substr($$1,1,7)}') +tacker_pkg=openstack-tacker-2016.2-1.git${tacker_commit}.noarch.rpm + +tackerclient_repo="http://github.com/openstack/python-tackerclient" +tackerclient_branch="stable/newton" tackerclient_commit=$(git ls-remote ${tackerclient_repo} ${tackerclient_branch} | awk '{print substr($$1,1,7)}') -tackerclient_pkg=python-tackerclient-2015.2-1.trozetgit${tackerclient_commit}.noarch.rpm +tackerclient_pkg=python-tackerclient-2016.2-1.git${tackerclient_commit}.noarch.rpm congress_repo="http://github.com/openstack/congress" congress_branch="stable/mitaka" diff --git a/ci/build.sh b/ci/build.sh index f1333ce4..1b66d557 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -36,6 +36,7 @@ CACHE_DIR="cache" CACHE_NAME="apex-cache" MAKE_TARGETS="images" REQUIRED_PKGS="rpm-build python-docutils" +RELEASE_RPM="" parse_cmdline() { while [ "${1:0:1}" = "-" ] @@ -63,6 +64,11 @@ parse_cmdline() { echo "Buiding opnfv-apex RPMs" shift 1 ;; + --release-rpm ) + RELEASE_RPM=" release-rpm" + echo "Buiding opnfv-apex RPMs" + shift 1 + ;; --debug ) debug="TRUE" echo "Enable debug output" @@ -83,6 +89,9 @@ run_make() { parse_cmdline "$@" +# Add release rpm to make targets if defined +MAKE_TARGETS+=$RELEASE_RPM + # Install build dependencies for pkg in $REQUIRED_PKGS; do if ! rpm -q $pkg > /dev/null; then @@ -123,6 +132,9 @@ if [[ "$MAKE_TARGETS" == "images" ]]; then if [[ $commit_file_list == *build/rpm_specs/opnfv-apex-undercloud.spec* ]]; then MAKE_TARGETS+=" undercloud-rpm-check" fi + if [[ $commit_file_list == *build/rpm_specs/opnfv-apex-release.spec* ]]; then + MAKE_TARGETS+=" release-rpm-check" + fi if [[ $commit_file_list == *build/rpm_specs/opnfv-apex-common.spec* ]]; then MAKE_TARGETS+=" common-rpm-check" fi diff --git a/config/network/network_settings.yaml b/config/network/network_settings.yaml index c052a438..1cba64bb 100644 --- a/config/network/network_settings.yaml +++ b/config/network/network_settings.yaml @@ -215,3 +215,5 @@ apex: introspection_range: - 192.0.2.100 - 192.0.2.120 # Range used for introspection phase (examining nodes). This cannot overlap with dhcp_range or overcloud_ip_range. + # If the external network 'public' is disabled, then this range will be re-used to configure the floating ip range + # for the overcloud default external network diff --git a/config/network/network_settings_v6.yaml b/config/network/network_settings_v6.yaml index 6b1dd5de..54c4113f 100644 --- a/config/network/network_settings_v6.yaml +++ b/config/network/network_settings_v6.yaml @@ -178,3 +178,5 @@ apex: introspection_range: - 192.0.2.100 - 192.0.2.120 # Range used for introspection phase (examining nodes). This cannot overlap with dhcp_range or overcloud_ip_range. + # If the external network 'public' is disabled, then this range will be re-used to configure the floating ip range + # for the overcloud default external network diff --git a/config/network/network_settings_vlans.yaml b/config/network/network_settings_vlans.yaml index 4e3da2f4..d892289f 100644 --- a/config/network/network_settings_vlans.yaml +++ b/config/network/network_settings_vlans.yaml @@ -215,3 +215,5 @@ apex: introspection_range: - 192.0.2.100 - 192.0.2.120 # Range used for introspection phase (examining nodes). This cannot overlap with dhcp_range or overcloud_ip_range. + # If the external network 'public' is disabled, then this range will be re-used to configure the floating ip range + # for the overcloud default external network diff --git a/config/yum.repos.d/opnfv-apex.repo b/config/yum.repos.d/opnfv-apex.repo new file mode 100644 index 00000000..aff09420 --- /dev/null +++ b/config/yum.repos.d/opnfv-apex.repo @@ -0,0 +1,6 @@ +[opnfv-apex] +name=OPNFV Apex Danube +baseurl=http://artifacts.opnfv.org/apex/danube/yumrepo/ +failovermethod=priority +enabled=1 +gpgcheck=0 diff --git a/docs/installationprocedure/baremetal.rst b/docs/installationprocedure/baremetal.rst index 878a49d7..15c80c3b 100644 --- a/docs/installationprocedure/baremetal.rst +++ b/docs/installationprocedure/baremetal.rst @@ -94,9 +94,10 @@ Install Bare Metal Jumphost support is completed. 1b. If your Jump host already has CentOS 7 with libvirt running on it then - install the install the RDO Release RPM: + install the install the RDO Newton Release RPM and epel-release: - ``sudo yum install -y https://www.rdoproject.org/repos/rdo-release.rpm`` + ``sudo yum install https://repos.fedorapeople.org/repos/openstack/openstack-newton/rdo-release-newton-4.noarch.rpm`` + ``sudo yum install epel-release`` The RDO Project release repository is needed to install OpenVSwitch, which is a dependency of opnfv-apex. If you do not have external connectivity to @@ -113,11 +114,26 @@ Install Bare Metal Jumphost the USB device as the boot media on your Jumphost 2b. If your Jump host already has CentOS 7 with libvirt running on it then - install the opnfv-apex RPMs from the OPNFV artifacts site - <http://artifacts.opnfv.org/apex.html>. The following RPMS are available - for installation: + install the opnfv-apex RPMs using the OPNFV artifacts yum repo. This yum + repo is created at release. It will not exist before release day. + + ``sudo yum install http://artifacts.opnfv.org/apex/danube/opnfv-apex-release-danube.noarch.rpm`` + + Once you have installed the repo definitions for Apex, RDO and EPEL then + yum install Apex: + + ``sudo yum install opnfv-apex`` - - opnfv-apex - OpenDaylight L2 / L3 and ONOS support * + If ONOS will be used, install the ONOS rpm instead of the opnfv-apex rpm. + + ``sudo yum install opnfv-apex-onos`` + +2c. If you choose not to use the Apex yum repo or you choose to use + pre-released RPMs you can download and install the required RPMs from the + artifacts site <http://artifacts.opnfv.org/apex.html>. The following RPMs + are available for installation: + + - opnfv-apex - OpenDaylight L2 / L3 and ODL SFC support * - opnfv-apex-onos - ONOS support * - opnfv-apex-undercloud - (reqed) Undercloud Image - opnfv-apex-common - (reqed) Supporting config files and scripts @@ -136,20 +152,18 @@ Install Bare Metal Jumphost no longer carry them and they will not need special handling for installation. - Python 3.4 is also required and it needs to be installed if you are using - the Centos 7 base image: + The EPEL and RDO yum repos are still required: ``sudo yum install epel-release`` - ``sudo yum install python34`` + ``sudo yum install https://repos.fedorapeople.org/repos/openstack/openstack-newton/rdo-release-newton-4.noarch.rpm`` - To install these RPMs download them to the local disk on your CentOS 7 - install and pass the file names directly to yum: + Once the apex RPMs are downloaded install them by passing the file names + directly to yum: ``sudo yum install python34-markupsafe-<version>.rpm python3-jinja2-<version>.rpm python3-ipmi-<version>.rpm`` ``sudo yum install opnfv-apex-<version>.rpm opnfv-apex-undercloud-<version>.rpm opnfv-apex-common-<version>.rpm`` - 3. After the operating system and the opnfv-apex RPMs are installed, login to your Jumphost as root. diff --git a/docs/installationprocedure/requirements.rst b/docs/installationprocedure/requirements.rst index 1b3fe87d..507b671e 100644 --- a/docs/installationprocedure/requirements.rst +++ b/docs/installationprocedure/requirements.rst @@ -33,7 +33,7 @@ Network requirements include: - Private Tenant-Networking Network* - - External Network + - External Network* - Storage Network* diff --git a/docs/releasenotes/release-notes.rst b/docs/releasenotes/release-notes.rst index f873d835..3e6e0aac 100644 --- a/docs/releasenotes/release-notes.rst +++ b/docs/releasenotes/release-notes.rst @@ -222,6 +222,7 @@ Deliverables Software Deliverables ~~~~~~~~~~~~~~~~~~~~~ - Apex .iso file +- Apex release .rpm (opnfv-apex-release) - Apex overcloud .rpm (opnfv-apex) - For nosdn and OpenDaylight Scenarios - Apex overcloud onos .rpm (opnfv-apex-onos) - ONOS Scenarios - Apex undercloud .rpm (opnfv-apex-undercloud) diff --git a/lib/post-install-functions.sh b/lib/post-install-functions.sh index 1055994e..102b86f5 100755 --- a/lib/post-install-functions.sh +++ b/lib/post-install-functions.sh @@ -13,7 +13,10 @@ function configure_post_install { local opnfv_attach_networks ovs_ip ip_range net_cidr tmp_ip af external_network_ipv6 external_network_ipv6=False - opnfv_attach_networks="admin external" + opnfv_attach_networks="admin" + if [[ $enabled_network_list =~ "external" ]]; then + opnfv_attach_networks+=' external' + fi echo -e "${blue}INFO: Post Install Configuration Running...${reset}" @@ -94,8 +97,11 @@ else fi if [ "$external_network_ipv6" == "True" ]; then neutron subnet-create --name external-net --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') external --ip_version 6 --ipv6_ra_mode slaac --ipv6_address_mode slaac --gateway ${external_gateway} --allocation-pool start=${external_floating_ip_range%%,*},end=${external_floating_ip_range##*,} ${external_cidr} -else +elif [[ "$enabled_network_list" =~ "external" ]]; then neutron subnet-create --name external-net --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') --disable-dhcp external --gateway ${external_gateway} --allocation-pool start=${external_floating_ip_range%%,*},end=${external_floating_ip_range##*,} ${external_cidr} +else + # we re-use the introspection range for floating ips with single admin network + neutron subnet-create --name external-net --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') --disable-dhcp external --gateway ${admin_gateway} --allocation-pool start=${admin_introspection_range%%,*},end=${admin_introspection_range##*,} ${admin_cidr} fi echo "Removing sahara endpoint and service" @@ -145,8 +151,13 @@ EOI # for virtual, we NAT external network through Undercloud # same goes for baremetal if only jumphost has external connectivity if [ "$virtual" == "TRUE" ] || ! test_overcloud_connectivity && [ "$external_network_ipv6" != "True" ]; then - if ! configure_undercloud_nat ${external_cidr}; then - echo -e "${red}ERROR: Unable to NAT undercloud with external net: ${external_cidr}${reset}" + if [[ "$enabled_network_list" =~ "external" ]]; then + nat_cidr=${external_cidr} + else + nat_cidr=${admin_cidr} + fi + if ! configure_undercloud_nat ${nat_cidr}; then + echo -e "${red}ERROR: Unable to NAT undercloud with external net: ${nat_cidr}${reset}" exit 1 else echo -e "${blue}INFO: Undercloud VM has been setup to NAT Overcloud external network${reset}" diff --git a/lib/python/apex/deploy_settings.py b/lib/python/apex/deploy_settings.py index a27d13f1..963520a6 100644 --- a/lib/python/apex/deploy_settings.py +++ b/lib/python/apex/deploy_settings.py @@ -38,7 +38,7 @@ class DeploySettings(dict): """ def __init__(self, filename): init_dict = {} - if type(filename) is str: + if isinstance(filename, str): with open(filename, 'r') as deploy_settings_file: init_dict = yaml.safe_load(deploy_settings_file) else: diff --git a/lib/python/apex/inventory.py b/lib/python/apex/inventory.py index 37143566..711eb18f 100644 --- a/lib/python/apex/inventory.py +++ b/lib/python/apex/inventory.py @@ -22,7 +22,7 @@ class Inventory(dict): """ def __init__(self, source, ha=True, virtual=False): init_dict = {} - if type(source) is str: + if isinstance(source, str): with open(source, 'r') as inventory_file: yaml_dict = yaml.safe_load(inventory_file) # collapse node identifiers from the structure diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py index b931a758..4fc6f583 100644 --- a/lib/python/apex/network_environment.py +++ b/lib/python/apex/network_environment.py @@ -21,6 +21,7 @@ from .common.constants import ( COMPUTE_PRE, PRE_CONFIG_DIR ) +from .network_settings import NetworkSettings HEAT_NONE = 'OS::Heat::None' PORTS = '/ports' @@ -63,15 +64,13 @@ class NetworkEnvironment(dict): Create Network Environment according to Network Settings """ init_dict = {} - if type(filename) is str: + if isinstance(filename, str): with open(filename, 'r') as net_env_fh: init_dict = yaml.safe_load(net_env_fh) super().__init__(init_dict) - try: - enabled_nets = net_settings.enabled_network_list - except: - raise NetworkEnvException('Invalid Network Setting object') + if not isinstance(net_settings, NetworkSettings): + raise NetworkEnvException('Invalid Network Settings object') self._set_tht_dir() @@ -86,19 +85,21 @@ class NetworkEnvironment(dict): nets[ADMIN_NETWORK]['installer_vm']['ip'] self[param_def]['DnsServers'] = net_settings['dns_servers'] - if EXTERNAL_NETWORK in enabled_nets: - external_cidr = nets[EXTERNAL_NETWORK][0]['cidr'] + if EXTERNAL_NETWORK in net_settings.enabled_network_list: + external_cidr = net_settings.get_network(EXTERNAL_NETWORK)['cidr'] self[param_def]['ExternalNetCidr'] = str(external_cidr) - if type(nets[EXTERNAL_NETWORK][0]['installer_vm']['vlan']) is int: + external_vlan = self._get_vlan(net_settings.get_network( + EXTERNAL_NETWORK)) + if isinstance(external_vlan, int): self[param_def]['NeutronExternalNetworkBridge'] = '""' - self[param_def]['ExternalNetworkVlanID'] = \ - nets[EXTERNAL_NETWORK][0]['installer_vm']['vlan'] - external_range = nets[EXTERNAL_NETWORK][0]['overcloud_ip_range'] + self[param_def]['ExternalNetworkVlanID'] = external_vlan + external_range = net_settings.get_network(EXTERNAL_NETWORK)[ + 'overcloud_ip_range'] self[param_def]['ExternalAllocationPools'] = \ [{'start': str(external_range[0]), 'end': str(external_range[1])}] self[param_def]['ExternalInterfaceDefaultRoute'] = \ - nets[EXTERNAL_NETWORK][0]['gateway'] + net_settings.get_network(EXTERNAL_NETWORK)['gateway'] if external_cidr.version == 6: postfix = '/external_v6.yaml' @@ -110,7 +111,7 @@ class NetworkEnvironment(dict): # apply resource registry update for EXTERNAL_RESOURCES self._config_resource_reg(EXTERNAL_RESOURCES, postfix) - if TENANT_NETWORK in enabled_nets: + if TENANT_NETWORK in net_settings.enabled_network_list: tenant_range = nets[TENANT_NETWORK]['overcloud_ip_range'] self[param_def]['TenantAllocationPools'] = \ [{'start': str(tenant_range[0]), @@ -123,7 +124,7 @@ class NetworkEnvironment(dict): postfix = '/tenant.yaml' tenant_vlan = self._get_vlan(nets[TENANT_NETWORK]) - if type(tenant_vlan) is int: + if isinstance(tenant_vlan, int): self[param_def]['TenantNetworkVlanID'] = tenant_vlan else: postfix = '/noop.yaml' @@ -131,7 +132,7 @@ class NetworkEnvironment(dict): # apply resource registry update for TENANT_RESOURCES self._config_resource_reg(TENANT_RESOURCES, postfix) - if STORAGE_NETWORK in enabled_nets: + if STORAGE_NETWORK in net_settings.enabled_network_list: storage_range = nets[STORAGE_NETWORK]['overcloud_ip_range'] self[param_def]['StorageAllocationPools'] = \ [{'start': str(storage_range[0]), @@ -143,7 +144,7 @@ class NetworkEnvironment(dict): else: postfix = '/storage.yaml' storage_vlan = self._get_vlan(nets[STORAGE_NETWORK]) - if type(storage_vlan) is int: + if isinstance(storage_vlan, int): self[param_def]['StorageNetworkVlanID'] = storage_vlan else: postfix = '/noop.yaml' @@ -151,7 +152,7 @@ class NetworkEnvironment(dict): # apply resource registry update for STORAGE_RESOURCES self._config_resource_reg(STORAGE_RESOURCES, postfix) - if API_NETWORK in enabled_nets: + if API_NETWORK in net_settings.enabled_network_list: api_range = nets[API_NETWORK]['overcloud_ip_range'] self[param_def]['InternalApiAllocationPools'] = \ [{'start': str(api_range[0]), @@ -163,7 +164,7 @@ class NetworkEnvironment(dict): else: postfix = '/internal_api.yaml' api_vlan = self._get_vlan(nets[API_NETWORK]) - if type(api_vlan) is int: + if isinstance(api_vlan, int): self[param_def]['InternalApiNetworkVlanID'] = api_vlan else: postfix = '/noop.yaml' @@ -184,9 +185,9 @@ class NetworkEnvironment(dict): self[param_def][flag] = True def _get_vlan(self, network): - if type(network['nic_mapping'][CONTROLLER]['vlan']) is int: + if isinstance(network['nic_mapping'][CONTROLLER]['vlan'], int): return network['nic_mapping'][CONTROLLER]['vlan'] - elif type(network['nic_mapping'][COMPUTE]['vlan']) is int: + elif isinstance(network['nic_mapping'][COMPUTE]['vlan'], int): return network['nic_mapping'][COMPUTE]['vlan'] else: return 'native' diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py index 951000dc..64065ca7 100644 --- a/lib/python/apex/network_settings.py +++ b/lib/python/apex/network_settings.py @@ -14,7 +14,6 @@ import ipaddress from copy import copy from . import ip_utils -from .common import utils from .common.constants import ( CONTROLLER, COMPUTE, @@ -42,7 +41,7 @@ class NetworkSettings(dict): """ def __init__(self, filename): init_dict = {} - if type(filename) is str: + if isinstance(filename, str): with open(filename, 'r') as network_settings_file: init_dict = yaml.safe_load(network_settings_file) else: @@ -55,7 +54,7 @@ class NetworkSettings(dict): def merge(pri, sec): for key, val in sec.items(): if key in pri: - if type(val) is dict: + if isinstance(val, dict): merge(pri[key], val) # else # do not overwrite what's already there @@ -71,7 +70,14 @@ class NetworkSettings(dict): def get_network(self, network): if network == EXTERNAL_NETWORK and self['networks'][network]: - return self['networks'][network][0] + for net in self['networks'][network]: + if 'public' in net: + return net + + raise NetworkSettingsException("The external network, " + "'public', should be defined " + "when external networks are " + "enabled") else: return self['networks'][network] @@ -92,10 +98,7 @@ class NetworkSettings(dict): if _network.get('enabled', True): logging.info("{} enabled".format(network)) self._config_required_settings(network) - if network == EXTERNAL_NETWORK: - nicmap = _network['nic_mapping'] - else: - nicmap = _network['nic_mapping'] + nicmap = _network['nic_mapping'] iface = nicmap[CONTROLLER]['members'][0] self._config_ip_range(network=network, interface=iface, @@ -137,7 +140,7 @@ class NetworkSettings(dict): if interfaces: interface = interfaces[0] - if type(_role.get('vlan', 'native')) is not int and \ + if not isinstance(_role.get('vlan', 'native'), int) and \ any(y == interface for x, y in self.nics[role].items()): raise NetworkSettingsException( "Duplicate {} already specified for " @@ -183,7 +186,6 @@ class NetworkSettings(dict): ip = ipaddress.ip_address(_network['installer_vm']['ip']) nic_if = ip_utils.get_interface(ucloud_if_list[0], ip.version) if nic_if: - ucloud_if_list = [nic_if] logging.info("{}_bridged_interface: {}". format(network, nic_if)) else: @@ -312,16 +314,16 @@ class NetworkSettings(dict): flatten lists to delim separated strings flatten dics to underscored key names and string values """ - if type(obj) is list: + if isinstance(obj, list): return "{}=\'{}\'\n".format(name, delim.join(map(lambda x: str(x), obj))) - elif type(obj) is dict: + elif isinstance(obj, dict): flat_str = '' for k in obj: flat_str += flatten("{}_{}".format(name, k), obj[k]) return flat_str - elif type(obj) is str: + elif isinstance(obj, str): return "{}='{}'\n".format(name, obj) else: return "{}={}\n".format(name, str(obj)) diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh index bd93aa78..a5d3b78d 100755 --- a/lib/undercloud-functions.sh +++ b/lib/undercloud-functions.sh @@ -253,6 +253,7 @@ sudo systemctl restart openstack-heat-api EOI # configure external network +if [[ "$enabled_network_list" =~ "external" ]]; then ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" << EOI if [[ "$external_installer_vm_vlan" != "native" ]]; then cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-vlan${external_installer_vm_vlan} @@ -274,6 +275,7 @@ else fi fi EOI +fi # WORKAROUND: must restart the above services to fix sync problem with nova compute manager # TODO: revisit and file a bug if necessary. This should eventually be removed |