Automation

 View Only
  • 1.  Get the list of ESXi servers /scratch locations path?

    Posted Oct 28, 2020 10:03 AM

    Hi All,

    Using this script, it is possible to automatically create /scratch directory location for multiple ESXi servers without causing outage during the business hours.

    https://gist.githubusercontent.com/vmnomad/0255d3a4b6397bfd11a09e6df7b2be0d/raw/5268132bc877ba8c40f6888930eb9bceaac5e71a…

    Would it be possible to get the list of ESXi servers that has no /scratch location or display the /scratch location full path when already configured?

    VMware Knowledge Base

    Thank you in advance.



  • 2.  RE: Get the list of ESXi servers /scratch locations path?
    Best Answer

    Posted Oct 28, 2020 10:07 AM

    You could do something like this

    Get-VMHost |

    Select Name,

        @{N='Scratch';E={(Get-AdvancedSetting -Entity $_ -Name 'ScratchConfig.CurrentScratchLocation').Value}}



  • 3.  RE: Get the list of ESXi servers /scratch locations path?

    Posted Oct 28, 2020 10:31 AM

    Wow, thanks LucD​ for the very quick reply :-)

    Name        Scratch                                         

    ----        -------                                         

    DCESXi02   /vmfs/volumes/5bee0d4f-06972c59-4e9f-1458d0b47050

    DCESXi03   /vmfs/volumes/5be524fc-abe31cc0-3f13-1458d050f658

    DCESXi01   /vmfs/volumes/5becf996-1a46a3dc-a02f-1458d0b30568

    How do we know if the above is a persistent location that can save CoreDump persistently?



  • 4.  RE: Get the list of ESXi servers /scratch locations path?

    Posted Oct 28, 2020 10:46 AM

    If that location is pointing to a datastore path (as in your report) and not a /tmp folder, I assume it is persistent.
    I don't know if there is a flag or property that actually says persistent or not.

    KB1033696 seems to say the same.



  • 5.  RE: Get the list of ESXi servers /scratch locations path?

    Posted Oct 28, 2020 11:16 AM

    yes, that does make sense.

    Thanks, Luc.