2

World! Could smb, please, help me with the following problem: I need to change boot options in input.xml file for a virtual machine FOO to boot (any time) from hdd. Are there any mistakes, will that work? Should I add smth to output.xml? (input.xml)

<domain type='qemu' >
  <name>FOO</name>
  <os>
    <type>hvm</type>
    <kernel>/var/lib/qemu/install/vmlinuz</kernel>
    <initrd>/var/lib/qemu/install/initrd</initrd>
    <cmdline> kickstart=http://example.com/myguest.ks </cmdline>
  </os>
  <memory>131072</memory>
  <vcpu>1</vcpu>
  <devices>
    <disk type='file'>
      <source file='/var/lib/qemu/images/FOO.img'/>
      <target dev='hda'/>
    </disk>
   </devices>
</domain> 

(output.xml)

<domain type='qemu' >
  <name>FOO</name>
  <os>
    <type>hvm</type>
    <boot dev='hd'/>
  </os>
  <memory>131072</memory>
  <vcpu>1</vcpu>
  <devices>
    <disk type='file'>
      <source file='/var/lib/qemu/images/FOO.img'/>
      <target dev='hda'/>
    </disk>
  </devices>
</domain>
  • 1
    Please note that the words "somebody" and "something" contain vowels. – pamphlet Oct 21 '13 at 20:23
  • What a marvellous note! Thank you for a valuable info. – user2904593 Oct 21 '13 at 21:51
  • I would like to know the correct answer to your question too, because I have written the script with exactly same transformation, but for some reasons it has just been rejected by the Contest system :) – Vitaly Isaev Oct 21 '13 at 22:47
  • ))) As I know, many people`ve written smth like that (as google says))) and they had similar problems. – user2904593 Oct 21 '13 at 23:24
  • The question is pretty unclear. From what I see this should work. Are you asking because for you that doesn't? Is the question still relevant? – nert Jan 04 '16 at 15:16

1 Answers1

0

What is described in the post should work just fine - simply deleting the kernel/initrd XML elements and setting the boot element instead is normal practice. In fact that is the exact way in which virt-install/virt-manager install guests when doing network location installs. They'll first boot the installer using kernel/initrd and then configure the guest to boot off the harddisk on next boot.

DanielB
  • 2,461
  • 1
  • 10
  • 13