Opened 14 years ago

Closed 13 years ago

#445 closed defect (fixed)

analyze-my-lvm error on VG's with similar names

Reported by: Michael Shapiro Owned by: Bruno Cornec
Priority: normal Milestone: 2.2.9.5
Component: mindi Version: 2.2.9.4
Severity: normal Keywords:
Cc:

Description

mindi-2.0.7.5-1.rhel4
mondo-2.2.9.4-1.rhel4

# vgs
  VG         #PV #LV #SN Attr   VSize   VFree  
  vgapps1      2   3   0 wz--n-  50.58G  28.58G
  vgroot       1   9   0 wz--n- 124.47G  96.97G
  vgroot-san   1   7   0 wz--n- 124.48G 105.03G

mondoarchive command:

mondoarchive -9 -E "/dev/emcpowera1 /dev/emcpowerb3 /dev/emcpowerc1" -H -N -0 -d lnapp015a.d -l GRUB -n lneng003:/rhn/mondo-images -p lnapp015a_dvd_083110-15-54 -s 4000m

The -E will exclude three disks and the VG's that are on them, vgroot-san and vgapps1. The OS VG is vgroot. The file $MINDI_TMP/excludedvgs contains:

vgroot-san
vgapps1

In the function ProcessLogicalVolume in analyze-my-lvm, in the section:

        # Do not process LV whose VG are excluded
        if [ -f $MINDI_TMP/excludedvgs ]; then
                if [ "`grep $volume_group $MINDI_TMP/excludedvgs`" != "" ]; then
                        echo "Not including LV $logical_volume as VG $volume_group was excluded"
                        return
                fi
        fi

The grep will filter out the OS VG, vgroot because it starts with the same characters as the excluded VG, vgroot-san. This causes all of the lvcreate lines in the lvm.res file to look like:

Finally, create the LV's (logical volumes).
Not including LV lvrootsan as VG vgroot-san was excluded
Not including LV lvhomesan as VG vgroot-san was excluded
Not including LV lvlhomesan as VG vgroot-san was excluded
Not including LV lvoptsan as VG vgroot-san was excluded
Not including LV lvusrsan as VG vgroot-san was excluded
Not including LV lvvarsan as VG vgroot-san was excluded
Not including LV lvtmpsan as VG vgroot-san was excluded
Not including LV lvroot as VG vgroot was excluded
Not including LV lvhome as VG vgroot was excluded
Not including LV lvlhome as VG vgroot was excluded
Not including LV lvopt as VG vgroot was excluded
Not including LV lvtmp as VG vgroot was excluded
Not including LV lvusr as VG vgroot was excluded
Not including LV lvvar as VG vgroot was excluded
Not including LV lva01 as VG vgroot was excluded
Not including LV lvquest as VG vgroot was excluded
Not including LV lva01 as VG vgapps1 was excluded
Not including LV lva02 as VG vgapps1 was excluded
Not including LV lvquest as VG vgapps1 was excluded

Changing the grep to an awk fixes the problem:

        # Do not process LV whose VG are excluded
        if [ -f $MINDI_TMP/excludedvgs ]; then
                if [ "`awk -v vg=$volume_group '{if ($1 == vg){print $1}}' /mindi.BpVqvA6553/excludedvgs`" != "" ]; then
                        echo "Not including LV $logical_volume as VG $volume_group was excluded"
                        return
                fi
        fi

Finally, create the LV's (logical volumes).
Not including LV lvrootsan as VG vgroot-san was excluded
Not including LV lvhomesan as VG vgroot-san was excluded
Not including LV lvlhomesan as VG vgroot-san was excluded
Not including LV lvoptsan as VG vgroot-san was excluded
Not including LV lvusrsan as VG vgroot-san was excluded
Not including LV lvvarsan as VG vgroot-san was excluded
Not including LV lvtmpsan as VG vgroot-san was excluded
# lvm lvcreate -L 3010m -r 0 -n lvroot vgroot
# lvm lvcreate -L 512m -r 0 -n lvhome vgroot
# lvm lvcreate -L 320m -r 0 -n lvlhome vgroot
# lvm lvcreate -L 2017m -r 0 -n lvopt vgroot
# lvm lvcreate -L 3010m -r 0 -n lvtmp vgroot
# lvm lvcreate -L 5027m -r 0 -n lvusr vgroot
# lvm lvcreate -L 3010m -r 0 -n lvvar vgroot
# lvm lvcreate -L 10240m -r 0 -n lva01 vgroot
# lvm lvcreate -L 1024m -r 0 -n lvquest vgroot
Not including LV lva01 as VG vgapps1 was excluded
Not including LV lva02 as VG vgapps1 was excluded
Not including LV lvquest as VG vgapps1 was excluded

Change History (2)

comment:1 by Bruno Cornec, 14 years ago

Status: newassigned

rev [2684] whould solve that issue, without resorting to awk, but just using the right grep option. Please tell me if there are other problems with it. Will be in 2.0.7.6 of mindi

comment:2 by Bruno Cornec, 13 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.