Need to support setting allocation ratios in nova-compute as well as scheduler

Bug #1677223 reported by Edward Hope-Morley
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Nova Cloud Controller Charm
Fix Released
Wishlist
Brett Milford
OpenStack Nova Compute Charm
Fix Released
Wishlist
Brett Milford

Bug Description

From the Liberty release notes:

"Allocation ratios for RAM and CPU are now defined within the nova-compute service (so per compute node). Ratios also need to be provided for the scheduler service. Depending on whether a compute node is running Kilo or Liberty, the allocation ratios will behave differently : if the compute node is running Kilo then the CPU and RAM allocation ratios for that compute node will be the ones defaulted in the controller's nova.conf file.Or, if the compute node is Liberty then you'll be able to set a per-compute allocation ratio for both CPU and RAM. In order to leave the operator providing the allocation ratios to all the compute nodes, the default allocation ratio will be set in nova.conf to 0.0 (even for the controller). That doesn't mean that allocation ratios will actually be 0.0, just that the operator needs to provide those before the next release (ie. Mitaka). To be clear, the default allocation ratios are still 16.0 for cpu_allocation_ratio and 1.5 for ram_allocation_ratio."

To be clear, we do already have the ability to set allocation ratios on the controller/scheduler via th nova-cloud-controller charm but we do not have ability to do so with the nova-compute charm.

Tags: sts
description: updated
James Page (james-page)
Changed in charm-nova-compute:
milestone: 17.05 → 17.08
James Page (james-page)
Changed in charm-nova-compute:
milestone: 17.08 → 17.11
James Page (james-page)
Changed in charm-nova-compute:
status: New → Triaged
importance: Medium → Wishlist
James Page (james-page)
Changed in charm-nova-compute:
milestone: 17.11 → 18.02
Ryan Beisner (1chb1n)
Changed in charm-nova-compute:
milestone: 18.02 → 18.05
James Page (james-page)
Changed in charm-nova-compute:
milestone: 18.05 → 18.08
James Page (james-page)
Changed in charm-nova-compute:
milestone: 18.08 → 18.11
James Page (james-page)
Changed in charm-nova-compute:
milestone: 18.11 → 19.04
David Ames (thedac)
Changed in charm-nova-compute:
milestone: 19.04 → 19.07
David Ames (thedac)
Changed in charm-nova-compute:
milestone: 19.07 → 19.10
David Ames (thedac)
Changed in charm-nova-compute:
milestone: 19.10 → 20.01
summary: - Need to support setting allocation rations in nova-compute as well as
+ Need to support setting allocation ratios in nova-compute as well as
scheduler
James Page (james-page)
Changed in charm-nova-compute:
milestone: 20.01 → 20.05
Revision history for this message
Brett Milford (brettmilford) wrote :
Changed in charm-nova-compute:
assignee: nobody → Brett Milford (brettmilford)
David Ames (thedac)
Changed in charm-nova-compute:
milestone: 20.05 → 20.08
James Page (james-page)
Changed in charm-nova-compute:
milestone: 20.08 → none
Revision history for this message
Edward Hope-Morley (hopem) wrote :

We should pick this back up again. Brett can you please update your patch and resubmit so we can work on the review again?

Changed in charm-nova-compute:
milestone: none → 21.01
David Ames (thedac)
Changed in charm-nova-compute:
milestone: 21.01 → none
Revision history for this message
Brett Milford (brettmilford) wrote :

A note regarding importance:

Allocation ratios are effectively not enforced in new charmed deployments since
Pike. This would result in the default allocation ratio for compute resources
being applied regardless of the juju configuration which is 16.0 for CPU, 1.0 DISK
and 1.5 for RAM.

This is problematic for hyperconverged deployments which rely on this to avoid
overcommit and the problems arising from resource starvation of ancillary
services (particularly colocated Ceph).

To avoid this, the default compute resource allocations need to be amended post
deployment to appropriate values, e.g:

openstack resource provider list # get the $RESOURCE_PROVIDER uuid for a compute resource provider
openstack resource provider inventory set $RESOURCE_PROVIDER --resource VCPU:allocation_ratio=16.0 --amend
openstack resource provider inventory set $RESOURCE_PROVIDER --resource MEMORY_MB:allocation_ratio=1.0 --amend
openstack resource provider inventory set $RESOURCE_PROVIDER --resource DISK_GB:allocation_ratio=1.0 --amend

Revision history for this message
Nobuto Murata (nobuto) wrote :
Changed in charm-nova-cloud-controller:
status: New → In Progress
importance: Undecided → Wishlist
assignee: nobody → Brett Milford (brettmilford)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-compute (master)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-compute/+/717888
Committed: https://opendev.org/openstack/charm-nova-compute/commit/43acdd4f8084f8d3ebf91fc4d6c32919bacf010b
Submitter: "Zuul (22348)"
Branch: master

commit 43acdd4f8084f8d3ebf91fc4d6c32919bacf010b
Author: Brett Milford <email address hidden>
Date: Tue Apr 7 11:00:37 2020 +1000

    Added allocation-ratio config opts

    Nova supports setting allocation ratios at the nova-compute level from
    Liberty onwards. Prior to this allocation ratios were set at the
    nova-scheduler level.

    Newton introduced the Placement API, and Ocata introduced the ability to
    have compute resources (Core/RAM/Disk) precomputed before passing
    candidates to the FilterScheduler [0]. Pike removed CoreFilter,
    RAMFilter and DiskFilter scheduler filters.

    From Pike onwards valid methods for settings these allocation ratios are via:
    - A call to the Placement API [1].
    - Config values to supplied to nova-compute (xxx_allocation_ratio).

    Stein introduced initial_xxx_allocation_ratio in response to the runtime
    behaviour of the ResourceTracker [2].

    Currently, the precedence of resource ratio values are:
    xxx_allocation_ratio > Placement API call > initial_xxx_allocation_ratio

    That is a (compute) resource provider's allocation ratios will default
    to initial_xxx_allocation_ratio which may be overridden at run time by a
    call to the Placement API. If xxx_allocation_ratio is set it will
    override all configurations for that provider.

    When not otherwise configured, we set initial_xxx_allocation_ratio to
    the values provided by ncc to maintain backwards compatibility. Where
    initial_xxx_allocation_ratio is not available we set
    xxx_allocation_ratio.

    [0] https://specs.openstack.org/openstack/nova-specs/specs/ocata/implemented/resource-providers-scheduler-db-filters.html
    [1] https://docs.openstack.org/api-ref/placement/#update-resource-provider-inventories
    [2] https://specs.openstack.org/openstack/nova-specs/specs/stein/implemented/initial-allocation-ratios.html

    Change-Id: Ifa314e9e23e0ae5d16113cd91a7507e61f9de704
    Closes-Bug: #1677223

Changed in charm-nova-compute:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (master)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/792752
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/eeac5fca9665d7d6ddf00db51a62a1272b2d5ea6
Submitter: "Zuul (22348)"
Branch: master

commit eeac5fca9665d7d6ddf00db51a62a1272b2d5ea6
Author: Brett Milford <email address hidden>
Date: Mon May 24 14:09:20 2021 +1000

    Expose *_allocation_ratio config

    This commit exposes allocation ratio configuration via the cloud-compute
    relation for backwards compatiable behaviour of the charms when
    configuration of allocation ratios is delegated to nova-compute.

    Closes-Bug: #1677223
    Change-Id: I5a6bd1fa06d06dfd3e49182cc72ad83025429b13

Changed in charm-nova-cloud-controller:
status: In Progress → Fix Committed
Changed in charm-nova-cloud-controller:
milestone: none → 21.10
Changed in charm-nova-compute:
milestone: none → 21.10
Changed in charm-nova-compute:
status: Fix Committed → Fix Released
Changed in charm-nova-cloud-controller:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.