diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/configure-deps-functions.sh | 6 | ||||
-rwxr-xr-x | lib/overcloud-deploy-functions.sh | 13 | ||||
-rwxr-xr-x | lib/parse-functions.sh | 6 | ||||
-rw-r--r-- | lib/python/apex/network_settings.py | 3 | ||||
-rwxr-xr-x | lib/python/apex_python_utils.py | 14 | ||||
-rwxr-xr-x | lib/undercloud-functions.sh | 89 |
6 files changed, 52 insertions, 79 deletions
diff --git a/lib/configure-deps-functions.sh b/lib/configure-deps-functions.sh index 11bba446..1d238f87 100755 --- a/lib/configure-deps-functions.sh +++ b/lib/configure-deps-functions.sh @@ -33,12 +33,8 @@ function configure_deps { systemctl status libvirtd || systemctl start libvirtd systemctl status openvswitch || systemctl start openvswitch - # If flat we only use admin network - if [[ "$net_isolation_enabled" == "FALSE" ]]; then - virsh_enabled_networks="admin" - enabled_network_list="admin" # For baremetal we only need to create/attach Undercloud to admin and external - elif [ "$virtual" == "FALSE" ]; then + if [ "$virtual" == "FALSE" ]; then virsh_enabled_networks="admin external" else virsh_enabled_networks=$enabled_network_list diff --git a/lib/overcloud-deploy-functions.sh b/lib/overcloud-deploy-functions.sh index 60d5e140..2066f15a 100755 --- a/lib/overcloud-deploy-functions.sh +++ b/lib/overcloud-deploy-functions.sh @@ -204,6 +204,10 @@ EOI # make sure ceph is installed DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" + #DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml" + DEPLOY_OPTIONS+=" -e network-environment.yaml" + + # get number of nodes available in inventory num_control_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:control /home/stack/instackenv.json") num_compute_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:compute /home/stack/instackenv.json") @@ -233,14 +237,7 @@ EOI DEPLOY_OPTIONS+=" --compute-scale ${num_compute_nodes}" fi - if [[ "$net_isolation_enabled" == "TRUE" ]]; then - #DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml" - DEPLOY_OPTIONS+=" -e network-environment.yaml" - fi - - if [[ "$ha_enabled" == "True" ]] || [[ "$net_isolation_enabled" == "TRUE" ]]; then - DEPLOY_OPTIONS+=" --ntp-server $ntp_server" - fi + DEPLOY_OPTIONS+=" --ntp-server $ntp_server" DEPLOY_OPTIONS+=" --control-flavor control --compute-flavor compute" if [[ "$virtual" == "TRUE" ]]; then diff --git a/lib/parse-functions.sh b/lib/parse-functions.sh index 4b3d2346..84da75c5 100755 --- a/lib/parse-functions.sh +++ b/lib/parse-functions.sh @@ -25,7 +25,7 @@ parse_network_settings() { done fi - if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS $net_isolation_arg -td $APEX_TMP_DIR -e $CONFIG/network-environment.yaml $parse_ext); then + if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -td $APEX_TMP_DIR -e $CONFIG/network-environment.yaml $parse_ext); then echo -e "${blue}${output}${reset}" eval "$output" else @@ -34,10 +34,6 @@ parse_network_settings() { fi if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then - if [ "$net_isolation_enabled" == "FALSE" ]; then - echo -e "${red}ERROR: flat network is not supported with ovs-dpdk ${reset}" - exit 1 - fi if [[ ! $enabled_network_list =~ "tenant" ]]; then echo -e "${red}ERROR: tenant network is not enabled for ovs-dpdk ${reset}" exit 1 diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py index 11798085..006d18c3 100644 --- a/lib/python/apex/network_settings.py +++ b/lib/python/apex/network_settings.py @@ -39,7 +39,7 @@ class NetworkSettings(dict): for deploy.sh consumption. This object will later be used directly as deployment script move to python. """ - def __init__(self, filename, network_isolation): + def __init__(self, filename): init_dict = {} if type(filename) is str: with open(filename, 'r') as network_settings_file: @@ -63,7 +63,6 @@ class NetworkSettings(dict): # merge the apex specific config into the first class settings merge(self, copy(self['apex'])) - self.network_isolation = network_isolation self.enabled_network_list = [] self.nics = {COMPUTE: {}, CONTROLLER: {}} self.nics_specified = {COMPUTE: False, CONTROLLER: False} diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py index b67028ac..b0ebb270 100755 --- a/lib/python/apex_python_utils.py +++ b/lib/python/apex_python_utils.py @@ -33,11 +33,8 @@ def parse_net_settings(args): Args: - file: string file to network_settings.yaml file - - network_isolation: bool - enable or disable network_isolation """ - settings = NetworkSettings(args.net_settings_file, - args.network_isolation) + settings = NetworkSettings(args.net_settings_file) net_env = NetworkEnvironment(settings, args.net_env_file, args.compute_pre_config, args.controller_pre_config) @@ -106,8 +103,7 @@ def build_nic_template(args): """ template_dir, template = args.template.rsplit('/', 1) - netsets = NetworkSettings(args.net_settings_file, - args.network_isolation) + netsets = NetworkSettings(args.net_settings_file) env = Environment(loader=FileSystemLoader(template_dir), autoescape=True) template = env.get_template(template) @@ -132,9 +128,6 @@ def get_parser(): default='network-settings.yaml', dest='net_settings_file', help='path to network settings file') - net_settings.add_argument('--flat', action='store_false', - default=True, dest='network_isolation', - help='disable network isolation') net_settings.add_argument('-e', '--net-env-file', default="network-environment.yaml", dest='net_env_file', @@ -178,9 +171,6 @@ def get_parser(): default='network-settings.yaml', dest='net_settings_file', help='path to network settings file') - nic_template.add_argument('--flat', action='store_false', - default=True, dest='network_isolation', - help='disable network isolation') nic_template.add_argument('-e', '--ext-net-type', default='interface', dest='ext_net_type', choices=['interface', 'br-ex'], diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh index 3c918502..98552f29 100755 --- a/lib/undercloud-functions.sh +++ b/lib/undercloud-functions.sh @@ -120,32 +120,31 @@ function configure_undercloud { local controller_nic_template compute_nic_template echo echo "Copying configuration files to Undercloud" - if [[ "$net_isolation_enabled" == "TRUE" ]]; then - echo -e "${blue}Network Environment set for Deployment: ${reset}" - cat $APEX_TMP_DIR/network-environment.yaml - scp ${SSH_OPTIONS[@]} $APEX_TMP_DIR/network-environment.yaml "stack@$UNDERCLOUD": - - # check for ODL L3/ONOS - if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then - ext_net_type=br-ex - fi - - if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then - ovs_dpdk_bridge='br-phy' - else - ovs_dpdk_bridge='' - fi - - if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS $net_isolation_arg -t $CONFIG/nics-template.yaml.jinja2 -e "br-ex"); then - echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}" - exit 1 - fi + echo -e "${blue}Network Environment set for Deployment: ${reset}" + cat $APEX_TMP_DIR/network-environment.yaml + scp ${SSH_OPTIONS[@]} $APEX_TMP_DIR/network-environment.yaml "stack@$UNDERCLOUD": - if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS $net_isolation_arg -t $CONFIG/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then - echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}" - exit 1 - fi - ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI + # check for ODL L3/ONOS + if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then + ext_net_type=br-ex + fi + + if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then + ovs_dpdk_bridge='br-phy' + else + ovs_dpdk_bridge='' + fi + + if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e "br-ex"); then + echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}" + exit 1 + fi + + if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then + echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}" + exit 1 + fi + ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI mkdir nics/ cat > nics/controller.yaml << EOF $controller_nic_template @@ -154,7 +153,6 @@ cat > nics/compute.yaml << EOF $compute_nic_template EOF EOI - fi # ensure stack user on Undercloud machine has an ssh key ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "if [ ! -e ~/.ssh/id_rsa.pub ]; then ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa; fi" @@ -189,27 +187,24 @@ EOI echo "Running undercloud configuration." echo "Logging undercloud configuration to undercloud:/home/stack/apex-undercloud-install.log" ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI -if [[ "$net_isolation_enabled" == "TRUE" ]]; 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 ${admin_installer_vm_ip}/${admin_cidr##*/} - openstack-config --set undercloud.conf DEFAULT network_gateway ${admin_installer_vm_ip} - openstack-config --set undercloud.conf DEFAULT network_cidr ${admin_cidr} - openstack-config --set undercloud.conf DEFAULT dhcp_start ${admin_dhcp_range%%,*} - openstack-config --set undercloud.conf DEFAULT dhcp_end ${admin_dhcp_range##*,} - openstack-config --set undercloud.conf DEFAULT inspection_iprange ${admin_introspection_range} - openstack-config --set undercloud.conf DEFAULT undercloud_debug false - openstack-config --set undercloud.conf DEFAULT undercloud_hostname "undercloud.${domain_name}" - sudo openstack-config --set /etc/ironic/ironic.conf disk_utils iscsi_verify_attempts 30 - sudo openstack-config --set /etc/ironic/ironic.conf disk_partitioner check_device_max_retries 40 - -fi +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 ${admin_installer_vm_ip}/${admin_cidr##*/} +openstack-config --set undercloud.conf DEFAULT network_gateway ${admin_installer_vm_ip} +openstack-config --set undercloud.conf DEFAULT network_cidr ${admin_cidr} +openstack-config --set undercloud.conf DEFAULT dhcp_start ${admin_dhcp_range%%,*} +openstack-config --set undercloud.conf DEFAULT dhcp_end ${admin_dhcp_range##*,} +openstack-config --set undercloud.conf DEFAULT inspection_iprange ${admin_introspection_range} +openstack-config --set undercloud.conf DEFAULT undercloud_debug false +openstack-config --set undercloud.conf DEFAULT undercloud_hostname "undercloud.${domain_name}" +sudo openstack-config --set /etc/ironic/ironic.conf disk_utils iscsi_verify_attempts 30 +sudo openstack-config --set /etc/ironic/ironic.conf disk_partitioner check_device_max_retries 40 sudo sed -i '/CephClusterFSID:/c\\ CephClusterFSID: \\x27$(cat /proc/sys/kernel/random/uuid)\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml sudo sed -i '/CephMonKey:/c\\ CephMonKey: \\x27'"\$(ceph-authtool --gen-print-key)"'\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml |