Hello There. I am currently attempting to automate the running of packer's hyper-v builder for work. I am using a ks.cfg file to do this, and will post the contents of it here. For some reason, when I run packer along with the ks file, the vm that is created for some reason doesn't have cd, which corresponds to the iso, as the first in the boot order. This causes the boot to fail every time. For some reason though, it doesn't fail if I don't use the ks file. Below is the ks.cfg file and the contents of my json file. Does anyone see what might be causing the boot order to change?
# CentOS 7.x kickstart file - centos7.ks
#
# For more information on kickstart syntax and commands, refer to the
# CentOS Installation Guide:
#
# For testing, you can fire up a local http server temporarily.
# cd to the directory where this ks.cfg file resides and run the following:
# $ python -m SimpleHTTPServer
# You don't have to restart the server every time you make changes. Python
# will reload the file from disk every time. As long as you save your changes
# they will be reflected in the next HTTP download. Then to test with
# a PXE boot server, enter the following on the PXE boot prompt:
# > linux text ks=http://<your_ip>:8000/ks.cfg
# Required settings
lang en_US.UTF-8
keyboard us
rootpw atomicorp
authconfig --enableshadow --enablemd5
timezone UTC
# Optional settings
install
cdrom
#user --name=vagrant --plaintext --password vagrant
unsupported_hardware
network --device eth0 --bootproto=dhcp
firewall --disabled
selinux --disabled
# The biosdevname and ifnames options ensure we get "eth0" as our interface
# even in environments like virtualbox that emulate a real NW card
bootloader --location=mbr --append="no_timer_check console=tty0 console=ttyS0,115200 net.ifnames=0 biosdevname=0"
text
skipx
zerombr
clearpart --all --initlabel
autopart
firstboot --disabled
reboot
%packages --nobase --ignoremissing --excludedocs
# vagrant needs this to copy initial files via scp
openssh-clients
# Prerequisites for installing VMware Tools or VirtualBox guest additions.
# Put in kickstart to ensure first version installed is from install disk,
# not latest from a mirror.
kernel-headers
kernel-devel
gcc
make
perl
curl
wget
bzip2
dkms
patch
net-tools
selinux-policy-devel
# Core selinux dependencies installed on 7.x, no need to specify
# Other stuff
sudo
nfs-utils
-fprintd-pam
-intltool
# Microcode updates cannot work in a VM
-microcode_ctl
# unnecessary firmware
-aic94xx-firmware
-alsa-firmware
-alsa-tools-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw*-firmware
-irqbalance
-ivtv-firmware
-iwl*-firmware
-kernel-firmware
-libertas-usb8388-firmware
-ql*-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
# Don't build rescue initramfs
-dracut-config-rescue
# no firewalld
-firewalld
-firewalld-filesystem
%end
%post
# configure vagrant user in sudoers
#echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
#chmod 0440 /etc/sudoers.d/vagrant
#cp /etc/sudoers /etc/sudoers.orig
sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers
# keep proxy settings through sudo
echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers
%end
"<up><wait><tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}<enter>"
"iso_url": "C:/Users/User/Downloads/CentOS-7-x86_64-Minimal-1810.iso",