Browse code

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

Attila Fazekas authored on 2015/02/19 00:22:06
Showing 1 changed files
... ...
@@ -103,14 +103,17 @@ function _create_lvm_volume_group {
103 103
 function init_lvm_volume_group {
104 104
     local vg=$1
105 105
     local size=$2
106
-    # Start with a clean volume group
107
-    _create_lvm_volume_group $vg $size
108 106
 
107
+    # Start the lvmetad and tgtd services
109 108
     if is_fedora || is_suse; then
110
-        # service is not started by default
109
+        # services is not started by default
110
+        start_service lvm2-lvmetad
111 111
         start_service tgtd
112 112
     fi
113 113
 
114
+    # Start with a clean volume group
115
+    _create_lvm_volume_group $vg $size
116
+
114 117
     # Remove iscsi targets
115 118
     sudo tgtadm --op show --mode target | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
116 119