Need a way to set cross_az_attach in nova.conf

Bug #1899084 reported by Vern Hart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Nova Cloud Controller Charm
Fix Released
Medium
Billy Olsen
OpenStack Nova Compute Charm
Fix Released
Medium
Billy Olsen

Bug Description

We have a deployment with multiple availability zones and we want to ensure that volumes attached to instances come from the same zone. There is a nova.conf directive, cross_az_attach, which, if false, requires volumes to be in the same az as the instance. More importantly, when nova boots from volume where the source is an image, then nova will attempt to create the volume in the same availability zone.

Unfortunately, we can't use config-flags for this because cross_az_attach is in the [cinder] section of nova.conf.

Revision history for this message
Nobuto Murata (nobuto) wrote :

https://jaas.ai/nova-cloud-controller#charm-config-cross-az-attach

Do you actually need it to nova-compute as well?

Revision history for this message
Vern Hart (vern) wrote :

Yes, this needs to be in nova.conf on computes as well. We already had cross_az_attach=false in nova-cloud-controller. When cross_az_attach=false is in nova.conf on compute node, we see error messages that tell us it's trying to create the volume in the same zone:

  nova.exception.BuildAbortException: Build of instance 850f7e99-5111-4d80-9e75-dabb3b20d80b aborted: Invalid input received: Availability zone \'zone2\' is invalid. (HTTP 400)

When cross_az_attach is missing (default is true) from the nova.conf on the compute we get errors that show it's trying to use volumes from the default backend (which is zone1), which will fail in this environment.

Revision history for this message
Nobuto Murata (nobuto) wrote :

Sounds like you are testing this new behavior in Ussuri?

https://opendev.org/openstack/nova/commit/07a24dcef7ce6767b4b5bab0c8d3166cbe5b39c0
> * `Bug 1694844 <https://bugs.launchpad.net/nova/+bug/1694844>`_. This is
> fixed in the 21.0.0 (Ussuri) release by using the volume zone for the
> server being created if the server is created without an explicit zone,
> :oslo.config:option:`default_schedule_zone` is None, and the volume zone
> does not match the value of
> :oslo.config:option:`default_availability_zone`.

Revision history for this message
Vern Hart (vern) wrote :

Perhaps this should be something that comes from nova-cloud-controller relation?

Revision history for this message
Vern Hart (vern) wrote :

Nobuto: If I understand that commit, that's for the scenario where you are not specifying a zone for the nova instance. We are always explicitly setting the zone for new VMs so this wouldn't apply to us. Additionally, this deployment is using train so that commit doesn't exist here.

Changed in charm-nova-compute:
status: New → Triaged
Changed in charm-nova-cloud-controller:
status: New → Triaged
importance: Undecided → Medium
Changed in charm-nova-compute:
importance: Undecided → Medium
Changed in charm-nova-cloud-controller:
assignee: nobody → Billy Olsen (billy-olsen)
Changed in charm-nova-compute:
assignee: nobody → Billy Olsen (billy-olsen)
Changed in charm-nova-cloud-controller:
milestone: none → 21.04
Changed in charm-nova-compute:
milestone: none → 21.04
Changed in charm-nova-cloud-controller:
status: Triaged → In Progress
Changed in charm-nova-compute:
status: Triaged → In Progress
Revision history for this message
Billy Olsen (billy-olsen) wrote :
Changed in charm-nova-compute:
milestone: 21.04 → none
Changed in charm-nova-cloud-controller:
milestone: 21.04 → none
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/+/786090
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/198c9e7d6e7197bc26198737124df7a658b8df56
Submitter: "Zuul (22348)"
Branch: master

commit 198c9e7d6e7197bc26198737124df7a658b8df56
Author: Billy Olsen <email address hidden>
Date: Tue Apr 13 11:38:56 2021 -0700

    Set cross_az_attach setting on cloud-compute relation

    Communicate to compute services the cross_az_attach config setting.
    Since the cross_az_attach setting needs to be applied at the compute
    node, update the relation settings to specify the cross_az_attach
    policy configured.

    Change-Id: I71e97453453d5d091449caf547e68c6455d091cf
    Closes-Bug: #1899084

Changed in charm-nova-cloud-controller:
status: In Progress → Fix Committed
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/+/786091
Committed: https://opendev.org/openstack/charm-nova-compute/commit/17e44e12e328922ec9e488ff29212e3e5cc94da6
Submitter: "Zuul (22348)"
Branch: master

commit 17e44e12e328922ec9e488ff29212e3e5cc94da6
Author: Billy Olsen <email address hidden>
Date: Tue Apr 13 11:41:46 2021 -0700

    Set cross_az_attach mode from ncc relation configuration

    The cross_az_attach property needs to be configured on the compute
    nodes. The policy is set on the ncc service and is propigated to the
    compute nodes on the cloud-compute relation. Update the relevant cinder
    config setting based on the value provided.

    Note, the default value for cross_az_attach is aligned with the nova
    default of True.

    Closes-Bug: #1899084
    Change-Id: I7d00b50acbfe05dfd943a3511126b507fc570aeb

Changed in charm-nova-compute:
status: In Progress → Fix Committed
Changed in charm-nova-compute:
milestone: none → 21.10
Changed in charm-nova-cloud-controller:
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.

Other bug subscribers

Remote bug watches

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