]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
22 months agocephadm: remove call to get_parm from fetch_configs
John Mulligan [Thu, 15 Jun 2023 19:54:09 +0000 (15:54 -0400)]
cephadm: remove call to get_parm from fetch_configs

Stop using get_parm in fetch_configs. Doing so makes clear that
the two if-branches in fetch_configs are symmetric, in the
handling of custom_config_files and symmetric with the behavior
of fetch_custom_config_files.
It also reveals that get_parm only has one remaining caller making it
simpler to remove get_parm in the future.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: convert test case to call command_deploy_from
John Mulligan [Sat, 20 May 2023 17:45:10 +0000 (13:45 -0400)]
cephadm: convert test case to call command_deploy_from

The test was previously using command_deploy but that is being
deprecated so call command_deploy_from instead.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: combine deploy functions some more
John Mulligan [Tue, 30 May 2023 20:23:13 +0000 (16:23 -0400)]
cephadm: combine deploy functions some more

During review it was pointed out that much of command_deploy and
command_deploy_from were still common. Combine the bulk of
command_deploy and command_deploy_from into a new _common_deploy.
The old _common_deploy is renamed to _dispatch_deploy but kept
as a separate function.

The reason for keeping _dispatch_deploy as a function is that
it limits the scope of variables. It helps knowing exactly what
is needed and what is not needed from _common_deploy.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: drop deploy_arguments key from deploy config JSON
John Mulligan [Thu, 1 Jun 2023 17:27:37 +0000 (13:27 -0400)]
cephadm: drop deploy_arguments key from deploy config JSON

Drop the now unnecessary deploy_arguments subsection from the JSON
object that the new `_orch deploy` takes. The intermediate code that
used it in the ceph mgr module has been replaced with `params`.

We still want to share some code with the old deploy, especially the
default values for various things that get attached to `ctx`. In
some cases this is particularly important as not all code checks
that `ctx` has an attribute first. Create an `ArgumentFacade` type
to reuse the `add_argument` calls for deploy, and instead store the
default key-value pairs for `ctx`.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: add a test for the apply_deploy_config_to_ctx function
John Mulligan [Thu, 1 Jun 2023 17:27:27 +0000 (13:27 -0400)]
cephadm: add a test for the apply_deploy_config_to_ctx function

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: split command_deploy_from into mockable parts
John Mulligan [Sat, 20 May 2023 17:42:02 +0000 (13:42 -0400)]
cephadm: split command_deploy_from into mockable parts

Split up command_deploy_from so that the part that reads the JSON
from an input source is moved into read_configuration_source and
the part that applied the configuration data to the ctx is moved
into apply_deploy_config_to_ctx. This will make these sections
reusable and, more importantly, make it easier to mock/monkeypatch
these functions in tests.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: make the old command_deploy deprecated with decorator
John Mulligan [Thu, 18 May 2023 20:14:24 +0000 (16:14 -0400)]
cephadm: make the old command_deploy deprecated with decorator

Add a deprecated command decorator. Decorate the old command_deploy with
it. By default it just logs if a deprecated command was used, but
custom builds of cephadm can set the NO_DEPRECATED var to True
and fail if a deprecated command is used.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agomgr/cephadm: add exchange types and use them for deploy
John Mulligan [Thu, 18 May 2023 19:10:16 +0000 (15:10 -0400)]
mgr/cephadm: add exchange types and use them for deploy

Add an exchange module for defining the "exchange protocol" that the
mgr module uses for communicating with the cephadm binary.  The
exchange module classes use data descriptors to define supported
fields in the resulting data and will be serialized to JSON for
communicating with cephadm.

The cephadm binary does not use these types because it currently
doesn't import anything outside of the standard library. A suggested
future change would be to move 'exhange.py' to python-common somewhere
and have the module be imported by both the mgr and cephadm and used
for both serialization and deserialization.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agomgr/cephadm: convert test_services.py for new deploy
John Mulligan [Tue, 16 May 2023 23:44:51 +0000 (19:44 -0400)]
mgr/cephadm: convert test_services.py for new deploy

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agomgr/cephadm: convert test_cephadm.py for new deploy
John Mulligan [Tue, 16 May 2023 23:44:34 +0000 (19:44 -0400)]
mgr/cephadm: convert test_cephadm.py for new deploy

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agomgr/cephadm: block future use of extra_args
John Mulligan [Tue, 16 May 2023 17:49:28 +0000 (13:49 -0400)]
mgr/cephadm: block future use of extra_args

Convert `extra_args` into a read-only property so that
current code continues to work but anything that tries
to set any `extra_args` now or in the future will be
intentionally broken.

This is mainly to find issues when running unit and teuthology tests.
This patch could be dropped before the final merge if desired.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agomgr/cephadm: convert extra_args to daemon_params dict
John Mulligan [Tue, 16 May 2023 17:48:58 +0000 (13:48 -0400)]
mgr/cephadm: convert extra_args to daemon_params dict

In serve.py we were creating various command line arguments
(and their values) to pass to cephadm. Now that we support
a single unified JSON-based input we can stop passing
these as CLI parameters and just pass it as a singular
JSONified dict.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agomgr/cephadm: deploy using deploy-from command
John Mulligan [Thu, 11 May 2023 15:07:53 +0000 (11:07 -0400)]
mgr/cephadm: deploy using deploy-from command

The new `deploy-from` command aims to be a cleaner, clearer way to pass
input to cephadm for service deployment. Make a minimal set of change to
use that new command.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agomgr/cephadm: allow passing a list as a compound command to _run_cephadm
John Mulligan [Wed, 24 May 2023 18:11:52 +0000 (14:11 -0400)]
mgr/cephadm: allow passing a list as a compound command to _run_cephadm

As we're adding "namespaces" to the cephadm command it's easier to work
with a compound list of terms as the command. This also avoids an issue
where the function call injects args between the command and the "args"
passed to _run_cephadm.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: update code to use fetch_custom_config_files
John Mulligan [Thu, 15 Jun 2023 19:34:15 +0000 (15:34 -0400)]
cephadm: update code to use fetch_custom_config_files

Update the code to use fetch_custom_config_files rather than
get_custom_config_files.  Like other fetch_ functions recently added
to cephadm we don't LBYL for checking values on ctx, but rather
call the fetch function on ctx and then check if the result contains
actionable data.
get_custom_config_files gets removed as no remaining callers exist.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: add fetch_custom_config_files function
John Mulligan [Thu, 15 Jun 2023 19:34:09 +0000 (15:34 -0400)]
cephadm: add fetch_custom_config_files function

This function works similarly to get_custom_config_files but doesn't
require the use of "ctx.config_json" and will prefer sourcing the
data from `config_blobs`.
This function also returns the list of dicts rather than return a dict
with exactly one key which maps to said list of dicts. There appeared
to be no benefit to that when the call sites of get_custom_config_files
was examined.

This function is `fetch_configs` evil twin.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: update code to use the fetch_tcp_ports function
John Mulligan [Fri, 26 May 2023 19:13:03 +0000 (15:13 -0400)]
cephadm: update code to use the fetch_tcp_ports function

Replace a bunch of locations that were "parsing" the tcp ports to use
the recently added fetch_tcp_ports function.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: add fetch_tcp_ports function for getting processed ports
John Mulligan [Fri, 26 May 2023 19:06:40 +0000 (15:06 -0400)]
cephadm: add fetch_tcp_ports function for getting processed ports

The cephadm cli can pass ports as either a string containing space
separated port numbers or, in the newer method, a (JSON) list of ints.
The fetch_tcp_ports function abstracts away the handling of
these input forms.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: add deploy-from command
John Mulligan [Thu, 11 May 2023 15:05:07 +0000 (11:05 -0400)]
cephadm: add deploy-from command

Add the `deploy-from` command. This command is like `deploy` in
functionality but instead of sourcing input from a mixture of various
CLI arguments, CLI arguments that take JSON strings, and JSON data
provided on stdin - this command aims to take configuration from a
single unified JSON object provided on the commands stdin.

This change strives to be as reasonably backwards compatible with
`deploy` as possible and this leads to some awkward hoop-jumping,
including: needing to nest CLI arguments inside the JSON, because
that is what the manager constructs; duplicate sources of the fsid
(CLI and JSON); the strange behavior of CephadmContext when setting
values; and a few others I'm probably forgetting.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: move the definition of most deploy args into a function
John Mulligan [Thu, 11 May 2023 14:55:14 +0000 (10:55 -0400)]
cephadm: move the definition of most deploy args into a function

Moving the bulk of the arguments specific to the `deploy` command will
allow future reuse of these arguments.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: be more explicit with a Dict's type specification
John Mulligan [Thu, 11 May 2023 14:36:50 +0000 (10:36 -0400)]
cephadm: be more explicit with a Dict's type specification

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: update code to use fetch_configs function
John Mulligan [Thu, 11 May 2023 14:36:13 +0000 (10:36 -0400)]
cephadm: update code to use fetch_configs function

Use the fetch_configs function wherever we were previously reading
configs via `get_parm(ctx.config_json)`.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: add fetch_configs function for reading configuration items from ctx
John Mulligan [Thu, 11 May 2023 14:30:51 +0000 (10:30 -0400)]
cephadm: add fetch_configs function for reading configuration items from ctx

The CephadmContext holds much of cephadm's state, including values
from cli options and (soon) configuration file input. Add a
`fetch_configs` function that reads processed configuration items from `config_blobs`
(a dict mapping config name to arbitrary configuration content) or
falls back to using the `get_parm` function on `ctx.config_json`.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: update code to use fetch_meta function
John Mulligan [Sat, 20 May 2023 14:55:16 +0000 (10:55 -0400)]
cephadm: update code to use fetch_meta function

Use the fetch_meta function wherever we require the metadata
properties dict.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: add fetch_meta function for reading metadata properties from ctx
John Mulligan [Thu, 11 May 2023 14:30:12 +0000 (10:30 -0400)]
cephadm: add fetch_meta function for reading metadata properties from ctx

The CephadmContext holds much of cephadm's state, including values from
cli options and (soon) configuration file input. Add a `fetch_meta`
function that reads processed metadata from `meta_properties` or parses
JSON stored on `meta_json`. Parsed JSON is saved to `meta_properties`.
Future code should always use fetch_meta for reading, and only ever
set `meta_properties` as a python dict, not round trip JSON through
meta_json.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: split default_image decorator into two functions
John Mulligan [Thu, 11 May 2023 14:25:38 +0000 (10:25 -0400)]
cephadm: split default_image decorator into two functions

Keep default_image as a decorator for functions that will only
ever need to update an image passed by the CLI. For other future
functions that want to execute code prior to assigning an image
from CLI parameters add `update_default_image` which takes a
CephadmContext and updates it and can be used by the caller
at an arbitrary point in the code flow.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: change tests to assert using mock call not func.args
John Mulligan [Thu, 1 Jun 2023 15:16:13 +0000 (11:16 -0400)]
cephadm: change tests to assert using mock call not func.args

The Python docs [1] note that:
  Changed in version 3.8: Added args and kwargs properties.

In order to run tests on python 3.6 (example: `tox -e py36`) we
change the tests to do the asserts using the older call(...)
comparison style, with mock.ANY used for args we don't care about.

[1] - https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.call_args

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: remove unused import from tests
John Mulligan [Thu, 1 Jun 2023 15:15:48 +0000 (11:15 -0400)]
cephadm: remove unused import from tests

This import breaks running tox with `-e py36` and adds no value. Just
remove it.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
22 months agocephadm: use enum for tracking redeploy/reconfig
Adam King [Wed, 31 May 2023 23:38:38 +0000 (19:38 -0400)]
cephadm: use enum for tracking redeploy/reconfig

Since the options are mutually exclusive, using
an enum is preferable to having multiple bools
to track each of them

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 7081759d48f4e9f21a6482c2f32446d9b1f895ea)

22 months agocephadm: open ports in firewall when adopting monitoring stack daemons
Adam King [Thu, 13 Apr 2023 17:54:00 +0000 (13:54 -0400)]
cephadm: open ports in firewall when adopting monitoring stack daemons

Otherwise we risk the prometheus/alertmanager/grafana
not functioning properly after adoption due to the necessary
port in the firewall not being open.

Fixes: https://tracker.ceph.com/issues/59443
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 40a98174ccab080fd540e05b6adadcf82e9c2a78)

22 months agocephadm: still try to open ports in firewall on redeploy/reconfig
Adam King [Thu, 13 Apr 2023 17:05:11 +0000 (13:05 -0400)]
cephadm: still try to open ports in firewall on redeploy/reconfig

Prior to this patch we were discarding the provided
ports on reconfig and redeploy in order to not fail
thinking there was a port conflict with the instance
of the daemon we were about to reconfig/redeploy. However,
it's still desirable for us to make sure the firewall ports
are open when we do a reconfig/redpeloy, so this refactors
the port handling approach to have it do that but
still avoid checking for port conflicts. It also include
an update of the type signature of deploy_daemon
to the py3 style. That wasn't needed for the change
but since I was added an arugment there I thought we might
as well do it now.

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit fdecd66f1306d3bf60780dbd44c9cb8e63b3892a)

22 months agocephadm: use DEFAULT_MODE constant at additional locations
John Mulligan [Tue, 6 Jun 2023 17:26:35 +0000 (13:26 -0400)]
cephadm: use DEFAULT_MODE constant at additional locations

Now that we have a DEFAULT_MODE constant we can replace other locations
where 0o600 is used with the constant.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit ca9b5d0bd6082112bcd2297a58113c9bb32dc954)

22 months agocephadm: use 0o600 as the default mode for write_new
John Mulligan [Tue, 6 Jun 2023 17:24:37 +0000 (13:24 -0400)]
cephadm: use 0o600 as the default mode for write_new

Add a constant DEFAULT_MODE of `0o600`, and make it the default of
the perms argument to write_new. This reduces a lot of code since
0o600 is the majority of the permissions used. Other cases can continue
to pass None to indicate no particular permissions are desired.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit b76132035be9383dafba382d0291da4068bfa94e)

22 months agocephadm: convert SNMPGateway create_daemon_conf to use write_new
John Mulligan [Tue, 6 Jun 2023 17:16:29 +0000 (13:16 -0400)]
cephadm: convert SNMPGateway create_daemon_conf to use write_new

While it is not entirely clear why this pattern of using os.open and
posix open flags instead of `open` directly was used I determined (using
strace) that the only major difference between these open flags and
those used by `open` was the lack of O_TRUNC. Unlike some other cases
this function does not use an intermediate temporary file.  This means
that if the file being written already exists and the data being written
is smaller then the remaining data will not be over-written.

Example:
```
$ cat existing
AAAAAAAA
$ cat existing
bbbAAAAA
```

I looked over the context that this function is used in and decided that
this behavior must not be intentional. Thus it should be safe
to convert this function to `write_new`.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 6ec5a5ead36a79ce331b6943296c401feea7a896)

22 months agocephadm: convert more temporary file writes to use write_new
John Mulligan [Tue, 6 Jun 2023 16:37:14 +0000 (12:37 -0400)]
cephadm: convert more temporary file writes to use write_new

Some functions are using the pattern:
```
with open(os.open(name + '.new, os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
    f.write(...)
    os.rename(name + '.new', name)
```
While it is not entirely clear why this pattern was first used,
it accomplishes the same goal as `write_new` only directly calling
the posix open call. I analyzed the open flags for `write_new` and
these calls using `strace` and noted that the only significant
difference was the lack of O_TRUNC in these cases. Since the ".new"
files should not exist the lack of O_TRUC ought not make any difference.
With this decided we can convert these instances to `write_new`.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 5845a758fde8def526f89b050f2b51e6b3458ddd)

22 months agocephadm: convert _write_custom_conf_files to use write_new
John Mulligan [Tue, 6 Jun 2023 16:25:34 +0000 (12:25 -0400)]
cephadm: convert _write_custom_conf_files to use write_new

We double checked the meaning of "w+" and it will open the file
read-write. Since the file is never read there's no real reason
to keep it that way so its OK to convert to `write_new`.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 642985c6894f8f62a313cd70c915d066f9c53d6e)

22 months agocephadm: convert some functions to use write_new
John Mulligan [Tue, 6 Jun 2023 00:12:59 +0000 (20:12 -0400)]
cephadm: convert some functions to use write_new

Convert a lot of the basic uses of the pattern:
with open(...) as f:
  f.write(...)
  os.fchown(f, ...)  # sometimes
  os.fchmod(f, ...)  # sometimes
  os.rename(...)   # sometimes

These are the most obvious cases to convert to `write_new`
and should largely be uncontroversial.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 300f5bfcb5dd16ba916951bab90c95a1b76d07f4)

22 months agocephadm: create functional mock for fchown
John Mulligan [Tue, 6 Jun 2023 00:08:49 +0000 (20:08 -0400)]
cephadm: create functional mock for fchown

The pyfakefs library apparently doesn't have its own mock for os.fchown.
This means that code using fchown currently calls into a mock with
no affect on the fake fs. For some reason I don't fully understand,
existing test cases work because they don't always follow the pattern
of open-write-rename. Switching to `write_new`, which always does a
rename, breaks some of the assertions performed in the tests on the fake
fs. Add a mock fchown that updates the state of the fake fs so
that converting call sites to use `write_new` will continue to work.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 02b6ce8a44f234aa3fe30fe21d6f28d4e36d7af5)

22 months agocephadm: add unit tests for write_new
John Mulligan [Tue, 6 Jun 2023 18:03:23 +0000 (14:03 -0400)]
cephadm: add unit tests for write_new

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit d5794f3441cf8da3c9716e796f41f2585d80adcb)

22 months agocephadm: add write_new function for robust file writes
John Mulligan [Tue, 6 Jun 2023 00:12:10 +0000 (20:12 -0400)]
cephadm: add write_new function for robust file writes

The cephadm code has a very common pattern made of at least one of
the three following steps:
* call fchown on the open file to set ownership
* call fchmod on the open file to set permissions
* rename the file from a temp name to final name

Add the write_new function to encapsulate these common actions.
If owner is not None then fchown will be called.
If perms is not None then fchmod will be called.
An optional encoding value may be passed.
It always uses a temporary file as a temporary file ensures that
there can never be a partially written file even in the event of
a power outage or system crash.
Encapsulating this all into a function also allows us to make
changes to this approach in the future without touching every
call site using `open(..., "w")` etc.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 7a8bfb91af246e36242aee90c3f9245fcdf6a318)

22 months agoqa/workunits/cephadm: align test_cephadm.sh with new cephadm version
John Mulligan [Mon, 8 May 2023 17:54:32 +0000 (13:54 -0400)]
qa/workunits/cephadm: align test_cephadm.sh with new cephadm version

The `cephadm version` command no longer bases the output on the
container images, rather it uses a special python file added to the
zipapp during the build to report on the version of cephadm (the
binary).

The other option was to preserve this behavior and add a new version
command or make it behave differently depending on what options were
provided. I discussed the options with AMK in person and we decided that
changing the tests was preferable.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit bd59b8091929ff067fabd4c8ca7ad86b3723aa0f)

22 months agocephadm: add executes_early decorator to version command
John Mulligan [Thu, 27 Apr 2023 17:39:02 +0000 (13:39 -0400)]
cephadm: add executes_early decorator to version command

Add the executes_early decorator and apply it to the version command
such that the version command will function without the uaual
requirements and set up steps that a cephadm command needs.
This allows anyone with a binary, root or not, to check the version.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 20e38136d7baafdf74a43c09effeffec3040f952)

22 months agocephadm: get cephadm version information from zipapp module
John Mulligan [Thu, 27 Apr 2023 17:36:51 +0000 (13:36 -0400)]
cephadm: get cephadm version information from zipapp module

Use the `_version.py` module that gets embedded into the zipapp at build
time to print cephadm's own version information.
The version string printed is basically copied from the one printed by
the `ceph` command.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit cfa2d0de77b71a6b61b75cd0ea408065aa9fbd45)

22 months agocephadm: configure cmake to pass versioning values to build.py
John Mulligan [Tue, 27 Sep 2022 20:53:52 +0000 (16:53 -0400)]
cephadm: configure cmake to pass versioning values to build.py

These values are copied from the variable names used in `ceph.in` (the
file that becomes the `ceph` command).

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 9a3438a4d23d418c6fd0b6d7fa6cea1d2afac6aa)

22 months agocephadm: add generated version info file to zipapp
John Mulligan [Tue, 27 Sep 2022 20:51:57 +0000 (16:51 -0400)]
cephadm: add generated version info file to zipapp

Pass --set-version-var=KEY=VALUE cli options to the script and it
will create an embedded "_version.py" file in the zipapp containing
the passed parameters.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 99acb2782d2fa238ee92123000e69b5e50dfe085)

22 months agoMerge pull request #53123 from adk3798/wip-62530-reef
Adam King [Thu, 31 Aug 2023 17:33:45 +0000 (13:33 -0400)]
Merge pull request #53123 from adk3798/wip-62530-reef

reef: mgr/cephadm: allow draining host without removing conf/keyring files

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53122 from adk3798/wip-62467-reef
Adam King [Thu, 31 Aug 2023 17:32:21 +0000 (13:32 -0400)]
Merge pull request #53122 from adk3798/wip-62467-reef

reef: cephadm: add tcmu-runner to logrotate config

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53121 from adk3798/wip-62462-reef
Adam King [Thu, 31 Aug 2023 17:31:34 +0000 (13:31 -0400)]
Merge pull request #53121 from adk3798/wip-62462-reef

reef: cephadm: support for CA signed keys

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53120 from adk3798/wip-62446-reef
Adam King [Thu, 31 Aug 2023 17:30:28 +0000 (13:30 -0400)]
Merge pull request #53120 from adk3798/wip-62446-reef

reef: mgr/cephadm: Add "networks" parameter to orch apply rgw

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53119 from adk3798/wip-62244-reef
Adam King [Thu, 31 Aug 2023 17:29:19 +0000 (13:29 -0400)]
Merge pull request #53119 from adk3798/wip-62244-reef

reef: mgr/cephadm: storing prometheus/alertmanager credentials in monstore

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53115 from adk3798/wip-61684-reef
Adam King [Thu, 31 Aug 2023 17:28:05 +0000 (13:28 -0400)]
Merge pull request #53115 from adk3798/wip-61684-reef

reef: python-common/drive_group: handle fields outside of 'spec' even when 'spec' is provided

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53114 from adk3798/wip-61681-reef
Adam King [Thu, 31 Aug 2023 17:27:12 +0000 (13:27 -0400)]
Merge pull request #53114 from adk3798/wip-61681-reef

reef: python-common/drive_selection: lower log level of limit policy message

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53112 from adk3798/wip-61675-reef
Adam King [Thu, 31 Aug 2023 17:25:51 +0000 (13:25 -0400)]
Merge pull request #53112 from adk3798/wip-61675-reef

reef: mgr/cephadm: validate host label before removing

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53111 from adk3798/wip-61549-reef
Adam King [Thu, 31 Aug 2023 14:46:50 +0000 (10:46 -0400)]
Merge pull request #53111 from adk3798/wip-61549-reef

reef: mgr/cephadm: also don't write client files/tuned profiles to maintenance hosts

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53110 from adk3798/wip-61545-reef
Adam King [Thu, 31 Aug 2023 14:45:31 +0000 (10:45 -0400)]
Merge pull request #53110 from adk3798/wip-61545-reef

reef: cephadm: Adding support to configure public_network cfg section

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53109 from adk3798/wip-61542-reef
Adam King [Thu, 31 Aug 2023 14:44:26 +0000 (10:44 -0400)]
Merge pull request #53109 from adk3798/wip-61542-reef

reef: cephadm: delete /tmp/cephadm-<fsid> when removing the cluster

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53106 from adk3798/wip-61537-reef
Adam King [Thu, 31 Aug 2023 13:31:03 +0000 (09:31 -0400)]
Merge pull request #53106 from adk3798/wip-61537-reef

reef: mgr/cephadm: show meaningful messages when failing to execute cmds

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #53010 from adk3798/reef-cephadm-tcmu-extra-args
Adam King [Thu, 31 Aug 2023 13:29:28 +0000 (09:29 -0400)]
Merge pull request #53010 from adk3798/reef-cephadm-tcmu-extra-args

reef: cephadm: Fix extra_container_args for iSCSI

Reviewed-by: John Mulligan <jmulligan@redhat.com>
22 months agoMerge pull request #52908 from adk3798/reef-cephadm-debian-recommends
Adam King [Thu, 31 Aug 2023 13:28:39 +0000 (09:28 -0400)]
Merge pull request #52908 from adk3798/reef-cephadm-debian-recommends

reef: debian/control: add docker-ce as recommends for cephadm package

Reviewed-by: John Mulligan<jmulligan@redhat.com>
22 months agoMerge pull request #53233 from rhcs-dashboard/wip-62652-reef
Nizamudeen A [Thu, 31 Aug 2023 09:06:22 +0000 (14:36 +0530)]
Merge pull request #53233 from rhcs-dashboard/wip-62652-reef

reef: mgr/dashboard: subvolume rm with snapshots

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
22 months agomgr/dashboard: subvolume rm with snapshots 53233/head
Pedro Gonzalez Gomez [Mon, 28 Aug 2023 13:03:06 +0000 (15:03 +0200)]
mgr/dashboard: subvolume rm with snapshots

Fixes: https://tracker.ceph.com/issues/62452
Signed-off-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
(cherry picked from commit 453fbcb1cf5da118edb64557ab7cc6efcbb57723)

22 months agoMerge pull request #53190 from rhcs-dashboard/wip-62563-reef
Nizamudeen A [Thu, 31 Aug 2023 05:30:24 +0000 (11:00 +0530)]
Merge pull request #53190 from rhcs-dashboard/wip-62563-reef

reef: mgr/dashboard: add e2e tests for cephfs management

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
22 months agoMerge pull request #53223 from rhcs-dashboard/wip-62598-reef
Nizamudeen A [Thu, 31 Aug 2023 05:18:13 +0000 (10:48 +0530)]
Merge pull request #53223 from rhcs-dashboard/wip-62598-reef

reef: mgr/dashboard: n/a entries behind primary snapshot mode

Reviewed-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
22 months agoMerge pull request #53199 from zdover23/wip-doc-2023-08-29-backport-53198-to-reef
zdover23 [Wed, 30 Aug 2023 19:14:09 +0000 (05:14 +1000)]
Merge pull request #53199 from zdover23/wip-doc-2023-08-29-backport-53198-to-reef

reef: doc/cephadm: add ssh note to install.rst

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
22 months agodoc/cephadm: add ssh note to install.rst 53199/head
Zac Dover [Mon, 28 Aug 2023 22:55:19 +0000 (08:55 +1000)]
doc/cephadm: add ssh note to install.rst

Add a note instructing the reader to have ssh running before the
"cephadm bootstrap" command is run.

Co-authored-by: Anthony D'Atri <anthony.datri@gmail.com>
Signed-off-by: Zac Dover <zac.dover@proton.me>
(cherry picked from commit f10781a281ef6a00a69d45dd6b78f29fd219f049)

22 months agoMerge pull request #53224 from zdover23/wip-doc-2023-08-30-backport-53213-to-reef
Anthony D'Atri [Wed, 30 Aug 2023 16:17:31 +0000 (12:17 -0400)]
Merge pull request #53224 from zdover23/wip-doc-2023-08-30-backport-53213-to-reef

reef: doc/cephadm: edit "Adding Hosts" in install.rst

22 months agodoc/cephadm: edit "Adding Hosts" in install.rst 53224/head
Zac Dover [Tue, 29 Aug 2023 22:33:09 +0000 (08:33 +1000)]
doc/cephadm: edit "Adding Hosts" in install.rst

Edit the English in the "Adding Hosts" section of
doc/cephadm/install.rst.

Signed-off-by: Zac Dover <zac.dover@proton.me>
(cherry picked from commit f0df9e1ea95362b28ca516e3a2efaab6365de5ea)

22 months agomgr/dashboard: n/a entries behind primary snapshot mode 53223/head
Pere Diaz Bou [Mon, 12 Jun 2023 09:16:33 +0000 (11:16 +0200)]
mgr/dashboard: n/a entries behind primary snapshot mode

Fixes: https://tracker.ceph.com/issues/62576
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
(cherry picked from commit 6066e37ad3c6bc43c3e5e4313a89265007e7d0d8)

22 months agoMerge pull request #53219 from rhcs-dashboard/wip-62640-reef
Nizamudeen A [Wed, 30 Aug 2023 11:07:49 +0000 (16:37 +0530)]
Merge pull request #53219 from rhcs-dashboard/wip-62640-reef

reef: mgr/dashboard: fix cephfs create form validator

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
22 months agomgr/dashboard: fix cephfs create form validator 53219/head
Nizamudeen A [Tue, 29 Aug 2023 14:16:07 +0000 (19:46 +0530)]
mgr/dashboard: fix cephfs create form validator

dashboard was allowing to create a filesystem with / in its name but the
cli throws out error in doing so. And the created volume in dashboard
just gets ended up as a stale volume

Fixes: https://tracker.ceph.com/issues/62628
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit d8208693d5b9a94fd24dbffcdb45fe67d4164b3b)

22 months agoMerge pull request #53214 from rhcs-dashboard/wip-62631-reef
Nizamudeen A [Wed, 30 Aug 2023 08:21:14 +0000 (13:51 +0530)]
Merge pull request #53214 from rhcs-dashboard/wip-62631-reef

reef: mgr/dashboard: fix rgw page issues when hostname not resolvable

Reviewed-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
22 months agoMerge pull request #53209 from rhcs-dashboard/wip-62629-reef
Nizamudeen A [Wed, 30 Aug 2023 08:19:50 +0000 (13:49 +0530)]
Merge pull request #53209 from rhcs-dashboard/wip-62629-reef

reef: mgr/dashboard: fix progress bar color visibility

Reviewed-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
22 months agomgr/dashboard: fix rgw page issues when hostname not resolvable 53214/head
Nizamudeen A [Thu, 24 Aug 2023 11:47:29 +0000 (17:17 +0530)]
mgr/dashboard: fix rgw page issues when hostname not resolvable

Fixes: https://tracker.ceph.com/issues/62396
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 78cfeb6372707ec3f997d28ad617367feb3a983e)

22 months agoMerge pull request #53201 from rhcs-dashboard/wip-62617-reef
Nizamudeen A [Tue, 29 Aug 2023 15:51:41 +0000 (21:21 +0530)]
Merge pull request #53201 from rhcs-dashboard/wip-62617-reef

reef: mgr/dashboard: set CORS header for unauthorized access

Reviewed-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
22 months agomgr/dashboard: fix progress bar color visibility 53209/head
Nizamudeen A [Mon, 28 Aug 2023 15:33:48 +0000 (21:03 +0530)]
mgr/dashboard: fix progress bar color visibility

Side effect of a recent change https://github.com/ceph/ceph/pull/52915/files#diff-747a9554e053df3b4d3fcc144bfb5c002654dc0fd5aa59b0ec18db56d85d5b28R29

Fixes: https://tracker.ceph.com/issues/62614
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit a690ff896d43c90f2a2900ba76607dd428b308df)

22 months agoMerge pull request #53173 from rhcs-dashboard/wip-62600-reef
Nizamudeen A [Tue, 29 Aug 2023 05:10:10 +0000 (10:40 +0530)]
Merge pull request #53173 from rhcs-dashboard/wip-62600-reef

reef: mgr/dashboard: disable protect if layering is not enabled on the image

Reviewed-by: Nizamudeen A <nia@redhat.com>
22 months agomgr/dashboard: allow CORS for unauthorized access 53201/head
Nizamudeen A [Mon, 28 Aug 2023 05:15:28 +0000 (10:45 +0530)]
mgr/dashboard: allow CORS for unauthorized access

Fixes: https://tracker.ceph.com/issues/62612
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 8158bdab7134714dc2a9f155e599cc2838c3358d)

22 months agomgr/dashboard: cephfs subvolume management e2e tests 53190/head
Nizamudeen A [Fri, 18 Aug 2023 08:17:31 +0000 (13:47 +0530)]
mgr/dashboard: cephfs subvolume management e2e tests

includes subvolume and subvolume groups e2es

Also taking care of renaming of Volume to File Systems in the remaining
actions like Edit and Remove

Fixes: https://tracker.ceph.com/issues/62564
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit b2c00675f412925b3d83f23b1dd6391af07ca7ea)

22 months agomgr/dashboard: cleanup behave logics
Nizamudeen A [Fri, 18 Aug 2023 08:16:02 +0000 (13:46 +0530)]
mgr/dashboard: cleanup behave logics

Fixes: https://tracker.ceph.com/issues/62564
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 30b31083d40e0ff4ffef167775a0491cd599504d)

22 months agomgr/dashboard: add e2e tests for cephfs management
Nizamudeen A [Sat, 5 Aug 2023 13:03:39 +0000 (18:33 +0530)]
mgr/dashboard: add e2e tests for cephfs management

Fixes: https://tracker.ceph.com/issues/62340
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 82654d2f02dccc800289ef7e0a58245d97e56119)

22 months agoMerge pull request #53179 from zdover23/wip-doc-2023-08-28-backport-53096-to-reef
Anthony D'Atri [Mon, 28 Aug 2023 13:37:47 +0000 (09:37 -0400)]
Merge pull request #53179 from zdover23/wip-doc-2023-08-28-backport-53096-to-reef

reef: doc/start: edit os-recommendations.rst

22 months agodoc/start: edit os-recommendations.rst 53179/head
Zac Dover [Wed, 23 Aug 2023 15:15:54 +0000 (01:15 +1000)]
doc/start: edit os-recommendations.rst

Improve the grammar in one sentence of the "Platforms" section of
doc/start/os-recommendations.rst. Improving that grammar involved
splitting the sentence into two sentences, but that's life. Update:
Anthony substantially rewrote this, so credit for this should rightly
go to him.

Co-authored-by: Anthony D'Atri <anthony.datri@gmail.com>
Signed-off-by: Zac Dover <zac.dover@proton.me>
(cherry picked from commit e19b9cea62c56cbd73049957d69d5aac16a97c08)

22 months agomgr/dashboard: disable protect if layering is not enabled on the image 53173/head
avanthakkar [Mon, 21 Aug 2023 13:34:53 +0000 (19:04 +0530)]
mgr/dashboard: disable protect if layering is not enabled on the image

Fixes: https://tracker.ceph.com/issues/62498
Signed-off-by: avanthakkar <avanjohn@gmail.com>
(cherry picked from commit 16e913f0ba3918732cfc9984f707379df65ac29a)

22 months agoMerge pull request #53142 from cloudbehl/wip-62348-reef
Nizamudeen A [Mon, 28 Aug 2023 04:44:49 +0000 (10:14 +0530)]
Merge pull request #53142 from cloudbehl/wip-62348-reef

reef: exposed the open api and telemetry links in details card

Reviewed-by: Nizamudeen A <nia@redhat.com>
22 months agoMerge pull request #53143 from cloudbehl/wip-62561-reef
Nizamudeen A [Mon, 28 Aug 2023 04:38:29 +0000 (10:08 +0530)]
Merge pull request #53143 from cloudbehl/wip-62561-reef

reef: mgr/dashboard: minor usability improvements

Reviewed-by: Nizamudeen A <nia@redhat.com>
22 months agoMerge pull request #53164 from zdover23/wip-doc-2023-08-27-backport-53163-to-reef
Anthony D'Atri [Sat, 26 Aug 2023 21:20:59 +0000 (17:20 -0400)]
Merge pull request #53164 from zdover23/wip-doc-2023-08-27-backport-53163-to-reef

reef: doc/cephadm: edit sentence in mgr.rst

22 months agodoc/cephadm: edit sentence in mgr.rst 53164/head
Zac Dover [Sat, 26 Aug 2023 20:31:12 +0000 (06:31 +1000)]
doc/cephadm: edit sentence in mgr.rst

Improve the grammar in the first sentence of
doc/cephadm/services/mgr.rst. This is a small change, but I could not
resist.

Signed-off-by: Zac Dover <zac.dover@proton.me>
(cherry picked from commit 3b8877481a8de0a92a7b68a775915eb079744f23)

22 months agoMerge pull request #53162 from zdover23/wip-doc-2023-08-26-backport-53161-to-reef
Rongqi Sun [Sat, 26 Aug 2023 08:44:46 +0000 (16:44 +0800)]
Merge pull request #53162 from zdover23/wip-doc-2023-08-26-backport-53161-to-reef

reef: doc/cephadm: update cephadm reef version

22 months agodoc/cephadm: update cephadm reef version 53162/head
Rongqi Sun [Sat, 26 Aug 2023 06:50:00 +0000 (14:50 +0800)]
doc/cephadm: update cephadm reef version

Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
(cherry picked from commit d9888a4223632e0e3f862b658699df8735ebda26)

23 months agoMerge pull request #53146 from zdover23/wip-doc-2023-08-25-backport-53125-to-reef
zdover23 [Fri, 25 Aug 2023 09:39:45 +0000 (19:39 +1000)]
Merge pull request #53146 from zdover23/wip-doc-2023-08-25-backport-53125-to-reef

reef: doc: expand and consolidate mds placement

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
23 months agodoc: expand and consolidate mds placement 53146/head
Patrick Donnelly [Thu, 24 Aug 2023 00:36:12 +0000 (20:36 -0400)]
doc: expand and consolidate mds placement

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
23 months agomgr/dashboard: minor usability improvements 53143/head
cloudbehl [Wed, 9 Aug 2023 07:12:14 +0000 (12:42 +0530)]
mgr/dashboard: minor usability improvements

Fixes: https://tracker.ceph.com/issues/62365
Signed-off-by: cloudbehl <cloudbehl@gmail.com>
(cherry picked from commit c49435e88992c90145553556811464872b5bf786)

23 months agomgr/dashboard: Add telemetry link in dashboard 53142/head
cloudbehl [Wed, 9 Aug 2023 18:05:08 +0000 (23:35 +0530)]
mgr/dashboard: Add telemetry link in dashboard

Fixes: https://tracker.ceph.com/issues/62380
Signed-off-by: cloudbehl <cloudbehl@gmail.com>
23 months agomgr/dashboard: exposed the open api documentations to details card
dpandit [Mon, 7 Aug 2023 07:55:34 +0000 (13:25 +0530)]
mgr/dashboard: exposed the open api documentations to details card

Fixes: https://tracker.ceph.com/issues/62296
Signed-off-by: dpandit <dpandit@li-6f946d4c-287f-11b2-a85c-b0cb07ed936d.ibm.com>
(cherry picked from commit c6857988d25c3aef2979442d848049393f5febb8)

23 months agoMerge pull request #53128 from zdover23/wip-doc-2023-08-24-backport-53117-to-reef
Anthony D'Atri [Thu, 24 Aug 2023 13:37:28 +0000 (09:37 -0400)]
Merge pull request #53128 from zdover23/wip-doc-2023-08-24-backport-53117-to-reef

doc: correct option name

23 months agodoc: correct option name 53128/head
Patrick Donnelly [Wed, 23 Aug 2023 20:23:46 +0000 (16:23 -0400)]
doc: correct option name

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 94129fc126043a42f50e8139c76ea3107ccacf14)

23 months agomgr/cephadm: add utils class for tracking special host labels 53123/head
Adam King [Wed, 22 Feb 2023 19:07:58 +0000 (14:07 -0500)]
mgr/cephadm: add utils class for tracking special host labels

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 0e90c7e097c4dafafbb6b669949c2b1ea8de25c8)

23 months agomgr/cephadm: allow draining host without removing conf/keyring files
Adam King [Tue, 21 Feb 2023 18:53:32 +0000 (13:53 -0500)]
mgr/cephadm: allow draining host without removing conf/keyring files

Fixes: https://tracker.ceph.com/issues/58820
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 871aefb11d0a736d66150fee40c213f4210fead4)

23 months agocephadm: add tcmu-runner to logrotate config 53122/head
Adam King [Fri, 2 Jun 2023 00:06:35 +0000 (20:06 -0400)]
cephadm: add tcmu-runner to logrotate config

This process could be used to set up the tcmu-runner
to log to a file much like other ceph daemons

- create /etc/tcmu directory
- create /etc/tcmu/tcmu.conf directory with default options
- change dir to /var/log
- change log level to 4
- add -v /etc/tcmu:/etc/tcmu to tcmu-runner container podman line in unit.run

In order to support this (mostly for debugging) we should
add tcmu-runner to the logrotate config

Fixes: https://tracker.ceph.com/issues/61571
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit d5d40e07cae8a1d6a94029c4354d146b0baa3971)

23 months agoqa/cephadm: add test for ca signed keys 53121/head
Adam King [Fri, 7 Jul 2023 15:03:56 +0000 (11:03 -0400)]
qa/cephadm: add test for ca signed keys

Test that bootstraps with a CA signed key using
the use_ca_signed_key cephadm override. Then follows
up by doing a check-host on each host which verifies
the cephadm mgr module can reach and authenticate with
the nodes using the new key setup.

This probably should really be a workunit, but
I didn't want to create a full new section for
this test and I needed a section that didn't
already run the cephadm task for every test. I could
see this being moved into some sort of
"test_special_deployment_scenarios" section in the future

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 141af1c6b156da34418100629cd1407b74c681ad)