Skip to content

Commit

Permalink
Storage provision fix
Browse files Browse the repository at this point in the history
Closes-Bug: #1533915
Closed-Bug: #1533998
Issue when provisioning storage+compute nodes, nova/cinder services
are not configured properly.
Fixed issue in unconfigure when removing the glace-api entry, used
the correct key.
Fixed keystone authentication setting username to cinderv2 incase of
openstack version > kilo.
Fixed issue in horizon in not displaying volumes in kilo.

Change-Id: Iec0bae8c33a3aa4b79ee84fc4d285130c6c434ce
  • Loading branch information
Jeya ganesh babu J committed Jan 15, 2016
1 parent 8e10ac9 commit 4071fb7
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions contrail_provisioning/storage/storagefs/setup.py
Expand Up @@ -938,8 +938,8 @@ def do_storage_unconfigure(self):
%(GLANCE_API_CONF, glance_store))
local('sudo openstack-config --del %s %s %s'
%(GLANCE_API_CONF, glance_store, glance_known_store))
local('sudo openstack-config --del %s %s show_image_direct_url'
%(GLANCE_API_CONF, glance_store))
local('sudo openstack-config --del %s DEFAULT show_image_direct_url'
%(GLANCE_API_CONF))
local('sudo openstack-config --del %s %s rbd_store_user'
%(GLANCE_API_CONF, glance_store))
local('sudo openstack-config --set %s DEFAULT workers 1'
Expand All @@ -960,9 +960,9 @@ def do_storage_unconfigure(self):
run('sudo openstack-config --del %s %s %s'
%(GLANCE_API_CONF, glance_store,
glance_known_store))
run('sudo openstack-config --del %s %s \
run('sudo openstack-config --del %s DEFAULT \
show_image_direct_url'
%(GLANCE_API_CONF, glance_store))
%(GLANCE_API_CONF))
run('sudo openstack-config --del %s %s \
rbd_store_user'
%(GLANCE_API_CONF, glance_store))
Expand Down Expand Up @@ -2271,6 +2271,9 @@ def do_configure_cinder(self):
true' %(CINDER_CONFIG_FILE))
run('sudo openstack-config --set %s DEFAULT auth_strategy \
keystone' %(CINDER_CONFIG_FILE))
run('sudo openstack-config --set %s keystone_authtoken \
admin_user cinderv2'
%(CINDER_CONFIG_FILE))
if self._args.cinder_vip != 'none':
run('sudo openstack-config --set %s keystone_authtoken \
auth_uri http://%s:5000/v2.0'
Expand All @@ -2295,6 +2298,9 @@ def do_configure_cinder(self):
true' %(CINDER_CONFIG_FILE))
local('sudo openstack-config --set %s DEFAULT auth_strategy \
keystone' %(CINDER_CONFIG_FILE))
local('sudo openstack-config --set %s keystone_authtoken \
admin_user cinderv2'
%(CINDER_CONFIG_FILE))
if self._args.cinder_vip != 'none':
local('sudo openstack-config --set %s keystone_authtoken \
auth_uri http://%s:5000/v2.0'
Expand Down Expand Up @@ -3237,6 +3243,34 @@ def do_keystone_config(self):
self._args.openstack_ip, self._args.openstack_ip,
self._args.openstack_ip), shell='/bin/bash')

v1_config = local('source /etc/contrail/openstackrc && \
keystone service-list | grep -w volume | wc -l',
capture=True, shell='/bin/bash')
if v1_config == '0':
local('source /etc/contrail/openstackrc && \
keystone service-create --type volume --name cinder \
--description volume', shell='/bin/bash')
v1_service = local('source /etc/contrail/openstackrc && \
keystone service-list | grep -w volume | awk \'{print $2}\'',
capture=True, shell='/bin/bash')
if self._args.cinder_vip != 'none':
local('source /etc/contrail/openstackrc && \
keystone endpoint-create --service-id %s \
--publicurl http://%s:8776/v1/%%\(tenant_id\)s \
--internalurl http://%s:8776/v1/%%\(tenant_id\)s \
--adminurl http://%s:8776/v1/%%\(tenant_id\)s \
--region RegionOne' %(v1_service,
self._args.cinder_vip, self._args.cinder_vip,
self._args.cinder_vip), shell='/bin/bash')
else:
local('source /etc/contrail/openstackrc && \
keystone endpoint-create --service-id %s \
--publicurl http://%s:8776/v1/%%\(tenant_id\)s \
--internalurl http://%s:8776/v1/%%\(tenant_id\)s \
--adminurl http://%s:8776/v1/%%\(tenant_id\)s \
--region RegionOne' %(v1_service,
self._args.openstack_ip, self._args.openstack_ip,
self._args.openstack_ip), shell='/bin/bash')
#end do_keystone_config()

def find_cinder_version(self):
Expand Down Expand Up @@ -3273,9 +3307,10 @@ def do_storage_setup(self):
# Check keystone configuration
self.do_keystone_config()

# Find Storage only nodes
self.find_storage_only_nodes()

if configure_with_ceph:
# Find Storage only nodes
self.find_storage_only_nodes()

# Create the required ceph monitors
self.do_monitor_create()
Expand Down

0 comments on commit 4071fb7

Please sign in to comment.