Skip to content

Commit

Permalink
DAOS-16160 control: Update pool create --size % opt for MD-on-SSD p2
Browse files Browse the repository at this point in the history
Features: pool control
Required-githooks: true

Signed-off-by: Tom Nabarro <tom.nabarro@intel.com>
  • Loading branch information
tanabarr committed Sep 20, 2024
1 parent be4ad88 commit 33fc7e5
Show file tree
Hide file tree
Showing 7 changed files with 694 additions and 888 deletions.
31 changes: 18 additions & 13 deletions src/control/cmd/dmg/pretty/storage_nvme.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,22 @@ func printNvmeFormatResults(inCtrlrs storage.NvmeControllers, out io.Writer, opt
return nil
}

func rolesRankFromSmd(ctrlr *storage.NvmeController) (string, string) {
rolesStr := "NA"
roles := ctrlr.Roles()
if !roles.IsEmpty() {
rolesStr = roles.String()
}

rankStr := "None"
rank := ctrlr.Rank()
if rank != ranklist.NilRank {
rankStr = rank.String()
}

return rolesStr, rankStr
}

// PrintNvmeControllers displays controller details in a verbose table.
func PrintNvmeControllers(controllers storage.NvmeControllers, out io.Writer, opts ...PrintConfigOption) error {
w := txtfmt.NewErrWriter(out)
Expand Down Expand Up @@ -245,18 +261,7 @@ func PrintNvmeControllers(controllers storage.NvmeControllers, out io.Writer, op
row[fwTitle] = ctrlr.FwRev
row[socketTitle] = fmt.Sprint(ctrlr.SocketID)
row[capacityTitle] = humanize.Bytes(ctrlr.Capacity())
roles := "NA"
rank := "None"
// Assumes that all SMD devices on a controller have the same roles and rank.
if len(ctrlr.SmdDevices) > 0 {
sd := ctrlr.SmdDevices[0]
roles = sd.Roles.String()
if sd.Rank != ranklist.NilRank {
rank = sd.Rank.String()
}
}
row[rolesTitle] = roles
row[rankTitle] = rank
row[rolesTitle], row[rankTitle] = rolesRankFromSmd(ctrlr)

table = append(table, row)
}
Expand All @@ -276,7 +281,7 @@ func PrintNvmeHealthMap(hsm control.HostStorageMap, out io.Writer, opts ...Print
lineBreak := strings.Repeat("-", len(hosts))
fmt.Fprintf(out, "%s\n%s\n%s\n", lineBreak, hosts, lineBreak)

if len(hss.HostStorage.NvmeDevices) == 0 {
if hss.HostStorage.NvmeDevices.Len() == 0 {
fmt.Fprintln(out, " No NVMe devices detected")
continue
}
Expand Down
Loading

0 comments on commit 33fc7e5

Please sign in to comment.