network installation on KVM fails to parse the kickstart profile

Latest response

I'm trying to perform network installation to automate the deployment of KVM guests.

I'm able to use the following command line to install RHEL 7 guests without any problem. However, the same command line fails to parse the ks.cfg file when trying to install a RHEL 6 guest

virt-install \
-n myRHELVM1 \
--os-type=Linux \
--os-variant=rhel6 \
--ram=2048 \
--vcpus=2 \
--disk path=/var/lib/libvirt/images/disk1.qcow2 \
--graphics none \
--l http://x.x.x.x/rhel/6 \
--network bridge:br0
--extra-args "inst.ks=http://server/vm.ks.cfg"

In this case, the VM boots from the network but fails to proceed with the kickstart profile. Could someone help pls?

Responses

Hi, I noticed you have a comma ("vm.ks,cfg") in the Kickstart's filename. Are you sure it's not a typo? Is that really the filename?

it's a typo - thanks for noting it... I'll modify it

Hi,

is there any specific error when parsing the ks.cfg?

Did you check the file with ksvalidator?

//Zdenek

I will need time to confirm this, but I am not certain that RHEL 6 accepts the inst.* options.
In case this is the right answer (and in hopes of quickly getting you moving forward), try just using ks=http://\<IP>/ks-cfg.ks.

Please see (Sec 26.6)
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Installation_Guide/index.html#ch-parmfiles-Kickstart_parameters

Well I missed that in my previous comment, but inst.ks came with RHEL7, up to RHEL6 was only a ks= valid option...

//Zdenek

Thanks for the hint.

I removed "inst." from the inst.ks option. The "inst.repo/ks" is the recommended option on RHEL 7 with KVM however, doing so does not parse the kickstart profile.

I'm now able to install both RHEL 7 and RHEL 6 with the same command line.

Thanks a lot James!

I just happen to have a bit of experience with this specific type of functionality (I use it on my laptop to build my lab environment) - so, I'm glad to help ;-)

This is what I typically use:

virt-install --name ${GUESTNAME} --hvm --connect qemu:///system \
  --description "${GUESTNAME}" --virt-type=kvm \
  --network=default --vcpus=${NUMCPUS} --ram=${MEM} \
  --disk /var/lib/libvirt/images/${GUESTNAME}/${GUESTNAME}-0.img,device=disk,bus=virtio,format=qcow2 \
  --os-type=linux --os-variant=${OSVARIANT} \
  --location="http://${WEBSERVER}/OS/${OSDIR}" \
  -x "ks=http://${WEBSERVER}/${GUESTNAME}.ks"

Obviously, there are other parts to this which set all those variables and I also "pre-create" the Virtual Disk.

  qemu-img create -f qcow2 -o preallocation=metadata /var/lib/libvirt/images/${GUESTNAME}/${GUESTNAME}-0.img ${HDDA}G 
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.