From 46f8012268baf787412f769b549fa8f3c46e54df Mon Sep 17 00:00:00 2001 From: Michael Vollman Date: Wed, 7 Aug 2019 15:43:28 -0400 Subject: [PATCH] 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 --- pkg/daemon/ceph/osd/volume.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/daemon/ceph/osd/volume.go b/pkg/daemon/ceph/osd/volume.go index df84223af..e1708c4a6 100644 --- a/pkg/daemon/ceph/osd/volume.go +++ b/pkg/daemon/ceph/osd/volume.go @@ -238,11 +238,11 @@ func (a *OsdAgent) initializeDevices(context *clusterd.Context, devices *DeviceO for md, devs := range metadataDevices { - batchArgs = append(batchArgs, path.Join("/dev", md)) - batchArgs = append(batchArgs, devs...) + mdArgs := append(batchArgs, path.Join("/dev", md)) + mdArgs = append(mdArgs, devs...) // Reporting - reportArgs := append(batchArgs, []string{ + reportArgs := append(mdArgs, []string{ "--report", }...) @@ -267,12 +267,12 @@ func (a *OsdAgent) initializeDevices(context *clusterd.Context, devices *DeviceO return fmt.Errorf("failed to unmarshal ceph-volume report json. %+v", err) } - if path.Join("/dev", a.metadataDevice) != cvReport.Vg.Devices { - return fmt.Errorf("ceph-volume did not use the expected metadataDevice [%s]", a.metadataDevice) + if path.Join("/dev", md) != cvReport.Vg.Devices { + return fmt.Errorf("ceph-volume did not use the expected metadataDevice [%s]", md) } // execute ceph-volume batching up multiple devices - if err := context.Executor.ExecuteCommand(false, "", baseCommand, batchArgs...); err != nil { + if err := context.Executor.ExecuteCommand(false, "", baseCommand, mdArgs...); err != nil { return fmt.Errorf("failed ceph-volume. %+v", err) // fail return here as validation provided by ceph-volume } }