diff --git a/fabfile/tasks/storage/provision.py b/fabfile/tasks/storage/provision.py index f4d4cb3bd..0dc020bdf 100644 --- a/fabfile/tasks/storage/provision.py +++ b/fabfile/tasks/storage/provision.py @@ -170,10 +170,11 @@ def create_storage_setup_cmd(mode): # storage-replica-size - Replica size for Ceph storage # openstack-ip - IP address of the first openstack node # orig-hostnames - Original hostnames + # service-dbpass - DB password for cinder(and all service) db user # WARNING: If anything is added in the arguments, make sure it # doesn't break add_storage_node task. - cmd = "PASSWORD=%s setup-vnc-storage --storage-setup-mode %s --storage-master %s --storage-hostnames %s --storage-hosts %s --storage-host-tokens %s --storage-disk-config %s --storage-ssd-disk-config %s --storage-journal-config %s --storage-local-disk-config %s --storage-local-ssd-disk-config %s --storage-nfs-disk-config %s --storage-directory-config %s --storage-chassis-config %s --live-migration %s --collector-hosts %s --collector-host-tokens %s --cfg-host %s --cinder-vip %s --config-hosts %s --storage-os-hosts %s --storage-os-host-tokens %s --storage-mon-hosts %s --cfg-vip %s --storage-compute-hostnames %s --storage-replica-size %s --openstack-ip %s --orig-hostnames %s" \ - %(storage_master_password, mode, storage_master_ip, ' '.join(storage_hostnames), ' '.join(storage_host_list), ' '.join(storage_pass_list), ' '.join(get_storage_disk_config()), ' '.join(get_storage_ssd_disk_config()), ' '.join(get_storage_journal_config()), ' '.join(get_storage_local_disk_config()), ' '.join(get_storage_local_ssd_disk_config()), ' '.join(get_storage_nfs_disk_config()), ' '.join(get_storage_directory_config()), ' '.join(get_storage_chassis_config()), get_live_migration_opts(), ' '.join(collector_host_list), ' '.join(collector_pass_list), cfm_ip, get_cinder_ha_vip(), ' '.join(cfg_host_list), ' '.join(storage_os_host_list), ' '.join(storage_os_pass_list), ' '.join(get_storage_mon_hosts()), get_cfg_ha_vip(), ' '.join(storage_compute_hostnames), get_storage_replica_size(), openstack_ip, ' '.join(orig_hostnames)) + cmd = "PASSWORD=%s setup-vnc-storage --storage-setup-mode %s --storage-master %s --storage-hostnames %s --storage-hosts %s --storage-host-tokens %s --storage-disk-config %s --storage-ssd-disk-config %s --storage-journal-config %s --storage-local-disk-config %s --storage-local-ssd-disk-config %s --storage-nfs-disk-config %s --storage-directory-config %s --storage-chassis-config %s --live-migration %s --collector-hosts %s --collector-host-tokens %s --cfg-host %s --cinder-vip %s --config-hosts %s --storage-os-hosts %s --storage-os-host-tokens %s --storage-mon-hosts %s --cfg-vip %s --storage-compute-hostnames %s --storage-replica-size %s --openstack-ip %s --orig-hostnames %s --service-dbpass %s" \ + %(storage_master_password, mode, storage_master_ip, ' '.join(storage_hostnames), ' '.join(storage_host_list), ' '.join(storage_pass_list), ' '.join(get_storage_disk_config()), ' '.join(get_storage_ssd_disk_config()), ' '.join(get_storage_journal_config()), ' '.join(get_storage_local_disk_config()), ' '.join(get_storage_local_ssd_disk_config()), ' '.join(get_storage_nfs_disk_config()), ' '.join(get_storage_directory_config()), ' '.join(get_storage_chassis_config()), get_live_migration_opts(), ' '.join(collector_host_list), ' '.join(collector_pass_list), cfm_ip, get_cinder_ha_vip(), ' '.join(cfg_host_list), ' '.join(storage_os_host_list), ' '.join(storage_os_pass_list), ' '.join(get_storage_mon_hosts()), get_cfg_ha_vip(), ' '.join(storage_compute_hostnames), get_storage_replica_size(), openstack_ip, ' '.join(orig_hostnames), get_service_dbpass()) return cmd diff --git a/fabfile/testbeds/testbed_multibox_example.py b/fabfile/testbeds/testbed_multibox_example.py index 4d72d78f4..de1c62f25 100644 --- a/fabfile/testbeds/testbed_multibox_example.py +++ b/fabfile/testbeds/testbed_multibox_example.py @@ -324,6 +324,7 @@ # manage_amqp : Default = 'no', if set to 'yes' provision's amqp in openstack nodes and # openstack services uses the amqp in openstack nodes instead of config nodes. # amqp_host is neglected if manage_amqp is set +# service_dbpass: Default = 'c0ntrail123'; DB password of all openstack service users # #env.openstack = { # 'service_token' : '33c57636fbc2c5552fd2', #Common service token for for all openstack services @@ -331,6 +332,7 @@ # 'manage_amqp' : 'yes', #Default no, Manage seperate AMQP for openstack services in openstack nodes. # 'osapi_compute_workers' : 40, #Default 40, For low memory system reduce the osapi compute workers thread. # 'conductor_workers' : 40, #Default 40, For low memory system reduce the conductor workers thread. +# 'service_dbpass' : 'c0ntrail123', #DB password of all openstack service users #} #Config node related config knobs diff --git a/fabfile/testbeds/testbed_singlebox_example.py b/fabfile/testbeds/testbed_singlebox_example.py index 594558c57..ea9664bd2 100644 --- a/fabfile/testbeds/testbed_singlebox_example.py +++ b/fabfile/testbeds/testbed_singlebox_example.py @@ -219,6 +219,7 @@ # manage_amqp : Default = 'no', if set to 'yes' provision's amqp in openstack nodes and # openstack services uses the amqp in openstack nodes instead of config nodes. # amqp_host is neglected if manage_amqp is set +# service_dbpass: Default = 'c0ntrail123'; DB password of all openstack service users # #env.openstack = { # 'service_token' : '33c57636fbc2c5552fd2', #Common service token for for all openstack services @@ -226,6 +227,7 @@ # 'manage_amqp' : 'yes', #Default no, Manage seperate AMQP for openstack services in openstack nodes. # 'osapi_compute_workers' : 40, #Default 40, For low memory system reduce the osapi compute workers thread. # 'conductor_workers' : 40, #Default 40, For low memory system reduce the conductor workers thread. +# 'service_dbpass' : 'c0ntrail123', #DB password of all openstack service users #} #Config node related config knobs diff --git a/fabfile/utils/commandline.py b/fabfile/utils/commandline.py index e67281b8b..d77a6d795 100644 --- a/fabfile/utils/commandline.py +++ b/fabfile/utils/commandline.py @@ -71,6 +71,7 @@ def frame_vnc_openstack_cmd(host_string, cmd="setup-vnc-openstack"): cmd += " --amqp_server_ip %s" % amqp_server_ip cmd += " --quantum_service_protocol %s" % get_quantum_service_protocol() cmd += " --service_token %s" % get_service_token() + cmd += " --service-dbpass %s" % get_service_dbpass() cmd += " --keystone_service_tenant_name %s" % get_keystone_service_tenant_name() cmd += " --neutron_password %s" % get_neutron_password() cmd += " --nova_password %s" % get_nova_password() diff --git a/fabfile/utils/host.py b/fabfile/utils/host.py index 9e188e23f..795d3d5a3 100644 --- a/fabfile/utils/host.py +++ b/fabfile/utils/host.py @@ -51,6 +51,11 @@ def get_service_token(): service_token = sudo("sudo cat /etc/contrail/service.token") return service_token + +def get_service_dbpass(): + return get_from_testbed_dict('openstack','service_dbpass', 'c0ntrail123') + + def copy_openstackrc(role='compute'): openstackrc = "/etc/contrail/openstackrc" temprc = "/tmp/openstackrc"