qa/suites/krbd: request msgr1 explicitly in unmap subsuite
Since commit 5011cc926cd4 ("qa/suites/krbd: run unmap subsuite with
msgr1 only"), unmap.t is run only against msgr1. pre-single-major.yaml
kernel has actually been gone for some time now, but there is still
value in maintaining a msgr1-only test. With the default switched to
msgr2 in commit a577f6fa405c ("krbd: "rbd device map" command should
use msgr2 by default"), msgr1 needs to be requested explicitly.
pybind: replace deprecated license classifiers with SPDX expression
Replace the deprecated "License :: OSI Approved :: GNU Lesser General
Public License v2 or later (LGPLv2+)" classifier with the SPDX license
expression "LGPL-2.0-or-later" in the license field.
Recent setuptools versions warn that license classifiers are deprecated
in favor of SPDX expressions in the license field. This change eliminates
the deprecation warning while maintaining the same licensing terms.
The warning looked like:
```
[1/1] Generating ../../../lib/cython_modules/lib.3/rados.cpython-313-x86_64-linux-gnu.so
/usr/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
In the EnableRequest state machine, clean up the handling of the async
request to fetch the mirror image, particularly when a non-primary image
is being created by the rbd-mirror daemon.
John Mulligan [Tue, 17 Jun 2025 19:09:20 +0000 (15:09 -0400)]
cephadm: add support for specific network binds to smb service
Add a bunch of code to support specific IP address (and/or interface -
see below) binds for the smb service. When the smb service is not
clustered it is using container networking - in this case we use
publish options for the container manager to only listen on the supplied
addresses.
When the smb service is clustered we need to jump through a bunch of
hoops to configure each service individually. Many are easy with just
a short set of CLI options. CTDB only listens on the (first) node
address that it can bind to and only that. smbd has complex interactions
based on the `interfaces` and `bind interfaces only` config parameters.
Because these parameters may be unique to a node (addresses certainly
will be - and interfaces names could be) we can not store this in
the registry based conf. Instead, we take the slightly hacky approach
of generating a stub conf file with just the interfaces related params
in them and telling sambacc to generate a config that includes this
stub config.
IMPORTANT: When using ctdb with public addresses smbd doesn't know what
additional IPs it may need to listen to, so instead of binding to
a fixed IP we configure it to use an interface. This does have a
downside of possibly listening to another address on the same interface
we don't want it to. Additionally, I have observed that as addresses
are added or removed from the interface by ctdb, smbd doesn't
consistently start listening to those addresses.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 18 Jun 2025 21:18:30 +0000 (17:18 -0400)]
mgr/cephadm: teach ctdb nodes logic about bind_addrs
Within the cephadm smb service class we have logic to help manage CTDB's
nodes. Ensure that this node handling logic also conforms to the recent
addition of the smb service's bind_addrs field.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 16 Jun 2025 20:05:22 +0000 (16:05 -0400)]
mgr/cephadm: add filter_host_candidates method to smb service class
Add a filter_host_candidates method to the smb service class allowing
that class to act as a HostSelector. The HostSelector was added in an
earlier commit to allow classes like this one to make specific host
selections based on unique to that class (or it's spec) criteria.
This method uses the newly added `bind_addrs` field of the smb service
spec to ensure only hosts that meet the desired set of
networks/addresses get used in placement.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 16 Jun 2025 20:04:35 +0000 (16:04 -0400)]
python-common/deployment: add bind_addrs and related type for smb
Add a `bind_addrs` field and `SMBClusterBindIPSpec` to the smb service
spec. If specified the `bind_addrs` field can contain one or more
SMBClusterBindIPSpec value. In JSON these values can contain either an
address `{"address": "192.168.76.10"}` or network `{"network":
"192.168.76.0/24"}`.
These specs will be used by cephadm to place the smb service only on
hosts that have IPs matching the supplied IP Address/Network values. It
will also instruct the smb services to only bind to these addresses.
A suggested future enhancement may be include an IP address range
representation for the SMBClusterBindIPSpec.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 16 Jun 2025 20:05:14 +0000 (16:05 -0400)]
mgr/cephadm: teach serve.py about host selector support
A previous commit added a HostSelector protocol type to the schedule
code. This change makes it so the function calling upon the
HostAssignment class detects if a CephService provides a
filter_host_candidates method - meaning the service class can act as a
HostSelector. If the class can be a HostSelector pass it to the
HostAssignment so that the custom selection operation can be run.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 16 Jun 2025 20:05:01 +0000 (16:05 -0400)]
mgr/cephadm: prepare schedule.py for per-service-type host filtering
Prepare schedule.py for per-service-type host filtering based on allowed
host addresses/networks. Add a new HostSelector protocol type to the
module defining what the filtering interface looks like.
This interface is intended allows CephService classes to "take over" the
network based filtering of nodes prior to placement and customize the
behavior of this step in cephamd's placement algorithm.
Note that the type must be passed in to the HostAssignment class as an
optional argument. If nothing is passed the class behaves as it did
before.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
VinayBhaskar-V [Tue, 13 May 2025 20:25:44 +0000 (01:55 +0530)]
rbd-mirror: prevent image deletion if remote image is not primary
A resync on a mirrored image may incorrectly results in the local
image being deleted even when the remote image is no longer primary.
This issue can occur under the following conditions:
* if resync is requested on the secondary before the remote image has
been fully demoted
* if the demotion of the primary image is not mirrored
due to the rbd-mirror daemon being offline.
This can be fixed by ensuring that image deletion during a resync is
only allowed when the remote image is confirmed to be primary.
This commit fixes the issue only for snapshot based mirroring mode