Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18502

YAML import and export for nodemaps

Details

    • New Feature
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • 9223372036854775807

    Description

      A general import and export for nodemaps and their properties would be beneficial, e.g., for backup, parsing, restore, etc. For exporting nodemap YAML definitions, the existing lctl nodemap_info can be extended. For importing nodemap YAML definitions, a new command, e.g., lctl nodemap_import, can be added. In addition, the API should allow enough flexibility to restrict the export/import to specific nodemaps and their properties so that users are not required to manually modify the YAML definition, e.g., to remove unwanted nodemaps or properties before importing.

      The following API definition is possible:

      1. (extended) lctl nodemap_info [--name <nodemap_name>] [--list] [–-yaml] [–-property <value>]
          - Adds the new --yaml argument which extends the existing lctl nodemap_info command to support YAML-formatted output.
          - All arguments are optional so that lctl nodemap_info. For example, only using --yaml would output all nodemaps in YAML format.
          - Using additional arguments to specify a nodemap and/or property restricts the output.
          - --property may be used multiple times to allow several properties to be exported.
       

      2. (new) lctl nodemap_import [--name <nodemap_name>] [-–property <value>] ./nodemap.yaml
          - Imports a YAML file generated by lctl nodemap_info
          - The command can be used to import multiple nodemaps and properties at once, depending on the input file.
          - lctl nodemap_import further allows restricting the import to specific nodemaps and/or properties. This is useful when the imported YAML file includes more information than needed. --property may be used multiple times to allow several properties to be imported.

      Sample YAML definition:

      nodemap.c0.admin_nodemap: 0
      nodemap.c0.audit_mode: 1
      nodemap.c0.deny_unknown: 0
      nodemap.c0.exports: [
       { nid: 192.155.155.50@tcp, uuid: bb3e4906-d094-4afb-a8bb-8ff66a6bb518 }
      ]
      nodemap.c0.fileset: /remote
      nodemap.c0.forbid_encryption: 0
      nodemap.c0.id: 2
      nodemap.c0.idmap: [
       { idtype: uid, client_id: 1003, fs_id: 11000 },
       { idtype: gid, client_id: 1003, fs_id: 11000 }
      ]
      nodemap.c0.map_mode: all
      nodemap.c0.offset: {
       start_uid: 0,
       limit_uid: 0,
       start_gid: 0,
       limit_gid: 0,
       start_projid: 0,
       limit_projid: 0
      }
      nodemap.c0.ranges: [
       { id: 2, start_nid: 192.155.155.50@tcp, end_nid: 192.155.155.50@tcp }
      ]
      nodemap.c0.rbac: file_perms,dne_ops,quota_ops,byfid_ops,chlg_ops,fscrypt_admin,server_upcall,ignore_root_prjquota,hsm_ops
      nodemap.c0.readonly_mount: 0
      nodemap.c0.sepol: 
      nodemap.c0.squash_gid: 65534
      nodemap.c0.squash_projid: 65534
      nodemap.c0.squash_uid: 65534
      nodemap.c0.trusted_nodemap: 0
      

       

      Attachments

        Issue Links

          Activity

            [LU-18502] YAML import and export for nodemaps
            mvef Marc Vef made changes -
            Description Original: A general import and export for nodemaps and their properties would be beneficial, e.g., for backup, parsing, restore, etc. For exporting nodemap YAML definitions, the existing {{lctl nodemap_info}} can be extended. For importing nodemap YAML definitions, a new command, e.g., {{{}lctl nodemap_import{}}}, can be added. In addition, the API should allow enough flexibility to restrict the export/import to specific nodemaps and their properties so that users are not required to manually modify the YAML definition, e.g., to remove unwanted nodemaps or properties before importing.

            The following API definition is possible:

            *1. (extended)* {{lctl nodemap_info [--name <nodemap_name>] [--list] [–-yaml] [–-property <value>]}}
                - Adds the new --yaml argument which extends the existing {{lctl nodemap_info}} command to support YAML-formatted output.
                - All arguments are optional so that {{{}lctl nodemap_info{}}}. For example, only using --yaml would output all nodemaps in YAML format.
                - Using additional arguments to specify a nodemap and/or property restricts the output.
                - --property may be used multiple times to allow several properties to be exported.
             

            *2. (new)* {{lctl nodemap_import [--name <nodemap_name>] [-–property <value>] ./nodemap.yaml}}
                - Imports a YAML file generated by {{{}lctl nodemap_info{}}}. 
                - The command can be used to import multiple nodemaps and properties at once, depending on the input file.
                - {{lctl nodemap_import}} further allows restricting the import to specific nodemaps and/or properties. This is useful when the imported YAML file includes more information than needed. --property may be used multiple times to allow several properties to be imported.
            h3. Sample YAML definition:
            {code:yaml}
            nm1:
              id: 1
              admin: true
              audit: true
              trusted: true
              deny_unknown: false
              forbit_encryption: false
              map_mode: all
              ranges:     id: 2
                start_nid: 192.155.155.50@tcp
                end_nid: 192.155.155.60@tcp
              rbac:    
                file_perms: true
                dne_ops: true
                quota_ops: true
                byfid_ops: true
                chlg_ops: true
                fscrypt_admin: true
              readonly_mount: false
              squash_uid: 65534
              squash_gid: 65534
              squash_projid: 65534
              filesets:    
                primary:
                  path: /foo/bar
                ro: false
                alternate:
                  - path: /home
                    ro: true
                  - path: /remote
                    ro: false{code}
             
            New: A general import and export for nodemaps and their properties would be beneficial, e.g., for backup, parsing, restore, etc. For exporting nodemap YAML definitions, the existing {{lctl nodemap_info}} can be extended. For importing nodemap YAML definitions, a new command, e.g., {{{}lctl nodemap_import{}}}, can be added. In addition, the API should allow enough flexibility to restrict the export/import to specific nodemaps and their properties so that users are not required to manually modify the YAML definition, e.g., to remove unwanted nodemaps or properties before importing.

            The following API definition is possible:

            *1. (extended)* {{lctl nodemap_info [--name <nodemap_name>] [--list] [–-yaml] [–-property <value>]}}
                - Adds the new --yaml argument which extends the existing {{lctl nodemap_info}} command to support YAML-formatted output.
                - All arguments are optional so that {{{}lctl nodemap_info{}}}. For example, only using --yaml would output all nodemaps in YAML format.
                - Using additional arguments to specify a nodemap and/or property restricts the output.
                - --property may be used multiple times to allow several properties to be exported.
             

            *2. (new)* {{lctl nodemap_import [--name <nodemap_name>] [-–property <value>] ./nodemap.yaml}}
                - Imports a YAML file generated by {{{}lctl nodemap_info{}}}. 
                - The command can be used to import multiple nodemaps and properties at once, depending on the input file.
                - {{lctl nodemap_import}} further allows restricting the import to specific nodemaps and/or properties. This is useful when the imported YAML file includes more information than needed. --property may be used multiple times to allow several properties to be imported.
            h3. Sample YAML definition:
            {code:yaml}
            nodemap.c0.admin_nodemap: 0
            nodemap.c0.audit_mode: 1
            nodemap.c0.deny_unknown: 0
            nodemap.c0.exports: [
             { nid: 192.155.155.50@tcp, uuid: bb3e4906-d094-4afb-a8bb-8ff66a6bb518 }
            ]
            nodemap.c0.fileset: /remote
            nodemap.c0.forbid_encryption: 0
            nodemap.c0.id: 2
            nodemap.c0.idmap: [
             { idtype: uid, client_id: 1003, fs_id: 11000 },
             { idtype: gid, client_id: 1003, fs_id: 11000 }
            ]
            nodemap.c0.map_mode: all
            nodemap.c0.offset: {
             start_uid: 0,
             limit_uid: 0,
             start_gid: 0,
             limit_gid: 0,
             start_projid: 0,
             limit_projid: 0
            }
            nodemap.c0.ranges: [
             { id: 2, start_nid: 192.155.155.50@tcp, end_nid: 192.155.155.50@tcp }
            ]
            nodemap.c0.rbac: file_perms,dne_ops,quota_ops,byfid_ops,chlg_ops,fscrypt_admin,server_upcall,ignore_root_prjquota,hsm_ops
            nodemap.c0.readonly_mount: 0
            nodemap.c0.sepol:
            nodemap.c0.squash_gid: 65534
            nodemap.c0.squash_projid: 65534
            nodemap.c0.squash_uid: 65534
            nodemap.c0.trusted_nodemap: 0
            {code}
             
            mvef Marc Vef made changes -
            Description Original: A general import and export for nodemaps and their properties would be beneficial, e.g., for backup, parsing, restore, etc. For exporting nodemap YAML definitions, the existing {{lctl nodemap_info}} can be extended. For importing nodemap YAML definitions, a new command, e.g., {{{}lctl nodemap_import{}}}, can be added. In addition, the API should allow enough flexibility to restrict the export/import to specific nodemaps and their properties so that users are not required to manually modify the YAML definition, e.g., to remove unwanted nodemaps or properties before importing.

            The following API definition is possible:

            *1. (extended)* {{lctl nodemap_info [--name <nodemap_name>] [--list-properties] [–-yaml] [–-property <value>]}}
                - Adds the new --yaml argument which extends the existing {{lctl nodemap_info}} command to support YAML-formatted output.
                - All arguments are optional so that {{{}lctl nodemap_info{}}}. For example, only using --yaml would output all nodemaps in YAML format.
                - Using additional arguments to specify a nodemap and/or property restricts the output.
                - --property may be used multiple times to allow several properties to be exported.
             

            *2. (new)* {{lctl nodemap_import [--name <nodemap_name>] [-–property <value>] ./nodemap.yaml}}
                - Imports a YAML file generated by {{{}lctl nodemap_info{}}}. 
                - The command can be used to import multiple nodemaps and properties at once, depending on the input file.
                - {{lctl nodemap_import}} further allows restricting the import to specific nodemaps and/or properties. This is useful when the imported YAML file includes more information than needed. --property may be used multiple times to allow several properties to be imported.
            h3. Sample YAML definition:
            {code:yaml}
            nm1:
              id: 1
              admin: true
              audit: true
              trusted: true
              deny_unknown: false
              forbit_encryption: false
              map_mode: all
              ranges:     id: 2
                start_nid: 192.155.155.50@tcp
                end_nid: 192.155.155.60@tcp
              rbac:    
                file_perms: true
                dne_ops: true
                quota_ops: true
                byfid_ops: true
                chlg_ops: true
                fscrypt_admin: true
              readonly_mount: false
              squash_uid: 65534
              squash_gid: 65534
              squash_projid: 65534
              filesets:    
                primary:
                  path: /foo/bar
                ro: false
                alternate:
                  - path: /home
                    ro: true
                  - path: /remote
                    ro: false{code}
             
            New: A general import and export for nodemaps and their properties would be beneficial, e.g., for backup, parsing, restore, etc. For exporting nodemap YAML definitions, the existing {{lctl nodemap_info}} can be extended. For importing nodemap YAML definitions, a new command, e.g., {{{}lctl nodemap_import{}}}, can be added. In addition, the API should allow enough flexibility to restrict the export/import to specific nodemaps and their properties so that users are not required to manually modify the YAML definition, e.g., to remove unwanted nodemaps or properties before importing.

            The following API definition is possible:

            *1. (extended)* {{lctl nodemap_info [--name <nodemap_name>] [--list] [–-yaml] [–-property <value>]}}
                - Adds the new --yaml argument which extends the existing {{lctl nodemap_info}} command to support YAML-formatted output.
                - All arguments are optional so that {{{}lctl nodemap_info{}}}. For example, only using --yaml would output all nodemaps in YAML format.
                - Using additional arguments to specify a nodemap and/or property restricts the output.
                - --property may be used multiple times to allow several properties to be exported.
             

            *2. (new)* {{lctl nodemap_import [--name <nodemap_name>] [-–property <value>] ./nodemap.yaml}}
                - Imports a YAML file generated by {{{}lctl nodemap_info{}}}. 
                - The command can be used to import multiple nodemaps and properties at once, depending on the input file.
                - {{lctl nodemap_import}} further allows restricting the import to specific nodemaps and/or properties. This is useful when the imported YAML file includes more information than needed. --property may be used multiple times to allow several properties to be imported.
            h3. Sample YAML definition:
            {code:yaml}
            nm1:
              id: 1
              admin: true
              audit: true
              trusted: true
              deny_unknown: false
              forbit_encryption: false
              map_mode: all
              ranges:     id: 2
                start_nid: 192.155.155.50@tcp
                end_nid: 192.155.155.60@tcp
              rbac:    
                file_perms: true
                dne_ops: true
                quota_ops: true
                byfid_ops: true
                chlg_ops: true
                fscrypt_admin: true
              readonly_mount: false
              squash_uid: 65534
              squash_gid: 65534
              squash_projid: 65534
              filesets:    
                primary:
                  path: /foo/bar
                ro: false
                alternate:
                  - path: /home
                    ro: true
                  - path: /remote
                    ro: false{code}
             
            mvef Marc Vef made changes -
            Link New: This issue is related to LU-18715 [ LU-18715 ]
            mvef Marc Vef made changes -
            Link New: This issue is related to LU-18357 [ LU-18357 ]
            mvef Marc Vef created issue -

            People

              wc-triage WC Triage
              mvef Marc Vef
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: