Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 10. Enabling PCI device tracking in the Placement service
Beyond tracking standard and complex resources like CPUs, RAM, and vGPUs, the Placement service enables the tracking and reservation of PCI devices.
You can reserve PCI devices in the Placement service so that even though they are configured to be available to the Compute service, the Placement service does not make them available for use. Reserving a device makes the device available to an external tool that can perform some maintenance operations or configuration of the device.
If you enable PCI device tracking and then disable it again, the nova-compute service does not start.
When PCI tracking in the Placement service is enabled, you cannot configure pci.alias with a repeated alias name associated to multiple alias specifications.
This feature is only supported for PCI devices consumed via nova flavors. PCI devices intended to be consumed via neutron ports, and therefore having the physical_network defined in the device spec, are not supported but can be used alongside this feature.
10.1. Prerequisites Link kopierenLink in die Zwischenablage kopiert!
- You have enabled PCI Passthrough. For more information, see Configuring PCI passthrough.
10.2. Configuring PCI device tracking for node sets Link kopierenLink in die Zwischenablage kopiert!
You must configure PCI device tracking on all node sets that use PCI passthrough.
You can configure only whole node sets. Reconfiguring a subset of the nodes within a node set is not supported. If you need to reconfigure a subset of nodes within a node set, you must scale the node set down, and create a new node set from the previously removed nodes.
Prerequisites
-
You have the
occommand line tool installed on your workstation. -
You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. -
You have selected the
OpenStackDataPlaneNodeSetCR that defines the nodes for which you want to enable PCI device tracking. For more information about creating anOpenStackDataPlaneNodeSetCR, see Creating the data plane in Deploying Red Hat OpenStack Services on OpenShift.
Procedure
Create or update the
ConfigMapCR namednova-extra-configand set the value of the[pci] report_in_placementparameter:apiVersion: v1 kind: ConfigMap metadata: name: nova-extra-config namespace: openstack data: 37-nova-pci-placement.conf: | [pci] report_in_placement = trueFor more information about creating
ConfigMapobjects, see Creating and using config maps in Nodes.Create a new
OpenStackDataPlaneDeploymentCR to configure the services on the data plane nodes and deploy the data plane, and save it to a file namedcompute_pci_tracking_deploy.yamlon your workstation:apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: compute_pci_trackingFor more information about creating an
OpenStackDataPlaneDeploymentCR, see Deploying the data plane in Deploying Red Hat OpenStack Services on OpenShift.In the
compute_pci_tracking_deploy.yaml, specify nodeSets to include all theOpenStackDataPlaneNodeSetCRs you want to deploy. Ensure that you include theOpenStackDataPlaneNodeSetCR that you selected as a prerequisite. ThatOpenStackDataPlaneNodeSetCR defines the nodes you want to designate for CPU pinning.WarningIf your deployment has more than one node set, changes to the
nova-extra-config.yamlConfigMapmight directly affect more than one node set, depending on how the node sets and theDataPlaneServicesare configured. To check if a node set uses thenova-extra-configConfigMapand therefore will be affected by the reconfiguration, complete the following steps:-
Check the services list of the node set and find the name of the
DataPlaneServicethat points to nova. Ensure that the value of the
edpmServiceTypefield of theDataPlaneServiceis set tonova.If the dataSources list of the
DataPlaneServicecontains a configMapRef namednova-extra-config, then this node set uses thisConfigMapand therefore will be affected by the configuration changes in thisConfigMap. If some of the node sets that are affected should not be reconfigured, you must create a new DataPlaneService pointing to a separateConfigMapfor these node sets.
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: compute-pci_tracking spec: nodeSets: - openstack-edpm - compute-pci-alias - compute-pci_tracking - ... - <nodeSet_name>-
Replace
<nodeSet_name>with the names of theOpenStackDataPlaneNodeSetCRs that you want to include in your data plane deployment.
-
Check the services list of the node set and find the name of the
-
Save the
compute_pci_tracking_deploy.yamldeployment file. Deploy the data plane:
$ oc create -f compute_pci_tracking_deploy.yamlVerify that the data plane is deployed:
$ oc get openstackdataplanenodeset NAME STATUS MESSAGE compute-pci_tracking True DeployedAccess the remote shell for
openstackclientand verify that the deployed Compute nodes are visible on the control plane:$ oc rsh -n openstack openstackclient $ openstack resource provider list
10.3. Enabling PCI device tracking on the control plane Link kopierenLink in die Zwischenablage kopiert!
To enable PCI device tracking, you must update the service configuration in the OpenStackControlPlane CR file, openstack_control_plane.yaml, and apply your update to the control plane.
Prerequisites
-
The
occommand line tool is installed on your workstation. -
You are logged in to Red Hat OpenStack Services on OpenShift (RHOSO) as a user with
cluster-adminprivileges.
Procedure
-
Open your
OpenStackControlPlanecustom resource (CR) file,openstack_control_plane.yaml, on your workstation. Add the following
[filter_scheduler] pci_in_placementconfiguration to thenovaservice configuration:nova: template: apiServiceTemplate: customServiceConfig: | [filter_scheduler] pci_in_placement = true cellTemplates: cell0: conductorServiceTemplate: customServiceConfig: | [filter_scheduler] pci_in_placement = true cell1: conductorServiceTemplate: customServiceConfig: | [filter_scheduler] pci_in_placement = true schedulerServiceTemplate: customServiceConfig: | [filter_scheduler] pci_in_placement = trueNoteIf there are multiple cells, you must apply the
[filter_scheduler] pci_in_placementconfiguration to each cell.Update the control plane:
$ oc apply -f openstack_control_plane.yaml -n openstackWait until RHOCP creates the resources related to the
OpenStackControlPlaneCR. Run the following command to check the status:$ oc get openstackcontrolplane -n openstackThe
OpenStackControlPlaneresources are created when the status is "Setup complete".TipAppend the
-woption to the end of the get command to track deployment progress.Optional: Confirm that the control plane is deployed by reviewing the pods in the openstack namespace for each of your cells:
$ oc get pods -n openstackThe control plane is deployed when all the pods are either completed or running.
10.4. Reserving a PCI device in the Placement service Link kopierenLink in die Zwischenablage kopiert!
To remove a PCI device from the Compute scheduler service, you must use an openstack command to reserve the device in the Placement service and therefore remove it from the Compute scheduler service. While reserved, the Compute service (nova) cannot use the device for virtual machines (VMs).
The device might need to be removed for various reasons, for example, to fix a device or to perform maintenance. After maintenance, you can do the reverse operation to unreserve the device.
Prerequisites
- You have enabled PCI tracking in Placement. For more information, see Enabling PCI device tracking in the Placement service.
Procedure
To reserve a specific device, for example, a device with PCI address 0000:09:00.0 on compute1, you must retrieve the UUID of the device by using the device resource provider (RP) in the command. The device RP is a combination of the hostname of the Compute node and the PCI address of the GPU, for example,
compute1_0000:09:00.0:$ openstack resource provider list --name compute1_0000:09:00.0 +--------------------------------------+-----------------------+------------+--------------------------------------+--------------------------------------+ | uuid | name | generation | root_provider_uuid | parent_provider_uuid | +--------------------------------------+-----------------------+------------+--------------------------------------+--------------------------------------+ | d3d0f3d7-8376-487f-8849-e43027c31582 | compute1_0000:09:00.0 | 2 | e909b54b-4cea-49f9-bfcb-17c833db51d1 | e909b54b-4cea-49f9-bfcb-17c833db51d1 | +--------------------------------------+-----------------------+------------+--------------------------------------+--------------------------------------+Use the
uuidof the device to check the current inventory of the RP. In this example, the UUID isd3d0f3d7-8376-487f-8849-e43027c31582:$ openstack resource provider inventory list d3d0f3d7-8376-487f-8849-e43027c31582 +----------------------+------------------+----------+----------+----------+-----------+-------+------+ | resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total | used | +----------------------+------------------+----------+----------+----------+-----------+-------+------+ | CUSTOM_PCI_8086_10C9 | 1.0 | 1 | 1 | 0 | 1 | 1 | 0 | +----------------------+------------------+----------+----------+----------+-----------+-------+------+NoteWhen you reserve a device, the Compute scheduler service is prevented from using it in future scheduling. However, the device might still be in use by a pre-existing VM. If the value of the
usedcolumn in the inventory list output is set to 0, then the device is not in use by a pre-existing VM.To reserve the device, set the value of
reservedto 1:openstack resource provider inventory set d3d0f3d7-8376-487f-8849-e43027c31582 --amend --resource CUSTOM_PCI_8086_10C9:reserved=1 +----------------------+------------------+----------+----------+----------+-----------+-------+ | resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total | +----------------------+------------------+----------+----------+----------+-----------+-------+ | CUSTOM_PCI_8086_10C9 | 1.0 | 1 | 1 | 1 | 1 | 1 | +----------------------+------------------+----------+----------+----------+-----------+-------+To unreserve the device and make it available to the Compute scheduler service again, set the value of
reservedto 0:openstack resource provider inventory set d3d0f3d7-8376-487f-8849-e43027c31582 --amend --resource CUSTOM_PCI_8086_10C9:reserved=0 +----------------------+------------------+----------+----------+----------+-----------+-------+ | resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total | +----------------------+------------------+----------+----------+----------+-----------+-------+ | CUSTOM_PCI_8086_10C9 | 1.0 | 1 | 1 | 0 | 1 | 1 | +----------------------+------------------+----------+----------+----------+-----------+-------+