Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostMount Env Variables (e.g. NUM_OSTS) #424

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Conversation

bdevcich
Copy link
Contributor

@bdevcich bdevcich commented Dec 4, 2024

There is no way to get the number of OSTs, etc when using PostMount commands. For instance, when setting the striping.

This change adds the following environment variables for use in the NnfStorageProfiles when using *CmdLines:

  • NUM_MDTS
  • NUM_MGTS
  • NUM_MGTMDTS
  • NUM_OSTS
  • NUM_NNFNODES

To support this, a list of nodes for each component type has been added to the status of NnfStorage, which in turn is copied to the NnfNodeStorage resource's spec. This info can then be turned into the environment variables for use when running the commands.

The .nnf-servers.json file created to store this information on the compute node has been updated to this new structure.

An example with 8 OSTs and 2 MGTMDTs on 1 rabbit:

{
  "mdt": [],
  "mgt": [],
  "mgtmdt": [
    "rabbit-node-1",
    "rabbit-node-1"
  ],
  "nnfNode": [
    "rabbit-node-1"
  ],
  "ost": [
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1"
  ]
}

There is no way to get the number of OSTs, etc when using `PostMount`
commands. For instance, when setting the striping.

This change adds the following environment variables for use in the
`NnfStorageProfiles` when using `*CmdLines`:

- NUM_MDTS
- NUM_MGTS
- NUM_MGTMDTS
- NUM_OSTS
- NUM_NNFNODES

To support this, a list of nodes for each component type has been added
to the status of `NnfStorage`, which in turn is copied to the
`NnfNodeStorage` resource's spec. This info can then be turned into the
environment variables for use when running the commands.

The `.nnf-servers.json` file created to store this information on the
compute node has been updated to this new structure.

An example with 8 OSTs and 2 MGTMDTs on 1 rabbit:

```json
{
  "mdt": [],
  "mgt": [],
  "mgtmdt": [
    "rabbit-node-1",
    "rabbit-node-1"
  ],
  "nnfNode": [
    "rabbit-node-1"
  ],
  "ost": [
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1",
    "rabbit-node-1"
  ]
}
```

Signed-off-by: Blake Devcich <[email protected]>
// EDIT THIS FUNCTION! If the annotation is holding anything that is
// hub-specific then copy it into 'dst' from 'restored'.
// Otherwise, you may comment out UnmarshalData() until it's needed.
if hasAnno {
dst.Status.LustreComponents.MDTs = append([]string(nil), restored.Status.LustreComponents.MDTs...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not have expected (x) to work for initializing that string array. I would have expected {x} instead, but that doesn't work. Huh.

I wonder what that's called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, this one really threw me for a loop.

@bdevcich bdevcich merged commit fdac84d into master Dec 9, 2024
3 checks passed
@bdevcich bdevcich deleted the post-mount-vars branch December 9, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants