diff --git a/pkg/daemon/ceph/osd/daemon.go b/pkg/daemon/ceph/osd/daemon.go index 9baa9dc7e5a8..e8e9b68a1756 100644 --- a/pkg/daemon/ceph/osd/daemon.go +++ b/pkg/daemon/ceph/osd/daemon.go @@ -446,6 +446,11 @@ func getAvailableDevices(context *clusterd.Context, agent *OsdAgent) (*DeviceOsd } logger.Infof("device %q is available.", device.Name) + if device.Type == sys.PartType && agent.storeConfig.EncryptedDevice { + logger.Infof("partition %q is not picked because encrypted OSD on partition is not allowed", device.Name) + continue + } + var deviceInfo *DeviceOsdIDEntry if agent.metadataDevice != "" && agent.metadataDevice == device.Name { // current device is desired as the metadata device diff --git a/pkg/daemon/ceph/osd/volume.go b/pkg/daemon/ceph/osd/volume.go index e6ff5c37cfac..b127f265d0b7 100644 --- a/pkg/daemon/ceph/osd/volume.go +++ b/pkg/daemon/ceph/osd/volume.go @@ -415,6 +415,12 @@ func (a *OsdAgent) allowRawMode(context *clusterd.Context) (bool, error) { // by default assume raw mode allowRawMode := true + // ceph-volume raw mode does not support encryption yet + if a.storeConfig.EncryptedDevice { + logger.Debug("won't use raw mode since encryption is enabled") + allowRawMode = false + } + // ceph-volume raw mode does not support more than one OSD per disk osdsPerDeviceCountString := sanitizeOSDsPerDevice(a.storeConfig.OSDsPerDevice) osdsPerDeviceCount, err := strconv.Atoi(osdsPerDeviceCountString) diff --git a/pkg/daemon/ceph/osd/volume_test.go b/pkg/daemon/ceph/osd/volume_test.go index 2fa3663e837f..95366f040b53 100644 --- a/pkg/daemon/ceph/osd/volume_test.go +++ b/pkg/daemon/ceph/osd/volume_test.go @@ -1599,7 +1599,7 @@ func TestAllowRawMode(t *testing.T) { wantErr bool }{ {"raw simple scenario supported", fields{"", config.StoreConfig{}}, args{&clusterd.Context{}, false}, true, false}, - {"raw encrypted scenario supported", fields{"", config.StoreConfig{EncryptedDevice: true}}, args{&clusterd.Context{}, false}, true, false}, + {"lvm complex scenario not supported: encrypted", fields{"", config.StoreConfig{EncryptedDevice: true}}, args{&clusterd.Context{}, false}, false, false}, {"lvm complex scenario not supported: osd per device > 1", fields{"", config.StoreConfig{OSDsPerDevice: 2}}, args{&clusterd.Context{}, false}, false, false}, {"lvm complex scenario not supported: metadata dev", fields{"/dev/sdb", config.StoreConfig{}}, args{&clusterd.Context{}, false}, false, false}, {"lvm complex scenario not supported: metadata dev", fields{"/dev/sdb", config.StoreConfig{}}, args{&clusterd.Context{}, false}, false, false},