Changeset 2321 for trunk/scripts/pv-fixup/pv-fixup
- Timestamp:
- May 2, 2009, 6:53:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/pv-fixup/pv-fixup
r2272 r2321 36 36 } 37 37 38 lvsleft () {39 lvs -o name,devices xenvg \40 | perl -lane "print \$F[0] if (\$F[1] =~ m|$DISK|)"41 }42 43 38 vmstolvs () { 44 39 perl -pe 's/^/d_/;s/$/_hda/' … … 50 45 | xargs lvs -o size --units=g \ 51 46 | perl -lne '$total += $_; END { print $total; }' 47 } 48 49 lvsleft () { 50 lvs -o name,devices $VG \ 51 | perl -lane "print \$F[0] if (\$F[1] =~ m|$DISK|)" 52 52 } 53 53 … … 108 108 # - pvmove all the LVs back 109 109 110 # Doing this part with CLVM again. 111 112 lvsleft () { 113 lvs -o name,devices $VG \ 114 | perl -lane "print \$F[0] if (\$F[1] =~ m|$TMPDEV|)" 115 } 116 117 movelv () { 118 echo pvmoving $VG/$1... 119 lvchange -an $VG/$1 120 pvmove -i 10 -n $VG/$1 $2 121 lvchange -ay $VG/$1 122 } 123 124 movestuff () { 125 date 126 while read lv; do 127 echo MOVING: $lv >>/var/log/lvm2.log 128 movelv $lv $TMPDEV 129 date 130 done 131 } 132 133 moveall () { 134 date 135 for lv in $(lvsleft); do 136 echo MOVING: $lv >>/var/log/lvm2.log 137 movelv $lv $TMPDEV 138 date 139 done 140 } 141 110 142 #FOREACH host: 111 for lv in $(lvs -o lv_name --noheadings $VG); do 112 movelv $VG/$lv $TMPDEV 113 done 143 #set logging in /etc/lvm/lvm.conf 144 while sleep 1; do 145 echo MARK: $(date) >>/var/log/lvm2.log 146 done & 147 lvsleft | grep -xf <(invirt-listvms | yamlkeys | vmstolvs) \ 148 | movestuff >>/root/lvm/movelv.log 2>&1 149 moveall >>/root/lvm/movelv.log 2>&1 150 while true; do 151 kinit -k -45 152 sh -x status.sh 2>&1 | zwrite -c xvm-auto -i pvmove -O auto 153 sleep 1800 154 done & 114 155 #done 156 157 #suffix=.return-1; mv /var/log/lvm2.log lvm/lvm2.$suffix.log; mv lvm/movelv{,.$suffix}.log 115 158 116 159 # hopefully empty: … … 121 164 vgreduce $VG $TMPDEV 122 165 pvremove $TMPDEV 166 #FOREACH host: 123 167 dmsetup remove $TMPDM 168 #done 124 169 125 170 # - pvresize the new PV to use the whole space
Note: See TracChangeset
for help on using the changeset viewer.