From 3f6a345d700940df2580da75260f55c489fcd8b1 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Wed, 25 Jan 2017 09:57:18 -0500 Subject: [PATCH] Remove setup-neutron We don't really need to use setup-neutron from os-cloud-config to create the ctlplane network and subnet. As simple as they are, it's more straightforward and clear to just use neutron commands directly. This removes all depedencies on os-cloud-config from instack-undercloud so we can remove that requirement from requirements.txt (and moves us closer to deprecating that entire repo). Change-Id: I88a4359884429f85f1ef356d50abb0bf664a5540 --- .../post-configure.d/98-undercloud-setup | 27 +++++++------------ requirements.txt | 1 - 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup b/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup index c58b1eb93..22ed22773 100755 --- a/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup +++ b/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup @@ -73,24 +73,15 @@ if [ "$net_create" -eq "1" ]; then neutron net-delete ctlplane fi - NETWORK_JSON=$(mktemp) - NETWORK_JSON_DATA='{"physical":{}}' - NETWORK_JSON_DATA=$(jq '.physical = .physical + { - "gateway": "'$NETWORK_GATEWAY'", - "metadata_server": "'$UNDERCLOUD_IP'", - "cidr": "'$NETWORK_CIDR'", - "allocation_start": "'$DHCP_START'", - "allocation_end": "'$DHCP_END'", - "name": "'$PHYSICAL_NETWORK'", - }' <<< $NETWORK_JSON_DATA) - if [ -n "${UNDERCLOUD_NAMESERVER:-}" ]; then - NETWORK_JSON_DATA=$(jq '.physical = .physical + { - "nameserver": "'$UNDERCLOUD_NAMESERVER'", - }' <<< $NETWORK_JSON_DATA) - fi - jq . > $NETWORK_JSON <<< $NETWORK_JSON_DATA - setup-neutron -n $NETWORK_JSON - rm $NETWORK_JSON + neutron net-create ctlplane \ + --provider:network_type flat \ + --provider:physical_network ctlplane + + neutron subnet-create --name ctlplane-subnet \ + --allocation-pool start=$DHCP_START,end=$DHCP_END \ + --gateway $NETWORK_GATEWAY \ + --host-route destination=169.254.169.254/32,nexthop=$METADATA_SERVER \ + ctlplane $NETWORK_CIDR fi # Disable nova quotas diff --git a/requirements.txt b/requirements.txt index afb8e3596..8d041dcf9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,5 @@ oslo.config psutil>=1.1.1,<2.0.0 netaddr>=0.7.12,!=0.7.16 pystache -os-cloud-config os-refresh-config os-apply-config