<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR-CA link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi guys,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-CA> I was trying to PXE boot a guest for quite some time now and I think I’ve found a solution that is kind of hackish but pretty simple. I’m not quite sure it’s good to go in trunk but felt like I’d share it since I’ve been messing a while on this. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>If anybody have a better solution, I would really like to hear/see/try it … <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>Here is how I did it:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>First, patch the libvirt/driver.py file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>--- /usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py.orig 2013-05-10 16:25:17.787862177 +0000<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>+++ /usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py 2013-05-10 16:26:39.442022870 +0000<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>@@ -87,6 +87,9 @@<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>LOG = logging.getLogger(__name__)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>libvirt_opts = [<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>+ cfg.StrOpt('default_guest_boot_dev',<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>+ default='hd',<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>+ help='Sets the default guest boot device'),<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA> cfg.StrOpt('rescue_image_id',<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA> default=None,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA> help='Rescue ami image'),<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>@@ -1792,7 +1795,7 @@<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA> instance['name'],<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA> "ramdisk")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA> else:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>- guest.os_boot_dev = "hd"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>+ guest.os_boot_dev = FLAGS.default_guest_boot_dev<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA> if FLAGS.libvirt_type != "lxc" and FLAGS.libvirt_type != "uml":<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA> guest.acpi = True<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>And add to nova.conf:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>default_guest_boot_dev=network<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>And finally add to /etc/dnsmasq.conf<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>dhcp-boot=boot\x86\pxelinux.com,host_name,host_ip<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA>dhcp-no-override<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>And restart dnsmasq.conf<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>In my actual setup, the guest will PXE boot, show the menu 60 seconds and then boot from hard disk after the 60 seconds timeout.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>Thank you very much,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-CA><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-CA>Dave<o:p></o:p></span></p></div></body></html>