diff options
-rw-r--r-- | build/network-environment.yaml | 2 | ||||
-rwxr-xr-x | ci/clean.sh | 2 | ||||
-rwxr-xr-x | ci/deploy.sh | 35 | ||||
-rw-r--r-- | config/network/network_settings.yaml | 3 | ||||
-rw-r--r-- | lib/python/apex/network_environment.py | 26 |
5 files changed, 64 insertions, 4 deletions
diff --git a/build/network-environment.yaml b/build/network-environment.yaml index 27733005..874e0112 100644 --- a/build/network-environment.yaml +++ b/build/network-environment.yaml @@ -65,7 +65,7 @@ parameters: CinderIscsiNetwork: storage GlanceApiNetwork: storage GlanceRegistryNetwork: internal_api - KeystoneAdminApiNetwork: internal_api + KeystoneAdminApiNetwork: ctlplane KeystonePublicApiNetwork: internal_api NeutronApiNetwork: internal_api HeatApiNetwork: internal_api diff --git a/ci/clean.sh b/ci/clean.sh index b7f10582..4cf6b64a 100755 --- a/ci/clean.sh +++ b/ci/clean.sh @@ -25,7 +25,7 @@ fi vm_index=4 ovs_bridges="br-admin br-private br-public br-storage" -OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network" +OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network api_network" # Clean off instack/undercloud VM for vm in instack undercloud; do diff --git a/ci/deploy.sh b/ci/deploy.sh index 1a84421e..8d82b423 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -291,7 +291,7 @@ function configure_deps { virsh net-list --all | grep -E "default\s+active\s+yes" > /dev/null || virsh net-autostart --network default if [[ -z "$virtual" || "$virtual" == "FALSE" ]]; then - for network in ${OPNFV_NETWORK_TYPES}; do + for network in ${enabled_network_list}; do echo "${blue}INFO: Creating Virsh Network: $network & OVS Bridge: ${NET_MAP[$network]}${reset}" ovs-vsctl list-br | grep "^${NET_MAP[$network]}$" > /dev/null || ovs-vsctl add-br ${NET_MAP[$network]} virsh net-list --all | grep $network > /dev/null || (cat > ${libvirt_dir}/apex-virsh-net.xml && virsh net-define ${libvirt_dir}/apex-virsh-net.xml) << EOF @@ -523,7 +523,7 @@ EOF for i in $(seq 0 $vm_index); do if ! virsh list --all | grep baremetal${i} > /dev/null; then define_vm baremetal${i} network 41 'admin_network' $vcpus $ramsize - for n in private_network public_network storage_network; do + for n in private_network public_network storage_network api_network; do if [[ $enabled_network_list =~ $n ]]; then echo -n "$n " virsh attach-interface --domain baremetal${i} --type network --source $n --model rtl8139 --config @@ -821,6 +821,31 @@ function undercloud_prep_overcloud_deploy { ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2" scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2 + # Install ovs-dpdk inside the overcloud image if it is enabled. + if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then + # install dpdk packages before ovs + echo -e "${blue}INFO: Enabling kernel modules for dpdk inside overcloud image${reset}" + + ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI + cat << EOF > vfio_pci.modules +#!/bin/bash +exec /sbin/modprobe vfio_pci >/dev/null 2>&1 +EOF + + cat << EOF > uio_pci_generic.modules +#!/bin/bash +exec /sbin/modprobe uio_pci_generic >/dev/null 2>&1 +EOF + + LIBGUESTFS_BACKEND=direct virt-customize --upload vfio_pci.modules:/etc/sysconfig/modules/ \ + --upload uio_pci_generic.modules:/etc/sysconfig/modules/ \ + --run-command "chmod 0755 /etc/sysconfig/modules/vfio_pci.modules" \ + --run-command "chmod 0755 /etc/sysconfig/modules/uio_pci_generic.modules" \ + -a overcloud-full.qcow2 +EOI + + fi + # Add performance deploy options if they have been set if [ ! -z "${deploy_options_array['performance']}" ]; then @@ -993,6 +1018,12 @@ set -o errexit echo "Configuring Neutron external network" neutron net-create external --router:external=True --tenant-id \$(keystone tenant-get service | grep id | awk '{ print \$4 }') neutron subnet-create --name external-net --tenant-id \$(keystone tenant-get service | grep id | awk '{ print \$4 }') --disable-dhcp external --gateway ${public_network_gateway} --allocation-pool start=${public_network_floating_ip_range%%,*},end=${public_network_floating_ip_range##*,} ${public_network_cidr} + +echo "Removing swift endpoint and service" +swift_service_id=\$(keystone service-list | grep swift | cut -d ' ' -f 2) +swift_endpoint_id=\$(keystone endpoint-list | grep \$swift_service_id | cut -d ' ' -f 2) +keystone endpoint-delete \$swift_endpoint_id +keystone service-delete \$swift_service_id EOI echo -e "${blue}INFO: Checking if OVS bridges have IP addresses...${reset}" diff --git a/config/network/network_settings.yaml b/config/network/network_settings.yaml index 88bb3b58..5614c64d 100644 --- a/config/network/network_settings.yaml +++ b/config/network/network_settings.yaml @@ -19,6 +19,9 @@ # See short description of the networks in the comments below. # +# DNS Servers for all nodes, comma delimited list +dns_servers: ["8.8.8.8", "8.8.4.4"] + # "admin" is the short name for Control Plane Network. # During OPNFV deployment it is used for node provisioning so # PXE boot should be enabled for the related interfaces on all diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py index e6f0135a..c9b7d3cc 100644 --- a/lib/python/apex/network_environment.py +++ b/lib/python/apex/network_environment.py @@ -20,6 +20,10 @@ STORAGE_RESOURCES = {'OS::TripleO::Network::Storage': None, 'OS::TripleO::Network::Ports::StorageVipPort': PORTS, 'OS::TripleO::Controller::Ports::StoragePort': PORTS, 'OS::TripleO::Compute::Ports::StoragePort': PORTS} +API_RESOURCES = {'OS::TripleO::Network::InternalApi': None, + 'OS::TripleO::Network::Ports::InternalApiVipPort': PORTS, + 'OS::TripleO::Controller::Ports::InternalApiPort': PORTS, + 'OS::TripleO::Compute::Ports::InternalApiPort': PORTS} class NetworkEnvironment: @@ -78,6 +82,7 @@ class NetworkEnvironment: net_settings[constants.PUBLIC_NETWORK]['gateway'] self.netenv_obj[param_def]['EC2MetadataIp'] = \ net_settings[constants.ADMIN_NETWORK]['provisioner_ip'] + self.netenv_obj[param_def]['DnsServers'] = net_settings['dns_servers'] if constants.PRIVATE_NETWORK in enabled_networks: priv_range = net_settings[constants.PRIVATE_NETWORK][ @@ -117,6 +122,27 @@ class NetworkEnvironment: if prefix is None: prefix = '' self.netenv_obj[reg][key] = tht_dir + prefix + postfix + + if constants.API_NETWORK in enabled_networks: + api_range = net_settings[constants.API_NETWORK][ + 'usable_ip_range'].split(',') + self.netenv_obj[param_def]['InternalApiAllocationPools'] = \ + [{'start': + api_range[0], + 'end': + api_range[1] + }] + api_cidr = net_settings[constants.API_NETWORK]['cidr'] + self.netenv_obj[param_def]['InternalApiNetCidr'] = str(api_cidr) + postfix = '/internal_api.yaml' + else: + postfix = '/noop.yaml' + + for key, prefix in API_RESOURCES.items(): + if prefix is None: + prefix = '' + self.netenv_obj[reg][key] = tht_dir + prefix + postfix + return self.netenv_obj def get_netenv_settings(self): |