2017-05-02 18:29:15 +02:00
|
|
|
Configure the Compute service to use the Bare Metal service
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2016-09-07 08:39:28 -04:00
|
|
|
|
2016-09-13 07:52:14 -04:00
|
|
|
The Compute service needs to be configured to use the Bare Metal service's
|
2017-07-24 13:53:10 +01:00
|
|
|
driver. The configuration file for the Compute service is typically located at
|
2016-09-13 07:52:14 -04:00
|
|
|
``/etc/nova/nova.conf``.
|
2016-09-07 08:39:28 -04:00
|
|
|
|
2016-09-13 07:52:14 -04:00
|
|
|
.. note::
|
2017-07-24 13:53:10 +01:00
|
|
|
|
|
|
|
As of the Newton release, it is possible to have multiple
|
|
|
|
nova-compute services running the ironic virtual driver (in
|
|
|
|
nova) to provide redundancy. Bare metal nodes are mapped to the
|
|
|
|
services via a hash ring. If a service goes down, the
|
|
|
|
available bare metal nodes are remapped to different services.
|
|
|
|
|
|
|
|
Once active, a node will stay mapped to the same nova-compute
|
|
|
|
even when it goes down. The node is unable to be managed through
|
|
|
|
the Compute API until the service responsible returns to an active
|
|
|
|
state.
|
|
|
|
|
|
|
|
The following configuration file must be modified on the Compute
|
|
|
|
service's controller nodes and compute nodes.
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-24 17:59:52 +02:00
|
|
|
#. Change these configuration options in the Compute service configuration
|
|
|
|
file (for example, ``/etc/nova/nova.conf``):
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
[default]
|
|
|
|
|
2017-08-24 17:59:52 +02:00
|
|
|
# Defines which driver to use for controlling virtualization.
|
|
|
|
# Enable the ironic virt driver for this compute instance.
|
2017-08-25 09:22:39 -04:00
|
|
|
compute_driver=ironic.IronicDriver
|
|
|
|
|
2017-08-24 17:59:52 +02:00
|
|
|
# Amount of memory in MB to reserve for the host so that it is always
|
|
|
|
# available to host processes.
|
|
|
|
# It is impossible to reserve any memory on bare metal nodes, so set
|
|
|
|
# this to zero.
|
2017-08-25 09:22:39 -04:00
|
|
|
reserved_host_memory_mb=0
|
|
|
|
|
2017-08-24 17:59:52 +02:00
|
|
|
[filter_scheduler]
|
2017-08-25 09:22:39 -04:00
|
|
|
|
2017-08-24 17:59:52 +02:00
|
|
|
# Enables querying of individual hosts for instance information.
|
|
|
|
# Not possible for bare metal nodes, so set it to False.
|
|
|
|
track_instance_changes=False
|
2017-08-25 09:22:39 -04:00
|
|
|
|
2017-09-08 16:44:24 +02:00
|
|
|
[scheduler]
|
|
|
|
|
|
|
|
# This value controls how often (in seconds) the scheduler should
|
|
|
|
# attempt to discover new hosts that have been added to cells.
|
|
|
|
# If negative (the default), no automatic discovery will occur.
|
|
|
|
# As each bare metal node is represented by a separate host, it has
|
|
|
|
# to be discovered before the Compute service can deploy on it.
|
|
|
|
# The value here has to be carefully chosen based on a compromise
|
|
|
|
# between the enrollment speed and the load on the Compute scheduler.
|
|
|
|
# The recommended value of 2 minutes matches how often the Compute
|
|
|
|
# service polls the Bare Metal service for node information.
|
|
|
|
discover_hosts_in_cells_interval=120
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
The alternative to setting the ``discover_hosts_in_cells_interval``
|
|
|
|
option is to run the following command on any Compute controller node
|
|
|
|
after each node is enrolled::
|
|
|
|
|
2018-05-02 08:28:23 -04:00
|
|
|
nova-manage cell_v2 discover_hosts --by-service
|
2017-08-24 17:59:52 +02:00
|
|
|
|
2018-01-16 18:31:33 +02:00
|
|
|
#. Consider enabling the following option on controller nodes:
|
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
[filter_scheduler]
|
|
|
|
|
|
|
|
# Enabling this option is beneficial as it reduces re-scheduling events
|
|
|
|
# for ironic nodes when scheduling is based on resource classes,
|
|
|
|
# especially for mixed hypervisor case with host_subset_size = 1.
|
|
|
|
# However enabling it will also make packing of VMs on hypervisors
|
|
|
|
# less dense even when scheduling weights are completely disabled.
|
|
|
|
#shuffle_best_same_weighed_hosts = false
|
|
|
|
|
|
|
|
|
2017-08-24 17:59:52 +02:00
|
|
|
#. Carefully consider the following option:
|
|
|
|
|
|
|
|
.. code-block:: ini
|
2017-08-25 09:22:39 -04:00
|
|
|
|
2017-08-24 17:59:52 +02:00
|
|
|
[compute]
|
|
|
|
|
|
|
|
# This option will cause nova-compute to set itself to a disabled state
|
|
|
|
# if a certain number of consecutive build failures occur. This will
|
|
|
|
# prevent the scheduler from continuing to send builds to a compute
|
|
|
|
# service that is consistently failing. In the case of bare metal
|
|
|
|
# provisioning, however, a compute service is rarely the cause of build
|
|
|
|
# failures. Furthermore, bare metal nodes, managed by a disabled
|
|
|
|
# compute service, will be remapped to a different one. That may cause
|
|
|
|
# the second compute service to also be disabled, and so on, until no
|
|
|
|
# compute services are active.
|
|
|
|
# If this is not the desired behavior, consider increasing this value or
|
|
|
|
# setting it to 0 to disable this behavior completely.
|
|
|
|
#consecutive_build_service_disable_threshold = 10
|
|
|
|
|
2016-09-13 07:52:14 -04:00
|
|
|
#. Change these configuration options in the ``ironic`` section.
|
|
|
|
Replace:
|
|
|
|
|
|
|
|
- ``IRONIC_PASSWORD`` with the password you chose for the ``ironic``
|
|
|
|
user in the Identity Service
|
|
|
|
- ``IRONIC_NODE`` with the hostname or IP address of the ironic-api node
|
|
|
|
- ``IDENTITY_IP`` with the IP of the Identity server
|
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
.. code-block:: ini
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
[ironic]
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
# Ironic authentication type
|
|
|
|
auth_type=password
|
2016-10-04 23:07:55 +00:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
# Keystone API endpoint
|
2018-07-18 17:06:48 +07:00
|
|
|
auth_url=http://IDENTITY_IP:5000/v3
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
# Ironic keystone project name
|
|
|
|
project_name=service
|
2016-10-04 23:07:55 +00:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
# Ironic keystone admin name
|
|
|
|
username=ironic
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
# Ironic keystone admin password
|
|
|
|
password=IRONIC_PASSWORD
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
# Ironic keystone project domain
|
|
|
|
# or set project_domain_id
|
|
|
|
project_domain_name=Default
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
# Ironic keystone user domain
|
|
|
|
# or set user_domain_id
|
|
|
|
user_domain_name=Default
|
2016-09-13 07:52:14 -04:00
|
|
|
|
|
|
|
#. On the Compute service's controller nodes, restart the ``nova-scheduler``
|
|
|
|
process:
|
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
.. code-block:: console
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2021-05-10 08:15:54 +00:00
|
|
|
Fedora/RHEL8/CentOS8/SUSE:
|
2017-08-25 09:22:39 -04:00
|
|
|
sudo systemctl restart openstack-nova-scheduler
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
Ubuntu:
|
|
|
|
sudo service nova-scheduler restart
|
2016-09-13 07:52:14 -04:00
|
|
|
|
|
|
|
#. On the Compute service's compute nodes, restart the ``nova-compute``
|
|
|
|
process:
|
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
.. code-block:: console
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2021-05-10 08:15:54 +00:00
|
|
|
Fedora/RHEL8/CentOS8/SUSE:
|
2017-08-25 09:22:39 -04:00
|
|
|
sudo systemctl restart openstack-nova-compute
|
2016-09-13 07:52:14 -04:00
|
|
|
|
2017-08-25 09:22:39 -04:00
|
|
|
Ubuntu:
|
|
|
|
sudo service nova-compute restart
|