Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrail_setup_utils/cinder-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ cat > $CONF_DIR/openstackrc <<EOF
export OS_USERNAME=admin
export OS_PASSWORD=$ADMIN_TOKEN
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://$CONTROLLER:5000/v2.0/
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0/
export OS_NO_CACHE=1
EOF

Expand Down
29 changes: 8 additions & 21 deletions contrail_setup_utils/compute-live-migration-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,13 @@ openstack-config --set /etc/nova/nova.conf DEFAULT live_migration VIR_MIGRATE_UN
openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0
cat /etc/libvirt/libvirtd.conf | sed s/"#listen_tls = 0"/"listen_tls = 0"/ | sed s/"#listen_tcp = 1"/"listen_tcp = 1"/ | sed s/"#auth_tcp = \"sasl\""/"auth_tcp = \"none\""/ > /tmp/libvirtd.conf
cp -f /tmp/libvirtd.conf /etc/libvirt/libvirtd.conf
if [ -f /etc/sysconfig/libvirtd ]
then
cat /etc/sysconfig/libvirtd | sed s/"#LIBVIRTD_ARGS=\"--listen\""/"LIBVIRTD_ARGS=\"--listen\""/ > /tmp/libvirtd
cp -f /tmp/libvirtd /etc/sysconfig/libvirtd
cat /etc/sysconfig/libvirtd | sed s/"#LIBVIRTD_ARGS=\"--listen\""/"LIBVIRTD_ARGS=\"--listen\""/ > /tmp/libvirtd
cp -f /tmp/libvirtd /etc/sysconfig/libvirtd

for svc in openstack-nova-compute; do
service $svc restart
done
for svc in openstack-nova-compute; do
service $svc restart
done

for svc in libvirtd; do
service $svc restart
done
fi
if [ -f /etc/default/libvirt-bin ]
then
cat /etc/default/libvirt-bin | sed s/"-d"/"-d -l"/ > /tmp/libvirt-bin
cp -f /tmp/libvirt-bin /etc/default/libvirt-bin
if [ -f /etc/init.d/nova-compute ]
then
service nova-compute restart
fi
service libvirt-bin restart
fi
for svc in libvirtd; do
service $svc restart
done
27 changes: 8 additions & 19 deletions contrail_setup_utils/compute-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,13 @@
if [ -f /etc/redhat-release ]; then
is_redhat=1
is_ubuntu=0
nova_compute_ver=`rpm -q --qf "%{VERSION}\n" openstack-nova-compute`
if [ "$nova_compute_ver" == "2013.1" ]; then
OS_NET=quantum
TENANT_NAME=quantum_admin_tenant_name
ADMIN_USER=quantum_admin_username
ADMIN_PASSWD=quantum_admin_password
ADMIN_AUTH_URL=quantum_admin_auth_url
OS_URL=quantum_url
OS_URL_TIMEOUT=quantum_url_timeout
else
OS_NET=neutron
TENANT_NAME=neutron_admin_tenant_name
ADMIN_USER=neutron_admin_username
ADMIN_PASSWD=neutron_admin_password
ADMIN_AUTH_URL=neutron_admin_auth_url
OS_URL=neutron_url
OS_URL_TIMEOUT=neutron_url_timeout
fi
OS_NET=quantum
TENANT_NAME=quantum_admin_tenant_name
ADMIN_USER=quantum_admin_username
ADMIN_PASSWD=quantum_admin_password
ADMIN_AUTH_URL=quantum_admin_auth_url
OS_URL=quantum_url
OS_URL_TIMEOUT=quantum_url_timeout
fi

if [ -f /etc/lsb-release ]; then
Expand Down Expand Up @@ -62,7 +51,7 @@ if [ $CONTROLLER != $COMPUTE ] ; then
openstack-config --set /etc/nova/nova.conf DEFAULT $OS_URL http://$QUANTUM:9696/
openstack-config --set /etc/nova/nova.conf DEFAULT $OS_URL_TIMEOUT 300
if [ $is_ubuntu -eq 1 ] ; then
openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.${OS_NET}v2.api.API
openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
fi
openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova
Expand Down
6 changes: 1 addition & 5 deletions contrail_setup_utils/glance-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ cat > $CONF_DIR/openstackrc <<EOF
export OS_USERNAME=admin
export OS_PASSWORD=$ADMIN_TOKEN
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://$CONTROLLER:5000/v2.0/
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0/
export OS_NO_CACHE=1
EOF

Expand All @@ -94,10 +94,6 @@ done
export ADMIN_TOKEN
export SERVICE_TOKEN

for cfg in api; do
openstack-config --set /etc/glance/glance-$cfg.conf DEFAULT notifier_strategy noop
done

for cfg in api registry; do
openstack-config --set /etc/glance/glance-$cfg.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/glance/glance-$cfg.conf keystone_authtoken admin_user glance
Expand Down
36 changes: 4 additions & 32 deletions contrail_setup_utils/keystone-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ service $keystone_svc restart
chkconfig $keystone_svc on

if [ ! -d /etc/keystone/ssl ]; then
keystone-manage pki_setup --keystone-user keystone --keystone-group keystone
keystone-manage pki_setup
chown -R keystone.keystone /etc/keystone/ssl
fi

# Set up a keystonerc file with admin password
export SERVICE_ENDPOINT=${SERVICE_ENDPOINT:-http://$CONTROLLER:${CONFIG_ADMIN_PORT:-35357}/v2.0}
export SERVICE_ENDPOINT=${SERVICE_ENDPOINT:-http://127.0.0.1:${CONFIG_ADMIN_PORT:-35357}/v2.0}

cat > $CONF_DIR/openstackrc <<EOF
export OS_USERNAME=admin
export OS_PASSWORD=$ADMIN_PASSWORD
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://$CONTROLLER:5000/v2.0/
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0/
export OS_NO_CACHE=1
EOF

Expand Down Expand Up @@ -121,45 +121,17 @@ for svc in keystone; do
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken admin_user $svc
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken admin_password $SERVICE_PASSWORD
openstack-config --set /etc/$svc/$svc.conf DEFAULT log_file /var/log/keystone/keystone.log
openstack-config --set /etc/$svc/$svc.conf sql connection mysql://keystone:keystone@127.0.0.1/keystone
openstack-config --set /etc/$svc/$svc.conf sql connection mysql://keystone:keystone@localhost/keystone
openstack-config --set /etc/$svc/$svc.conf catalog template_file /etc/keystone/default_catalog.templates
openstack-config --set /etc/$svc/$svc.conf catalog driver keystone.catalog.backends.sql.Catalog
openstack-config --set /etc/$svc/$svc.conf identity driver keystone.identity.backends.sql.Identity
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.backends.memcache.Token
openstack-config --set /etc/$svc/$svc.conf ec2 driver keystone.contrib.ec2.backends.sql.Ec2
openstack-config --set /etc/$svc/$svc.conf DEFAULT onready keystone.common.systemd
openstack-config --set /etc/$svc/$svc.conf memcache servers 127.0.0.1:11211
done

keystone-manage db_sync

# Increase memcached 'item_size_max' to 2MB, default is 1MB
# Work around for bug https://bugs.launchpad.net/keystone/+bug/1242620
item_size_max="2m"
if [ $is_ubuntu -eq 1 ] ; then
memcache_conf='/etc/memcached.conf'
opts=$(grep "\-I " ${memcache_conf})
if [ $? -ne 0 ]; then
echo "-I ${item_size_max}" >> ${memcache_conf}
fi
elif [ $is_redhat -eq 1 ]; then
memcache_conf='/etc/sysconfig/memcached'
opts=$(grep OPTIONS ${memcache_conf} | grep -Po '".*?"')
if [ $? -ne 0 ]; then
#Write option to memcached config file
echo "OPTIONS=\"-I ${item_size_max}\"" >> ${memcache_conf}
else
#strip the leading and trailing qoutes
opts=$(echo "$opts" | sed -e 's/^"//' -e 's/"$//')
grep OPTIONS ${memcache_conf} | grep -Po '".*?"' | grep "\-I"
if [ $? -ne 0 ]; then
#concatenate with the existing options.
opts="$opts -I ${item_size_max}"
sed -i "s/OPTIONS.*/OPTIONS=\"${opts}\"/g" ${memcache_conf}
fi
fi
fi

# Create link /usr/bin/nodejs to /usr/bin/node
if [ ! -f /usr/bin/nodejs ]; then
ln -s /usr/bin/node /usr/bin/nodejs
Expand Down
34 changes: 10 additions & 24 deletions contrail_setup_utils/nova-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,14 @@ if [ -f /etc/redhat-release ]; then
web_svc=httpd
mysql_svc=mysqld
nova_pfx=openstack-nova
nova_api_ver=`rpm -q --qf "%{VERSION}\n" openstack-nova-api`
echo $nova_api_ver
if [ "$nova_api_ver" == "2013.1" ]; then
OS_NET=quantum
TENANT_NAME=quantum_admin_tenant_name
ADMIN_USER=quantum_admin_username
ADMIN_PASSWD=quantum_admin_password
ADMIN_AUTH_URL=quantum_admin_auth_url
OS_URL=quantum_url
OS_URL_TIMEOUT=quantum_url_timeout
META_DATA_PROXY=service_quantum_metadata_proxy
else
OS_NET=neutron
TENANT_NAME=neutron_admin_tenant_name
ADMIN_USER=neutron_admin_username
ADMIN_PASSWD=neutron_admin_password
ADMIN_AUTH_URL=neutron_admin_auth_url
OS_URL=neutron_url
OS_URL_TIMEOUT=neutron_url_timeout
META_DATA_PROXY=service_neutron_metadata_proxy
fi
OS_NET=quantum
TENANT_NAME=quantum_admin_tenant_name
ADMIN_USER=quantum_admin_username
ADMIN_PASSWD=quantum_admin_password
ADMIN_AUTH_URL=quantum_admin_auth_url
OS_URL=quantum_url
OS_URL_TIMEOUT=quantum_url_timeout
META_DATA_PROXY=service_quantum_metadata_proxy
fi

if [ -f /etc/lsb-release ]; then
Expand Down Expand Up @@ -125,12 +112,12 @@ cat > $CONF_DIR/openstackrc <<EOF
export OS_USERNAME=admin
export OS_PASSWORD=$ADMIN_TOKEN
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://$CONTROLLER:5000/v2.0/
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0/
export OS_NO_CACHE=1
EOF

# must set SQL connection before running nova-manage
openstack-config --set /etc/nova/nova.conf DEFAULT sql_connection mysql://nova:nova@127.0.0.1/nova
openstack-config --set /etc/nova/nova.conf DEFAULT sql_connection mysql://nova:nova@localhost/nova

for APP in nova; do
openstack-db -y --init --service $APP --rootpw "$MYSQL_TOKEN"
Expand All @@ -150,7 +137,6 @@ done
openstack-config --set /etc/nova/nova.conf DEFAULT $TENANT_NAME service
openstack-config --set /etc/nova/nova.conf DEFAULT $ADMIN_USER $OS_NET
openstack-config --set /etc/nova/nova.conf DEFAULT $ADMIN_PASSWD $SERVICE_TOKEN
openstack-config --set /etc/nova/nova.conf DEFAULT $ADMIN_AUTH_URL http://$CONTROLLER:35357/v2.0/
openstack-config --set /etc/nova/nova.conf DEFAULT $OS_URL http://$QUANTUM:9696/
openstack-config --set /etc/nova/nova.conf DEFAULT $OS_URL_TIMEOUT 300
openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api $OS_NET
Expand Down
3 changes: 0 additions & 3 deletions contrail_setup_utils/quantum-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,12 @@ fi

for svc in $net_svc_name; do
openstack-config --set /etc/$svc/$svc.conf DEFAULT bind_port $QUANTUM_PORT
openstack-config --set /etc/$svc/$svc.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken admin_user $svc
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken admin_password $SERVICE_TOKEN
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken auth_host $CONTROLLER
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken admin_token $SERVICE_TOKEN
done

openstack-config --set /etc/$net_svc_name/$net_svc_name.conf quotas quota_driver neutron.quota.ConfDriver
openstack-config --set /etc/$net_svc_name/$net_svc_name.conf QUOTAS quota_network -1
openstack-config --set /etc/$net_svc_name/$net_svc_name.conf QUOTAS quota_subnet -1
openstack-config --set /etc/$net_svc_name/$net_svc_name.conf QUOTAS quota_port -1
Expand Down
15 changes: 3 additions & 12 deletions contrail_setup_utils/setup-quantum-in-keystone.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def __init__(self, args_str = None):
self._args_user = self._args.user
self._args_passwd = self._args.password
self._args_svc_passwd = self._args.svc_password
self._args_region_name = self._args.region_name
self._args_tenant_id = self._args.tenant
self._args_quant_ip = self._args.quant_server_ip
self._args_root_password = self._args.root_password
Expand All @@ -57,14 +56,8 @@ def __init__(self, args_str = None):
self._quant_admin_name = "admin"

try:
if self._args_svc_passwd:
self.kshandle = client.Client(token=self._args_svc_passwd,
endpoint=self._auth_url)
else:
self.kshandle = client.Client(username=self._args_user,
password=self._args_passwd,
tenant_name=self._args_tenant_id,
auth_url=self._auth_url)
self.kshandle = client.Client(username=self._args_user, password=self._args_passwd,
tenant_name=self._args_tenant_id, auth_url=self._auth_url)
except Exception as e:
print e
raise e
Expand Down Expand Up @@ -94,7 +87,6 @@ def _parse_quant_args(self, args_str):
'password': 'contrail123',
'svc_password': 'contrail123',
'root_password': 'c0ntrail123',
'region_name': 'RegionOne',
}

if args.conf_file:
Expand Down Expand Up @@ -123,7 +115,6 @@ def _parse_quant_args(self, args_str):
parser.add_argument("--password", help = "Password to access keystone server")
parser.add_argument("--svc_password", help = "Quantum service password on keystone server")
parser.add_argument("--root_password", help = "Root password for keystone server")
parser.add_argument("--region_name", help = "Region Name for quantum endpoint")

self._args = parser.parse_args(remaining_argv)

Expand Down Expand Up @@ -256,7 +247,7 @@ def quant_set_endpoints(self):

# service endpoint does not exist, create one
try:
self.kshandle.endpoints.create(region=self._args.region_name,
self.kshandle.endpoints.create(region="RegionOne",
service_id=self.quant_svc_id,
publicurl=self._args_quant_url,
adminurl=self._args_quant_url,
Expand Down
Loading