Commit Graph
484 Commits
Author SHA1 Message Date
Sébastien Han 504e9aa806 ceph: do not duplicate osd info
When c-v runs after the end of the prepare sequence, it will look for
lvm and raw-based OSDs. The raw mode detects LVM OSDs so we must trim
the list of OSD, only to report the LVM ones if their ID exists.

Closes: https://github.com/rook/rook/issues/7359
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-03-09 15:17:32 +01:00
Sébastien Han 3dde2609fa ceph: add raw mode for non-pvc osd
For simple OSD scenario that don't require the following:

* an encrypted osd
* an osd with a backing device
* multiple osd on the same block device

The OSD will be prepared using the ceph-volume raw mode which does
not use LVM on non-pvc case.

Closes: https://github.com/rook/rook/issues/4768
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-03-03 14:11:26 +01:00
Sébastien Han 06810b9700 ceph: fix iteration
block if not defined was used with osdInfo.Device so not empty anymore
in the loop, which means it will have the same value for all OSDs in the
loop.
This is only called when running on PVC, where a single device is
present so the loop has a single iteration, so not a big issue.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-03-03 14:06:19 +01:00
Sébastien Han 8dfa99e01d ceph: rework multiple filesystem support
The upcoming Rook release 1.6 will support Ceph Pacific which introduces
stable support for multiple Ceph Filesystems in the same cluster. So we
now allow the creation of multiple Filesystem if the release is Pacific.

Also, we remove the Operator config flag which was not necessary.

Here I have 2 filesystems:

```
[root@rook-ceph-tools-6b4889fdfd-vncck /]# ceph fs ls
name: myfs, metadata pool: myfs-metadata, data pools: [myfs-data0 ]
name: myfs2, metadata pool: myfs2-metadata, data pools: [myfs2-data0 ]
```

```
  cluster:
    id:     cc747950-589a-4862-bad2-ff7de1217b1a
    health: HEALTH_WARN
            mons a,b,c are low on available space
            6 pool(s) have no replicas configured

  services:
    mon: 3 daemons, quorum a,b,c (age 2d)
    mgr: a(active, since 2d)
    mds: myfs:1 myfs2:1 {myfs2:0=myfs2-b=up:active,myfs:0=myfs-b=up:active} 2 up:standby-replay
    osd: 3 osds: 3 up (since 2m), 3 in (since 6d)

  data:
    pools:   6 pools, 717 pgs
    objects: 44 objects, 4.2 KiB
    usage:   46 MiB used, 90 GiB / 90 GiB avail
    pgs:     717 active+clean

  io:
    client:   1.8 KiB/s rd, 4 op/s rd, 0 op/s wr

  progress:
    Global Recovery Event (45s)
      [===========================.]
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-03-02 18:27:04 +01:00
Sébastien Han a134d1df6e Merge pull request #7336 from leseb/revert-vault-backend
ceph: revert kms VAULT_KV_VERS to VAULT_BACKEND
2021-03-02 10:44:43 +01:00
Sébastien Han e4c3a4cef7 ceph: revert kms VAULT_KV_VERS to VAULT_BACKEND
The vault env variable VAULT_BACKEND is read by the secret library so we
must not change it. This is reverting
ee6a03dfb8 with a few extra fixes for the
rgw code.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-03-02 10:08:39 +01:00
Blaine Gardner efa7d66d45 ceph: remove driveGroup support
Remove features and design that supports adding OSDs to Ceph clusters
via `spec:driveGroups`. Update the Ceph upgrade doc that informs users
who currently use Drive Groups (we believe there are none of these
users) how to migrate to using the `spec:storage` config.

Resolves https://github.com/rook/rook/issues/7275

Revert "ceph: fix drive group deployment failure"
This reverts commit 76f1d9944e.

Revert "ceph: osd: add drive groups spec to cluster CR"
This reverts commit 7117fc12b7.

Revert "design: ceph orchestrator module add/remove OSDs"
This reverts commit 178187d035.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-02-25 17:08:47 -07:00
Sébastien Han 91343f4fdd Merge pull request #7283 from leseb/rm-index-cephfs-mirror
ceph: misc improvement for the ceph-fs-mirror implementation
2021-02-23 17:06:29 +01:00
Sébastien Han 8e8afe7a75 ceph: do not check ok-to-stop fs-mirror
The fs-mirror has no "ok-to-stop" command so let's skip it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-23 10:49:13 +01:00
Sébastien Han 0300111f73 ceph: fail if subfailure domains are identical
Both cannot be identical otherwise this will create placement issues.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-22 17:24:24 +01:00
Travis Nielsen 7404de7b38 Merge pull request #7264 from fritchie/pool-quotas
ceph: add ability to set pool quotas
2021-02-19 12:53:41 -07:00
Frank Ritchie a0488dac73 ceph: add ability to set pool quotas
This will allow setting ceph pool quotas in bytes and/or objects.

Ceph documentation: https://docs.ceph.com/en/latest/rados/operations/pools/#set-pool-quotas

Signed-off-by: Frank Ritchie <12985912+fritchie@users.noreply.github.com>
2021-02-19 13:49:25 -05:00
Travis Nielsen 291bf9e061 ceph: enforce portable osds in same topology as osd prepare job
The osd prepare job detects the failure domain for the OSD by querying
the node topology labels. This topology is then assigned to the OSD
daemon in the CRUSH map. Previously, the affinity was required to be
set in the cluster CR, but it was very difficult to get right. Now the
operator will enforce the correct topology label on the OSD daemon
nodeAffinity by setting the label of the lowest topology in the hierarcy.

For example, if there are region, zone, and rack labels, the rack label
would be used to set the node affinity for the OSD daemon. If an
OSD prepare job is run in rack1, the corresponding OSD daemon will
have node affinity to rack1 to ensure the same topology. Previously,
the OSD could have ended up in rack2 unless the storageClassDeviceSet
placement was very carefully crafted.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-18 12:49:37 -07:00
Sébastien Han f8ce9df5e3 Merge pull request #7001 from crombus/master
ceph: Add ceph archive cmd in osd removal
2021-02-18 17:09:52 +01:00
crombus 76ed166e86 ceph: add ceph archive cmd in osd removal
Add ceph archive cmd in osd removal for
Silencing the warning when osd is removed.

Signed-off-by: crombus <pkundra@redhat.com>
2021-02-18 21:08:16 +05:30
Travis Nielsen dfc24ddd24 Merge pull request #7240 from leseb/fix-vault-key-override
ceph: do not override existing keys
2021-02-16 16:09:34 -07:00
Sébastien Han 9a604640ac ceph: do not override existing keys
If the cluster was expanded we would iterate over the entire list of
OSDs again, create a new key and override in Vault... The Secret store
is not impacted since we have a handler for "already exist".

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-16 19:20:20 +01:00
Blaine Gardner a95734160e ceph: create new osds on pvc before update existing
Add a new OSD provisioner status (reported by provisioner configmap)
that denotes that an OSD is preexisting and that OSD prepare does not
need to be run for the OSD. This only applies to OSDs on PVC currently
where existence of a deployment for the OSD indicates no further
provisioning needs to occur. New status is "preexisting".

Allow creating new OSDs on PVCs before updating existing ones by
allowing deferring OSDs during processing of OSD provisioning status
ConfigMaps. Deferral is identified by new "preexisting" status.

Add a unit test to ensure OSD on PVC provisioning occurs as expected
including deferring already-created OSDs to be updated after new PVCs
are created.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-02-12 17:38:35 -07:00
Sébastien Han e6e9c8c901 ceph: do not print pointer memory address
When printing pointers of struct (regardless if it is also a slice or
not) we must implement a stringer interface so they can be displayed
properly, this is especially useful when looking at the prepare job
logs.

Before this patch:

```
2021-02-10 06:39:06.783508 D | inventory: discovered disks are [0xc00029c240 0xc00024a000 0xc00086c480 0xc00024a480]
```

After this patch:

```
2021-02-11 13:05:15.730500 D | inventory: discovered disks are:
2021-02-11 13:05:15.730636 D | inventory: &{Name:dm-0 Parent: HasChildren:false DevLinks:/dev/disk/by-id/dm-uuid-LVM-aIFRq5P3hwE2YhukbOmsEZoLY61HxvX62A1xxb6ajTymVE0N8S4Ga0KWlHSgpvNw /dev/disk/by-id/dm-name-ceph--e29bf82e--86f1--4c8e--8412--c468def5a844-osd--block--2044a1ea--6e5e--4423--88cf--8947bf6957d1 Size:32208060416 UUID:91a852c2-8727-4277-9d92-879ee1996503 Serial: Type:lvm Rotational:true Readonly:false Partitions:[] Filesystem:ceph_bluestore Vendor: Model: WWN: WWNVendorExtension: Empty:false CephVolumeData: RealPath:/dev/mapper/ceph--e29bf82e--86f1--4c8e--8412--c468def5a844-osd--block--2044a1ea--6e5e--4423--88cf--8947bf6957d1 KernelName:dm-0 Encrypted:false}
2021-02-11 13:05:15.730657 D | inventory: &{Name:dm-1 Parent: HasChildren:false DevLinks:/dev/disk/by-id/dm-uuid-LVM-GyLVW5UxDRcws8PwsbQuY2CjrQwdn1VxgPQjsKZ2pGVaS1r2Ct0OGZ4P80yEMtqW /dev/disk/by-id/dm-name-ceph--334c640f--7a7f--4fdb--9db4--2f9459e19f9a-osd--block--66ce11c8--20f0--4600--ae50--e8849c9a0af6 Size:32208060416 UUID:cdbcb218-1b03-4d8c-b7d2-25cb88e33b6a Serial: Type:lvm Rotational:true Readonly:false Partitions:[] Filesystem:ceph_bluestore Vendor: Model: WWN: WWNVendorExtension: Empty:false CephVolumeData: RealPath:/dev/mapper/ceph--334c640f--7a7f--4fdb--9db4--2f9459e19f9a-osd--block--66ce11c8--20f0--4600--ae50--e8849c9a0af6 KernelName:dm-1 Encrypted:false}
2021-02-11 13:05:15.730686 D | inventory: &{Name:dm-2 Parent: HasChildren:false DevLinks:/dev/disk/by-id/dm-name-ceph--a011b5c2--cc3f--497a--b19a--6d284461cbc4-osd--block--4de5491c--ecf8--455d--9858--547001fd0321 /dev/disk/by-id/dm-uuid-LVM-QGzgO4E228fvT3NsighNABGdvAKxQEhFOh9rKiDLnSOTk7jLZWu2r1RIMXe5GNqW Size:32208060416 UUID:2238ce24-79e4-41a0-b8ce-e381ac41d5b0 Serial: Type:lvm Rotational:true Readonly:false Partitions:[] Filesystem:ceph_bluestore Vendor: Model: WWN: WWNVendorExtension: Empty:false CephVolumeData: RealPath:/dev/mapper/ceph--a011b5c2--cc3f--497a--b19a--6d284461cbc4-osd--block--4de5491c--ecf8--455d--9858--547001fd0321 KernelName:dm-2 Encrypted:false}
2021-02-11 13:05:15.730713 D | inventory: &{Name:vda1 Parent:vda HasChildren:false DevLinks:/dev/disk/by-path/pci-0000:00:05.0-part1 /dev/disk/by-path/virtio-pci-0000:00:05.0-part1 /dev/disk/by-uuid/0fdf5e49-6b3c-42f2-a1c5-bf77e490dfa4 /dev/disk/by-partuuid/f9dd32c9-a4a5-654f-aee4-651276fdc754 /dev/disk/by-label/boot2docker-data Size:19998934528 UUID: Serial: Type:part Rotational:true Readonly:false Partitions:[] Filesystem:ext4 Vendor: Model: WWN: WWNVendorExtension: Empty:false CephVolumeData: RealPath:/dev/vda1 KernelName:vda1 Encrypted:false}
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-11 14:06:42 +01:00
Sébastien Han 7c928f4196 ceph: return an error if PVC is not clean
With 5f57b6fd3a, we introduced a
regression in the validation code.
If the OSD PV comes from another cluster, GetCephVolumeRawOSDs must
return an error.
The prepare job will crash loop but at least with a useful and
comprehensive message.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 11:28:08 +01:00
Sébastien Han 8d033efb5a ceph: silence harmless errors
If the ceph cli outputs an error with "error calling conf_read_file"
this means that the operator has not written its ceph configuration
file. Thus ceph cli commands will fail, so we can just ignore that since
the operator will soon write this file in its initialization sequence.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-03 17:28:44 +01:00
Santosh Pillai 113376f1ab ceph: timeout radosgw-admin cli commands
When creating object store, `radosgw-admin realm get ..` command is stuck forever when required number of OSDs are not available. Because of this the uninstall of object store is also stuck. User has to manually remove the finalizer to delete the object store.This PR uses `ExecuteCommandWithTimeout` for running `radosgw-admin` command. Timeout during installation will be reconciled. Cleanup will be treated as best effort. Any errors during uninstalling of single site object store will only be logged.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-02-01 10:57:04 +05:30
Sébastien Han c0123cf182 ceph: add cephfs mirroring support
With Ceph Pacific, Rook can now deploy the cephfs-mirror daemon.
This initial commit covers the deployment of a single daemon only.
Multiple mirror daemons is currently untested.
Only a single mirror daemon is recommended.

The configuration of peers will come in a later PR since the mgr module
is still pending upstream: https://github.com/ceph/ceph/pull/39050

The same goes for integration tests, they will get added later once we
start testing on Pacific.

Closes: https://github.com/rook/rook/issues/7002
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-28 19:21:18 +01:00
Santosh Pillai 4237aa7ecc ceph: configure health check timeout for OSDs when upgrading
added waitTimeoutForHealthyOSD in the cluster crd that defines the time (in minutes) the operator would wait before an OSD can be stopped for
upgrade. This PR also removes the ok-to-continue logic for osds as its already handled by ok-to-stop. The default value is 10 minutes.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-01-27 11:13:05 +05:30
Jiffin Tony Thottan da61c9a83e ceph: vault kms configuration for ceph object store
The first patch to configure vault for ceph object store. If the `security.kms` configured in
`clusterSpec` CRD, RGW will be configured with vault kms settings to handle SSE request from s3 clients.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-01-22 10:44:03 +05:30
Sébastien Han 362637ec3d ceph: do not explicitly turn on the balancer
As of Pacific the balancer is now on by default in upmap mode.
In earlier versions, the balancer was included in the `always_on_modules` list, but needed to be
turned on explicitly using the ``ceph balancer on command.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-08 17:20:47 +01:00
shenjiatong 8d3d460e70 ceph: refactor and remove duplicate codes
Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2020-12-18 18:01:30 +08:00
shenjiatong 04aabb3896 ceph: analyze result for new typed return from lvm batch
Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2020-12-18 11:11:03 +08:00
ushen 373b952988 ceph: allow ceph 14.2.15 for lvm batch
14.2.15 lvm batch command prepare report changes
output format. This commit skips md check if ceph version
is greater than 14.2.13.

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2020-12-18 11:11:02 +08:00
Travis Nielsen 45e8ca7173 Merge pull request #6838 from synarete/ceph-crush-rule-with-device-class
ceph: Two step crush rule with device class
2020-12-16 13:08:52 -07:00
Travis Nielsen 64fc740d8a ceph: revert new node is not provisioned when useallnodes is true
This reverts commit a6ee5657ae.
The operator reconcile of the cephcluster was staying in an endless
loop in clusters that did not have OSDs configured on all nodes.
Now we revert this change for the patch release and will follow
up with a more complete fix in https://github.com/rook/rook/pull/6813.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-16 11:36:31 -07:00
Shachar Sharon 39a806f747 test: ceph add-rule via crush-map explicit decompile/compile
Test the code-flow when creating crush-rule via explicit
decompile/compile crushmap, when building two-steps crush rule. Relevant
for the case where 'PoolSpec.Replicated.ReplicasPerFailureDomain' is non
zeoro.

This test requires ceph's 'crushtool' to be installed on local machine.
Otherwise, it is ignored.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
2020-12-16 17:43:49 +02:00
Shachar Sharon 53461dd2ef ceph: pass 'device-class' when creating explicit crush-rule
When 'pool.Replicated.ReplicasPerFailureDomain' is non zero, the code
goes via route of adding explicit crush-rule from template, but ignores
the 'pool.DeviceClass' if it is set. Added option to template to have
(optional) 'class hdd|ssd'

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
2020-12-16 17:42:27 +02:00
Travis Nielsenandshenjiatong a0a27bc426 ceph: apply deviceClass properly to new osds
The deviceClass property was being ignored when creating the
non-pvc OSDs. Now the deviceClass will be specified as a property
for individual devices, all devices on a node, or all OSDs in the
cluster, depending on the level where the config is applied in the
cluster CR.

Co-authored-by: shenjiatong <yshxxsjt715@gmail.com>
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-11 10:16:00 -07:00
Travis Nielsen d0ba899341 ceph: check stretch cluster is ready to configure arbiter
The arbiter can only be configured with the stretch cluster if the
CRUSH map is balanced and there are two zones in the CRUSH map.
After the OSDs are configured, we wait for all the OSD pods to be
running and that the CRUSH map is balanced. If it takes more than
two minutes, we fail the reconcile and try again. This is only done
the first time the stretch cluster is configured. In future reconciles
we first check if the stretch cluster is already enabled before
enabling it again.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-09 16:37:24 -07:00
Travis Nielsen 6fb3c522bb Merge pull request #6768 from shaas/master
ceph: fix #6214 New node is not provisioned when useAllNodes: true
2020-12-04 08:57:49 -07:00
Stefan Haas a6ee5657ae ceph: fix #6214 New node is not provisioned when useAllNodes: true
Signed-off-by: Stefan Haas <shaas@suse.com>
2020-12-04 15:05:58 +01:00
Sébastien Han aca5a8cc53 ceph: use debug message for snap schedule
We don't need to print this every 60s in the operator log.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-26 09:12:11 +01:00
Sébastien Han 5d9612c2ae ceph: fix metadata device passed by-id
The code was assuming that devices were passed by the user as
"/dev/sda", this is bad! We all know people should be using paths like
/dev/disk/by-id so we must support them.

Closes: https://github.com/rook/rook/issues/6685
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-25 15:00:47 +01:00
Arun Kumar Mohan ded16f779d ceph: changes for 'sigs.k8s.io/sig-storage-lib-external-provisioner/v6'
Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 21:14:03 +05:30
Arun Kumar Mohan 65d16bfc94 ceph: manual changes needed for kubernetes api updates
Fetched latest lib-bucket-provisioner changes as well.

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 21:14:01 +05:30
Sébastien Han afc7ecff31 ceph: add snapshot scheduling for mirrored pools
Now, we can schedule snapshots on pools from the CephBlockPool CR when
the pool is mirrored.
It can be enabled like this:

```
mirroring:
  enabled: true
  mode: pool
  snapshotSchedules:
    - interval: 24h # daily snapshots
      startTime: 14:00:00-05:00
```

Multiple schedules are supported since snapshotSchedules is a list.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 09:50:09 +01:00
Lalit Maganti 1d1a9f111a ceph: associate newly created pools to existing filesystem
When new pools are added to an already existing filesystem, we would
create them but not actually associate them to the filesystem. Ensure
that we do this.

Also, while we're here, we refactor the CreateFilesystem test: before,
we were not properly testing creating the filesystem from scratch
because we would return valid JSON for *every* ceph command. Change this
by making the first run return an error so that we get some better
coverage.

After this, we also add a check for the correctness of adding new pools
to the CreateFilesystem unittest.

Fixes #5876

Signed-off-by: Lalit Maganti <lalitm@google.com>
2020-11-11 22:16:37 +00:00
Sébastien Han e3d032dbc1 Merge pull request #6489 from travisn/stretch-mons
ceph: Stretch cluster configuration
2020-11-06 15:16:39 +01:00
Mateusz Gozdek 8ba3762fa4 docs: fix bunch of typos
Found by running the following command:

codespell -S .git,*.png,*.jpg -L \
aks,keyserver,atleast,dne,ser,ist,files\',ba,dum,iam,te -f -H

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-06 10:01:04 +01:00
Sébastien Han 8631eef1f7 ceph: correctly populate variable
The wrong variable was referenced in the print.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-05 18:06:47 +01:00
Sébastien Han bc5c8d32f1 ceph: fix crush-class osd on non-PVC
We need to use storeConfig instead device config as the later never
seems to be populated.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-05 18:06:47 +01:00
Sébastien Han 6b211eacba ceph: add unit test for osd batch mode
We now have much better coverage on the c-v on non-pvc scenario.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-05 18:06:11 +01:00
Travis Nielsen e72b69f8e0 ceph: validate pools for stretch clusters
Pools in stretch clusters will all use the same crush rule that
is generated by the operator when configuring the cluster for
stretch mode, with replica 4 and two replicas per failure domain.
Pools cannot create new crush rules, so we require that replica be
4 when the pools is created, EC is not allowed, and no new
crush rule will be created.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-05 09:23:57 -07:00
Travis Nielsen b91f4211c9 ceph: configure a stretched cluster
In clusters where only two datacenters (or similar failure domains)
are available, a different mon and osd approach is needed to deal
with the network partitions or some other reason for one of the failure
domains going down. The Ceph stretched cluster makes the mons aware
of the failure domains by configuring one as the arbiter in a third
zone, while keeping two replicas of the data in each of the data
zoens.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-05 09:17:52 -07:00