For saving the time of people who might face the similar issue in future (believe me I have wasted 2-3 days), when you test the custom-built iso in a virtual environment (eg: VirtualBox), it emulates the ISO and presents it to the virtual machine as a CDROM device. While when you will test on a bare/physical server, it will be presented as a /dev/sdX device (where X may be a,b,b1,c2, and so on depending on the number of external devices or USBs attached to the machine, ex: /dev/sdb1). So, giving the path of ks file as cdrom:/ks/ks.cfg
won't work on bare servers/machines, so the best option is to use the "LABEL" for identification of media. But for this, you will have to build your ISO and make it bootable using the same custom LABEL. You will also have to specify the LABEL identification method in your isolinux.cfg file.
For ex:
Your isolinux.cfg's menu entry should look like this:
label check
menu label Install CentOS with MY Customizations
menu default
kernel vmlinuz biosdevname=0
append initrd=initrd.img inst.stage2=hd:LABEL=MYCUSTOMISO ks=hd:LABEL=MYCUSTOMISO:/ks/ks.cfg
In above example, the kickstart file is located in the ks folder which is at the root directory of installation media. You should build your ISO using "-V" switch and specify your ISO's LABEL. (Don't worry, the bootable disk creation tools usually change the label of your USB to the value passed in this -V switch (if they don't, manually give the disk this specific label)
mkisofs -o /home/mycustom.iso -V 'MYCUSTOMISO' -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /home/cent/CustomISO/kickstart_build/isolinux/
Please refer the official RedHat documentation for more details on how to make Kickstart available at installation time: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/s1-kickstart2-startinginstall
Also, pykickstart docs are great one-stop reference for your kickstart needs: https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html