Browse Source

devstack: Do a vgscan before checking if the VG is there

There might be a rescan for volume groups needed before checking if
the volume group is already there. Otherwise, the check for the volume
group fails which means the code tries to create the volume, but that
fails then because the volume is already there.
Here is the devstack run log:

  [...]
  plugin.sh:configure_backing_file:538  sudo losetup -f --show /opt/stack/data/lvm-shares-backing-file
  plugin.sh:configure_backing_file:538  DEV=/dev/loop2
  plugin.sh:configure_backing_file:543  sudo vgs lvm-shares
    Volume group "lvm-shares" not found
    Cannot process volume group lvm-shares
  plugin.sh:configure_backing_file:543  sudo vgcreate lvm-shares /dev/loop2
    Physical volume '/dev/loop2' is already in volume group 'lvm-shares'
    Unable to add physical volume '/dev/loop2' to volume group 'lvm-shares'
    /dev/loop2: physical volume not initialized.
  plugin.sh:configure_backing_file:1  exit_trap
  [...]

Change-Id: I0189580ae40b180249fd5846aa986052e44ce2c2
Thomas Bechtold 3 months ago
parent
commit
49e68f8409
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      devstack/plugin.sh

+ 1
- 0
devstack/plugin.sh View File

@@ -530,6 +530,7 @@ function create_custom_share_types {
530 530
 
531 531
 # configure_backing_file - Set up backing file for LVM
532 532
 function configure_backing_file {
533
+    sudo vgscan
533 534
     if ! sudo vgs $SHARE_GROUP; then
534 535
         if [ "$CONFIGURE_BACKING_FILE" = "True" ]; then
535 536
             SHARE_BACKING_FILE=${SHARE_BACKING_FILE:-$DATA_DIR/${SHARE_GROUP}-backing-file}

Loading…
Cancel
Save