Xenpvnetboot: Difference between revisions

From Xen
Jump to navigationJump to search
(Fixed typos)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=A network bootloader for Xen PV guests.=
= xenpvnetboot =
A network bootloader for Xen PV guests.


'''xenpvnetboot''' supports getting boot images from the following locations:
'''xenpvnetboot''' supports getting boot images from the following locations:


<pre>
- http://host/path
- https://host/path
- http://host/path
- ftp://host/path
- https://host/path
- file:///path
- ftp://host/path
- tftp://host/path
- file:///path
- nfs:host:/path
- tftp://host/path
- /path
- nfs:host:/path
- /path/file.iso
- /path
- /path/filesystem.img
- /path/file.iso
- /path/filesystem.img
- /dev/sda1
- /dev/sda1
- nfs+iso:host:/path/file.iso
- nfs+iso:host:/path/filesystem.img
- nfs+iso:host:/path/file.iso
- nfs+iso:host:/path/filesystem.img
</pre>


To use it, set xenpvnetboot as bootloader in the VM config file:
To use it, set xenpvnetboot as bootloader in the VM config file:


<pre>
bootloader = '/usr/bin/xenpvnetboot'
bootloader = 'xenpvnetboot'
</pre>


To get boot images from various locations, set the right bootloader arguments:
To get boot images from various locations, set the right bootloader arguments:


<pre>
bootloarder_args = ['--location=http://192.168.0.1/fedora/x86_64']
bootloarder_args = ['--location=ftp://192.168.0.1/fedora/x86_64']
bootloader_args = ['--location=http://192.168.0.1/fedora/x86_64']
bootloarder_args = ['--location=file:///fedora/x86_64']
bootloader_args = ['--location=ftp://192.168.0.1/fedora/x86_64']
bootloarder_args = ['--location=tftp://192.168.0.1/fedora/x86_64']
bootloader_args = ['--location=file:///fedora/x86_64']
bootloarder_args = ['--location=/fedora/x86_64']
bootloader_args = ['--location=tftp://192.168.0.1/fedora/x86_64']
bootloarder_args = ['--location=/fedora/Fedora-16-x86_64-DVD.iso']
bootloader_args = ['--location=/fedora/x86_64']
bootloarder_args = ['--location=nfs:192.168.0.1:/fedora/x86_64']
bootloader_args = ['--location=/fedora/Fedora-16-x86_64-DVD.iso']
bootloarder_args = ['--location=nfs+iso:192.168.0.1:/fedora/Fedora-16-x86_64-DVD.iso']
bootloader_args = ['--location=nfs:192.168.0.1:/fedora/x86_64']
bootloader_args = ['--location=nfs+iso:192.168.0.1:/fedora/Fedora-16-x86_64-DVD.iso']
</pre>


You can use '''kernel''' and '''ramdisk''' in the VM config file to specify the relative path of the boot kernel and ramdisk: xenpvnetboot will join them with '''--location''' to find them:
You can use '''kernel''' and '''ramdisk''' in the VM config file to specify the relative path of the boot kernel and ramdisk: xenpvnetboot will join them with '''--location''' to find them:


<pre>
kernel = 'images/pxeboot/vmlinuz'
kernel = 'images/pxeboot/vmlinuz'
ramdisk = 'images/pxeboot/initrd.img'
ramdisk = 'images/pxeboot/initrd.img'
Line 41: Line 47:
ramdisk = 'fedora/x86_64/images/pxeboot/initrd.img'
ramdisk = 'fedora/x86_64/images/pxeboot/initrd.img'
bootloarder_args = ['--location=http://192.168.0.1/']
bootloarder_args = ['--location=http://192.168.0.1/']
</pre>


You can also omit the --location option and specify the full URL for kernel
You can also omit the '''--location''' option and specify the full URL for '''kernel''' and '''ramdisk''' directly:
and ramdisk directly:


<pre>
kernel = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/vmlinuz'
kernel = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/vmlinuz'
ramdisk = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/initrd.img'
ramdisk = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/initrd.img'
</pre>


These 4 ways are equivalent:
If only --location is specified and kernel and ramdisk are not specified,
xenpvnetboot will search the following default paths under location for boot images:


<pre>
bootloader_args = ['--location', 'http://192.168.0.1/']
kernel = 'OL6/images/pxeboot/vmlinuz'
ramdisk = 'OL6/images/pxeboot/initrd.img'
----
bootloader_args = ['--location', 'http://192.168.0.1/OL6']
kernel = 'images/pxeboot/vmlinuz'
ramdisk = 'images/pxeboot/initrd.img'
----
kernel = 'http://192.168.0.1/OL6/images/pxeboot/vmlinuz'
ramdisk = 'http://192.168.0.1/OL6/images/pxeboot/initrd.img'
----
bootloader_args = ['--location', 'http://192.168.0.1/OL6',
'--kernel', 'images/pxeboot/vmlinuz',
'--ramdisk', 'images/pxeboot/initrd.img']
</pre>
If only '''--location''' is specified and '''kernel''' and '''ramdisk''' are not specified, xenpvnetboot will search the following default paths under location for boot images:

<pre>
('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
Line 57: Line 90:
('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6
('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6
</pre>

'''xenpvnetboot''' requires python module [http://urlgrabber.baseurl.org urlgrabber].

=Common problems=


By default, the Xen Project software tries to write the bootloader files into "/run/". This size of this partition is determined by the RAM size of dom0. In some cases this partition has not enough space to allocate kernel and ramdisk files. In this cases you can specify another directory with the following option:
'''xenpvnetboot''' requires the python module [http://urlgrabber.baseurl.org urlgrabber].


<pre>
--output-directory=OUTPUT_DIRECTORY
</pre>
[[Category:Xen]]
[[Category:Xen]]
[[Category:Users]]
[[Category:Users]]

Latest revision as of 15:57, 6 August 2018

A network bootloader for Xen PV guests.

xenpvnetboot supports getting boot images from the following locations:

    - http://host/path
    - https://host/path
    - ftp://host/path
    - file:///path
    - tftp://host/path
    - nfs:host:/path
    - /path
    - /path/file.iso
    - /path/filesystem.img
    - /dev/sda1
    - nfs+iso:host:/path/file.iso
    - nfs+iso:host:/path/filesystem.img

To use it, set xenpvnetboot as bootloader in the VM config file:

    bootloader = 'xenpvnetboot'

To get boot images from various locations, set the right bootloader arguments:

    bootloader_args = ['--location=http://192.168.0.1/fedora/x86_64']
    bootloader_args = ['--location=ftp://192.168.0.1/fedora/x86_64']
    bootloader_args = ['--location=file:///fedora/x86_64']
    bootloader_args = ['--location=tftp://192.168.0.1/fedora/x86_64']
    bootloader_args = ['--location=/fedora/x86_64']
    bootloader_args = ['--location=/fedora/Fedora-16-x86_64-DVD.iso']
    bootloader_args = ['--location=nfs:192.168.0.1:/fedora/x86_64']
    bootloader_args = ['--location=nfs+iso:192.168.0.1:/fedora/Fedora-16-x86_64-DVD.iso']

You can use kernel and ramdisk in the VM config file to specify the relative path of the boot kernel and ramdisk: xenpvnetboot will join them with --location to find them:

    kernel = 'images/pxeboot/vmlinuz'
    ramdisk = 'images/pxeboot/initrd.img'
    bootloarder_args = ['--location=http://192.168.0.1/fedora/x86_64']

    kernel = 'fedora/x86_64/images/pxeboot/vmlinuz'
    ramdisk = 'fedora/x86_64/images/pxeboot/initrd.img'
    bootloarder_args = ['--location=http://192.168.0.1/']

You can also omit the --location option and specify the full URL for kernel and ramdisk directly:

    kernel = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/vmlinuz'
    ramdisk = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/initrd.img'

These 4 ways are equivalent:

   bootloader_args = ['--location', 'http://192.168.0.1/']
   kernel = 'OL6/images/pxeboot/vmlinuz'
   ramdisk = 'OL6/images/pxeboot/initrd.img'
  
   ----
  
   bootloader_args = ['--location', 'http://192.168.0.1/OL6']
   kernel = 'images/pxeboot/vmlinuz'
   ramdisk = 'images/pxeboot/initrd.img'
  
   ----
  
   kernel = 'http://192.168.0.1/OL6/images/pxeboot/vmlinuz'
   ramdisk = 'http://192.168.0.1/OL6/images/pxeboot/initrd.img'
  
   ----
  
   bootloader_args = ['--location', 'http://192.168.0.1/OL6',
                      '--kernel', 'images/pxeboot/vmlinuz',
                      '--ramdisk', 'images/pxeboot/initrd.img']

If only --location is specified and kernel and ramdisk are not specified, xenpvnetboot will search the following default paths under location for boot images:

    ('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
    ('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
    ('boot/x86_64/vmlinuz-xen', 'boot/x86_64/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
    ('current/images/netboot/xen/vmlinuz', 'current/images/netboot/xen/initrd.gz'), # Debian
    ('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
    ('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6

xenpvnetboot requires python module urlgrabber.

Common problems

By default, the Xen Project software tries to write the bootloader files into "/run/". This size of this partition is determined by the RAM size of dom0. In some cases this partition has not enough space to allocate kernel and ramdisk files. In this cases you can specify another directory with the following option:

--output-directory=OUTPUT_DIRECTORY