因此,我使用以下脚本来创建VM。实际上,我有一个小批处理文件,可以打开腻子,登录CVM,提示我获取$名称,然后运行下面的脚本。该图像是我制作的,然后作为磁盘映像被Sysppreppped和上传。
一切都很好,除了我打开控制台时,它会通过Windows设置。我有一个不明的文件,但我不确定如何将其与脚本一起使用。如果我浏览GUI创建VM,我只需将其指向我们的文件共享中的未加工文件即可。
有没有办法连接sysprep文件?我认为这可能是一个参数vm.disk_create,但我还不够聪明,无法弄清楚这一部分,并认为也许其他人更聪明地可以帮助您。我知道的第一世界问题,但它可以帮助我节省30秒的额外,而不必输入管理员密码并设置键盘设置等。
#创建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 &&
#
#创建D驱动器
acli vm.disk_create $ name bus = scsi create_size = $ hd index = 1容器= $容器;
#Create CD ROM驱动器
acli vm.disk_create $ name bus = sata cdrom = true空= true;
#ADD A NIC
对于我in $(eval echo“ {1 .. $ end}”);do acli vm.nic_create $ name connected = true Network = $ vlan request_ip = true;完毕 ;
#ADD VM到保护域
NCLI保护域保护名称= $ domain vm-names = $名称&&
#VM上的力量
ACLI vm.on $ name
提前致谢
最好的答案Galad2003
I used the following command:<\/p>
acli vm.disk_update $name disk_addr=\"sata.0\" clone_from_image=\"AutoUnattend.iso\"<\/code><\/pre>I created an ISO with my Answer file in the root and uploaded the image to Prism. Make sure it is called \u201cunattend\u201d. I could have sworn Windows required it to be named AutoUnattend.xml but that didn\u2019t work until I changed the name.<\/p>
So this will work like the GUI where you can upload an Answer file when creating a VM but without using a GUI because yuck.<\/p>
I could also put the answer file in my image and have it run that way but 1. If I update my answer file I have to update my image. 2. I can use different answer files with the image.<\/p>
My next step may be to get this loop for more than 1 VM and\/or create them from a CSV (not sure if that will be possible).<\/p>","className":"post__content__best_answer"}">