Skip to content

Commit 2e86f7a

Browse files
committed
added flavor configuration for GPU in project_config
changed subsubsection characters to more conventional ones
1 parent 91d3e25 commit 2e86f7a

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

source/gpus_in_openstack.rst

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Hypervisor Configuration Requirements
2121
-------------------------------------
2222

2323
Find the GPU device IDs
24-
~~~~~~~~~~~~~~~~~~~~~~~
24+
^^^^^^^^^^^^^^^^^^^^^^^
2525

2626
From the host OS, use ``lspci -nn`` to find the PCI vendor ID and
2727
device ID for the GPU device and supporting components. These are
@@ -52,7 +52,7 @@ Alternatively, for an Nvidia Quadro RTX 6000:
5252
These parameters will be used for device-specific configuration.
5353

5454
Kernel Ramdisk Reconfiguration
55-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5656

5757
The ramdisk loaded during kernel boot can be extended to include the
5858
vfio PCI drivers and ensure they are loaded early in system boot.
@@ -85,7 +85,7 @@ The handler for regenerating the Dracut initramfs is:
8585
become: true
8686
8787
Kernel Boot Parameters
88-
~~~~~~~~~~~~~~~~~~~~~~
88+
^^^^^^^^^^^^^^^^^^^^^^
8989

9090
Set the following kernel parameters by adding to
9191
``GRUB_CMDLINE_LINUX_DEFAULT`` or ``GRUB_CMDLINE_LINUX`` in
@@ -109,7 +109,7 @@ role from Ansible Galaxy:
109109
- vfio-pci.ids
110110
111111
Kernel Device Management
112-
~~~~~~~~~~~~~~~~~~~~~~~~
112+
^^^^^^^^^^^^^^^^^^^^^^^^
113113

114114
In the hypervisor, we must prevent kernel device initialisation of
115115
the GPU and prevent drivers from loading for binding the GPU in the
@@ -133,7 +133,7 @@ host OS. We do this using ``udev`` rules:
133133
become: true
134134
135135
Kernel Drivers
136-
~~~~~~~~~~~~~~
136+
^^^^^^^^^^^^^^
137137

138138
Prevent the ``nouveau`` kernel driver from loading by
139139
blacklisting the module:
@@ -203,7 +203,7 @@ OpenStack Nova configuration
203203
----------------------------
204204

205205
Configure nova-scheduler
206-
~~~~~~~~~~~~~~~~~~~~~~~~
206+
^^^^^^^^^^^^^^^^^^^^^^^^
207207

208208
The nova-scheduler service must be configured to enable the ``PciPassthroughFilter``
209209
To enable it add it to the list of filters to Kolla-Ansible configuration file:
@@ -216,7 +216,7 @@ To enable it add it to the list of filters to Kolla-Ansible configuration file:
216216
enabled_filters = AvailabilityZoneFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter
217217
218218
Configure nova-compute
219-
~~~~~~~~~~~~~~~~~~~~~~
219+
^^^^^^^^^^^^^^^^^^^^^^
220220

221221
Configuration can be applied in flexible ways using Kolla-Ansible's
222222
methods for `inventory-driven customisation of configuration
@@ -248,7 +248,7 @@ Again, the 4-digit PCI Vendor ID and Device ID extracted from ``lspci
248248
{% endraw %}
249249
250250
Configure nova-api
251-
~~~~~~~~~~~~~~~~~~
251+
^^^^^^^^^^^^^^^^^^
252252

253253
pci.alias also needs to be configured on the controller.
254254
This configuration should match the configuration found on the compute nodes.
@@ -263,23 +263,51 @@ Add it to Kolla-Ansible configuration file:
263263
alias = { "vendor_id":"10de", "product_id":"15f8", "device_type":"type-PCI", "name":"gpu-p100" }
264264
265265
Reconfigure nova service
266-
~~~~~~~~~~~~~~~~~~~~~~~~
266+
^^^^^^^^^^^^^^^^^^^^^^^^
267267

268268
.. code-block:: text
269269
270270
kayobe overcloud service reconfigure -kt nova --kolla-skip-tags common --skip-precheck
271271
272272
Configure a flavor
273-
~~~~~~~~~~~~~~~~~~
273+
^^^^^^^^^^^^^^^^^^
274+
274275
For example, to request two of the GPUs with alias gpu-p100
275276

276277
.. code-block:: text
277278
278279
openstack flavor set m1.medium --property "pci_passthrough:alias"="gpu-p100:2"
279280
280281
282+
This can be also defined in the |project_config| repository:
283+
|project_config_source_url|
284+
285+
add extra_specs to flavor in etc/|project_config|/|project_config|.yml:
286+
287+
.. code-block:: console
288+
:substitutions:
289+
290+
admin# cd |base_path|/src/|project_config|
291+
admin# vim etc/|project_config|/|project_config|.yml
292+
293+
name: "m1.medium"
294+
ram: 4096
295+
disk: 40
296+
vcpus: 2
297+
extra_specs:
298+
"pci_passthrough:alias": "gpu-p100:2"
299+
300+
Invoke configuration playbooks afterwards:
301+
302+
.. code-block:: console
303+
:substitutions:
304+
305+
admin# source |base_path|/src/|kayobe_config|/etc/kolla/public-openrc.sh
306+
admin# source |base_path|/venvs/|project_config|/bin/activate
307+
admin# tools/|project_config| --vault-password-file |vault_password_file_path|
308+
281309
Create instance with GPU passthrough
282-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
283311

284312
.. code-block:: text
285313

0 commit comments

Comments
 (0)