Re-activate vg and lvs on rebuild
Re-creates the loopback devices on rebuild/update. Re-enables volume groups and also logical volumes Change-Id: Ib319eebecfd29c71bc346c48ed47525552d54e94
This commit is contained in:
parent
a60e01c0da
commit
82eb9d86ec
44
playbooks/activate_cinder_volumes.yml
Normal file
44
playbooks/activate_cinder_volumes.yml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
# implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
- name: Check if using lvm based storage
|
||||||
|
stat: path=/mnt/state/var/lib/cinder/cinder-volumes-backing-file
|
||||||
|
register: lvm_backing_file
|
||||||
|
- name: Re-create cinder loopdevice
|
||||||
|
command: losetup -f /mnt/state/var/lib/cinder/cinder-volumes-backing-file
|
||||||
|
when: lvm_backing_file.stat.exists
|
||||||
|
sudo: yes
|
||||||
|
- pause: seconds=5
|
||||||
|
when: lvm_backing_file.stat.exists
|
||||||
|
- name: Re-scan for volume groups
|
||||||
|
command: pvscan
|
||||||
|
when: lvm_backing_file.stat.exists
|
||||||
|
sudo: yes
|
||||||
|
- pause: seconds=5
|
||||||
|
- name: Re-enable volume groups
|
||||||
|
command: vgchange -a y
|
||||||
|
when: lvm_backing_file.stat.exists
|
||||||
|
sudo: yes
|
||||||
|
- pause: seconds=5
|
||||||
|
when: lvm_backing_file.stat.exists
|
||||||
|
- name: Get all cinder lvm volumes
|
||||||
|
shell: "lvdisplay | grep cinder-volumes | grep 'LV Path' | awk '{print $3}'"
|
||||||
|
when: lvm_backing_file.stat.exists
|
||||||
|
register: cinder_volumes
|
||||||
|
sudo: yes
|
||||||
|
- name: Activate cinder lvm volumes
|
||||||
|
shell: lvchange -a y {{ item }}
|
||||||
|
with_items: cinder_volumes.stdout_lines
|
||||||
|
when: lvm_backing_file.stat.exists
|
||||||
|
sudo: yes
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
for CINDER_VOLUME in `dmsetup ls 2>/dev/null | cut -f 1 |grep 'cinder--volumes'|grep -v pool`; do
|
for CINDER_VOLUME in `lvdisplay | grep cinder-volumes | grep 'LV Path' | awk '{print $3}'`; do
|
||||||
dmsetup remove $CINDER_VOLUME
|
lvchange -a n $CINDER_VOLUME
|
||||||
done
|
done
|
||||||
vgchange -a n
|
vgchange -a n
|
@ -270,6 +270,7 @@
|
|||||||
max_fail_percentage: 0
|
max_fail_percentage: 0
|
||||||
sudo: yes
|
sudo: yes
|
||||||
tasks:
|
tasks:
|
||||||
|
- include: activate_cinder_volumes.yml
|
||||||
- include: mysql_init_fix.yml
|
- include: mysql_init_fix.yml
|
||||||
- include: rabbitmq_occ_disable.yml
|
- include: rabbitmq_occ_disable.yml
|
||||||
- include: refresh_config.yml
|
- include: refresh_config.yml
|
||||||
@ -349,6 +350,7 @@
|
|||||||
max_fail_percentage: 0
|
max_fail_percentage: 0
|
||||||
sudo: yes
|
sudo: yes
|
||||||
tasks:
|
tasks:
|
||||||
|
- include: activate_cinder_volumes.yml
|
||||||
# This action of stopping prior to starting is to ensure that should
|
# This action of stopping prior to starting is to ensure that should
|
||||||
# MySQL started upon boot, then it would hopefully pickup new config
|
# MySQL started upon boot, then it would hopefully pickup new config
|
||||||
# that os-collect-config and os-apply-config would have put in place.
|
# that os-collect-config and os-apply-config would have put in place.
|
||||||
|
@ -102,6 +102,7 @@ helion_overcloud_controller_services:
|
|||||||
- nova-novncproxy
|
- nova-novncproxy
|
||||||
- nova-scheduler
|
- nova-scheduler
|
||||||
- ceilometer-api
|
- ceilometer-api
|
||||||
|
- ceilometer-collector
|
||||||
- snmpd
|
- snmpd
|
||||||
- rsync
|
- rsync
|
||||||
- stunnel
|
- stunnel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user