Merge "Add lioadm cinder iscsi helper support"
This commit is contained in:
commit
0471e588df
@ -1,4 +1,4 @@
|
|||||||
tgt
|
tgt # NOPRIME
|
||||||
lvm2
|
lvm2
|
||||||
qemu-utils
|
qemu-utils
|
||||||
libpq-dev
|
libpq-dev
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
lvm2
|
lvm2
|
||||||
tgt
|
tgt # NOPRIME
|
||||||
qemu-tools
|
qemu-tools
|
||||||
python-devel
|
python-devel
|
||||||
postgresql-devel
|
postgresql-devel
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
lvm2
|
lvm2
|
||||||
scsi-target-utils
|
scsi-target-utils # NOPRIME
|
||||||
qemu-img
|
qemu-img
|
||||||
postgresql-devel
|
postgresql-devel
|
||||||
iscsi-initiator-utils
|
iscsi-initiator-utils
|
||||||
|
25
lib/cinder
25
lib/cinder
@ -89,6 +89,8 @@ CINDER_SECURE_DELETE=$(trueorfalse True CINDER_SECURE_DELETE)
|
|||||||
# https://bugs.launchpad.net/cinder/+bug/1180976
|
# https://bugs.launchpad.net/cinder/+bug/1180976
|
||||||
CINDER_PERIODIC_INTERVAL=${CINDER_PERIODIC_INTERVAL:-60}
|
CINDER_PERIODIC_INTERVAL=${CINDER_PERIODIC_INTERVAL:-60}
|
||||||
|
|
||||||
|
CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-tgtadm}
|
||||||
|
|
||||||
# Tell Tempest this project is present
|
# Tell Tempest this project is present
|
||||||
TEMPEST_SERVICES+=,cinder
|
TEMPEST_SERVICES+=,cinder
|
||||||
|
|
||||||
@ -126,6 +128,7 @@ function is_cinder_enabled {
|
|||||||
function cleanup_cinder {
|
function cleanup_cinder {
|
||||||
# ensure the volume group is cleared up because fails might
|
# ensure the volume group is cleared up because fails might
|
||||||
# leave dead volumes in the group
|
# leave dead volumes in the group
|
||||||
|
if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
|
||||||
local targets=$(sudo tgtadm --op show --mode target)
|
local targets=$(sudo tgtadm --op show --mode target)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
# If tgt driver isn't running this won't work obviously
|
# If tgt driver isn't running this won't work obviously
|
||||||
@ -152,6 +155,9 @@ function cleanup_cinder {
|
|||||||
else
|
else
|
||||||
stop_service tgtd
|
stop_service tgtd
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
sudo cinder-rtstool get-targets | sudo xargs -rn 1 cinder-rtstool delete
|
||||||
|
fi
|
||||||
|
|
||||||
if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
|
if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
|
||||||
local be be_name be_type
|
local be be_name be_type
|
||||||
@ -231,7 +237,7 @@ function configure_cinder {
|
|||||||
iniset $CINDER_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
iniset $CINDER_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
||||||
iniset $CINDER_CONF DEFAULT verbose True
|
iniset $CINDER_CONF DEFAULT verbose True
|
||||||
|
|
||||||
iniset $CINDER_CONF DEFAULT iscsi_helper tgtadm
|
iniset $CINDER_CONF DEFAULT iscsi_helper "$CINDER_ISCSI_HELPER"
|
||||||
iniset $CINDER_CONF database connection `database_connection_url cinder`
|
iniset $CINDER_CONF database connection `database_connection_url cinder`
|
||||||
iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
|
iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
|
||||||
iniset $CINDER_CONF DEFAULT rootwrap_config "$CINDER_CONF_DIR/rootwrap.conf"
|
iniset $CINDER_CONF DEFAULT rootwrap_config "$CINDER_CONF_DIR/rootwrap.conf"
|
||||||
@ -395,6 +401,13 @@ function init_cinder {
|
|||||||
function install_cinder {
|
function install_cinder {
|
||||||
git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH
|
git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH
|
||||||
setup_develop $CINDER_DIR
|
setup_develop $CINDER_DIR
|
||||||
|
if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
|
||||||
|
if is_fedora; then
|
||||||
|
install_package scsi-target-utils
|
||||||
|
else
|
||||||
|
install_package tgt
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# install_cinderclient() - Collect source and prepare
|
# install_cinderclient() - Collect source and prepare
|
||||||
@ -422,6 +435,7 @@ function start_cinder {
|
|||||||
service_port=$CINDER_SERVICE_PORT_INT
|
service_port=$CINDER_SERVICE_PORT_INT
|
||||||
service_protocol="http"
|
service_protocol="http"
|
||||||
fi
|
fi
|
||||||
|
if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
|
||||||
if is_service_enabled c-vol; then
|
if is_service_enabled c-vol; then
|
||||||
# Delete any old stack.conf
|
# Delete any old stack.conf
|
||||||
sudo rm -f /etc/tgt/conf.d/stack.conf
|
sudo rm -f /etc/tgt/conf.d/stack.conf
|
||||||
@ -438,6 +452,7 @@ function start_cinder {
|
|||||||
# NOTE(gfidente): ensure tgtd is running in debug mode
|
# NOTE(gfidente): ensure tgtd is running in debug mode
|
||||||
sudo tgtadm --mode system --op update --name debug --value on
|
sudo tgtadm --mode system --op update --name debug --value on
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
|
run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
|
||||||
echo "Waiting for Cinder API to start..."
|
echo "Waiting for Cinder API to start..."
|
||||||
@ -466,14 +481,6 @@ function stop_cinder {
|
|||||||
for serv in c-api c-bak c-sch c-vol; do
|
for serv in c-api c-bak c-sch c-vol; do
|
||||||
stop_process $serv
|
stop_process $serv
|
||||||
done
|
done
|
||||||
|
|
||||||
if is_service_enabled c-vol; then
|
|
||||||
if is_ubuntu; then
|
|
||||||
stop_service tgt
|
|
||||||
else
|
|
||||||
stop_service tgtd
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# create_volume_types() - Create Cinder's configured volume types
|
# create_volume_types() - Create Cinder's configured volume types
|
||||||
|
@ -49,7 +49,7 @@ function configure_cinder_backend_lvm {
|
|||||||
iniset $CINDER_CONF $be_name volume_backend_name $be_name
|
iniset $CINDER_CONF $be_name volume_backend_name $be_name
|
||||||
iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.lvm.LVMVolumeDriver"
|
iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.lvm.LVMVolumeDriver"
|
||||||
iniset $CINDER_CONF $be_name volume_group $VOLUME_GROUP_NAME-$be_name
|
iniset $CINDER_CONF $be_name volume_group $VOLUME_GROUP_NAME-$be_name
|
||||||
iniset $CINDER_CONF $be_name iscsi_helper "tgtadm"
|
iniset $CINDER_CONF $be_name iscsi_helper "$CINDER_ISCSI_HELPER"
|
||||||
|
|
||||||
if [[ "$CINDER_SECURE_DELETE" == "False" ]]; then
|
if [[ "$CINDER_SECURE_DELETE" == "False" ]]; then
|
||||||
iniset $CINDER_CONF $be_name volume_clear none
|
iniset $CINDER_CONF $be_name volume_clear none
|
||||||
|
7
lib/lvm
7
lib/lvm
@ -108,15 +108,20 @@ function init_lvm_volume_group {
|
|||||||
if is_fedora || is_suse; then
|
if is_fedora || is_suse; then
|
||||||
# services is not started by default
|
# services is not started by default
|
||||||
start_service lvm2-lvmetad
|
start_service lvm2-lvmetad
|
||||||
|
if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
|
||||||
start_service tgtd
|
start_service tgtd
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Start with a clean volume group
|
# Start with a clean volume group
|
||||||
_create_lvm_volume_group $vg $size
|
_create_lvm_volume_group $vg $size
|
||||||
|
|
||||||
# Remove iscsi targets
|
# Remove iscsi targets
|
||||||
|
if [ "$CINDER_ISCSI_HELPER" = "lioadm" ]; then
|
||||||
|
sudo cinder-rtstool get-targets | sudo xargs -rn 1 cinder-rtstool delete
|
||||||
|
else
|
||||||
sudo tgtadm --op show --mode target | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
|
sudo tgtadm --op show --mode target | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
|
||||||
|
fi
|
||||||
_clean_lvm_volume_group $vg
|
_clean_lvm_volume_group $vg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user