OpenStack Nova Scheduler Service
The OpenStack nova-scheduler
service
supports plug-ins to filter which hosts are eligible candidates on
which to schedule a virtual machine. The AppFormixFilter
queries the Contrail Insights Platform to determine if a host is
compliant with the Host Scheduling service-level agreement (SLA).
If a host is not compliant with the SLA policy, then the host is filtered
from the list of eligible hosts.
If the AppFormixFilter
fails to request
SLA status of a host, then the host remains in the eligible pool.
Installation
To use AppFormixFilter
in OpenStack
Nova Scheduler, you must first install the appformix_openstack
package and then modify the configuration in /etc/nova/nova.conf
.
Install appformix_openstack Package
First, on the OpenStack controller host that executes the nova-scheduler
service, install the AppFormix Python
package that contains OpenStack filter scheduler plug-ins:
pip install appformix_openstack-0.6.1-py2-none-any.whl
By default, this command installs the resources in:
/usr/local/lib/python2.7/dist-packages/appformix
To install in a different directory, run the following:
pip install --target <dir>
The directory specified must be part of the PYTHONPATH
environment variable in order for the nova-scheduler
to be able to find the plug-in.
If the OpenStack services are running in containers, the resources should be installed in a directory that is accessible to the Nova containers.
Modify the Nova Configuration File
Then modify the /etc/nova/nova.conf
file. If the OpenStack services are running in containers, make
sure the changes are made in the nova.conf
files in all the Nova containers. Following are instructions for
different OpenStack releases.
For OpenStack Releases Juno to Newton
Add the following lines in the [DEFAULT]
section of /etc/nova/nova.conf
:
# # Configure Contrail Insights Platform URL used by AppFormixFilter. # # If `appformix_controller_url` has HTTPS as its protocol, and the host # has a self-signed certificate, then set `appformix_verify_cert` to # false to ignore verification of the certificate. By default, # `appformix_verify_cert` is True. # # Set 'appformix_api_token' to the value of 'TokenId' from # the file /opt/appformix/etc/appformix_token.rst on the Contrail Insights Platform host. # appformix_controller_url = <base URL, e.g., http://appformix_platform_host:9000/> appformix_verify_cert = False appformix_api_token = <AppFormix token from /opt/appformix/etc/appformix_token.rst> # # Adding AppFormixFilter to `scheduler_available_filters` makes it # available as a choice to configure in `scheduler_default_filters`. # The appformix-openstack Python package must be installed on the host # that executes nova-scheduler service. # The following are sample configuration values for nova-scheduler to # use the FilterScheduler. The key addition is to include # AppFormixFilter in the list of `scheduler_available_filters`. # scheduler_driver_task_period = 60 scheduler_driver = nova.scheduler.filter_scheduler.FilterScheduler scheduler_available_filters = appformix.openstack.nova_filters.AppFormixFilter scheduler_available_filters = nova.scheduler.filters.all_filters scheduler_default_filters = AppFormixFilter, DiskFilter, RetryFilter, CoreFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter
For OpenStack Ocata and Later Releases
Add the following lines in the
[DEFAULT]
section of/etc/nova/nova.conf
:# # Configure Contrail Insights Platform URL used by AppFormixFilter. # # If `appformix_controller_url` has HTTPS as its protocol, and the host # has a self-signed certificate, then set `appformix_verify_cert` to # false to ignore verification of the certificate. By default, # `appformix_verify_cert` is True. # # Set 'appformix_api_token' to the value of 'TokenId' from # the file /opt/appformix/etc/appformix_token.rst on the AppFormix Platform host. # appformix_controller_url = <base URL, e.g., http://appformix_platform_host:9000/> appformix_verify_cert = False appformix_api_token = <AppFormix token from /opt/appformix/etc/appformix_token.rst>
Add the following lines under the
[scheduler]
section:periodic_task_interval = 60 driver = filter_scheduler
Add the following lines under the
[filter_scheduler]
section:# # Adding AppFormixFilter to `available_filters` makes it # available as a choice to configure in `enabled_filters`. # The appformix-openstack Python package must be installed on the host # that executes nova-scheduler service. # The other variables are sample configuration values for nova-scheduler # to use the FilterScheduler. The key addition is to include # AppFormixFilter in the list of `enabled_filters`. # available_filters = nova.scheduler.filters.all_filters available_filters = appformix.openstack.nova_filters.AppFormixFilter enabled_filters = AppFormixFilter, RetryFilter, AvailabilityZoneFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter
Restart the OpenStack Nova Scheduler Services
Run the following command to restart the Nova Scheduler services:
service nova-scheduler restart
If the OpenStack services are running in containers, restart all of the Nova containers.
Using the Contrail Insights Nova Scheduler Plug-In
The Contrail Insights nova-scheduler
plug-in uses a Scheduling SLA to filter hosts. This SLA is comprised
of user-defined Contrail Insights Alarms. Contrail Insights ships
with a default Scheduling SLA that includes alarms for missed heartbeat,
high CPU load, and high memory usage.
To change the alarms in the Scheduling SLA, do the following:
Select Settings from the list in the top right of the Dashboard, then select SLA Settings > Scheduling.
Figure 1: Settings in DashboardClick Delete Profile to delete the existing profile.
Figure 2: Delete Scheduling ProfileClick Add New Rule and define a new alarm.
Figure 3: Add New Rule in Scheduling ProfileSelect the newly created alarm from the list of available alarms and click Create Profile. You can add several alarms with custom weights to the SLA profile.
Figure 4: Create Profile in Scheduling SLATo see the plug-in in action, generate some load on one of the
nova-compute
hosts so that the Scheduling SLA is violated. Check the status of the SLA from the Alarms page.Figure 5: Violated Scheduling SLA in Alarms pageThen create some new virtual machines and check which host they get scheduled on. The host that is violating the SLA will not have any new virtual machines scheduled on it. This will be enforced until the host starts complying with the SLA.
Troubleshooting
For debugging, enable the verbose
and debug
options in nova.conf
by adding them to the [DEFAULT]
section
in /etc/nova/nova.conf
.
verbose = True debug = True
Then restart the nova-scheduler
service
or all Nova containers. Detailed logs will appear in /var/log/nova/nova.log
.