diff options
author | Tim Rozet <trozet@redhat.com> | 2015-12-17 16:59:05 -0500 |
---|---|---|
committer | Dan Radez <dradez@redhat.com> | 2016-01-06 13:22:07 -0500 |
commit | 37dffdb77dc1424b45fa1fac8a8eebda846b107e (patch) | |
tree | 5d37ab2270ebc3e13a0cd5e79fdf72c4ac3caeeb /build | |
parent | d71330a6abf114050893d52497a5de05c19d70e1 (diff) |
Adds some network parsing for baremetal deployments and other fixes
Changes include:
- Fixes Intel Pod 2 inventory file
- Check for DHCP server on the host and disable
- Adds realistic+common network-settings file
- Modifies baremetal deployments to bridge to correct interface
- Adds private/storage network OVS bridges
- Parses network-settings into valid network-environment variables
- If certain network-settings are missing they will be auto-detected
Note: The actual settings set forth for deployment only include
admin/external networks at the moment. Private/storage networks will be
handled in an upcoming patch.
JIRA: APEX-50
Change-Id: I0a1a86f37c08702a93fe167688c3149ba5573db4
Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'build')
-rw-r--r-- | build/Makefile | 22 | ||||
-rwxr-xr-x | build/instack.sh | 31 | ||||
-rw-r--r-- | build/network-environment.yaml | 31 | ||||
-rw-r--r-- | build/nics/controller.yaml | 2 | ||||
-rw-r--r-- | build/opnfv-apex.spec | 18 |
5 files changed, 68 insertions, 36 deletions
diff --git a/build/Makefile b/build/Makefile index 87e8db08..f1341fbe 100644 --- a/build/Makefile +++ b/build/Makefile @@ -101,13 +101,15 @@ rpm: pushd ../ && git archive --format=tar --prefix=opnfv-apex-$(RPMVERS)/ HEAD > build/opnfv-apex.tar tar -u --xform="s:stack/instack.qcow2:opnfv-apex-$(RPMVERS)/build/instack.qcow2:" --file=opnfv-apex.tar stack/instack.qcow2 tar -u --xform="s:instack.xml:opnfv-apex-$(RPMVERS)/build/instack.xml:" --file=opnfv-apex.tar instack.xml - tar -u --xform="s:baremetalbrbm_brbm1_0.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_0.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_0.xml - tar -u --xform="s:baremetalbrbm_brbm1_1.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_1.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_1.xml - tar -u --xform="s:baremetalbrbm_brbm1_2.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_2.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_2.xml - tar -u --xform="s:baremetalbrbm_brbm1_3.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_3.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_3.xml - tar -u --xform="s:baremetalbrbm_brbm1_4.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_4.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_4.xml + tar -u --xform="s:baremetalbrbm_brbm1_brbm2_brbm3_0.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_brbm2_brbm3_0.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_brbm2_brbm3_0.xml + tar -u --xform="s:baremetalbrbm_brbm1_brbm2_brbm3_1.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_brbm2_brbm3_1.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_brbm2_brbm3_1.xml + tar -u --xform="s:baremetalbrbm_brbm1_brbm2_brbm3_2.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_brbm2_brbm3_2.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_brbm2_brbm3_2.xml + tar -u --xform="s:baremetalbrbm_brbm1_brbm2_brbm3_3.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_brbm2_brbm3_3.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_brbm2_brbm3_3.xml + tar -u --xform="s:baremetalbrbm_brbm1_brbm2_brbm3_4.xml:opnfv-apex-$(RPMVERS)/build/baremetalbrbm_brbm1_brbm2_brbm3_4.xml:" --file=opnfv-apex.tar baremetalbrbm_brbm1_brbm2_brbm3_4.xml tar -u --xform="s:brbm-net.xml:opnfv-apex-$(RPMVERS)/build/brbm-net.xml:" --file=opnfv-apex.tar brbm-net.xml tar -u --xform="s:brbm1-net.xml:opnfv-apex-$(RPMVERS)/build/brbm1-net.xml:" --file=opnfv-apex.tar brbm1-net.xml + tar -u --xform="s:brbm2-net.xml:opnfv-apex-$(RPMVERS)/build/brbm2-net.xml:" --file=opnfv-apex.tar brbm2-net.xml + tar -u --xform="s:brbm3-net.xml:opnfv-apex-$(RPMVERS)/build/brbm3-net.xml:" --file=opnfv-apex.tar brbm3-net.xml tar -u --xform="s:default-pool.xml:opnfv-apex-$(RPMVERS)/build/default-pool.xml:" --file=opnfv-apex.tar default-pool.xml tar -u --xform="s:instackenv-virt.json:opnfv-apex-$(RPMVERS)/build/instackenv-virt.json:" --file=opnfv-apex.tar instackenv-virt.json tar -u --xform="s:stack/overcloud-full-odl.qcow2:opnfv-apex-$(RPMVERS)/build/stack/overcloud-full.qcow2:" --file=opnfv-apex.tar stack/overcloud-full-odl.qcow2 @@ -121,11 +123,11 @@ instack: .PHONY: instack-clean instack-clean: rm -f instackenv-virt.json - rm -f baremetalbrbm_brbm1_0.xml - rm -f baremetalbrbm_brbm1_1.xml - rm -f baremetalbrbm_brbm1_2.xml - rm -f baremetalbrbm_brbm1_3.xml - rm -f baremetalbrbm_brbm1_4.xml + rm -f baremetalbrbm_brbm1_brbm2_brbm3_0.xml + rm -f baremetalbrbm_brbm1_brbm2_brbm3_1.xml + rm -f baremetalbrbm_brbm1_brbm2_brbm3_2.xml + rm -f baremetalbrbm_brbm1_brbm2_brbm3_3.xml + rm -f baremetalbrbm_brbm1_brbm2_brbm3_4.xml rm -f instack.xml .PHONY: iso diff --git a/build/instack.sh b/build/instack.sh index e52e3e55..39ab9b05 100755 --- a/build/instack.sh +++ b/build/instack.sh @@ -7,6 +7,7 @@ rdo_images_uri=https://ci.centos.org/artifacts/rdo/images/liberty/delorean/stabl vm_index=4 RDO_RELEASE=liberty SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null) +OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network" # check for dependancy packages for i in rpm-build createrepo libguestfs-tools python-docutils bsdtar; do @@ -88,7 +89,7 @@ sudo ../ci/clean.sh # and rebuild the bare undercloud VMs ssh -T ${SSH_OPTIONS[@]} stack@localhost <<EOI set -e -NODE_COUNT=5 NODE_CPU=2 NODE_MEM=8192 TESTENV_ARGS="--baremetal-bridge-names 'brbm brbm1'" instack-virt-setup +NODE_COUNT=5 NODE_CPU=2 NODE_MEM=8192 TESTENV_ARGS="--baremetal-bridge-names 'brbm brbm1 brbm2 brbm3'" instack-virt-setup EOI # let dhcp happen so we can get the ip @@ -163,24 +164,28 @@ fi echo $'\nGenerating libvirt configuration' for i in \$(seq 0 $vm_index); do - virsh dumpxml baremetalbrbm_brbm1_\$i | awk '/model type='\''virtio'\''/{c++;if(c==2){sub("model type='\''virtio'\''","model type='\''rtl8139'\''");c=0}}1' > baremetalbrbm_brbm1_\$i.xml + virsh dumpxml baremetalbrbm_brbm1_brbm2_brbm3_\$i | awk '/model type='\''virtio'\''/{c++;if(c==2){sub("model type='\''virtio'\''","model type='\''rtl8139'\''");c=0}}1' > baremetalbrbm_brbm1_brbm2_brbm3_\$i.xml done virsh dumpxml instack > instack.xml virsh net-dumpxml brbm > brbm-net.xml virsh net-dumpxml brbm1 > brbm1-net.xml +virsh net-dumpxml brbm2> brbm2-net.xml +virsh net-dumpxml brbm3 > brbm3-net.xml virsh pool-dumpxml default > default-pool.xml EOI # copy off the instack artifacts echo "Copying instack files to build directory" for i in $(seq 0 $vm_index); do - scp ${SSH_OPTIONS[@]} stack@localhost:baremetalbrbm_brbm1_${i}.xml . + scp ${SSH_OPTIONS[@]} stack@localhost:baremetalbrbm_brbm1_brbm2_brbm3_${i}.xml . done scp ${SSH_OPTIONS[@]} stack@localhost:instack.xml . scp ${SSH_OPTIONS[@]} stack@localhost:brbm-net.xml . scp ${SSH_OPTIONS[@]} stack@localhost:brbm1-net.xml . +scp ${SSH_OPTIONS[@]} stack@localhost:brbm2-net.xml . +scp ${SSH_OPTIONS[@]} stack@localhost:brbm3-net.xml . scp ${SSH_OPTIONS[@]} stack@localhost:default-pool.xml . # pull down the the built images @@ -254,22 +259,6 @@ LIBGUESTFS_BACKEND=direct virt-customize --upload ../opendaylight-puppet-neutron ## END WORK AROUND popd -# resize instack machine -echo "Checking if instack needs to be resized..." -instack_size=$(LIBGUESTFS_BACKEND=direct virt-filesystems --long -h --all -a stack/instack.qcow2 |grep device | grep -Eo "[0-9\.]+G" | sed -n 's/\([0-9][0-9]*\).*/\1/p') -if [ "$instack_size" -lt 30 ]; then - qemu-img create -f qcow2 -o preallocation=metadata newinstack.qcow2 30G - LIBGUESTFS_BACKEND=direct virt-resize --expand /dev/sda1 stack/instack.qcow2 newinstack.qcow2; - LIBGUESTFS_BACKEND=direct virt-customize -a newinstack.qcow2 --run-command 'xfs_growfs -d /dev/sda1 || true' - LIBGUESTFS_BACKEND=direct virt-sparsify newinstack.qcow2 stack/instack.qcow2 - new_size=$(LIBGUESTFS_BACKEND=direct virt-filesystems --long -h --all -a stack/instack.qcow2 |grep device | grep -Eo "[0-9\.]+G" | sed -n 's/\([0-9][0-9]*\).*/\1/p') - if [ "$new_size" -lt 30 ]; then - echo "Error resizing instack machine, disk size is ${new_size}" - exit 1 - else - echo "instack successfully resized" - fi -fi # move and Sanitize private keys from instack.json file mv stack/instackenv.json instackenv-virt.json sed -i '/pm_password/c\ "pm_password": "INSERT_STACK_USER_PRIV_KEY",' instackenv-virt.json @@ -281,8 +270,8 @@ set -e virsh destroy instack 2> /dev/null || echo -n '' virsh undefine instack --remove-all-storage 2> /dev/null || echo -n '' for i in \$(seq 0 $vm_index); do - virsh destroy baremetalbrbm_brbm1_\$i 2> /dev/null || echo -n '' - virsh undefine baremetalbrbm_brbm1_\$i --remove-all-storage 2> /dev/null || echo -n '' + virsh destroy baremetalbrbm_brbm1_brbm2_brbm3_\$i 2> /dev/null || echo -n '' + virsh undefine baremetalbrbm_brbm1_brbm2_brbm3_\$i --remove-all-storage 2> /dev/null || echo -n '' done EOI diff --git a/build/network-environment.yaml b/build/network-environment.yaml index a3d56025..a42a54bb 100644 --- a/build/network-environment.yaml +++ b/build/network-environment.yaml @@ -37,3 +37,34 @@ parameter_defaults: ExternalInterfaceDefaultRoute: 192.168.37.1 EC2MetadataIp: 192.0.2.1 DnsServers: ["8.8.8.8","8.8.4.4"] + +# ServiceNetMap: +# NeutronTenantNetwork: tenant +# CeilometerApiNetwork: internal_api +# MongoDbNetwork: internal_api +# CinderApiNetwork: internal_api +# CinderIscsiNetwork: storage +# GlanceApiNetwork: storage +# GlanceRegistryNetwork: internal_api +# KeystoneAdminApiNetwork: internal_api +# KeystonePublicApiNetwork: internal_api +# NeutronApiNetwork: internal_api +# HeatApiNetwork: internal_api +# NovaApiNetwork: internal_api +# NovaMetadataNetwork: internal_api +# NovaVncProxyNetwork: internal_api +# SwiftMgmtNetwork: storage_mgmt +# SwiftProxyNetwork: storage +# HorizonNetwork: internal_api +# MemcachedNetwork: internal_api +# RabbitMqNetwork: internal_api +# RedisNetwork: internal_api +# MysqlNetwork: internal_api +# CephClusterNetwork: storage_mgmt +# CephPublicNetwork: storage +# # Define which network will be used for hostname resolution +# ControllerHostnameResolveNetwork: internal_api +# ComputeHostnameResolveNetwork: internal_api +# BlockStorageHostnameResolveNetwork: internal_api +# ObjectStorageHostnameResolveNetwork: internal_api +# CephStorageHostnameResolveNetwork: storage diff --git a/build/nics/controller.yaml b/build/nics/controller.yaml index 1b421ac9..336b34a1 100644 --- a/build/nics/controller.yaml +++ b/build/nics/controller.yaml @@ -106,7 +106,7 @@ resources: members: - type: interface - name: nic2 + name: nic3 # force the MAC address of the bridge to this interface primary: true diff --git a/build/opnfv-apex.spec b/build/opnfv-apex.spec index 9b6a6f85..cb9f7705 100644 --- a/build/opnfv-apex.spec +++ b/build/opnfv-apex.spec @@ -1,5 +1,5 @@ Name: opnfv-apex -Version: 2.6 +Version: 2.7 Release: %{release} Summary: Scripts and Disk images for deployment @@ -33,12 +33,16 @@ install ci/clean.sh %{buildroot}%{_bindir}/opnfv-clean mkdir -p %{buildroot}%{_var}/opt/opnfv/stack/ mkdir -p %{buildroot}%{_var}/opt/opnfv/nics/ +mkdir -p %{buildroot}%{_var}/opt/opnfv/lib/ +install lib/common-functions.sh %{buildroot}%{_var}/opt/opnfv/lib/ install build/instack.qcow2 %{buildroot}%{_var}/opt/opnfv/stack/ install build/instack.xml %{buildroot}%{_var}/opt/opnfv/ -install build/baremetalbrbm_brbm1_*.xml %{buildroot}%{_var}/opt/opnfv/ +install build/baremetalbrbm_brbm1_brbm2_brbm3_*.xml %{buildroot}%{_var}/opt/opnfv/ install build/brbm-net.xml %{buildroot}%{_var}/opt/opnfv/ install build/brbm1-net.xml %{buildroot}%{_var}/opt/opnfv/ +install build/brbm2-net.xml %{buildroot}%{_var}/opt/opnfv/ +install build/brbm3-net.xml %{buildroot}%{_var}/opt/opnfv/ install build/default-pool.xml %{buildroot}%{_var}/opt/opnfv/ install build/network-environment.yaml %{buildroot}%{_var}/opt/opnfv/ install build/nics/controller.yaml %{buildroot}%{_var}/opt/opnfv/nics/ @@ -55,15 +59,19 @@ install docs/installation-instructions.html %{buildroot}%{_docdir}/opnfv/ install docs/release-notes/index.rst %{buildroot}%{_docdir}/opnfv/release-notes.rst install docs/release-notes.html %{buildroot}%{_docdir}/opnfv/ install config/deploy/deploy_settings.yaml %{buildroot}%{_docdir}/opnfv/deploy_settings.yaml.example +install config/deploy/network/network_settings.yaml %{buildroot}%{_docdir}/opnfv/network_settings.yaml.example %files %{_bindir}/opnfv-deploy %{_bindir}/opnfv-clean +%{_var}/opt/opnfv/lib/common-functions.sh %{_var}/opt/opnfv/stack/instack.qcow2 %{_var}/opt/opnfv/instack.xml -%{_var}/opt/opnfv/baremetalbrbm_brbm1_*.xml +%{_var}/opt/opnfv/baremetalbrbm_brbm1_brbm2_brbm3_*.xml %{_var}/opt/opnfv/brbm-net.xml %{_var}/opt/opnfv/brbm1-net.xml +%{_var}/opt/opnfv/brbm2-net.xml +%{_var}/opt/opnfv/brbm3-net.xml %{_var}/opt/opnfv/default-pool.xml %{_var}/opt/opnfv/network-environment.yaml %{_var}/opt/opnfv/nics/controller.yaml @@ -77,9 +85,11 @@ install config/deploy/deploy_settings.yaml %{buildroot}%{_docdir}/opnfv/deploy_s %doc %{_docdir}/opnfv/release-notes.rst %doc %{_docdir}/opnfv/release-notes.html %doc %{_docdir}/opnfv/deploy_settings.yaml.example - +%doc %{_docdir}/opnfv/network_settings.yaml.example %changelog +* Tue Dec 20 2015 Tim Rozet <trozet@redhat.com> - 2.7-1 +- Modifies networks to include OPNFV private/storage networks * Tue Dec 15 2015 Dan Radez <dradez@redhat.com> - 2.6-1 - Added deploy settings for flat network config - cleaned up files that don't need to be in the rpm |