Skip to content

Commit

Permalink
SM-Storage: Fix Liberty live-migration and mitaka provisioning
Browse files Browse the repository at this point in the history
Partial-Bug: #1609619

1. Fix ceph:ceph for /var/lib/ceph before starting service
2. Remove rpc_backend from cinder.conf
3. remove scheduler from cinder call

Change-Id: I4c94541d0bd13ac7f6a6dd80f16099911ffb42a6
  • Loading branch information
Dheeraj Gautam committed Aug 15, 2016
1 parent b5843bf commit eb433fc
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 16 deletions.
Expand Up @@ -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}'`
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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',
Expand Down
Expand Up @@ -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,
Expand Down

0 comments on commit eb433fc

Please sign in to comment.