<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body >Hi Kerim, <div><br></div><div>Yes, essentially two things are required;</div><div><br></div><div>1) be able to create an lv using extents from a specific physical device in the vg</div><div> </div><div>2) be able to allocate 100% of the extents from that specific device</div><div><br></div><div>Many thanks,</div><div>Luke</div><br><br><div>-------- Original message --------</div><div>From: Kerim Gueney <kgueney@uni-koeln.de> </div><div>Date:21/11/2014 13:54 (GMT+00:00) </div><div>To: linux-fai-devel@uni-koeln.de </div><div>Subject: Re: lvcreateopts ordering / sizing </div><div><br></div>What exactly is it that you're trying to do, if I may ask? Do you want <br>the main-soir volume to use all of the remaining space on /dev/md3?<br><br>I'm currently looking at this issue and just want to make sure I <br>understand it correctly.<br><br>Best regards<br>Kerim<br><br><br>On 11/19/2014 09:07 PM, Luke Alexander wrote:<br>> Hi,<br>><br>> I have a problem where I'd like to be able to specify a physical device as an LV create option:<br>><br>> ---<br>><br>> disk_config lvm fstabkey:device<br>> vg main md2,md3<br>> main-root / 10G xfs defaults<br>> main-mnt /home/mnt 50G xfs defaults<br>> main-solr /srv/solr/disk1 0- xfs defaults lvcreateopts="/dev/md3"<br>><br>> ---<br>><br>> Please assume that the md devices are created OK (which they are), I'd like for main-solr LV to use 100% of the PD /dev/md3<br>><br>> Using (undocumented?) lvcreateopts I was able to see the device trying to be used, but the ordering is incorrect, the PD switch to the lvcreate command should be at the end of the command, but lvcreateopts is added as the beginning flags the 'lvcreate' command...<br>><br>> To get past that we can change /usr/share/fai/setup-storage/Commands.pm :<br>><br>> &FAI::push_command( "lvcreate -n $lv -L " .<br>> &FAI::convert_unit($lv_size->{eff_size} . "B") . " $vg $create_options", "vg_enabled_$vg",<br>><br>> However this didn't work as the size option used '0-' trys to consume the entire VG size (so both, md2 and md3)<br>><br>> VG #PV #LV #SN Attr VSize VFree<br>> main 2 2 0 wz--n- 1.79t 1.73t<br>><br>> the lvcreate command looks like:<br>> lvcreate -n solr -L 1794482.72765625 main /dev/md3<br>><br>> the command fails as there are already devices using the VG - so the full VG size is not possible to use...<br>><br>> I then thought maybe I could change the lvcreateopts to comsume 100% of the PV (rather than VG), but I think this isn't parsed by Parsed.pm properly?<br>> lvcreateopts="-l +100%PVS /dev/md3"<br>><br>> Anyway, I can work round this by using the above hack to Commands.pm and setting the size option in the disk_config recipe to something like 900G:<br>><br>> main-solr /srv/solr/disk1 900G xfs defaults lvcreateopts="/dev/md3"<br>><br>> There is probably a more elegant way to do this though, you may have some pointers?<br>><br>> Apologies if this is the wrong list, I wasn't sure since I thought I could assist with the Commands.pm change if needed?<br>><br>> Thanks,<br>> Luke<br><br></body>