Use DevStack process functions

This allows us to run a sheep process under screen.

Change-Id: I020005671d28373c9a70291376d0637e4495493d
This commit is contained in:
MORITA Kazutaka 2015-02-13 00:58:39 +09:00
parent ae63085841
commit fe3e19e17f
2 changed files with 7 additions and 9 deletions

View File

@ -46,8 +46,7 @@ function check_os_support_sheepdog {
# stop_sheepdog() - Stop running processes (non-screen)
function stop_sheepdog {
sudo pkill -f sheep
sleep 3
stop_process sheepdog
if egrep -q ${SHEEPDOG_DATA_DIR} /proc/mounts; then
sudo umount ${SHEEPDOG_DATA_DIR}
@ -69,6 +68,7 @@ function cleanup_sheepdog {
function configure_sheepdog {
# create a backing file disk
create_disk ${SHEEPDOG_DISK_IMAGE} ${SHEEPDOG_DATA_DIR} ${SHEEPDOG_LOOPBACK_DISK_SIZE}
sudo chown -R ${STACK_USER}: ${SHEEPDOG_DATA_DIR}
}
# install_sheepdog() - Collect source and prepare
@ -84,15 +84,10 @@ function install_sheepdog {
# start_sheepdog() - Start running processes, including screen
function start_sheepdog {
# clean up from previous (possibly aborted) runs
# make sure to kill all sheepdog processes first
sudo pkill -f sheep || true
run_process sheepdog "sheep -f -o -l 7 -c local ${SHEEPDOG_DATA_DIR}"
sleep 3
sudo sheep -l 7 -c local ${SHEEPDOG_DATA_DIR}
sleep 3
sudo dog cluster format -c 1
dog cluster format -c 1
}
# configure_cinder_backend_sheepdog - Configure Cinder for Sheepdog backends

View File

@ -1,5 +1,8 @@
# Devstack settings
# we have to add sheepdog to enabled services for run_process to work
enable_service sheepdog
# enable sheepdog cinder backend
CINDER_ENABLED_BACKENDS=sheepdog:sheepdog
TEMPEST_STORAGE_PROTOCOL=sheepdog