Pass kickstart file to virtual manager xml file

百般思念 提交于 2019-12-12 23:29:36

问题


I need to pass kickstart file to xml for creating a virtual device using virt-install.

<os>
    <type arch="x86_64" machine="pc-i440fx-xenial">hvm</type>
    <loader>/usr/lib/xen/boot/hvmloader</loader>
    <kernal>/boot/vmlinuz-3.10.0-327.el7.x86_64</kernal>
    <initrd>/boot/initrd.img-4.4.0-59-generic</initrd>
    <cmdline>ks=http://ipaddr/try.cfg ip=ip netmask=255.255.255.0</cmdline>
    <bootmenu enable="yes" />
</os>

Is this the right way? I followed the steps given in this tutorial. But I get the following error:

File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1029, in create

if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self) libvirt.libvirtError: unable to stat:

/boot/vmlinuz-3.10.0-327.el7.x86_64: No such file or directory


回答1:


The overall syntax you've used is correct, but you've got some mistakes in the data you've provided. In particular you've provided a kernel image for the <initrd> option - that should be pointing to an initrd image. Also, you generally won't want to be using the kernel+initrd from your host OS /boot directory at all. Rather you'd want to get the kernel+initrd for the OS installer. If you were trying to install Fedora in your guest, you'd grab the files from

http://dl.fedoraproject.org/pub/fedora/linux/releases/25/Server/x86_64/os/images/pxeboot/

and put them in /var/lib/libvirt/images/ and point your XML to those.



来源:https://stackoverflow.com/questions/41631063/pass-kickstart-file-to-virtual-manager-xml-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!