Skip to content

Commit

Permalink
Additional packaging and provisioning changes for liberty on mainline
Browse files Browse the repository at this point in the history
Bringing in the changes done on R3.0 into mainline
https://review.opencontrail.org/#/c/18699 - #1561163
https://review.opencontrail.org/#/c/18837 - #1561163
https://review.opencontrail.org/#/c/18864 - #1547784
https://review.opencontrail.org/#/c/18871 - #1561163
https://review.opencontrail.org/#/c/18907 - #1564023
https://review.opencontrail.org/#/c/18928 - #1564221

Partial-Bug: #1547784

Change-Id: I6f120d2d068fde57bc5e3aab8c47fc882a585e18
  • Loading branch information
a committed Mar 31, 2016
1 parent 4dcdc1f commit 17c9ba9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
Expand Up @@ -94,7 +94,7 @@ if [ $CONTROLLER != $COMPUTE ] ; then
if [ $? -eq 0 ]; then
kilo_or_above=1
else
if [[ $nova_compute_version == *"12.0.0"* ]]; then
if [[ $nova_compute_version == *"12.0."* ]]; then
kilo_or_above=1
fi
fi
Expand Down
23 changes: 14 additions & 9 deletions contrail_provisioning/config/scripts/quantum-server-setup.sh
Expand Up @@ -97,21 +97,26 @@ openstack-config --set /etc/$net_svc_name/$net_svc_name.conf QUOTAS quota_port -
if [ -d /etc/neutron ]; then
PYDIST=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2
openstack-config --set /etc/neutron/neutron.conf DEFAULT api_extensions_path extensions:${PYDIST}/neutron_plugin_contrail/extensions
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_hosts $AMQP_SERVER
liberty_ubuntu=0
if [ $is_ubuntu -eq 1 ] ; then
neutron_server_version=`dpkg -l | grep 'ii' | grep nova-api | awk '{print $3}'`
if [[ $neutron_server_version == *"12.0.0"* ]]; then
neutron_server_version=`dpkg -l | grep 'ii' | grep neutron-server | awk '{print $3}'`
if [[ $neutron_server_version == *"7.0."* ]]; then
liberty_ubuntu=1
fi
fi
if [ $is_ubuntu -eq 1 ] && [ $liberty_ubuntu -eq 1 ] ; then
# for liberty loadbalanacer plugin would be V2 by default and
# neutron_lbaas extensions would be needed in api_extensions_path
openstack-config --set /etc/neutron/neutron.conf DEFAULT api_extensions_path extensions:${PYDIST}/neutron_plugin_contrail/extensions:${PYDIST}/neutron_lbaas/extensions
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2
else

if [ $is_ubuntu -eq 1 ] ; then
if [ $liberty_ubuntu -eq 1 ] ; then
# for liberty loadbalanacer plugin would be V2 by default and
# neutron_lbaas extensions would be needed in api_extensions_path
openstack-config --set /etc/neutron/neutron.conf DEFAULT api_extensions_path extensions:${PYDIST}/neutron_plugin_contrail/extensions:${PYDIST}/neutron_lbaas/extensions
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2
else
openstack-config --set /etc/neutron/neutron.conf DEFAULT api_extensions_path extensions:${PYDIST}/neutron_plugin_contrail/extensions
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin
fi
else
openstack-config --set /etc/neutron/neutron.conf DEFAULT api_extensions_path extensions:${PYDIST}/neutron_plugin_contrail/extensions
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin
fi
Expand Down
Expand Up @@ -37,9 +37,12 @@ ENABLE_ENDPOINTS=yes
#ENABLE_QUANTUM=yes
if [ -f /etc/redhat-release ]; then
rpm -q contrail-heat > /dev/null && ENABLE_HEAT='yes'
is_ubuntu=0
fi
if [ -f /etc/lsb-release ] && egrep -q 'DISTRIB_ID.*Ubuntu' /etc/lsb-release; then
dpkg -l contrail-heat > /dev/null && ENABLE_HEAT='yes'
is_ubuntu=1
keystone_version=`dpkg -l | grep 'ii' | grep keystone | grep -v python | awk '{print $3}'`
fi
CONTROLLER=${INTERNAL_VIP:-$CONTROLLER}

Expand Down Expand Up @@ -89,6 +92,7 @@ if [ $? != 0 ]; then
echo "Keystone is not up, Exiting..."
exit 1
fi

ADMIN_TENANT=$(get_tenant admin)
SERVICE_TENANT=$(get_tenant service)
DEMO_TENANT=$(get_tenant demo)
Expand Down Expand Up @@ -197,12 +201,28 @@ keystone user-role-add --tenant-id $SERVICE_TENANT \
--role-id $ADMIN_ROLE
fi

ubuntu_liberty=0
if [ $is_ubuntu -eq 1 ]; then
if [[ $keystone_version == *"8.0.0"* ]]; then
ubuntu_liberty=1
fi
fi

source /etc/contrail/openstackrc

if [[ -n "$ENABLE_ENDPOINTS" ]]; then
if [ -z $(endpoint_lookup $NOVA_SERVICE) ]; then
keystone endpoint-create --region $OS_REGION_NAME --service-id $NOVA_SERVICE \
--publicurl 'http://'$CONTROLLER':8774/v1.1/$(tenant_id)s' \
--adminurl 'http://localhost:$(compute_port)s/v1.1/$(tenant_id)s' \
--internalurl 'http://'$CONTROLLER':8774/v1.1/$(tenant_id)s'
if [ $ubuntu_liberty -eq 1 ]; then
openstack endpoint create --region $OS_REGION_NAME $NOVA_SERVICE \
--publicurl 'http://'$CONTROLLER':8774/v1.1/$(tenant_id)s' \
--adminurl 'http://localhost:8774/v1.1/$(tenant_id)s' \
--internalurl 'http://'$CONTROLLER':8774/v1.1/$(tenant_id)s'
else
keystone endpoint-create --region $OS_REGION_NAME --service-id $NOVA_SERVICE \
--publicurl 'http://'$CONTROLLER':8774/v1.1/$(tenant_id)s' \
--adminurl 'http://localhost:$(compute_port)s/v1.1/$(tenant_id)s' \
--internalurl 'http://'$CONTROLLER':8774/v1.1/$(tenant_id)s'
fi
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions contrail_provisioning/openstack/scripts/nova-server-setup.sh
Expand Up @@ -217,13 +217,13 @@ openstack-config --set /etc/nova/nova.conf DEFAULT quota_ram 10000000

openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
if [ $is_ubuntu -eq 1 ] ; then
if [[ $nova_api_version == *"2013.2"* ]] || [[ $nova_api_version == *"2015"* ]] || [[ $nova_api_version == *"12.0.0"* ]]; then
if [[ $nova_api_version == *"2013.2"* ]] || [[ $nova_api_version == *"2015"* ]] || [[ $nova_api_version == *"12.0."* ]]; then
openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
else
openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class contrail_nova_networkapi.api.API
fi
openstack-config --set /etc/nova/nova.conf DEFAULT ec2_private_dns_show_ip False
if [[ $nova_api_version == *"2015"* ]] || [[ $nova_api_version == *"12.0.0"* ]]; then
if [[ $nova_api_version == *"2015"* ]] || [[ $nova_api_version == *"12.0."* ]]; then
openstack-config --set /etc/nova/nova.conf neutron admin_auth_url ${AUTH_PROTOCOL}://$CONTROLLER:35357/v2.0/
openstack-config --set /etc/nova/nova.conf neutron admin_username $OS_NET
openstack-config --set /etc/nova/nova.conf neutron admin_password $ADMIN_TOKEN
Expand Down

0 comments on commit 17c9ba9

Please sign in to comment.