Close Menu
DPC Virtual Tips
    Read More

    How to Investigate TCP Retransmissions on Linux

    August 11, 2026

    Slurm Node Is DRAINED: How to Find the Exact Reason

    August 10, 2026

    Why Is My Slurm Job Pending? How to Decode Every Common Reason

    August 9, 2026
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Tuesday, August 11
    DPC Virtual Tips
    • Home
    • Operating Systems
    • PowerFlex
    • HPC
    • Virtualization
    • About the Author
    • About Us
    • Contact
    DPC Virtual Tips
    Home » Changing NTP Settings on ESXi Hosts
    Virtualization

    Changing NTP Settings on ESXi Hosts

    DaniloBy DaniloMay 19, 2025Updated:August 5, 2026No Comments2 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    vCenter NTP configuration
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Changing NTP Settings on ESXi Hosts is an article that shows an automated approach to changing the NTP client configurations on all connected ESXi hosts under the same vCenter Server, using a Python script.

    The idea is to use a Linux CentOS 9 as a script server. We’ll execute a Python script from this server to connect to each ESXi host and upgrade the VMware Tools.

    So, let’s get started:

    1- Install CentOS 9 (without GUI) – We have tested it with CentOS 9, but feel free to install a different Linux flavor and adjust the script to run on it.

    2- Access it by SSH with root rights and install Python:

    curl -O https://raw.githubusercontent.com/danchiacchio/scripts/refs/heads/main/sh_PythonInstall/install-python.sh
    
    chmod +x install-python.sh
    
    ./install-python.sh

    Grab a coffee and wait for a while. The automated Python install takes a while to complete! ☕

    3- Creating a working directory (something such as /root/scripts/py_vESXiNTPd) – you can choose the directory name:

    mkdir -p /root/scripts/py_vESXiNTPd

    4- Go to the working directory and download the Python script “py_ESXiNTPd.py”:

    cd /root/scripts/py_vESXiNTPd
    
    curl -O https://raw.githubusercontent.com/danchiacchio/scripts/refs/heads/main/py_vESXiNTPd/py_ESXiNTPd.py
    
    pip install pyvmomi paramiko

    5- Creating the NTP client configuration file:

    touch ntp_config.txt

    And adding content into it – this is an example of NTP client configuration for an ESXi host – Adjust it to satisfy your needs:

    restrict default nomodify notrap nopeer noquery
    restrict 127.0.0.1
    restrict -6 ::1
    driftfile /etc/ntp.drift
    logconfig +clockstatus +peerstatus +sysstatus +syncstatus
    server 192.168.255.3
    tos maxdist 30

    6- Run the Python script:

    chmod 700 py_ESXiNTPd.py
    
    python3 py_ESXiNTPd.py

    After running the script, for instance, we can get the ntpd status for hosts in a specific cluster:

    To get the NTP configuration for a particular ESXi host:

    If you need to update or change the NTP configuration, you can select option five and specify the configuration file that you previously created!

    This is a base-menu script, very user-friendly. So, explore the options to be familiar with them. If you have any doubts or improvements, feel free to contact me 😉

    Note: So, I tested it several times in a lab environment, and it worked as expected. However, be careful when executing it in a production environment. We’ll not be responsible for downtime or weird behavior in your environment!

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleUpgrading VMware Tools on ESXi Hosts
    Next Article Changing DNS Settings on ESXi Hosts
    Danilo

    Infrastructure Engineer with experience in Virtualization, Linux, Windows Server and learning automation using Python. DPC Virtual Tips was created to share practical tutorials, lab experiences and troubleshooting guides focused on enterprise infrastructure technologies.

    Related Posts

    VM Replication with vSphere Replication and Site Recovery Manager

    June 16, 2025

    Changing DNS Settings on ESXi Hosts

    May 20, 2025

    Upgrading VMware Tools on ESXi Hosts

    May 13, 2025

    Comments are closed.

    Search
    Categories
    • HPC (10)
    • Operating Systems (83)
    • PowerFlex (22)
    • Virtualization (129)
    Read More
    Operating Systems

    How to Investigate TCP Retransmissions on Linux

    By DaniloAugust 11, 20260
    HPC

    Slurm Node Is DRAINED: How to Find the Exact Reason

    By DaniloAugust 10, 20260
    HPC

    Why Is My Slurm Job Pending? How to Decode Every Common Reason

    By DaniloAugust 9, 20260
    Operating Systems

    Linux Process Resource Usage: How to Find Heavy Processes

    By DaniloAugust 6, 20260
    HPC

    Lustre Filesystem Commands: A Practical Admin Guide

    By DaniloAugust 5, 20260
    Latest Posts

    How to Investigate TCP Retransmissions on Linux

    August 11, 2026

    Slurm Node Is DRAINED: How to Find the Exact Reason

    August 10, 2026

    Why Is My Slurm Job Pending? How to Decode Every Common Reason

    August 9, 2026
    Images from Gallery
    hpc main commands
    linux commands
    install rock linux
    lustre fs
    shell scripting
    vSAN Trace Files
    Categories
    • HPC
    • Operating Systems
    • PowerFlex
    • Virtualization
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Copyright © 2026, DPC Virtual Tips. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.

    We use cookies to ensure your best experience on our website. If you continue using our website, we'll assume you agree to our cookie policy