Skip to content

Commit

Permalink
Merge pull request rook#13169 from cybozu-go/osd-revert-encrypted-osd…
Browse files Browse the repository at this point in the history
…-on-part

Revert "osd: support encrypted OSD on partiton"
  • Loading branch information
satoru-takeuchi authored Nov 8, 2023
2 parents 592b74b + 8e80b21 commit 77db655
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/daemon/ceph/osd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions pkg/daemon/ceph/osd/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/ceph/osd/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 77db655

Please sign in to comment.