Skip to content

Commit

Permalink
Merge "Liberty VM launch issue from horizon" into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 19, 2016
2 parents 7d8ee7f + ce7d1c8 commit 73bff77
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
11 changes: 8 additions & 3 deletions contrail_provisioning/openstack/scripts/cinder-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ if [ -f /etc/redhat-release ]; then
web_svc=httpd
mysql_svc=mysqld
os_cinder=$(rpm -q --queryformat="%{VERSION}" openstack-cinder)
is_kilo_or_above=$(python -c "from distutils.version import LooseVersion; \
print LooseVersion('$os_cinder') >= LooseVersion('2015.1.1')")
fi

if [ -f /etc/lsb-release ] && egrep -q 'DISTRIB_ID.*Ubuntu' /etc/lsb-release; then
Expand All @@ -32,6 +34,8 @@ if [ -f /etc/lsb-release ] && egrep -q 'DISTRIB_ID.*Ubuntu' /etc/lsb-release; th
web_svc=apache2
mysql_svc=mysql
os_cinder=$(dpkg-query -W -f='${Version}' cinder-api | cut -d ':' -f 2)
is_kilo_or_above=$(python -c "from distutils.version import LooseVersion; \
print LooseVersion('$os_cinder') >= LooseVersion('1:2015.1.1')")
fi
echo "$0: Openstack Cinder Version: ( $os_cinder )"

Expand Down Expand Up @@ -111,17 +115,18 @@ export SERVICE_TOKEN
for svc in cinder; do

# If cinder is Kilo based, need additional settings
is_kilo_or_above=$(python -c "from distutils.version import LooseVersion; \
print LooseVersion('$os_cinder') >= LooseVersion('2015.1.1')")
if [ "$is_kilo_or_above" == "True" ]; then
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken \
auth_uri http://${controller_ip}:5000/v2.0
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken \
identity_uri http://${controller_ip}:35357
admin_user='cinderv2'
else
admin_user='cinder'
fi

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_user $admin_user
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken admin_password $ADMIN_TOKEN
openstack-config --set /etc/$svc/$svc.conf keystone_authtoken auth_protocol $AUTH_PROTOCOL
if [ "$INTERNAL_VIP" != "none" ]; then
Expand Down
13 changes: 11 additions & 2 deletions contrail_provisioning/storage/storagefs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,10 @@ def do_update_monhost_config(self):
self._args.storage_host_tokens):
with settings(host_string = 'root@%s' %(entry),
password = entry_token):
config_avail = run('ls %s 2>/dev/null | wc -l'
%(CEPH_CONFIG_FILE))
if config_avail == '0':
local('sudo ceph-deploy config push %s' %(hostname))
run('sudo openstack-config --set %s global "mon_initial_members" "%s"'
%(CEPH_CONFIG_FILE, mon_initial_members[:-2]))
run('sudo openstack-config --set %s global "mon_host" "%s"'
Expand Down Expand Up @@ -1581,6 +1585,9 @@ def do_monitor_create(self):
# Set number of disk threads
def do_tune_ceph(self):

# Set tunables to optimal
local('ceph osd crush tunables optimal')

# rbd cache enabled
local('ceph tell osd.* injectargs -- --rbd_cache=true')
#local('ceph tell osd.* injectargs -- --rbd_cache_size=%s'
Expand Down Expand Up @@ -1695,6 +1702,8 @@ def do_tune_ceph(self):
%(CEPH_CONFIG_FILE))
run('sudo openstack-config --set %s global \
throttler_perf_counter false' %(CEPH_CONFIG_FILE))
run('sudo openstack-config --set %s global \
rbd_default_format 2' %(CEPH_CONFIG_FILE))
run('sudo openstack-config --set %s osd \
osd_enable_op_tracker false' %(CEPH_CONFIG_FILE))
run('sudo openstack-config --set %s osd \
Expand Down Expand Up @@ -1953,7 +1962,7 @@ def do_configure_virsh_cinder_rbd(self):
%(CINDER_CONFIG_FILE))
local('sudo openstack-config --set %s rbd-disk rbd_secret_uuid %s'
%(CINDER_CONFIG_FILE, virsh_secret))
local('sudo openstack-config --set %s rbd-disk glance_api_version 2'
local('sudo openstack-config --set %s DEFAULT glance_api_version 2'
%(CINDER_CONFIG_FILE))
local('sudo openstack-config --set %s rbd-disk volume_backend_name RBD'
%(CINDER_CONFIG_FILE))
Expand All @@ -1974,7 +1983,7 @@ def do_configure_virsh_cinder_rbd(self):
run('sudo openstack-config --set %s rbd-disk \
rbd_secret_uuid %s'
%(CINDER_CONFIG_FILE, virsh_secret))
run('sudo openstack-config --set %s rbd-disk \
run('sudo openstack-config --set %s DEFAULT \
glance_api_version 2'
%(CINDER_CONFIG_FILE))
run('sudo openstack-config --set %s rbd-disk \
Expand Down

0 comments on commit 73bff77

Please sign in to comment.