summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Mitchell <mmitchell@iweb.com>2016-09-13 22:33:09 -0400
committerMathieu Mitchell <mmitchell@iweb.com>2016-09-27 17:09:10 -0400
commit289b59855ddd388ac895ffde52f4965cd160ace4 (patch)
treeb6372217ae6125155fd2b025ff78823e0bed7346
parenteb3a5ca587cb1b5c14559d68b6cdfceaf79b6775 (diff)
downloadironic-289b59855ddd388ac895ffde52f4965cd160ace4.tar.gz
[install-guide] Import "Appending kernel parameters to boot instances"
Import appending kernel parameters to advanced section. Change-Id: Id688a06ddcdcdfd7dae98e48381f92894825bff8 Partial-bug: #1612278 (cherry picked from commit 240ee8ffc9370e60a194908898738df7077d10ac)
-rw-r--r--doc/source/deploy/install-guide.rst62
-rw-r--r--install-guide/source/advanced.rst2
-rw-r--r--install-guide/source/include/kernel-boot-parameters.rst69
3 files changed, 74 insertions, 59 deletions
diff --git a/doc/source/deploy/install-guide.rst b/doc/source/deploy/install-guide.rst
index 4d74aac2f..6c8614dc6 100644
--- a/doc/source/deploy/install-guide.rst
+++ b/doc/source/deploy/install-guide.rst
@@ -700,66 +700,10 @@ to the Bare Metal service Install Guide.
Appending kernel parameters to boot instances
=============================================
-The Bare Metal service supports passing custom kernel parameters to boot instances to fit
-users' requirements. The way to append the kernel parameters is depending on how to boot instances.
-
-Network boot
-------------
-Currently, the Bare Metal service supports assigning unified kernel parameters to PXE
-booted instances by:
-
-* Modifying the ``[pxe]/pxe_append_params`` configuration option, for example::
-
- [pxe]
-
- pxe_append_params = quiet splash
-
-* Copying a template from shipped templates to another place, for example::
-
- https://git.openstack.org/cgit/openstack/ironic/tree/ironic/drivers/modules/pxe_config.template
-
- Making the modifications and pointing to the custom template via the configuration
- options: ``[pxe]/pxe_config_template`` and ``[pxe]/uefi_pxe_config_template``.
+The `Appending kernel parameters to boot instances`_ section has been moved
+to the Bare Metal service Install Guide.
-Local boot
-----------
-For local boot instances, users can make use of configuration drive
-(see `Enabling the configuration drive (configdrive)`_) to pass a custom
-script to append kernel parameters when creating an instance. This is more
-flexible and can vary per instance.
-Here is an example for grub2 with ubuntu, users can customize it
-to fit their use case:
-
- .. code:: python
-
- #!/usr/bin/env python
- import os
-
- # Default grub2 config file in Ubuntu
- grub_file = '/etc/default/grub'
- # Add parameters here to pass to instance.
- kernel_parameters = ['quiet', 'splash']
- grub_cmd = 'GRUB_CMDLINE_LINUX'
- old_grub_file = grub_file+'~'
- os.rename(grub_file, old_grub_file)
- cmdline_existed = False
- with open(grub_file, 'w') as writer, \
- open(old_grub_file, 'r') as reader:
- for line in reader:
- key = line.split('=')[0]
- if key == grub_cmd:
- #If there is already some value:
- if line.strip()[-1] == '"':
- line = line.strip()[:-1] + ' ' + ' '.join(kernel_parameters) + '"'
- cmdline_existed = True
- writer.write(line)
- if not cmdline_existed:
- line = grub_cmd + '=' + '"' + ' '.join(kernel_parameters) + '"'
- writer.write(line)
-
- os.remove(old_grub_file)
- os.system('update-grub')
- os.system('reboot')
+.. _`Appending kernel parameters to boot instances`: http://docs.openstack.org/project-install-guide/baremetal/draft/advanced.html#appending-kernel-parameters-to-boot-instances
.. _BuildingDeployRamdisk:
diff --git a/install-guide/source/advanced.rst b/install-guide/source/advanced.rst
index bba9796f3..de74fefdb 100644
--- a/install-guide/source/advanced.rst
+++ b/install-guide/source/advanced.rst
@@ -6,3 +6,5 @@ Advanced features
.. include:: include/local-boot-partition-images.rst
.. include:: include/root-device-hints.rst
+
+.. include:: include/kernel-boot-parameters.rst
diff --git a/install-guide/source/include/kernel-boot-parameters.rst b/install-guide/source/include/kernel-boot-parameters.rst
new file mode 100644
index 000000000..f6b6a5344
--- /dev/null
+++ b/install-guide/source/include/kernel-boot-parameters.rst
@@ -0,0 +1,69 @@
+.. _kernel-boot-parameters:
+
+Appending kernel parameters to boot instances
+---------------------------------------------
+
+The Bare Metal service supports passing custom kernel parameters to boot instances to fit
+users' requirements. The way to append the kernel parameters is depending on how to boot instances.
+
+
+Network boot
+============
+
+Currently, the Bare Metal service supports assigning unified kernel parameters to PXE
+booted instances by:
+
+* Modifying the ``[pxe]/pxe_append_params`` configuration option, for example::
+
+ [pxe]
+
+ pxe_append_params = quiet splash
+
+* Copying a template from shipped templates to another place, for example::
+
+ https://git.openstack.org/cgit/openstack/ironic/tree/ironic/drivers/modules/pxe_config.template
+
+ Making the modifications and pointing to the custom template via the configuration
+ options: ``[pxe]/pxe_config_template`` and ``[pxe]/uefi_pxe_config_template``.
+
+
+Local boot
+==========
+
+For local boot instances, users can make use of configuration drive
+(see :ref:`configdrive`) to pass a custom
+script to append kernel parameters when creating an instance. This is more
+flexible and can vary per instance.
+Here is an example for grub2 with ubuntu, users can customize it
+to fit their use case:
+
+ .. code:: python
+
+ #!/usr/bin/env python
+ import os
+
+ # Default grub2 config file in Ubuntu
+ grub_file = '/etc/default/grub'
+ # Add parameters here to pass to instance.
+ kernel_parameters = ['quiet', 'splash']
+ grub_cmd = 'GRUB_CMDLINE_LINUX'
+ old_grub_file = grub_file+'~'
+ os.rename(grub_file, old_grub_file)
+ cmdline_existed = False
+ with open(grub_file, 'w') as writer, \
+ open(old_grub_file, 'r') as reader:
+ for line in reader:
+ key = line.split('=')[0]
+ if key == grub_cmd:
+ #If there is already some value:
+ if line.strip()[-1] == '"':
+ line = line.strip()[:-1] + ' ' + ' '.join(kernel_parameters) + '"'
+ cmdline_existed = True
+ writer.write(line)
+ if not cmdline_existed:
+ line = grub_cmd + '=' + '"' + ' '.join(kernel_parameters) + '"'
+ writer.write(line)
+
+ os.remove(old_grub_file)
+ os.system('update-grub')
+ os.system('reboot')