Commit Graph
240 Commits
Author SHA1 Message Date
travisn f3ce214822 ceph: configure additional lvm settings for rhel8
RHEL8 introduces some lvm changes. For OSDs on PVs to work
we need to set allow_changes_with_duplicate_pvs = 1.
This is required since we're copying the block image
under another location.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-09-20 11:51:07 -06:00
Santosh Pillai 9db863377a release the device held onto by lvm
When running osds on pvc, the lvm is still holding the device when the cluster is deleted. As a result the PVs go into `failed` state
when the cluster is deleted. On deactivating the device, the 'failed' pvs get deleted as well. Solution involves:
- Running `lvchange -an <vg group name>` to deactivate the device.
- This command runs after 'osd prepare' completes.
- This command also runs after the 'osd daemon pod' is deleted or if the ceph-osd process terminates for some reasons.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-09-20 18:08:13 +05:30
Sébastien Hanand: Tuan Do Anh <tuanda@vn.fujitsu.com> 13686e3f8c test: remove unused function
Remove dead code.

Co-authored-by:: Tuan Do Anh <tuanda@vn.fujitsu.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-09-19 11:37:14 +02:00
Sébastien Han 171c4ac438 ceph: fix upgrade commands
Several commands were not using the cli finalizer function which builds
up the right argument to run a ceph command. This was working on the
operator since it used to have an /etc/ceph/ceph.conf file so we could
ran the command without specifying the ceph conf and key paths.
However, we recently removed that and it silently broke this "already"
broken code :).

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-09-17 18:59:42 +02:00
Sébastien Han ff73043b75 Merge pull request #3790 from umangachapagain/nbd-filter
ignore updates on nbd device
2019-09-11 17:59:15 +02:00
Blaine Gardner 704786f273 Ceph: use combined output from ceph-volume
ceph-volume now sends status and log output to stderr, which breaks
`ceph-volume lvm prepare` if not other things as well. Use the combined
stdout and stderr output from ceph-volume to fix this.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-09-09 10:29:51 -06:00
Travis Nielsen 49c516916e Merge pull request #3781 from rohantmp/topology
Fix topologyAware on PVC-based OSDs
2019-09-06 13:59:22 -06:00
Rohan CJ f8b7537830 Fix topologyAware on PVC-based OSDs
Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-09-06 23:17:01 +05:30
Alexander Trost 10f17bc1e0 Merge pull request #3791 from ashishranjan738/osdpanic
fix(osd prepare): osd prepare job getting into panic state
2019-09-06 17:38:13 +02:00
Travis Nielsen cb5143555d Merge pull request #3779 from sp98/fix-osd-failure-on-pvc
fix random OSD daemon pod failures when running OSD on PVC
2019-09-06 06:59:57 -06:00
Ashish Ranjan f16c8dc060 fix(osd prepare): osd prepare job getting into panic state
Osd pods getting into panic state due to index out of range error.

logs of osd prepare job:

```
[aranjan@localhost:~]$ oc logs -f rook-ceph-osd-prepare-set1-0-data-6f2nh-zh4zl
2019-09-06 07:48:11.448085 I | cephcmd: desired devices to configure osds: [{Name:/mnt/set1-0-data-6f2nh OSDsPerDevice:1 MetadataDevice: DatabaseSizeMB:0 DeviceClass: IsFilter:false}]
2019-09-06 07:48:11.449841 I | rookcmd: starting Rook v1.0.0-623.gc18d575c.dirty with arguments '/rook/rook ceph osd provision'
2019-09-06 07:48:11.449866 I | rookcmd: flag values: --cluster-id=308f232a-d07a-11e9-96ba-0adfe2bb9bfc, --data-device-filter=, --data-devices=/mnt/set1-0-data-6f2nh, --data-directories=, --encrypted-device=false, --force-format=false, --
help=false, --location=, --log-flush-frequency=5s, --log-level=INFO, --metadata-device=, --node-name=set1-0-data-6f2nh, --operator-image=, --osd-database-size=0, --osd-journal-size=5120, --osd-store=, --osd-wal-size=576, --osds-per-devic
e=1, --pvc-backed-osd=true, --service-account=
2019-09-06 07:48:11.449875 I | op-mon: parsing mon endpoints: a=172.30.150.154:6789
2019-09-06 07:48:11.470058 I | cephconfig: writing config file /var/lib/rook/rook-ceph/rook-ceph.config
2019-09-06 07:48:11.470797 I | cephconfig: generated admin config in /var/lib/rook/rook-ceph
2019-09-06 07:48:11.470989 I | cephosd: discovering hardware
2019-09-06 07:48:11.471030 I | exec: Running command: lsblk /mnt/set1-0-data-6f2nh --bytes --nodeps --pairs --output SIZE,ROTA,RO,TYPE,PKNAME
2019-09-06 07:48:11.473887 I | exec: Running command: sgdisk --print /mnt/set1-0-data-6f2nh
2019-09-06 07:48:11.476048 I | cephosd: creating and starting the osds
2019-09-06 07:48:11.476070 I | exec: Running command: lsblk /mnt/set1-0-data-6f2nh --bytes --pairs --output NAME,SIZE,TYPE,PKNAME
2019-09-06 07:48:11.478030 I | sys: Output: NAME="xvdbg" SIZE="10737418240" TYPE="disk" PKNAME=""
2019-09-06 07:48:11.478056 I | cephosd: /mnt/set1-0-data-6f2nh found in the desired devices
2019-09-06 07:48:11.488231 I | cephosd: configuring osd devices: {"Entries":{"/mnt/set1-0-data-6f2nh":{"Data":-1,"Metadata":null,"Config":{"Name":"/mnt/set1-0-data-6f2nh","OSDsPerDevice":1,"MetadataDevice":"","DatabaseSizeMB":0,"DeviceCl
ass":"","IsFilter":false},"LegacyPartitionsFound":false}}}
2019-09-06 07:48:11.492191 I | cephosd: device /mnt/set1-0-data-6f2nh to be configured by ceph-volume
2019-09-06 07:48:11.492213 I | cephosd: 0/0 pre-ceph-volume osd devices succeeded on this node
2019-09-06 07:48:11.492399 I | exec: Running command: ceph auth get-or-create-key client.bootstrap-osd mon allow profile bootstrap-osd --connect-timeout=15 --cluster=rook-ceph --conf=/var/lib/rook/rook-ceph/rook-ceph.config --keyring=/va
r/lib/rook/rook-ceph/client.admin.keyring --format json --out-file /tmp/973674470
2019-09-06 07:48:12.020858 I | cephosd: Successfully updated lvm config file
2019-09-06 07:48:12.020894 I | cephosd: configuring new device /mnt/set1-0-data-6f2nh
2019-09-06 07:48:12.020908 I | exec: Running command: stdbuf -oL ceph-volume lvm prepare --data /mnt/set1-0-data-6f2nh
2019-09-06 07:48:55.172366 I | cephosd:
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/rook/rook/pkg/daemon/ceph/osd.getLVPath(0x0, 0x0, 0x1e3c60d, 0x2)
        /home/aranjan/Project/go/src/github.com/rook/rook/pkg/daemon/ceph/osd/volume.go:128 +0x2fd
github.com/rook/rook/pkg/daemon/ceph/osd.(*OsdAgent).initializeBlockPVC(0xc000829c30, 0xc00072e1e0, 0xc000736e70, 0x1e4927d, 0xd, 0x0, 0x0)
        /home/aranjan/Project/go/src/github.com/rook/rook/pkg/daemon/ceph/osd/volume.go:108 +0x50b
github.com/rook/rook/pkg/daemon/ceph/osd.(*OsdAgent).configureCVDevices(0xc000829c30, 0xc00072e1e0, 0xc000736e70, 0x38, 0xc000829310, 0x2, 0x2, 0x0)
        /home/aranjan/Project/go/src/github.com/rook/rook/pkg/daemon/ceph/osd/volume.go:70 +0x33a
github.com/rook/rook/pkg/daemon/ceph/osd.(*OsdAgent).configureDevices(0xc000829c30, 0xc00072e1e0, 0xc0000bc370, 0x1c, 0xc0008296e8, 0x1, 0x1, 0xd)
        /home/aranjan/Project/go/src/github.com/rook/rook/pkg/daemon/ceph/osd/agent.go:213 +0x97d
github.com/rook/rook/pkg/daemon/ceph/osd.Provision(0xc00072e1e0, 0xc000829c30, 0xc0000560d0, 0x24)
        /home/aranjan/Project/go/src/github.com/rook/rook/pkg/daemon/ceph/osd/daemon.go:166 +0xeb2
github.com/rook/rook/cmd/rook/ceph.prepareOSD(0x359be60, 0x35cd220, 0x0, 0x0, 0x0, 0x0)
        /home/aranjan/Project/go/src/github.com/rook/rook/cmd/rook/ceph/osd.go:252 +0x838
github.com/rook/rook/vendor/github.com/spf13/cobra.(*Command).execute(0x359be60, 0x35cd220, 0x0, 0x0, 0x359be60, 0x35cd220)
        /home/aranjan/Project/go/src/github.com/rook/rook/vendor/github.com/spf13/cobra/command.go:762 +0x465
github.com/rook/rook/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x359e200, 0xc0006eff30, 0xb, 0xb)
        /home/aranjan/Project/go/src/github.com/rook/rook/vendor/github.com/spf13/cobra/command.go:852 +0x2ec
github.com/rook/rook/vendor/github.com/spf13/cobra.(*Command).Execute(...)
        /home/aranjan/Project/go/src/github.com/rook/rook/vendor/github.com/spf13/cobra/command.go:800
main.main()
        /home/aranjan/Project/go/src/github.com/rook/rook/cmd/rook/main.go:35 +0x12e
```

Signed-off-by: Ashish Ranjan <aranjan@redhat.com>
2019-09-06 13:40:22 +05:30
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
Santosh Pillai ead0653068 fix random OSD daemon pod failures when running OSD on PVC
OSD pods when running on PVC fail randomly due to some race condition:
 - OSD daemon pod was activating the volume group using vgchange -an without any volume group name.
 - This caused the pods to fail randomly when number of OSDs is more, say greater than 10.
 - This fix adds Volume group name while activating/deactivating volume groups to fix this

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-09-05 20:34:03 +05:30
Maksim Nabokikh 179e1a310d ceph: Add dynamic flexvolume expansion
Allow to dynamic resize of rook volumes

Signed-off-by: Maksim Nabokikh <maksim.nabokikh@flant.com>
2019-09-05 02:40:22 +04:00
Sébastien Han 1393b1af3c ceph: osd lvm flag
udev is not running in the container so lvm might be stuck requesting lvm
devices. So let's not talk to udev to get lvm devices.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-30 17:39:49 +02:00
Sébastien Han 87ca208640 Merge pull request #3596 from rohantmp/managedPDB
Managed PDBs
2019-08-30 14:34:31 +02:00
Rohan CJ 4072d14557 Add tests for the clusterdisruption controller and update the docs and
pending releas notes for managed PDBs.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-08-30 14:04:23 +05:30
Sébastien Han e2c8a9935c Merge pull request #3696 from mvollman/db-devices-n-size
ceph: add db-devices flag and fix DatabaseSizeMB
2019-08-30 09:49:42 +02:00
Rohan CJ 5a248fbf59 Set a noout on failuredomains when in maintenance.
Maintenance is only defined when managedDisruptionBudgets are enabled.
Details can be found in the design doc for manged poddisriptionbudgets.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-08-30 09:01:15 +05:30
Rohan CJ d6b23dd549 Add nodedrain controller for deploying canary deployments for every node.
Canary pods can be watched to determine when a node is draining.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-08-30 09:01:11 +05:30
Michael Vollman ed9519953a ceph: add per OSD custom deviceClass support
Add deviceClass as a per OSD config option under
storage/nodes/devices/config for setting a custom crush device class
per OSD.

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-29 20:39:41 -04:00
Michael Vollman 496c638306 ceph: add db-devices flag and fix DatabaseSizeMB
Adding support for the db-devices flag for ceph versions 14.2.1 and
newer.  This flag will allow for explictly setting the db device for
bluestore configurations to the device specified as metadataDevice.

Fixing the databaseSizeMB config parameter to ensure it is used to set
the size of the db-device partition when specified at either the global
or individual device level. (#3652)

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-29 20:39:41 -04:00
Blaine Gardner 1be43290be Ceph: override configs in CRD
Allow users to specify overrides in the CephCluster CRD. The override
ConfigMap still exists for emergency situations and is mounted into
daemon pods directly instead of being merged into a Rook-created config
file.

Rook Ceph no longer uses a config file for managing daemons with the
exception of the OSDs which still generate a config in an init
container.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-08-29 15:38:27 -06:00
Michael Vollman 9eccffd794 ceph: fix md and dev ordering for c-v batch
Ensure that the metadata device and osd devices are passed as a space
separated list to ceph-volume.  Currently osds-per-device is placed
between the metadataDevice and the osd devices causing an error.

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-26 19:17:52 -04:00
Sébastien Han b3f58863e9 Merge pull request #3600 from mvollman/bugfix-osdsPerDevice
ceph: fix osdsPerDevice config
2019-08-22 20:24:01 +02:00
Sébastien Han 0785962e09 ceph: update mon configmap for external cluster
With this change, the admin can specify a single mon and the operator
will add any other mons to both ClusterInfo and the configmap of mon
endpoints.

It will periodically check for changes too and update both ClusterInfo
and the configmap accordingly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 18bf541c00 ceph: remove redundant debug log
GetMonStatus is called by checkHealth in health.go and is already
printing GetMonStatus's response so there is no need to print it twice.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 46cdf15936 ceph: config: apply the correct msgr2 prefix
External clusters might only listen on msgr2, so we must acknowledge
that and set the correct prefix to 'v2:' instead of 'v1:' on the
operator's ceph config file.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Michael Vollman 33711b7d36 ceph: fix osdsPerDevice config
Fix variable scoping issue that is ignoring osdsPerDevice config
setting.  Ensure that in all scenarios both the global and per OSD
osdsPerDevice setting are honored.  When both are set the more specific
setting will be used. (#3599)

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-20 07:09:12 -04:00
Travis Nielsen 27cad9d008 Merge pull request #3606 from sp98/sed_to_golang
Replace "sed" commands with native golang file handling
2019-08-19 12:03:43 -06:00
Santosh Pillai b1c9ad97ae replace "sed" commands with native golang file handling
- OSD backed by PVC required updating the lvm.conf file which was done by executing the 'sed' commands.
- This patch removes the 'sed' command and uses golang utlities to update the lvm.conf file.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-08-19 12:38:56 +05:30
Michael Vollman 46f8012268 ceph: fix per osd metadata support
When setting metadataDevice per OSD the check that c-v is properly using
the metadata device is failing because it is only looking at the global
md setting which is nil and not the per OSD setting.

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-15 07:22:00 -04:00
Travis Nielsen 1591ba843e Merge pull request #3607 from obnoxxx/logic-flow-createReplicationCrushRule
ceph:pools: polish logic flow a bit in createReplicationCrushRule()
2019-08-13 13:22:21 -06:00
travisn 9c73bfc603 ceph mds: properly trim the daemon name
The daemon name always needs to have the prefix rook-ceph-mds-
removed from the deployment name in order to translate to the
daemon name. The daemon name is not dependent on the namespace.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 9a3dc52a11 ceph: minimum version allowed is mimic 13.2.4
With the 1.1 release we should not be creating bluestore OSDs
with rook's legacy partitioning scheme. All new bluestore OSDs
should be created with ceph-volume. Therefore, the miminum
version allowed is a version of mimic supporting ceph-volume.

This commit also adds consistent version checking between
the Add and Update methods for the operator handling the
CR events.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:22:59 -06:00
Michael Adam 9c2c3c5d55 ceph:pools: polish logic flow a bit in createReplicationCrushRule()
This is not changing the behavior of the code but making the
flow of logic in the createReplicationCrushRule() function consistent
by removing an else branch. This was just a reflex when I was reading
the code.

Signed-off-by: Michael Adam <obnox@redhat.com>
2019-08-13 13:50:20 +02:00
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
Michael Vollman f3ef680298 ceph: Add support for per OSD metdataDevices
Add ceph-volume support for per OSD metdataDevices

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-02 07:41:45 -04:00
Blaine Gardner 55a726fda9 ceph: osd use copy-binaries top level cmd
Replace usage of the custom osd copybins command with the new top-level
copy-binaries command introduced with cmd-reporter.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-29 09:23:45 -06:00
Blaine Gardner 6d2ef93669 Merge pull request #3443 from SUSE/nfs-refactor
Ceph NFS: use new config
2019-07-25 09:39:50 -06:00
Michael Vollman bd58df9d3b ceph: fail when metadataDevice not used by cephvol
fail when metadataDevice is specified but ceph-volume batch does not
automatically use the metadataDevice as the block.db. (#3092)

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-07-23 07:23:51 -04:00
Blaine Gardner aa0d3346f2 ceph nfs: refactor to use new config pattern
Refactor the Ceph NFS (Ganesha) daemon to use the new config pattern.

Use of a custom Rook binary to run NFS has been removed in favor of
instead running the required DBUS process as a sidecar. The effect here
is that the NFS Ganesha container itself may fail and restart a few
times before the DBUS sidecar is running.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Sébastien Han 05d8d23f18 ceph: upgrade: pass daemonType and Name directly
We do not determine the daemon type and name by string parsing anymore
but passing that info directly in the update call, it's more reliable.
Also removing a bunch of unused functions.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:58:31 +02:00
Sébastien Han c24ae45eca ceph: upgrade, don't check osd if aio
If we detect all OSDs are running on the same host, we don't perform any
checks for upgrade.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:41:40 +02:00
Sébastien Han 7eb7e8a192 ceph: upgrade: always retrieve cluster version
Do not consider clusterInfo Ceph version since it's the one picked by
the spec image.
The CephVersion provided here needs to be the current running version
of Ceph for when it is later passed to OkToStop and checked with
IsAtLeast. If you are upgrading from a pre 14.2.1 version to a
version 14.2.1 or newer, IsAtLeast will incorrectly return true and
then fail trying to run mon ok-to-stop on a mon pod running a pre 14.2.1 version.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:18 +02:00
Sébastien Han bd7df53b18 ceph: refuse to upgrade an un-healthy cluster
If the cluster shows a state of HEALTH_ERR, Rook will refuse to upgrade
it if the image version changed.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:15 +02:00
Sébastien Han 9824bd2ff9 ceph: improve upgrade procedure
When a cluster is updated with a different image version, this triggers
a serialized restart of all the pods. Prior to this commit, no safety
check were performed and rook was hoping for the best outcome.

Now before doing restarting a daemon we check it can be restarted. Once
it's restarted we also check we can pursue with the rest of the
platform. For instance, with monitors we check that they are in quorum,
for OSD we check that PGs are clean and for MDS we make sure they are
 all active.

Fixes: https://github.com/rook/rook/issues/2889
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:37:43 +02:00
Blaine Gardner 5fc99a6266 Merge pull request #3369 from SUSE/cmd-reporter
Add cmd-reporter daemon; use it to get ceph version
2019-07-11 16:05:14 -06:00
Sébastien Han a4168fc8f8 Merge pull request #3414 from leseb/do-not-create-cm
ceph: stop creating initial crushmap
2019-07-09 09:39:15 +02:00
Sébastien Han fc27fbdff5 Merge pull request #3409 from noahdesu/pvc-binding-size-suffix
ceph: adjust M-to-Mi rounding in PV creation
2019-07-09 09:38:04 +02:00