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

lnetctl export FILE writes peer configuration to stdout instead of FILE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • Lustre 2.17.0
    • None
    • 4
    • 9223372036854775807

      Stumbled upon this while testing something else.

      When given a filename, lnetctl export --backup writes the peer section to stdout instead of the requested file. Reproduced on Lustre 2.17.59 over TCP

      sudo lnetctl export --backup /tmp/lnet-before-file.yaml
      peer:
      -     primary nid: 10.10.0.10@tcp
            Multi-Rail: true
            peer ni:
            -     nid: 10.10.0.10@tcp
      -     primary nid: 10.10.0.21@tcp
            Multi-Rail: true
            peer ni:
            -     nid: 10.10.0.21@tcp
      -     primary nid: 10.10.0.22@tcp
            Multi-Rail: true
            peer ni:
            -     nid: 10.10.0.22@tcp
      -     primary nid: 10.10.0.20@tcp
            Multi-Rail: true
            peer ni:
            -     nid: 10.10.0.20@tcp
      
      grep -A5 '^peer:' /tmp/lnet-before-file.yaml
      
      

      The grep command returns no output.

      Test with fix:

      sudo ./lnet/utils/lnetctl export --backup /tmp/lnet-fixed-file.yaml
      [root@lustre-client1 lustre-release]# grep -A5 '^peer:' /tmp/lnet-fixed-file.yaml
      peer:
      -     primary nid: 10.10.0.10@tcp
            Multi-Rail: true
            peer ni:
            -     nid: 10.10.0.10@tcp
      -     primary nid: 10.10.0.21@tcp 
      

      Attached my proposed fix, which passes the selected output stream to yaml_lnet_peer_display() instead of hardcoding stdout.

            wc-triage WC Triage
            mdube Mathieu Dube
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: