Commit Graph
26 Commits
Author SHA1 Message Date
Yuichiro Ueno 0559977b8a core: add context parameter to k8sutil pod
This commit adds context parameter to k8sutil pod functions. By this, we
can handle cancellation during API call of pod resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
2021-11-13 15:39:41 +09:00
subhamkrai 6387c7d063 core: close stdoutPipe for the discovery daemon
Closing stdoutPipe for the discovery daemon that
could possibly leaks memory due to unclosed resources.

Closes: https://github.com/rook/rook/issues/8914
Signed-off-by: subhamkrai <srai@redhat.com>
2021-10-05 18:10:59 +00:00
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
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
Alexander Trost 1a072be677 core: fix info log for discovered devices
Fix the info log statement to log the discovered devices as their string
representation instead of pointers.
This changes the info log to only be the device names and the debug log
to be the whole disk struct as well.

Resolves #5625

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2020-06-16 09:37:33 +02:00
Haichao Li c0a7297931 tests: Fix ProbeDevices function unit test failure
During the sgdisk command test, there was no output assignment,
causing uuid not found for device /dev/testa. Follow the log.

2020-04-27 18:24:21.921337 I | rook-discover: RUN Command lsblk
  [--all --noheadings --list --output KNAME]
2020-04-27 18:24:21.921491 I | rook-discover: RUN Command lsblk
[/dev/testa --bytes --nodeps --pairs --paths --output SIZE,ROTA,
RO,TYPE,PKNAME,NAME]
2020-04-27 18:24:21.921549 I | rook-discover: RUN Command sgdisk
[--print /dev/testa]
2020-04-27 18:24:21.921576 W | inventory: skipping device "testa"
because 'lsblk' failed. uuid not found for device /dev/testa. output=
2020-04-27 18:24:21.921592 I | rook-discover: localdevices: []
2020-04-27 18:24:21.921598 I | rook-discover: available devices: []
--- FAIL: TestProbeDevices (0.00s)
    discover_test.go:95:
                Error Trace:    discover_test.go:95
                Error:          Not equal:
                                expected: 1
                                actual  : 0
                Test:           TestProbeDevices
panic: runtime error: index out of range [0] with length 0 [recovered]
        panic: runtime error: index out of range [0] with length 0
FAIL    github.com/rook/rook/pkg/daemon/discover        0.050s

Signed-off-by: Haichao Li <haichao.li@arm.com>
2020-04-28 17:51:22 +08:00
Travis Nielsen e8f9cfcb71 exec: always write commands to debug log
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-19 07:49:54 -06:00
Travis Nielsen f2ecaa2bda exec: remove the unused actionName param
The helpers for executing a process have long required an actionName
param which is not being used. Now we remove the old param
while also cleaning up various other usages of the exec
package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-19 07:49:53 -06:00
Nizamudeen 53883f68cf ceph: Handling Unhandled errors
This commit is to handle all those unhandled errors which raises the gosec warning.

Fixed G104: Unhandled Errors are handled now

Signed-off-by: Nizamudeen <nia@redhat.com>
2020-02-21 22:48:24 +05:30
Sébastien Han 227d2d527a ceph: osd store refactor
Multiple things:

1. We removed all the function/methods/tests that were used to
create and manage rook legacy OSDS as well as bringing support to
Bluestore OSD only.
It also fixes various go-lint issues in the respectives files.

2. use c-v inventory to detect available devices:
Now we rely on the 'ceph-volume inventory' command to tell us if a
device is available or not.

3. implement raw mode for osd on pvc
When an OSD will be bootstrap on a PVC, the new c-v raw mode will be
used. It consists of putting block, db and wal under the same device.
Here LVM is out of the picture and the raw device is used as is. The
implementation is backward compatible so existing OSD on PVC will LVM
will continue to operate.

Closes: https://github.com/rook/rook/issues/4363
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-01-23 19:13:09 +01:00
Travis Nielsen 5d24710fd2 ceph: set discover ownerrefs without blocking parent deletion
An owner reference cannot be set with BlockOwnerDeletion: true
if the operator does not have privs to add a finalizer to the parent.
The discover resources don't need to block deletion based on the
parent so we remove that property from the owner reference.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-12-13 15:22:21 -07:00
Sébastien Han 2396e64525 rook: add owner reference to discover cm
Add owner reference to the discover config map so that when the
discover pod goes away we also remove its configmap.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-12 15:10:06 +01:00
Nizamudeen 910fe6f980 ceph: make the udevfilter into configurable
Added default regex values.
Created an environment variable and using that variable the user can give custom regex values
Updated the PendingReleaseNotes.md
Signed-off-by: Nizamudeen <nia@redhat.com>
2019-12-10 10:07:30 +05:30
Juan Miguel Olmo Martínez 7c942604f6 ceph: Get <ceph-volume inventory> data in dev. configmaps
**Description of your changes:**
This modification adds the information extracted from 'ceph-volume inventory':
command to the device configmaps generated by the discovery daemon when
"rook discover" starts with the new boolean "--use-ceph-volume" parameter.

Resolves #
https://github.com/rook/rook/issues/2606

Now the <cephVolumeData> field contains all the information returned
from <ceph-volume inventory> command.

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
2019-11-06 10:22:56 +01:00
Umanga Chapagain 3f2c9f4e79 ignore updates on nbd device
- adds regex to ignore updates on nbd device
  similar to 'rbd' and 'dm'

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-09-06 12:00:51 +05:30
rohan47andAshish Ranjan d2f52aebe5 Adds support for storageClassDeviceSet in rook-ceph operator
- Added code to support StorageClassDeviceSet spec provided in the cluster-on-pvc.yaml
- The code reads the StorageClassDeviceSet spec and creates pvc based on the ‘count’ field for each device set.
- OSD prepare job is started for each PVC which activates the ceph-volume on each PVC
- Finally OSD is started on each of the PVC device.

Co-authored-by: rohan47 <rohgupta@redhat.com>
Co-authored-by: Ashish Ranjan <aranjan@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-08-12 09:24:13 -06:00
Noah Watkins 3966f163ed discover: handle false-positives observed by users
the only exception to a naive device list comparison had been to ignore
drive UUID information which was unreliable when a device wasn't
formatted / partitioned. however various users have reported different
type of false positives that resulted in orchestration being run
continuously due to the wrong observation that devices were changing.

this patch fixes the cases we have observed and attempts to be slightly
more conservative in the calculation.

1. the devlinks is ignored. when a device is setup for lvm, for example,
the devlinks will be updated with different paths that point to the
device in addition to its standard paths addressable by pci address.

2. in the lvm case, the "model" field and "filesystem" field may also
change.

3. we ignore devices with devlinks that contain "usb" to avoid issues
when using usb drives.

4. be smart about detecting device availability. if a device transitions
from a non-empty (or has-partitions) state to an empty (or unpartitioned)
state then orchestration is triggered. this like observing that a device
is now available (e.g. in the allDevices case). however, when a device
transistions from empty to non-empty, then this is ignored as while it
is a change, it's generally a change associated with the new consumption
of the device.

fixes: #3059
fixes: #3185
fixes: #3131

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-06-07 08:22:08 -07:00
Noah Watkins fbc64ff8f4 ceph: check for equiv device config maps in operator
this is an attempt to reduce the number of false positive config map
updates used to trigger orchestration for hotplugging.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-26 09:37:25 -07:00
Noah Watkins 16a7d6aef6 ceph: blacklist rbd devices from hotplug detection
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-23 13:44:30 -07:00
Noah Watkins e97a746386 discover: trigger device probe on udev event
this patch monitors udev events from the block subsystem via the udevadm
tool. it watches for add and delete events within a specified period
(e.g. 2 seconds) and then emits a trigger which starts a new device
probe operation.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-16 11:29:09 -07:00
Noah Watkins e0c1f5af1a discover: smarter device list change calculation
this patch ignores the UUID when determining if a device probe result
has changed. it has been observed that on some machines the UUID for the
devices are not stable. the UUID is still reported as normal through the
configmap.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-16 11:28:41 -07:00
Alexander Trost b12d1e82cf Use truncated node name "everywhere"
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-11-23 10:02:35 +01:00
travisn 01dc5656f3 reduce frequency of device discovery
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-17 09:56:47 -06:00
Huamin Chen 82425aafcc prepare osd in a job per node. Once all osds are prepared, store osd info in orchestration configmap.
Operator watches the configmap, starts one osd replica set per osd.

Signed-off-by: Huamin Chen <hchen@redhat.com>
2018-07-05 16:02:27 -06:00
travisn d5d3540497 osd: detect disk uuid with sgdisk
Signed-off-by: travisn <tnielsen@redhat.com>
2018-06-19 13:05:51 -07:00
Huamin Chen 6c11ff52d4 add device discovery daemon to operator:
run "rook discover" on storage nodes and discover devices on each node. The discovered disks are saved in a per node configmap, local-device-nodename.
Device information consits of name and persistent names, uuid, partition, filesystem, rotational, readonly, size, etc.

Signed-off-by: Huamin Chen <hchen@redhat.com>
2018-05-07 17:49:02 +00:00