Matthew Oliver [Thu, 18 Jun 2020 01:39:39 +0000 (01:39 +0000)]
cephadm: Set ms bind ipv6 when mon-ip is ipv6
If you use cephadm bootstrap with an ipv6 mon ip then currently you'll
get into a address family split-brain state, where the mon's messenger
connects and binds to ipv6 but the mgr's binds to ipv4 (usually
0.0.0.0). In this state the bootstrap process hangs as it attempts to
talk and get the mgr state.
A work around is to have `ms bind ipv6 = true` in a ceph conf
you can then pass to bootstrap which gets pulled in and set in mon's
config store.
This patch sets `ms bind ipv6 = true` to the global section in the
mon config store when the mon-ip argument is an ipv6 address.
Fixes: https://tracker.ceph.com/issues/45016 Signed-off-by: Matthew Oliver <moliver@suse.com>
(cherry picked from commit 08ba08f7bb5b577ad3c3895e2c7f9f4d4555f185)
Matthew Oliver [Wed, 20 May 2020 00:22:45 +0000 (10:22 +1000)]
cephadm: Give iscsci a RO /lib/modules bind mounted
The ceph iscsi container needs to be able to insert the iscsi_target_mod
but it doesn't exist in the container. for security reasons bind
mounting /lib/modules seems a little dangerous unless we can mount it
RO.
Unfortuntly the docker volume mount (-v) doesn't allow you mount
readonly, adding a `--read-only` actaully does the opposite, makes the
root on the container RO and expects you to write to the mounted volumes
(-v).
However, we get more grainular control over bind mount options if we use
`--mount`[0]. Here we can still bind mound the volume into the container,
but can also add additional options, like bind mounting RO.
This patch adds at addiontal `bind_mounts` option to the CephContainer
along side `volume_mounts`. The `bind_mounts` take a List[List[str]]:
And this is plumbed through into cephadm. Bind_mounts only needs to be
used if you need a little more control over the mounting, otherwise the
volume_mounts are easier to use.
Fixes: https://tracker.ceph.com/issues/45252 Signed-off-by: Matthew Oliver <moliver@suse.com>
(cherry picked from commit d9b5371478b744920cf14e1b34b7d63226c71050)
Kiefer Chang [Thu, 18 Jun 2020 07:42:50 +0000 (15:42 +0800)]
stop.sh: do not block script when there is no running cluster
A query for current fsid is called inside `do_killcephadm`. This blocks
the script when there is no running cluster. The fix avoids entering the
function if cephadm command fails or returns no daemons.
The change also hides the following output for non-cephadm environments:
```
Unable to locate any of ['podman', 'docker']
```
Michael Fritch [Mon, 15 Jun 2020 21:22:08 +0000 (15:22 -0600)]
cephadm: sort the list of inferred fsids
$ cephadm shell
ERROR: Cannot infer an fsid, one must be specified: ['1d5df33f-eb94-4a4f-b192-1d5e770ed0e7', 'unknown']
$ cephadm shell
ERROR: Cannot infer an fsid, one must be specified: ['unknown', '1d5df33f-eb94-4a4f-b192-1d5e770ed0e7']
Instead of printing out a traceback if adding the host fails
during bootstrapping process, should now print error message
telling user host failed to be added
Sebastian Wagner [Tue, 12 May 2020 12:07:32 +0000 (14:07 +0200)]
cephadm: Manually remove containers
This fixes:
```
Error: error creating container storage: the container name "ceph-<fsid>-mon.b" is already in use by "<container-id>". You have to remove that container to be able to reuse that name.: that name is already in use
```
Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.spec.ts
- Replace cd-usage-bar totalBytes and usedBytes with total and bytes Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
* refs/pull/35499/head:
qa/tasks/test_nfs: Add test for cluster info
mgr/volumes/nfs: Add cluster show info command
volumes/fs/nfs: Don't parse rados export objects during FSExport init
pybind/mgr/volumes/nfs: Fix flake8 errors
qa/tasks/test_nfs: Add todo note for cluster update test
qa/tasks/cephfs/test_nfs: Add test for get and list detailed export
qa/tasks/cephfs/test_nfs: Add test for export user id
qa/tasks/cephfs/test_nfs: Add description for each test
doc/cephfs: Add list and get export usage
qa/tasks/cephfs: Add tests for export create with non-existing fsname and cluster id
qa/tasks/cephfs: Add tests for invalid cluster id, export type and modify list cluster
qa/tasks/cephfs: Add test for listing exports
pybind/mgr/volumes/nfs: Reorder FSExport and NFSCluster class methods
mgr/volumes/nfs: Set pool_namespace and cluster_id through decorator
mgr/volumes/nfs: Check cluster availability in export command methods
mgr/volumes/nfs: Misc changes to export get and ls command
qa/tasks/cephfs: Add test for nfs cluster ls command
mgr/volumes/nfs: Add nfs cluster ls command
mgr/volumes/nfs: Remove 'ganesha-' prefix from orch returned service id
qa/tasks/cephfs: Add test to check if export is available on restarting mgr
mgr/volumes/nfs: get export in a nfs cluster
mgr/volumes/nfs: list exports within a ganesha cluster
mgr/volumes/nfs: Check if cluster exists before creating exports
mgr/volumes/nfs: Fetch exports in persistent way if mgr is restarted
mgr/volume/nfs: allow only [A-Za-z0-9-_.] characters
qa/tasks/cephfs: Add idempotency test for nfs commands
mgr/volumes/nfs: Reorder imports
qa/tasks/cephfs/test_nfs.py: flake8 fixes
qa/tasks/cephfs/nfs: Poll for max 60 seconds to ensure removal of ganesha services
vstart: just use ganesha.nfsd that's in $PATH
vstart: Add ip value to nfs mount information
pybind/mgr/volumes/nfs: Remove unused cephfs module
mgr/volumes/nfs: Ignore if ganesha disconnects
mgr/volumes/nfs: use f-string for creating Exception
vstart: allow specifying a different ganesha binary
vstart: handle multiple ganesha's more sanely
vstart.sh: update comment to use ganesha from CentOS Storage SIG
vstart: set $CEPH_CONF when running ganesha-rados-grace
vstart: Support deployment of ganesha daemon by cephadm with NFS option.
mgr/test_orchestrator: List nfs daemon
qa/tasks/cephfs: Enable multiple exports tests
mgr/nfs: Instead of 'auth del' use 'auth rm'
qa/tasks/cephfs: Don't enable cephadm in TestNFS
qa/tasks/cephfs: Add tests for nfs exports
mgr/volumes/nfs: Fix idempotency of cluster and export commands
mgr/volumes/nfs: Fix incorrect read only access_type value
mgr/fs/nfs: Use check_mon_command() instead of mon_command()
qa/cephfs: Add tests for nfs
mgr/volumes/nfs: Remove type option from export create interface
vstart: Instead of CACHEINODE use MDCACHE
mgr/volumes: Rearrange nfs export interface
mgr/volumes/nfs: Delete common config object on cluster deletion
mgr/volumes/nfs: Delete all exports on cluster deletion
mgr/volumes: Make nfs create export interface idempotent
vstart: Add watch url for conf-nfs object
mgr/volumes/nfs: Delete user on removing export
mgr/volumes: Create user for given path and fs
vstart: Ensure cephadm and NFS does not conflict
vstart: Update details about ganesha packages
mgr/volumes/nfs: Add delete cephfs export command
mgr/volumes/nfs: Add RADOS notify for common config object
mgr/volumes/nfs: Pass cluster_id directly to NFSCluster {create, update, delete} methods
mgr/volumes: Add nfs cluster delete interface
mgr/volumes: Add nfs cluster update interface
vstart: Enable test_orchestrator in start_ganesha()
mgr/volumes: Add placement option to create nfs cluster interface
mgr/volumes/nfs: Change common ganesha config object name to 'conf-nfs.ganesha-<cluster_id>'
mgr/volumes/nfs: Call orch nfs apply
mgr/volumes: Add a note about placement option in nfs cluster create
mgr/volumes: Remove unused typing module
mgr/volumes: Make cluster id option mandatory in nfs create export
mgr/volumes: Update nfs cluster and export interface
vstart: Update the nfs cluster create and export interface
mgr/volumes: Remove GaneshaConf and NFSConfig class
mgr/volumes: Create multiple CephFS exports
mgr/volumes: Move ganesha common config to vstart
mgr/volumes/nfs: Fix mypy errors
mgr/volumes/nfs: Update the export class to remove unecessary config options
mgr/volumes: Remove dependency on dashboard ganesha module
vstart: Use random port instead of default Ganesha port
vstart: Use "NFS" instead "GANESHA" for starting nfs ganesha clusters
mgr/volumes: Improve readability of ganesha common config
vstart: Add note about mounting cephfs exports
src/vstart: Set CEPH_CONF environment variables
mgr/volumes/fs: Update default ganesha conf options
doc: Add document about fs nfs interface to create CephFS exports
vstart: Update fs nfs export create command
mgr/volumes: Update nfs export create and delete command
mgr/volumes: Remove create_rados_pool method
mgr/volumes: Changes to nfs export delete and create
mgr/volumes: While creating nfs-ganesha user update its cap
mgr/volumes: Update caps for new user created and add it's key to keyring
vstart: Update vstart according to cluster create command
mgr/volumes: Add Ganesha common config
mgr/volumes: Create NFSConfig class
mgr/volumes: Add command to create nfs-ganesha clusters
mgr: Create pool for nfs ganesha recovery
mgr: Add "ceph fs nfs delete <export_id>" to delete exports
mgr: Add command to create exports for nfs-ganesha
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Varsha Rao [Mon, 15 Jun 2020 11:29:41 +0000 (16:59 +0530)]
mgr/volumes/nfs: Misc changes to export get and ls command
This patch does following changes:
* Add extra line before every class definition
* Reorder export dictionary
* Use _fetch_export() in get export command
* Remove cluster_id key from export dictionary if single export is deleted