diff --git a/contrail_provisioning/compute/scripts/compute-server-setup.sh b/contrail_provisioning/compute/scripts/compute-server-setup.sh index b7f6ef76..60a545c1 100755 --- a/contrail_provisioning/compute/scripts/compute-server-setup.sh +++ b/contrail_provisioning/compute/scripts/compute-server-setup.sh @@ -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 diff --git a/contrail_provisioning/config/scripts/quantum-server-setup.sh b/contrail_provisioning/config/scripts/quantum-server-setup.sh index 25c13330..120fa811 100755 --- a/contrail_provisioning/config/scripts/quantum-server-setup.sh +++ b/contrail_provisioning/config/scripts/quantum-server-setup.sh @@ -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 diff --git a/contrail_provisioning/openstack/ha/scripts/contrail-ha-keystone-setup.sh b/contrail_provisioning/openstack/ha/scripts/contrail-ha-keystone-setup.sh index 67af0f17..cfa093e4 100755 --- a/contrail_provisioning/openstack/ha/scripts/contrail-ha-keystone-setup.sh +++ b/contrail_provisioning/openstack/ha/scripts/contrail-ha-keystone-setup.sh @@ -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} @@ -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) @@ -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 diff --git a/contrail_provisioning/openstack/scripts/nova-server-setup.sh b/contrail_provisioning/openstack/scripts/nova-server-setup.sh index 48562615..6fd354f0 100755 --- a/contrail_provisioning/openstack/scripts/nova-server-setup.sh +++ b/contrail_provisioning/openstack/scripts/nova-server-setup.sh @@ -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