The best approach is to use a script to generate the partitionfile that gets included in the kickstart file. If you read "partitionfile" section of the man page for linuximage, you'll see that you can set a prefix on the file name that indicates to xCAT that it is a script.
For instance in your osimage definition for a Linux machine: partitionfile=s:/install/custom/install/rh/my-partitions.sh The script runs under the Anaconda environment in RHEL systems, which means you have access to Anaconda functions like "list-harddrives" You can parse the output and dynamically generate your disk layout, PV groups, volume groups, whatever you want. Just output the final configuration to /tmp/partitionfile in your script. To pick it up in the kickstart, the template file must contain this block: #XCAT_PARTITION_START# %include /tmp/partitionfile #XCAT_PARTITION_END# I use this all the time to make different disk layouts depending on the number of drives and their sizes. > On February 2, 2020 at 10:03 PM Imam Toufique <techie...@gmail.com> wrote: > > I have been attaching a partition def. file with osimage for my stateful > installs. > > so, here is my current one: > > bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda > zerombr > clearpart --all --initlabel > part /boot --size 300 --fstype ext3 > part swap --size 4096 > part / --size 1 --grow --fstype xfs > > Now, if I understand correctly, partition file/script cant be associated > with a 'group', only with an 'osimage' . > > the above is good for a single disk setup. If I have 2 drives in a > system and I want software raid (i.e. RAID1, in this case), then I have to > attach another script to it, for the selected 'osimage'. > > How do I make this a bit more dynamic, so I can select a 'group' ( or > something )that will select a specific partition definition file? I can > write something at a higher level to instruct my wrapper script that machine > X has 2 drives, therefore, select a RAID1 specific partition definition file > -- but, I think that's a bit tacky way to do this. > > How do you guys handle this in general? > thanks > _______________________________________________ > xCAT-user mailing list > xCAT-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xcat-user >
_______________________________________________ xCAT-user mailing list xCAT-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xcat-user