diff --git a/contrail/environment/modules/contrail/files/config-storage-live-migration.sh b/contrail/environment/modules/contrail/files/config-storage-live-migration.sh index 84a079e6..e6e0f360 100644 --- a/contrail/environment/modules/contrail/files/config-storage-live-migration.sh +++ b/contrail/environment/modules/contrail/files/config-storage-live-migration.sh @@ -2,9 +2,37 @@ set -x RETVAL=0 + ## TODO: change arguments from positional to options ## server-ip is required to download live-migration QCOW2 image. +FILE_NAME=/etc/apparmor.d/usr.lib.libvirt.virt-aa-helper +TEMP_FILE_NAME=/tmp/usr.lib.libvirt.virt-aa-helper + +## NOTE: ANY CHANGES FOR FOLLOWING CODE SHOULD BE DONE IN +## NOTE: config-storage-lm-compute.sh AS WELL. +## NOTE: THIS IS TEMP FIX, AS FILE NEEDS TO BE RE-WRITTEN +if [ -f ${FILE_NAME} ] +then + grep -n "instances/global" ${FILE_NAME} + RETVAL=$? + if [ ${RETVAL} -eq 0 ] + then + echo "instance/global entry is there" + else + ##copy lines after instances/snapshots + echo "instances/global is not there" + snap_lineno=`grep -n "instances/snapshots" ${FILE_NAME} | cut -d ':' -f 1` + tail_lineno=`expr ${snap_lineno} + 1` + echo "instances/snapshots is at ${snap_lineno}" + head -n ${snap_lineno} ${FILE_NAME} > ${TEMP_FILE_NAME} + echo " /var/lib/nova/instances/global/_base/** r," >> ${TEMP_FILE_NAME} + echo " /var/lib/nova/instances/global/snapshots/** r," >> ${TEMP_FILE_NAME} + tail -n ${tail_lineno} ${FILE_NAME} >> ${TEMP_FILE_NAME} + \mv -f ${TEMP_FILE_NAME} ${FILE_NAME} + apparmor_parser -r ${FILE_NAME} + fi +fi exit 0 ADMIN_TENANT_ID=`keystone tenant-list |grep " admin" | awk '{print $2}'` diff --git a/contrail/environment/modules/contrail/files/config-storage-lm-compute.sh b/contrail/environment/modules/contrail/files/config-storage-lm-compute.sh index 6029d5e6..2dafac15 100644 --- a/contrail/environment/modules/contrail/files/config-storage-lm-compute.sh +++ b/contrail/environment/modules/contrail/files/config-storage-lm-compute.sh @@ -2,6 +2,34 @@ set -x RESTART_SERVICES=0 +FILE_NAME=/etc/apparmor.d/usr.lib.libvirt.virt-aa-helper +TEMP_FILE_NAME=/tmp/usr.lib.libvirt.virt-aa-helper + +## NOTE: ANY CHANGES FOR FOLLOWING CODE SHOULD BE DONE IN +## NOTE: config-storage-lm-compute.sh AS WELL. +## NOTE: THIS IS TEMP FIX, AS FILE NEEDS TO BE RE-WRITTEN + +if [ -f ${FILE_NAME} ] +then + grep -n "instances/global" ${FILE_NAME} + RETVAL=$? + if [ ${RETVAL} -eq 0 ] + then + echo "instance/global entry is there" + else + ##copy lines after instances/snapshots + echo "instances/global is not there" + snap_lineno=`grep -n "instances/snapshots" ${FILE_NAME} | cut -d ':' -f 1` + tail_lineno=`expr ${snap_lineno} + 1` + echo "instances/snapshots is at ${snap_lineno}" + head -n ${snap_lineno} ${FILE_NAME} > ${TEMP_FILE_NAME} + echo " /var/lib/nova/instances/global/_base/** r," >> ${TEMP_FILE_NAME} + echo " /var/lib/nova/instances/global/snapshots/** r," >> ${TEMP_FILE_NAME} + tail -n ${tail_lineno} ${FILE_NAME} >> ${TEMP_FILE_NAME} + \mv -f ${TEMP_FILE_NAME} ${FILE_NAME} + apparmor_parser -r ${FILE_NAME} + fi +fi ## Get the ip address of nova-host. ## NOTE: we already checked about the ip resolution. so awk must ## NOTE: give correct results diff --git a/contrail/environment/modules/contrail/files/config-storage-openstack.sh b/contrail/environment/modules/contrail/files/config-storage-openstack.sh index ca369edc..1194ae10 100644 --- a/contrail/environment/modules/contrail/files/config-storage-openstack.sh +++ b/contrail/environment/modules/contrail/files/config-storage-openstack.sh @@ -48,11 +48,15 @@ openstack-config --set /etc/glance/glance-api.conf glance_store rbd_store_pool i openstack-config --set /etc/glance/glance-api.conf glance_store rbd_store_ceph_conf /etc/ceph/ceph.conf openstack-config --set /etc/glance/glance-api.conf glance_store stores glance.store.rbd.Store,glance.store.filesystem.Store,glance.store.http.Store ## configure ceph-rest-api +echo ${INTERNAL_VIP} + if [ ${INTERNAL_VIP} != "" ] then sed -i "s/app.run(host=app.ceph_addr, port=app.ceph_port)/app.run(host=app.ceph_addr, port=5006)/" /usr/bin/ceph-rest-api + echo "editing 5006 port" else sed -i "s/app.run(host=app.ceph_addr, port=app.ceph_port)/app.run(host=app.ceph_addr, port=5005)/" /usr/bin/ceph-rest-api + echo "editing 5005 port" fi ## Check if "ceph -s" is returing or it is waiting for other monitors to be up diff --git a/contrail/environment/modules/contrail/manifests/lib/storage_common.pp b/contrail/environment/modules/contrail/manifests/lib/storage_common.pp index 5a7be1c6..439b381d 100644 --- a/contrail/environment/modules/contrail/manifests/lib/storage_common.pp +++ b/contrail/environment/modules/contrail/manifests/lib/storage_common.pp @@ -141,24 +141,25 @@ #notify { "Pool data: ${pool_data}":;} $contrail_pool_map = join($pool_data, "', '") $host_num_disk = size($contrail_storage_osd_disks) - ceph::pool {'internal': size => 1 } - -> file { 'compute_pool_config' : - path => '/opt/contrail/bin/compute_pool_config.py', - content => template("${module_name}/compute-pool-config.erb"), - require => Package['contrail-storage'] - } - -> - exec { 'setup_compute_pool_config' : - command => 'python /opt/contrail/bin/compute_pool_config.py', - provider => shell, - logoutput => $contrail_logoutput - } - -> Contrail::Lib::Report_status['storage-compute_completed'] + ceph::pool {'internal': size => 1 } -> + file { 'compute_pool_config' : + path => '/opt/contrail/bin/compute_pool_config.py', + content => template("${module_name}/compute-pool-config.erb"), + require => Package['contrail-storage'] + } + -> + exec { 'setup_compute_pool_config' : + command => 'python /opt/contrail/bin/compute_pool_config.py', + provider => shell, + logoutput => $contrail_logoutput + } + -> Contrail::Lib::Report_status['storage-compute_completed'] } } if 'openstack' in $contrail_host_roles { Ceph::Key<| title == 'client.bootstrap-osd' |> -> Exec['setup-config-storage-openstack'] + notify {"internal_vip => ${internal_vip}":;} file { 'config-storage-openstack.sh': ensure => present, path => '/etc/contrail/contrail_setup_utils/config-storage-openstack.sh', diff --git a/contrail/environment/modules/contrail/manifests/profile/openstack/cinder.pp b/contrail/environment/modules/contrail/manifests/profile/openstack/cinder.pp index 2e6bed75..32ad9ee5 100644 --- a/contrail/environment/modules/contrail/manifests/profile/openstack/cinder.pp +++ b/contrail/environment/modules/contrail/manifests/profile/openstack/cinder.pp @@ -67,14 +67,24 @@ verbose => $openstack_verbose, database_idle_timeout => '180', } - class { '::cinder::scheduler': - scheduler_driver => 'cinder.scheduler.simple.SimpleScheduler', - } + class { '::cinder::scheduler': } + } + + contrail::lib::augeas_conf_rm { "cinder_rpc_backend": + key => 'rpc_backend', + config_file => '/etc/cinder/cinder.conf', + lens_to_use => 'properties.lns', + match_value => 'cinder.openstack.common.rpc.impl_kombu', + } + + cinder_config { + 'oslo_messaging_rabbit/heartbeat_timeout_threshold' : value => '0'; } class { '::cinder::glance': glance_api_servers => [ $glance_api_server ], } + class { '::cinder::api': keystone_password => $cinder_password, auth_uri => $auth_uri,