From f79e4a1703ba54008e7049b041600546e0482f75 Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Tue, 15 Dec 2015 15:44:01 -0500 Subject: Adding network configuration options - enabling subnet configuration for undercloud - enabling external network configuration Change-Id: Id1951d31faa1a68f850a75e2466d30b8abcea8ac --- build/instack.sh | 1 - build/opnfv-apex.spec | 13 ++++--- ci/deploy.sh | 69 +++++++++++++++++++++++++++----------- config/deploy/deploy_settings.yaml | 23 +++++++++++-- 4 files changed, 79 insertions(+), 27 deletions(-) diff --git a/build/instack.sh b/build/instack.sh index 69fec702..48aef0b2 100755 --- a/build/instack.sh +++ b/build/instack.sh @@ -113,7 +113,6 @@ else echo -e "${blue}\rInstack VM has IP $UNDERCLOUD${reset}" fi - # ensure that we can ssh to the undercloud CNT=10 while ! ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "echo ''" > /dev/null && [ $CNT -gt 0 ]; do diff --git a/build/opnfv-apex.spec b/build/opnfv-apex.spec index 88ec6425..ee819481 100644 --- a/build/opnfv-apex.spec +++ b/build/opnfv-apex.spec @@ -1,7 +1,7 @@ Name: opnfv-apex -Version: 2.5 +Version: 2.6 Release: %{release} -Summary: RDO Manager disk images for deployment +Summary: Scripts and Disk images for deployment Group: System Environment License: Apache 2.0 @@ -13,9 +13,10 @@ BuildRequires: openvswitch qemu-kvm python-docutils Requires: openvswitch qemu-kvm bridge-utils libguestfs-tools %description -These files are disk images used to launch the instack +These files are scripts and disk images used to launch the instack libvirt VM and to load into the instack undercloud machine -to deploy an OpenStack overcloud. +to deploy an OpenStack overcloud. Installation is done via RDO Manager +https://rdoproject.org %prep %setup -q @@ -55,6 +56,7 @@ install docs/installation-instructions/index.rst %{buildroot}%{_docdir}/opnfv/in 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 %files %{_bindir}/opnfv-deploy @@ -78,9 +80,12 @@ install docs/release-notes.html %{buildroot}%{_docdir}/opnfv/ %doc %{_docdir}/opnfv/installation-instructions.html %doc %{_docdir}/opnfv/release-notes.rst %doc %{_docdir}/opnfv/release-notes.html +%doc %{_docdir}/opnfv/deploy_settings.yaml.example %changelog +* Tue Dec 15 2015 Dan Radez - 2.6-1 +- Added deploy settings for flat network config * Wed Dec 09 2015 Dan Radez - 2.5-1 - Updating the OpenDaylight Patch * Fri Dec 05 2015 Dan Radez - 2.4-1 diff --git a/ci/deploy.sh b/ci/deploy.sh index 24187f16..d090280c 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -53,7 +53,7 @@ parse_yaml() { for (i in vname) {if (i > indent) {delete vname[i]}} if (length($3) > 0) { vn=""; for (i=0; i> ~/.ssh/authorized_keys + # copy stack's ssh key to this users authorized keys + ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "cat /home/stack/.ssh/id_rsa.pub" >> ~/.ssh/authorized_keys + + # configure undercloud on Undercloud VM + echo "Running undercloud configuration." + echo "Logging undercloud configuration to instack:/home/stack/apex-undercloud-install.log" + ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI +if [ -n "$DEPLOY_SETTINGS_FILE" ]; then + sed -i 's/#local_ip/local_ip/' undercloud.conf + sed -i 's/#network_gateway/network_gateway/' undercloud.conf + sed -i 's/#network_cidr/network_cidr/' undercloud.conf + sed -i 's/#dhcp_start/dhcp_start/' undercloud.conf + sed -i 's/#dhcp_end/dhcp_end/' undercloud.conf + sed -i 's/#inspection_iprange/inspection_iprange/' undercloud.conf + sed -i 's/#undercloud_debug/undercloud_debug/' undercloud.conf + + openstack-config --set undercloud.conf DEFAULT local_ip ${deploy_options_array['instack_ip']}/${deploy_options_array['provisioning_cidr']##*/} + openstack-config --set undercloud.conf DEFAULT network_gateway ${deploy_options_array['provisioning_gateway']} + openstack-config --set undercloud.conf DEFAULT network_cidr ${deploy_options_array['provisioning_cidr']} + openstack-config --set undercloud.conf DEFAULT dhcp_start ${deploy_options_array['provisioning_dhcp_start']} + openstack-config --set undercloud.conf DEFAULT dhcp_end ${deploy_options_array['provisioning_dhcp_end']} + openstack-config --set undercloud.conf DEFAULT inspection_iprange ${deploy_options_array['provisioning_inspection_iprange']} + openstack-config --set undercloud.conf DEFAULT undercloud_debug false + + if [ -n "$net_isolation_enabled" ]; then + sed -i '/ControlPlaneSubnetCidr/c\\ ControlPlaneSubnetCidr: "${deploy_options_array['provisioning_cidr']##*/}"' network-environment.yaml + sed -i '/ControlPlaneDefaultRoute/c\\ ControlPlaneDefaultRoute: ${deploy_options_array['provisioning_gateway']}' network-environment.yaml + sed -i '/ExternalNetCidr/c\\ ExternalNetCidr: ${deploy_options_array['ext_net_cidr']}' network-environment.yaml + sed -i '/ExternalAllocationPools/c\\ ExternalAllocationPools: [{'start': '${deploy_options_array['ext_allocation_pool_start']}', 'end': '${deploy_options_array['ext_allocation_pool_end']}'}]' network-environment.yaml + sed -i '/ExternalInterfaceDefaultRoute/c\\ ExternalInterfaceDefaultRoute: ${deploy_options_array['ext_gateway']}' network-environment.yaml + fi +fi + +openstack undercloud install &> apex-undercloud-install.log +EOI } ##preping it for deployment and launch the deploy ##params: none function undercloud_prep_overcloud_deploy { -# configure undercloud on Undercloud VM -ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "openstack undercloud install > apex-undercloud-install.log" + + if [[ ${#deploy_options_array[@]} -eq 0 || ${deploy_options_array['sdn_controller']} == 'opendaylight' ]]; then + DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight.yaml" + elif [ ${deploy_options_array['sdn_controller']} == 'opendaylight-external' ]; then + DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight-external.yaml" + elif [ ${deploy_options_array['sdn_controller']} == 'onos' ]; then + echo -e "${red}ERROR: ONOS is currently unsupported...exiting${reset}" + exit 1 + elif [ ${deploy_options_array['sdn_controller']} == 'opencontrail' ]; then + echo -e "${red}ERROR: OpenContrail is currently unsupported...exiting${reset}" + exit 1 + fi # check if HA is enabled if [[ "$ha_enabled" == "TRUE" ]]; then @@ -639,7 +670,7 @@ main() { elif [ -n "$INVENTORY_FILE" ]; then parse_inventory_file fi - copy_materials_to_instack + configure_undercloud undercloud_prep_overcloud_deploy } diff --git a/config/deploy/deploy_settings.yaml b/config/deploy/deploy_settings.yaml index f024116c..52d39130 100644 --- a/config/deploy/deploy_settings.yaml +++ b/config/deploy/deploy_settings.yaml @@ -3,9 +3,26 @@ global_params: network_isolation_settings: network/network-environment-example.yaml deploy_options: + # instack_ip + # IP address given to instack on the provisioning network + instack_ip: 192.0.2.1 + # CIDR of provisioning network + provisioning_cidr: 192.0.2.0/24 + # gateway IP of provisioning network + provisioning_gateway: 192.0.2.1 + # IP pool start used for provisioning overcloud nodes + provisioning_dhcp_start: 192.0.2.5 + # IP pool end used for inspecting overcloud nodes + provisioning_dhcp_end: 192.0.2.24 + # IP pool used for inspecting overcloud nodes on the provisioning network + provisioning_inspection_iprange: 192.0.2.100,192.0.2.124 sdn_controller: opendaylight tacker: false congress: false - - - + # CIDR used to for the external network + ext_net_cidr: 192.168.37.0/24 + # Allocation pools for floating ip addresses on the ext net + ext_allocation_pool_start: 192.168.37.50 + ext_allocation_pool_end: 192.168.37.99 + # Default Gateway for External Network + ext_gateway: 192.168.37.1 -- cgit 1.2.3-korg