From spikewhitetx at gmail.com Fri Sep 5 14:37:57 2014 From: spikewhitetx at gmail.com (Spike White) Date: Fri, 5 Sep 2014 09:37:57 -0500 Subject: =?UTF-8?Q?Missing_any_tricks_to_minimize_bloat_=5Bof_absolute=2Dmi?= =?UTF-8?Q?nimal_kickstart=2Dbased_static_boot_media_caused_by_new_=E2=80=9Cnol?= =?UTF-8?Q?oader=E2=80=9D_anaconda_architecture=5D_=3F?= Message-ID: All, We do [kickstart-based essentially unattended] static, DHCP and PXE Linux imaging at work. But 90% is static builds. My focus below is on kickstart-based static builds. Because attaching virtual media to our remote server consoles is *so* slow, I slim down the static boot media to the bare minimum. 40 MB, as of RHEL 6.5. That's largely just the vmlinuz + initrd.img (Even 40 MB is slow.) >From ~RHEL3 up to RHEL 6.5, that meant I only have to drop a vmlinuz, initrd.img and syslinux.cfg on my USB boot image. (For convenience, I use a FAT32 fs, but ext2/3 would work also). The RHEL 6.5 syslinux.cfg looks like this: LABEL rhel65_x86_64 MENU label ^RHEL 6.5/64 (prod build) MENU INDENT 3 KERNEL /boot/rhel/6.5/x86_64/vmlinuz APPEND initrd=/boot/rhel/6.5/x86_64/initrd.img nofb ramdisk_size=10000 ks=hd:LABEL=MINIBOOT:/ks.cfg So the provisioning engineer will craft 30 - 40 ks.cfg files (via ks.cfg web builder page). Each called ks-.cfg. Crack open the USB boot media, deposit all in top directory, button back up. Will use same boot media for all 30 ? 40 servers that provisioner builds that day. ks-.cfg has these two relevant lines: url --url=http://143.166.6.45/redhat/RHEL6/64/install network --bootproto=static --ip=10.194.53.143 --netmask=255.255.255.0 --gateway=10.194.53.1 --nameserver=143.166.33.44 --hostname=hiutest03. That is, each ks-.cfg is unique for each server. But the boot media is generic for all servers and all provisioners. Apparently, this worked with static builds because the loader of the old anaconda architecture ?pre-parsed? the network and url line of the ks.cfg. Anaconda?s loader brought the network up, then went to the specified URL to pull the stage2 image, etc. It all worked. BTW, depending on server model & role, the public interface is on different NICs. Since I didn?t specify the specific network interface in the network line above in the ks.cfg, the old anaconda would pop up a list of possible NICs. The provisioner would select the one that?s public for this role & model of server. Also when the old anaconda couldn?t find the specified ?ks.cfg? it popped up a screen asking for the name. So the provisioner replaced ?ks.cfg? with ?ks-.cfg?. I?m guessing the new ?noloader? anaconda re-architecture starting in Fedora 17 is what now disallows this absolute minimal kickstart boot media. I know it doesn?t work in RHEL7.0 (which is ~Fedora 19). For static builds, it appears that now it requires either: ? all static IP info must be specified in the kernel boot options via ip=::::: ? or stage 2 bootloader must be included in static-based boot media. And kernel boot options must specify via: inst.stage2=hd:/MINIBOOT/squashfs.img (or LiveOS.iso) That is: 1. Either each boot media must be unique. (Which means the provisioners can't spin 1 media w/ 30-40 ks.cfg files and attach to 30-40 servers). Would look like this: LABEL rhel65_x86_64 MENU label ^RHEL 7.0/64 (prod build) MENU INDENT 3 KERNEL /boot/rhel/6.5/x86_64/vmlinuz APPEND initrd=/boot/rhel/6.5/x86_64/initrd.img nofb ramdisk_size=10000 ks=hd:LABEL=MINIBOOT:/ks.cfg ip==::::: Or 2. The boot media must have squashfs.img embedded. I.e., instead of 40 MB boot media, it's now 300 MB. (Which means it'll be much slower to pull image.) It'd look like this: LABEL rhel65_x86_64 MENU label ^RHEL 7.0/64 (prod build) MENU INDENT 3 KERNEL /boot/rhel/6.5/x86_64/vmlinuz APPEND initrd=/boot/rhel/6.5/x86_64/initrd.img nofb ramdisk_size=10000 ks=hd:LABEL=MINIBOOT:/ks.cfg inst.stage2=hd:LABEL=MINIBOOT:/squashfs.img It?d be like this: https://gist.github.com/pauljeff/4b9ad551cb6c35870d7c Am I missing any tricks? BTW, I?m able to spin a ?minimal LiveCD? https://projects.centos.org/trac/livecd/wiki/CreateImage and embed that squashfs.img or LiveCD.iso. So then it?s only 200 MB total. That?s still quite slow to transfer to remote consoles. For completeness: ? PXE builds are unaffected. (Worst case, I could do ks.device=bootif in the pxelinux.cfg.) ? DHCP builds will be similarly affected. Since vmlinuz/initrd.img is now completely non-interactive, it doesn?t pop up a screen with list of NICs and ask which one to use to acquire DHCP address (like RHEL 6.5 did). (All NICs will have link, so "ks.device=link" isn't viable.) Also ? on somewhat-related topic, we are *very* excited by the ?minimal? install option offered by this new anaconda architecture. Previously, we?d ?security-harden? the RHEL 5/6 builds by removing over 100 RPMs. It?s always easier to build up -- add RPMs to an ?@minimal? build -- than to work out all the dependencies to remove RPMs from an ?@base? build. As you can tell, we?re huge into kickstart so removing ?individual package selection? in anaconda doesn?t hurt us a bit. (But then, we?re atypical -- an enterprise customer first and Fedora hobbyists only in our spare time.) Spike -------------- next part -------------- An HTML attachment was scrubbed... URL: From tradej at redhat.com Mon Sep 22 14:11:07 2014 From: tradej at redhat.com (Tomas Radej) Date: Mon, 22 Sep 2014 16:11:07 +0200 Subject: Do you need urlgrabber? Message-ID: <54202DFB.5000007@redhat.com> Hi, Pykickstart uses urlgrabber on multiple occasions to download URLs either into memory or as files in filesystems. I would like to know if you need this particular library, or if it can be replaced by e. g. pycurl or even urllib. The reason is that the packaging team is planning to drop support (and probably even ownership) of python-urlgrabber as of Fedora 22. I am invested in this matter due to my participation in the 'Python 3 as default' initiative [1], and pykickstart's Python 3 compatibility [2], which is better achieved without urlgrabber than with it, is a part of it. Thank you, Tomas Radej [1] https://fedoraproject.org/wiki/Changes/Python_3_as_Default [2] https://bugzilla.redhat.com/show_bug.cgi?id=985310 From anders.blomdell at control.lth.se Mon Sep 22 15:16:52 2014 From: anders.blomdell at control.lth.se (Anders Blomdell) Date: Mon, 22 Sep 2014 17:16:52 +0200 Subject: Do you need urlgrabber? In-Reply-To: <54202DFB.5000007@redhat.com> References: <54202DFB.5000007@redhat.com> Message-ID: <54203D64.40304@control.lth.se> On 2014-09-22 16:11, Tomas Radej wrote: > Hi, > > Pykickstart uses urlgrabber on multiple occasions to download URLs > either into memory or as files in filesystems. I would like to know > if you need this particular library, or if it can be replaced by e. > g. pycurl or even urllib. The reason is that the packaging team is > planning to drop support (and probably even ownership) of > python-urlgrabber as of Fedora 22. Well, I kind of like the mirroring support in urlgrabber, but besides the pain to rip it out from where I use it, I could live without it :-( > I am invested in this matter due to my participation in the 'Python 3 > as default' initiative [1], and pykickstart's Python 3 compatibility > [2], which is better achieved without urlgrabber than with it, is a > part of it. Does better mean simpler in this case? /Anders -- Anders Blomdell Email: anders.blomdell at control.lth.se Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden From tradej at redhat.com Tue Sep 23 08:00:11 2014 From: tradej at redhat.com (Tomas Radej) Date: Tue, 23 Sep 2014 10:00:11 +0200 Subject: Do you need urlgrabber? In-Reply-To: <54203D64.40304@control.lth.se> References: <54202DFB.5000007@redhat.com> <54203D64.40304@control.lth.se> Message-ID: <5421288B.7060305@redhat.com> On 09/22/2014 05:16 PM, Anders Blomdell wrote: > On 2014-09-22 16:11, Tomas Radej wrote: >> Hi, >> >> Pykickstart uses urlgrabber on multiple occasions to download URLs >> either into memory or as files in filesystems. I would like to know >> if you need this particular library, or if it can be replaced by e. >> g. pycurl or even urllib. The reason is that the packaging team is >> planning to drop support (and probably even ownership) of >> python-urlgrabber as of Fedora 22. > Well, I kind of like the mirroring support in urlgrabber, but besides > the pain to rip it out from where I use it, I could live without it :-( Well, I expect someone to take it and keep it alive, so it's not like you'd have to stop using it altogether, but from pykickstart's and other important components' perspective, it's not ideal to keep it included. >> I am invested in this matter due to my participation in the 'Python 3 >> as default' initiative [1], and pykickstart's Python 3 compatibility >> [2], which is better achieved without urlgrabber than with it, is a >> part of it. > Does better mean simpler in this case? Exactly. If there are no objections, I'll make a patch that removes the usage of urlgrabber and replaces it with whatever is suitable and supported, and post it to this list. Cheers, TR From clumens at redhat.com Tue Sep 23 13:50:02 2014 From: clumens at redhat.com (Chris Lumens) Date: Tue, 23 Sep 2014 09:50:02 -0400 Subject: Do you need urlgrabber? In-Reply-To: <5421288B.7060305@redhat.com> References: <54202DFB.5000007@redhat.com> <54203D64.40304@control.lth.se> <5421288B.7060305@redhat.com> Message-ID: <20140923135002.GZ8775@dhcp55.install.bos.redhat.com> > If there are no objections, I'll make a patch that removes the usage of > urlgrabber and replaces it with whatever is suitable and supported, and post > it to this list. Go for it. - Chris From huruomu at gmail.com Mon Sep 29 09:16:14 2014 From: huruomu at gmail.com (Romu Hu) Date: Mon, 29 Sep 2014 17:16:14 +0800 Subject: Always use local disk for driveorder Message-ID: <5429235E.8000701@gmail.com> Hi, When installing with kickstart, sda is not always the local disk, e.g. it may be a storage device connected to HBA. How to tell anaconda to find the device name of the local disk and always use it for driveorder? i.e. always install Linux (and boot loader) in the local disk. Thanks Romu From chavanpushpendra at gmail.com Mon Sep 29 11:04:15 2014 From: chavanpushpendra at gmail.com (Mr. Pushpendra Chavan) Date: Mon, 29 Sep 2014 16:34:15 +0530 Subject: Always use local disk for driveorder In-Reply-To: <5429235E.8000701@gmail.com> References: <5429235E.8000701@gmail.com> Message-ID: You can use the /dev/disk/by-id/ values in kickstart for installing on particular disks. But this will make the kickstart hard-coded for each machine. Are you using same kickstart for multiple machines? Also you can try using blacklist boot parameter to disable San devices. On 29-Sep-2014 2:51 PM, "Romu Hu" wrote: > Hi, > > When installing with kickstart, sda is not always the local disk, e.g. it > may be a storage device connected to HBA. How to tell anaconda to find the > device name of the local disk and always use it for driveorder? i.e. always > install Linux (and boot loader) in the local disk. > > Thanks > Romu > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jebi01 at handelsbanken.se Mon Sep 29 12:40:07 2014 From: jebi01 at handelsbanken.se (Jerry Billing) Date: Mon, 29 Sep 2014 14:40:07 +0200 Subject: Always use local disk for driveorder In-Reply-To: References: <5429235E.8000701@gmail.com> Message-ID: Hi To blacklist SAN drivers, see: https://access.redhat.com/solutions/43439#comment-form To exclude the driver for Brocade HBA cards you could do: boot> linux blacklist=bfa ks=http://example.com/my-ks.cfg /Jerry From: "Mr. Pushpendra Chavan" To: Discussion list about Kickstart , Date: 2014-09-29 13:09 Subject: Re: Always use local disk for driveorder Sent by: kickstart-list-bounces at redhat.com You can use the /dev/disk/by-id/ values in kickstart for installing on particular disks. But this will make the kickstart hard-coded for each machine. Are you using same kickstart for multiple machines? Also you can try using blacklist boot parameter to disable San devices. On 29-Sep-2014 2:51 PM, "Romu Hu" wrote: Hi, When installing with kickstart, sda is not always the local disk, e.g. it may be a storage device connected to HBA. How to tell anaconda to find the device name of the local disk and always use it for driveorder? i.e. always install Linux (and boot loader) in the local disk. Thanks Romu _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From chavanpushpendra at gmail.com Mon Sep 29 13:43:47 2014 From: chavanpushpendra at gmail.com (Mr. Pushpendra Chavan) Date: Mon, 29 Sep 2014 19:13:47 +0530 Subject: Always use local disk for driveorder In-Reply-To: References: <5429235E.8000701@gmail.com> Message-ID: Hi Jerry, Yes, you are right. That KCS Makes sense. Onecan blacklist the SAN driver which will not let SAN volumes to be loaded during installations. On Mon, Sep 29, 2014 at 6:10 PM, Jerry Billing wrote: > Hi > > To blacklist SAN drivers, see: > https://access.redhat.com/solutions/43439#comment-form > > To exclude the driver for Brocade HBA cards you could do: > > boot> linux blacklist=bfa ks=http://example.com/my-ks.cfg > > /Jerry > > > > > > > From: "Mr. Pushpendra Chavan" > To: Discussion list about Kickstart , > Date: 2014-09-29 13:09 > Subject: Re: Always use local disk for driveorder > Sent by: kickstart-list-bounces at redhat.com > ________________________________ > > > > You can use the /dev/disk/by-id/ values in kickstart for installing on > particular disks. But this will make the kickstart hard-coded for each > machine. > > Are you using same kickstart for multiple machines? Also you can try using > blacklist boot parameter to disable San devices. > > On 29-Sep-2014 2:51 PM, "Romu Hu" wrote: > Hi, > > When installing with kickstart, sda is not always the local disk, e.g. it > may be a storage device connected to HBA. How to tell anaconda to find the > device name of the local disk and always use it for driveorder? i.e. always > install Linux (and boot loader) in the local disk. > > Thanks > Romu > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list_______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From huruomu at gmail.com Mon Sep 29 14:44:04 2014 From: huruomu at gmail.com (Romu) Date: Mon, 29 Sep 2014 22:44:04 +0800 Subject: Always use local disk for driveorder In-Reply-To: References: <5429235E.8000701@gmail.com> Message-ID: Hi, Thank you for the solutions! Yes, the kickstart is for multiple machines. But I think setting a disk id or SAN driver parameter for every machine is doable. I can't access the redhat solution page. Does it prove any other solutions? Thanks Romu 2014-09-29 21:43 GMT+08:00 Mr. Pushpendra Chavan : > Hi Jerry, > > Yes, you are right. That KCS Makes sense. > > Onecan blacklist the SAN driver which will not let SAN volumes to be > loaded during installations. > > > > On Mon, Sep 29, 2014 at 6:10 PM, Jerry Billing > wrote: > > Hi > > > > To blacklist SAN drivers, see: > > https://access.redhat.com/solutions/43439#comment-form > > > > To exclude the driver for Brocade HBA cards you could do: > > > > boot> linux blacklist=bfa ks=http://example.com/my-ks.cfg > > > > /Jerry > > > > > > > > > > > > > > From: "Mr. Pushpendra Chavan" > > To: Discussion list about Kickstart , > > Date: 2014-09-29 13:09 > > Subject: Re: Always use local disk for driveorder > > Sent by: kickstart-list-bounces at redhat.com > > ________________________________ > > > > > > > > You can use the /dev/disk/by-id/ values in kickstart for installing on > > particular disks. But this will make the kickstart hard-coded for each > > machine. > > > > Are you using same kickstart for multiple machines? Also you can try > using > > blacklist boot parameter to disable San devices. > > > > On 29-Sep-2014 2:51 PM, "Romu Hu" wrote: > > Hi, > > > > When installing with kickstart, sda is not always the local disk, e.g. it > > may be a storage device connected to HBA. How to tell anaconda to find > the > > device name of the local disk and always use it for driveorder? i.e. > always > > install Linux (and boot loader) in the local disk. > > > > Thanks > > Romu > > > > _______________________________________________ > > Kickstart-list mailing list > > Kickstart-list at redhat.com > > > https://www.redhat.com/mailman/listinfo/kickstart-list_______________________________________________ > > Kickstart-list mailing list > > Kickstart-list at redhat.com > > https://www.redhat.com/mailman/listinfo/kickstart-list > > > > > > _______________________________________________ > > Kickstart-list mailing list > > Kickstart-list at redhat.com > > https://www.redhat.com/mailman/listinfo/kickstart-list > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spikewhitetx at gmail.com Tue Sep 30 23:25:47 2014 From: spikewhitetx at gmail.com (Spike White) Date: Tue, 30 Sep 2014 18:25:47 -0500 Subject: always use local disk for driveorder Message-ID: Romu, You've hit on a real problem. Not only can SAN-attached disk be enumerated first, also sometimes USB media (for physical installs). Or virtual media (if doing remote installs off a remote access controller, or via PXE). So using /ddev/disk/by-path/* is certainly one great way to solve this. To get a concrete example of what others are saying, consider a Dell server. Consistently, the 1st PERC vol seems to be enumerated as [0:2:0:0] on M620s and R620s. Here's example output from lsscsi -g: # lsscsi -g [0:0:32:0] enclosu DP BACKPLANE 1.07 - /dev/sg0 [0:2:0:0] disk DELL PERC 6/i 1.22 /dev/sda /dev/sg1 [0:2:1:0] disk DELL PERC 6/i 1.22 /dev/sdb /dev/sg2 ks.cfg now allows /dev/disk/by-path/ and /dev/disk/by-id shell-like globs. See http://fedoraproject.org/wiki/Anaconda/Kickstart, Special Notes for Referring to Disks. So /dev/disk/by-path/pci-*-usb-* captures all USB media, /dev/disk/by-path/pci-*-scsi-* captures all PERC vols, /dev/disk/by-path/pci-*-scsi-0:2:0:0 captures first PERC vol (on a M620), /dev/disk/by-path/pci-*-fc-* captures all FC LUNs. However, on other Dell server models, the first PERC volume varies. Sometimes it's 0:1:0:0. So /dev/disk/by-path/pci-*-scsi-0:[1-9]:0:0 will be your first PERC volume on *any* Dell server in the last decade or so. Armed with this information, you can specify your boot disk in your ks.cfg. ... %include /tmp/ignoredisk # Partition and format the drives. part /boot --fstype ext3 --size=100 --asprimary But wait! What is this /tmp/ignoredisk file? It comes from your "%pre" section. %pre # This *definitely* works. See %include ignoredisk discussion above. FIRST_PERC_VOL=$(ls -1 /dev/disk/by-path/pci-*-scsi-0:[1-9]:0:0 | grep -v usb) echo "ignoredisk --only-use=$FIRST_PERC_VOL" > /tmp/ignoredisk echo "clearpart --all --initlabel --drives=$FIRST_PERC_VOL" >> /tmp/ignoredisk In summary, blacklisting kerrnel modules is simpler, but doesn't cover all the different cases. Doing as above covers all cases, but only for one particular server family. Spike -------------- next part -------------- An HTML attachment was scrubbed... URL: