Commit 01d2da3b authored by David Johnson's avatar David Johnson

Significantly improve pv disk/part selection.

(The new thing should basically filter out everything we don't want to
use.  Really.)
parent 961378fa
......@@ -95,7 +95,7 @@ elif [ "$COMPUTE_EXTRA_NOVA_DISK_SPACE" = "1" ]; then
#
# See if we can try to use an LVM instead of just the 4th partition.
#
lsblk -n -P -o NAME,FSTYPE,MOUNTPOINT,PARTTYPE,PARTUUID | perl -e 'my %devs = (); while (<STDIN>) { $_ =~ s/([A-Z0-9a-z]+=)/;\$$1/g; eval "$_"; if ($NAME ne "sda" && $NAME ne "/dev/nvme0n1" && $NAME ne "sda2" && $FSTYPE eq "" && $FSTYPE eq "" && $MOUNTPOINT eq "" && ($PARTTYPE eq "" || $PARTTYPE eq "0x0")) { push(@devs,"/dev/$NAME"); } }; print join(" ",@devs)."\n"' > /tmp/devs
lsblk -n -P -o NAME,FSTYPE,MOUNTPOINT,PARTTYPE,PARTUUID,TYPE,PKNAME | perl -e 'my %devs = (); while (<STDIN>) { $_ =~ s/([A-Z0-9a-z]+=)/;\$$1/g; eval "$_"; if (!($TYPE eq "disk" || $TYPE eq "part")) { next; }; if (exists($devs{$PKNAME})) { delete $devs{$PKNAME}; } if ($FSTYPE eq "" && $MOUNTPOINT eq "" && ($PARTTYPE eq "" || $PARTTYPE eq "0x0")) { $devs{$NAME} = "/dev/$NAME"; } }; print join(" ",values(%devs))."\n"' > /tmp/devs
DEVS=`cat /tmp/devs`
if [ -n "$DEVS" ]; then
VGNAME="openstack-volumes"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment