Ensure lvm2-lvmetad service running on Fedora

When the lvm package gets installed the meta service does
not gets started automatically, but it becomes enabled so it would be
running on the next reboot.

The lvm commands are configured to use this service.
In the past this issue just causes warnings in the cinder log,
but now it can lead to a real issue.

It is better to ensure it is really running,
because it speeds up the lvm related commands.

Change-Id: I17fe2c3bcf77a6505ed2b6c824c5b20807beb725
This commit is contained in:
Attila Fazekas 2015-02-18 16:22:06 +01:00
parent 2e9d32baf2
commit 380d92cc7a

View File

@ -103,14 +103,17 @@ function _create_lvm_volume_group {
function init_lvm_volume_group {
local vg=$1
local size=$2
# Start with a clean volume group
_create_lvm_volume_group $vg $size
# Start the lvmetad and tgtd services
if is_fedora || is_suse; then
# service is not started by default
# services is not started by default
start_service lvm2-lvmetad
start_service tgtd
fi
# Start with a clean volume group
_create_lvm_volume_group $vg $size
# Remove iscsi targets
sudo tgtadm --op show --mode target | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true