From db2d875fe77f55aa9f8d79dd13a1d63a06fcc2c7 Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Mon, 28 Nov 2022 23:08:53 +0000 Subject: [PATCH] osd: improve log on specifying lv and loop device as osd We can use LVM logical volumes and loop devices as OSD iff we specify them in the `devices` field. If we use filters like `deviceFilter`, these devices are not picked with a log message which let users to specify the exact device name. It's better to mention which field users should use in this case. Closes: https://github.com/rook/rook/issues/11353 Signed-off-by: Satoru Takeuchi (cherry picked from commit 36f80749388361eb4f09d54f043bd74a74e15070) --- pkg/daemon/ceph/osd/daemon.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/daemon/ceph/osd/daemon.go b/pkg/daemon/ceph/osd/daemon.go index ecc906672..8b4631c79 100644 --- a/pkg/daemon/ceph/osd/daemon.go +++ b/pkg/daemon/ceph/osd/daemon.go @@ -455,10 +455,10 @@ func getAvailableDevices(context *clusterd.Context, agent *OsdAgent) (*DeviceOsd } else if len(desiredDevices) == 1 && desiredDevices[0].Name == "all" { // user has specified all devices, use the current one for data if device.Type == sys.LVMType { - logger.Infof("logical volume %q is not picked by `useAllDevices: true`. please specify the exact device name (e.g. /dev/vg/lv) instead", device.Name) + logger.Infof("logical volume %q is not picked by `useAllDevices: true`. please specify the exact device name (e.g. /dev/vg/lv) in `devices` field instead", device.Name) continue } else if device.Type == sys.LoopType { - logger.Infof("loop device %q is not picked by `useAllDevices: true`. please specify the exact device name (e.g. /dev/loop0) instead", device.Name) + logger.Infof("loop device %q is not picked by `useAllDevices: true`. please specify the exact device name (e.g. /dev/loop0) in `devices` field instead", device.Name) continue } deviceInfo = &DeviceOsdIDEntry{Data: unassignedOSDID, DeviceInfo: device} @@ -469,10 +469,10 @@ func getAvailableDevices(context *clusterd.Context, agent *OsdAgent) (*DeviceOsd if desiredDevice.IsFilter { // the desired devices is a regular expression if device.Type == sys.LVMType { - logger.Infof("logical volume %q is not picked by `deviceFilter`. please specify the exact device name (e.g. /dev/vg/lv) instead", device.Name) + logger.Infof("logical volume %q is not picked by `deviceFilter`. please specify the exact device name (e.g. /dev/vg/lv) in `devices` field instead", device.Name) continue } else if device.Type == sys.LoopType { - logger.Infof("loop device %q is not picked by `deviceFilter`. please specify the exact device name (e.g. /dev/loop0) instead", device.Name) + logger.Infof("loop device %q is not picked by `deviceFilter`. please specify the exact device name (e.g. /dev/loop0) in `devices` field instead", device.Name) continue } matched, err = regexp.Match(desiredDevice.Name, []byte(device.Name)) @@ -486,10 +486,10 @@ func getAvailableDevices(context *clusterd.Context, agent *OsdAgent) (*DeviceOsd } } else if desiredDevice.IsDevicePathFilter { if device.Type == sys.LVMType { - logger.Infof("logical volume %q is not picked by `devicePathFilter`. please specify the exact device name (e.g. /dev/vg/lv) instead", device.Name) + logger.Infof("logical volume %q is not picked by `devicePathFilter`. please specify the exact device name (e.g. /dev/vg/lv) in `devices` field instead", device.Name) continue } else if device.Type == sys.LoopType { - logger.Infof("loop device %q is not picked by `devicePathFilter`. please specify the exact device name (e.g. /dev/loop0) instead", device.Name) + logger.Infof("loop device %q is not picked by `devicePathFilter`. please specify the exact device name (e.g. /dev/loop0) in `devices` field instead", device.Name) continue } pathnames := append(strings.Fields(device.DevLinks), filepath.Join("/dev", device.Name))