Skip to content

Commit

Permalink
Closes-Bug: #1377511
Browse files Browse the repository at this point in the history
Issue: rabbit_host in cinder is configured to use storage-master
       instead of config node
Fixed by configured rabbit_host to config node

Change-Id: I5227dfcc75ea01c25cbf5fc3d37003033c53f7e4
  • Loading branch information
spuru committed Oct 18, 2014
1 parent ba83a95 commit dbe0418
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions contrail_provisioning/storage/setup.py
Expand Up @@ -38,6 +38,7 @@ def parse_args(self, args_str):
--live-migration enabled
--collector-hosts 10.157.43.171 10.157.42.166
--collector-host-tokens n1keenA n1keenA
--cfg-host 10.157.43.171
'''

parser = self._parse_args(args_str)
Expand All @@ -56,6 +57,7 @@ def parse_args(self, args_str):
parser.add_argument("--live-migration", help = "Live migration enabled")
parser.add_argument("--collector-hosts", help = "IP Addresses of collector nodes", nargs='+', type=str)
parser.add_argument("--collector-host-tokens", help = "Passwords of collector nodes", nargs='+', type=str)
parser.add_argument("--cfg-host", help = "IP Address of config node")
parser.add_argument("--add-storage-node", help = "Add a new storage node to the existing cluster")
parser.add_argument("--storage-setup-mode", help = "Configuration mode")

Expand Down Expand Up @@ -90,6 +92,8 @@ def enable_storage(self):
storage_setup_args = storage_setup_args + " --storage-directory-config %s" %(' '.join(self._args.storage_directory_config))
storage_setup_args = storage_setup_args + " --collector-hosts %s" %(' '.join(self._args.collector_hosts))
storage_setup_args = storage_setup_args + " --collector-host-tokens %s" %(' '.join(self._args.collector_host_tokens))
if self._args.cfg_host:
storage_setup_args = storage_setup_args + " --cfg-host %s" % (self._args.cfg_host)
for storage_host, storage_host_token in zip(self._args.storage_hosts, self._args.storage_host_tokens):
if storage_host == self._args.storage_master:
storage_master_passwd = storage_host_token
Expand Down
13 changes: 7 additions & 6 deletions contrail_provisioning/storage/storagefs/setup.py
Expand Up @@ -886,7 +886,7 @@ def __init__(self, args_str = None):
if disksplit[0] == hostname:
if disksplit[0] == add_storage_node:
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection mysql://cinder:cinder@%s/cinder' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.cfg_host))
run('sudo cinder-manage db sync')
existing_backends=run('sudo cat /etc/cinder/cinder.conf |grep enabled_backends |awk \'{print $3}\'', shell='/bin/bash')
if existing_backends != '':
Expand Down Expand Up @@ -917,7 +917,7 @@ def __init__(self, args_str = None):
if disksplit[0] == hostname:
if disksplit[0] == add_storage_node:
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection mysql://cinder:cinder@%s/cinder' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.cfg_host))
run('sudo cinder-manage db sync')
existing_backends=run('sudo cat /etc/cinder/cinder.conf |grep enabled_backends |awk \'{print $3}\'', shell='/bin/bash')
if existing_backends != '':
Expand Down Expand Up @@ -1509,7 +1509,7 @@ def __init__(self, args_str = None):

local('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection mysql://cinder:cinder@127.0.0.1/cinder')
#recently contrail changed listen address from 0.0.0.0 to mgmt address so adding mgmt network to rabbit host
local('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.storage_master))
local('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.cfg_host))

if configure_with_ceph == 1:
# Cinder Configuration
Expand Down Expand Up @@ -1558,7 +1558,7 @@ def __init__(self, args_str = None):
if local_disk_list != '':
if entries != self._args.storage_master:
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection mysql://cinder:cinder@%s/cinder' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.cfg_host))
run('sudo cinder-manage db sync')
existing_backends=run('sudo cat /etc/cinder/cinder.conf |grep enabled_backends |awk \'{print $3}\'', shell='/bin/bash')
if existing_backends != '':
Expand Down Expand Up @@ -1587,7 +1587,7 @@ def __init__(self, args_str = None):
if local_ssd_disk_list != '':
if entries != self._args.storage_master:
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection mysql://cinder:cinder@%s/cinder' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.storage_master))
run('sudo openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host %s' %(self._args.cfg_host))
run('sudo cinder-manage db sync')
existing_backends=run('sudo cat /etc/cinder/cinder.conf |grep enabled_backends |awk \'{print $3}\'', shell='/bin/bash')
if existing_backends != '':
Expand Down Expand Up @@ -1787,6 +1787,7 @@ def _parse_args(self, args_str):
parser.add_argument("--storage-directory-config", help = "Directories to be sued for distributed storage", nargs="+", type=str)
parser.add_argument("--collector-hosts", help = "IP Addresses of collector nodes", nargs='+', type=str)
parser.add_argument("--collector-host-tokens", help = "Passwords of collector nodes", nargs='+', type=str)
parser.add_argument("--cfg-host", help = "IP Address of config node")
parser.add_argument("--add-storage-node", help = "Add a new storage node")
parser.add_argument("--storage-setup-mode", help = "Storage configuration mode")

Expand All @@ -1801,4 +1802,4 @@ def main(args_str = None):
#end main

if __name__ == "__main__":
main()
main()

0 comments on commit dbe0418

Please sign in to comment.