Merge pull request #11069 from cybozu-go/osd-clarify-lv-is-not-picked-by-filters

osd: clarify lv is not picked by filters
This commit is contained in:
Satoru Takeuchi authored and GitHub committed 2022-09-29 05:00:42 +09:00
commit 9a30f361bb
2 files changed
+6 -6

No files matched your search

@@ -325,14 +325,14 @@ This feature is only available when `useAllNodes` has been set to `false`.
Below are the settings for host-based cluster. This type of cluster can specify devices for OSDs, both at the cluster and individual node level, for selecting which storage resources will be included in the cluster.
* `useAllDevices`: `true` or `false`, indicating whether all devices found on nodes in the cluster should be automatically consumed by OSDs. **Not recommended** unless you have a very controlled environment where you will not risk formatting of devices with existing data. When `true`, all devices and partitions will be used. Is overridden by `deviceFilter` if specified.
* `deviceFilter`: A regular expression for short kernel names of devices (e.g. `sda`) that allows selection of devices and partitions to be consumed by OSDs. If individual devices have been specified for a node then this filter will be ignored. This field uses [golang regular expression syntax](https://golang.org/pkg/regexp/syntax/). For example:
* `useAllDevices`: `true` or `false`, indicating whether all devices found on nodes in the cluster should be automatically consumed by OSDs. **Not recommended** unless you have a very controlled environment where you will not risk formatting of devices with existing data. When `true`, all devices and partitions will be used. Is overridden by `deviceFilter` if specified. LVM logical volumes are not picked by `useAllDevices`.
* `deviceFilter`: A regular expression for short kernel names of devices (e.g. `sda`) that allows selection of devices and partitions to be consumed by OSDs. LVM logical volumes are not picked by `deviceFilter`.If individual devices have been specified for a node then this filter will be ignored. This field uses [golang regular expression syntax](https://golang.org/pkg/regexp/syntax/). For example:
* `sdb`: Only selects the `sdb` device if found
* `^sd.`: Selects all devices starting with `sd`
* `^sd[a-d]`: Selects devices starting with `sda`, `sdb`, `sdc`, and `sdd` if found
* `^s`: Selects all devices that start with `s`
* `^[^r]`: Selects all devices that do *not* start with `r`
* `devicePathFilter`: A regular expression for device paths (e.g. `/dev/disk/by-path/pci-0:1:2:3-scsi-1`) that allows selection of devices and partitions to be consumed by OSDs. If individual devices or `deviceFilter` have been specified for a node then this filter will be ignored. This field uses [golang regular expression syntax](https://golang.org/pkg/regexp/syntax/). For example:
* `devicePathFilter`: A regular expression for device paths (e.g. `/dev/disk/by-path/pci-0:1:2:3-scsi-1`) that allows selection of devices and partitions to be consumed by OSDs. LVM logical volumes are not picked by `devicePathFilter`.If individual devices or `deviceFilter` have been specified for a node then this filter will be ignored. This field uses [golang regular expression syntax](https://golang.org/pkg/regexp/syntax/). For example:
* `^/dev/sd.`: Selects all devices starting with `sd`
* `^/dev/disk/by-path/pci-.*`: Selects all devices which are connected to PCI bus
* `devices`: A list of individual device names belonging to this node to include in the storage cluster.
+3 -3
View File
@@ -447,7 +447,7 @@ 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`", device.Name)
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)
continue
}
deviceInfo = &DeviceOsdIDEntry{Data: unassignedOSDID, DeviceInfo: device}
@@ -458,7 +458,7 @@ 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`", device.Name)
logger.Infof("logical volume %q is not picked by `deviceFilter`. please specify the exact device name (e.g. /dev/vg/lv) instead", device.Name)
continue
}
matched, err = regexp.Match(desiredDevice.Name, []byte(device.Name))
@@ -472,7 +472,7 @@ 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`", device.Name)
logger.Infof("logical volume %q is not picked by `devicePathFilter`. please specify the exact device name (e.g. /dev/vg/lv) instead", device.Name)
continue
}
pathnames := append(strings.Fields(device.DevLinks), filepath.Join("/dev", device.Name))