@@ -248,6 +248,8 @@ def parse_args():
248248 parser .add_option ("-c" , "--cdrom" , type = "string" , dest = "cdrom" ,
249249 action = "callback" , callback = cli .check_before_store ,
250250 help = _ ("File to use a virtual CD-ROM device for fully virtualized guests" ))
251+ parser .add_option ("" , "--pxe" , action = "store_true" , dest = "pxe" ,
252+ help = _ ("Boot an installer from the network using the PXE boot protocol" ))
251253 parser .add_option ("" , "--os-type" , type = "string" , dest = "os_type" ,
252254 action = "callback" , callback = cli .check_before_store ,
253255 help = _ ("The OS type for fully virtualized guests, e.g. 'linux', 'unix', 'windows'" ))
@@ -367,15 +369,24 @@ def main():
367369 print >> sys .stderr , _ ("LiveCD installations are not supported for paravirt guests" )
368370 sys .exit (1 )
369371 installer = virtinst .LiveCDInstaller (type = type )
372+ elif options .pxe :
373+ installer = virtinst .PXEInstaller (type = type )
370374 else :
371375 installer = virtinst .DistroInstaller (type = type )
372376
377+ if (options .pxe and options .location ) or (options .location and options .cdrom ) or (options .cdrom and options .pxe ):
378+ print >> sys .stderr , _ ("Only one of --pxe, --location and --cdrom can be used" )
379+ sys .exit (1 )
380+
373381 if hvm :
374382 # Xen only supports CDROM
375383 if type == "xen" :
376384 installer .cdrom = True
377385 guest = virtinst .FullVirtGuest (connection = conn , installer = installer , arch = options .arch )
378386 else :
387+ if options .pxe :
388+ print >> sys .stderr , _ ("Network PXE boot is not support for paravirtualized guests" )
389+ sys .exit (1 )
379390 guest = virtinst .ParaVirtGuest (connection = conn , installer = installer )
380391
381392 # now let's get some of the common questions out of the way
@@ -400,7 +411,8 @@ def main():
400411 get_paravirt_extraargs (options .extra , guest )
401412 continue_inst = False
402413 else :
403- get_fullvirt_cdrom (options .cdrom , options .location , guest )
414+ if not options .pxe :
415+ get_fullvirt_cdrom (options .cdrom , options .location , guest )
404416 if options .noacpi :
405417 guest .features ["acpi" ] = False
406418 if options .noapic :
0 commit comments