VMware vSphere

 View Only
Expand all | Collapse all

Help with Changing Syslog.global.LogDir

  • 1.  Help with Changing Syslog.global.LogDir

    Posted Jun 18, 2020 01:11 AM

    Hi guys,

    Would like a hand in being able to change the location of our syslogs and to also increase the size of log files.

    Having an issue now, where within the first 6 months of this new setup we have run out of disk space "Ramdisk Var is full".

    Current settings are the default. size of logs are at 1024 and default location of scratch directory.

    I am running vSphere 6.7 with only 2 hosts. Each host has plenty of local disc space. Would like to set up new location on local disc with 5MB size and 10 rotations.

    I am just unsure of how to create new directory to point to.

    Thanks



  • 2.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 18, 2020 03:38 AM

    Just open a SSH or login into to the local shell and type

    df -h
    cd /vmfs/volumes
    ls -alh
    cd yourlargedatastore
    mkdir youresx1

    The yourlargedatastore can be a shared or local one.

    Now use esxcli to specify the syslog parameter you want and to get rid of the full ramdisk you need to restart the host.  You can than check the content of the youresx1 directory.

    Btw. before restarting you can set the scratch disk as well. See VMware Knowledge Base

    Regards,
    Joerg



  • 3.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 18, 2020 05:24 AM

    Hello Joerg,

    Thank you for your reply.

    I have been able to create the directory which is currently to the local disc of host.

    Whenever I try to change syslog directory from the GUI I get an error: A Specified parameter was not correct.

    I am using the datastore and the new directory I added like so:  [localdatastore] /youresx1/

    This is what is driving me nuts.  :smileysad:

    I feel like I need to do a reboot of host and then maybe I might be able to make the change. and then reboot again to create a persistant scratch location.

    With the current system not allowing me to migrate any vm's I have to do this after hours.



  • 4.  RE: Help with Changing Syslog.global.LogDir
    Best Answer

    Broadcom Employee
    Posted Jun 18, 2020 02:58 PM
    1. Login to vSphere Web Client.
    2. Go to Manage \ Settings \ Advanced System Settings. In search field type Syslog.global.logDir and hit Enter. ![Change location of VMware ESXi System Logs to local or remote datastore - 2][3]
    3. Double click on Syslog.global.logDir and enter name of the datastore where you want to store logs in format [datastore_name]folder. In my case it looks like that: [ESXi01-local]logs. After you commit change alert on ESXi disappears. ![Change location of VMware ESXi System Logs to local or remote datastore - 2][3]
    4. Browse datastore where we store ESXi logs to check if settings are applied correctly. ![Change location of VMware ESXi System Logs to local or remote datastore - 3][4]


  • 5.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 18, 2020 11:01 PM

    Hi Sukanyad,

    Thank you for your reply.

    I have a similar named datastore to you and have created a folder.

    Datastore name is bresx03-local and folder name is syslog-esx03.

    So when I add that in this format [bresx03-local] /syslog-esx03  I get an error message "A specified parameter was not correct:"



  • 6.  RE: Help with Changing Syslog.global.LogDir

    Broadcom Employee
    Posted Jun 19, 2020 04:31 AM

    The syntax is incorrect

    try the below:

    [bresx03-local] syslog-esx03



  • 7.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 19, 2020 04:36 AM

    I have tried that.

    Just tried it again, I get the same error.

    I just wonder that the current state of hosts with "ramdisk var full" error.

    I need to reboot hosts to clear that out first I think.



  • 8.  RE: Help with Changing Syslog.global.LogDir

    Broadcom Employee
    Posted Jun 19, 2020 04:40 AM

    yes you need to clear space otherwise it wont work . :smileyhappy:

    Also reboot the host and try again.



  • 9.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 19, 2020 04:45 AM

    I do have one other question.

    If I make changes for a persistent scratch location, which I can see is done in the Scratch.ConfiguredScratchLocation field, Im assuming I dont need to change the path in the Syslog.global.LogDir?



  • 10.  RE: Help with Changing Syslog.global.LogDir

    Broadcom Employee
    Posted Jun 19, 2020 04:56 AM

    Yes if the scratchconfig is already configured to a shared datastore we dont need syslog .



  • 11.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 19, 2020 05:01 AM

    Awesome,

    Well, I'm rebooting Hosts in about 2 hours.

    Hope it all reboots OK with no issues.  :smileyconfused:



  • 12.  RE: Help with Changing Syslog.global.LogDir

    Broadcom Employee
    Posted Jun 19, 2020 05:06 AM

    Yes let me know the status



  • 13.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 19, 2020 05:18 AM

    OH, one more thing.

    How do I check if logging is happening to new scratch location?



  • 14.  RE: Help with Changing Syslog.global.LogDir

    Broadcom Employee
    Posted Jun 19, 2020 05:24 AM

    Just open a SSH or login into to the local shell and type

    ls -l

    you can see scratch config location

    or

    cd /var/log/

    it should take to datastore where logs are present



  • 15.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 19, 2020 08:28 AM

    Hi Sukanyad,

    Have rebooted hosts and no issues at all.

    New scratch location has been changed as I wanted to.

    All good.

    Thanks for your help. Much appreciated.



  • 16.  RE: Help with Changing Syslog.global.LogDir

    Broadcom Employee
    Posted Jun 19, 2020 09:28 AM

    Welcome :smileyhappy:



  • 17.  RE: Help with Changing Syslog.global.LogDir

    Posted Nov 19, 2024 10:53 AM

    Hi I was reading this blog and found it interesting. I have a similar situation on my host. Did you change the scratchconfig value or the syslog.global.logdir. I just want to know where to make the actual change? Thanks in advance.




  • 18.  RE: Help with Changing Syslog.global.LogDir

    Posted Jun 16, 2022 11:57 AM

    nice thanks