通过naa在ESXi主机上获取物理磁盘的位置

    运行shell

    1. [root@jortech-node01:~] sh disk_placement.sh

    shell脚本:

    1. # Script to obtain the placement of the physical disk by naa on ESXi hosts
    2. # Author: Jorluis Perales, VxRail TSE 2 @ Dell EMC
    3. # Version 1.0
    4. #
    5. # Do not change anything below this line
    6. # --------------------------------------
    7. echo "=============Physical disks placement=============="
    8. echo ""
    9. esxcli storage core device list | grep "naa" | awk '{print $1}' | grep "naa" | while read in; do
    10. echo "$in"
    11. esxcli storage core device physical get -d "$in"
    12. sleep 1
    13. echo "===================================================="
    14. done

    输出示例:

    1. [root@vxrail-node01:~] sh disk_placement.sh
    2. =============Physical disks placement==============
    3. naa.5002538a9823d020
    4. Physical Location: enclosure 1, slot 5
    5. ====================================================
    6. naa.5002538a9823d1c0
    7. Physical Location: enclosure 1, slot 4
    8. ====================================================
    9. naa.58ce38ee204ccd59
    10. Physical Location: enclosure 1, slot 9
    11. ====================================================
    12. naa.5002538a9823d070
    13. Physical Location: enclosure 1, slot 2
    14. ====================================================
    15. naa.5002538a9823d040
    16. Physical Location: enclosure 1, slot 1
    17. ====================================================
    18. naa.5002538a9823d080
    19. Physical Location: enclosure 1, slot 0
    20. ====================================================
    21. naa.58ce38ee204bf101
    22. Physical Location: enclosure 1, slot 8
    23. ====================================================
    24. naa.5002538a9823cfd0
    25. Physical Location: enclosure 1, slot 6
    26. ====================================================