So I use the following script to create a VM. I actually have a small batch file that opens putty, logs into a CVM, prompts me for the $name and then runs the script below. The image is one I made, then sysprepped and uploaded as a disk image.
Everything works great except that when I then open the console it goes through the Windows setup. I have an Unnattend file but I am unsure how to use it with my script. If I go through the GUI to create a VM I just point it to the unattened file in our file share.
Is there a way to attach the sysprep file? I thought it might be a parameter vm.disk_create but I am not clever enough to figure that part out and thought maybe someone else smarter could help. First world problems I know but it could help save me 30 extra seconds of not having to type the admin password in and set the keyboard settings etc.
#creates a vm
acli vm.create $name memory=$mem num_cores_per_vcpu=$core num_vcpus=$vcpu uefi_boot=TRUE &&
#Create C:
acli vm.disk_create $name clone_from_image=$image &&
#
#creates a D drive
acli vm.disk_create $name bus=scsi create_size=$hd index=1 container=$container ;
#create CD ROM drive
acli vm.disk_create $name bus=sata cdrom=true empty=true ;
#Add a NIC
for i in $(eval echo "{1..$END}"); do acli vm.nic_create $name connected=true network=$vlan request_ip=true; done ;
#Add VM to protection domain
ncli protection-domain protect name=$domain vm-names=$name &&
#powers on vm
acli vm.on $name
Thanks in advance