Skip to content

Enabling NTP on Microsoft Hyper-V guests

Control Center requires a common time source. The procedures in this section configure NTP to synchronize the system clocks of Control Center hosts.

Note

The procedures in this section are required only for multi-host deployments running as Microsoft Hyper-V guests.
VMware vSphere guests use an hourly cron job to synchronize their system clocks with the host.

Configure NTP to rely on a time source as follows, depending on internet access of the Control Center hosts:

  • If no host can access the internet, configure NTP to rely on a private master server (the first two procedures).
  • If all hosts can access the internet, configure NTP to rely on public time servers (the third procedure).

Configuring NTP clients

(Hyper-V only) This procedure configures delegates to synchronize their clocks with the NTP server on the Control Center master host. Perform this procedure only if the delegates do not have internet access. Repeat this procedure on each Control Center delegate host.

  1. Gain access to the Control Center host, through the console interface of your hypervisor, or through a remote shell utility such as PuTTY.
  2. Start a command-line session as root.

    1. In the Appliance Administration menu, select Root Shell.
    2. Select Run, and then press Enter.

    The menu is replaced by a command prompt similar to the following example:

    [root@hostname ~]#
    
  3. Create a backup of the NTP configuration file.

    cp -p /etc/ntp.conf /etc/ntp.conf.orig
    
  4. Edit the NTP configuration file./

    1. Open /etc/ntp.conf with a text editor.
    2. Replace all of the lines in the file with the following lines:

      # Point to the master time server
      server Master-Address
      
      restrict default ignore
      restrict 127.0.0.1
      restrict Master-Address mask 255.255.255.255 nomodify notrap noquery
      
      driftfile /var/lib/ntp/drift
      
    3. Replace both instances of Master-Address with the IPv4 address of the host where the NTP server is running (the Control Center master host).

    4. Save the file and exit the editor.
    5. Stop Control Center.
    systemctl stop serviced
    
  5. Synchronize the clock with the master server.

    ntpd -gq
    
  6. Enable and start the NTP service.

    systemctl enable ntpd && systemctl start ntpd
    
  7. Start Control Center.

    systemctl start serviced
    

Configuring an NTP master server

(Hyper-V only) This procedure configures an NTP master server on the Control Center master host. Perform this procedure only if the host does not have internet access.

  1. Gain access to the Control Center host, through the console interface of your hypervisor, or through a remote shell utility such as PuTTY.
  2. Start a command-line session as root.

    1. In the Appliance Administration menu, select Root Shell.
    2. Select Run, and then press Enter.

    The menu is replaced by a command prompt similar to the following example:

    [root@hostname ~]#
    
  3. Create a backup of the NTP configuration file.

    cp -p /etc/ntp.conf /etc/ntp.conf.orig
    
  4. Edit the NTP configuration file.

    1. Open /etc/ntp.conf with a text editor.
    2. Replace all of the lines in the file with the following lines:

      # Use the local clock
      server 127.127.1.0 prefer
      fudge  127.127.1.0 stratum 10
      driftfile /var/lib/ntp/drift
      broadcastdelay 0.008
      
      # Give localhost full access rights
      restrict 127.0.0.1
      
      # Grant access to client hosts
      restrict Address-Range mask Netmask nomodify notrap
      
    3. Replace Address-Range with the range of IPv4 network addresses that are allowed to query this NTP server.

      For example, the following IP addresses are assigned to Control Center hosts: - 203.0.113.10 - 203.0.113.11 - 203.0.113.12 - 203.0.113.13

      For the preceding addresses, the value for Address-Range is 203.0.113.0.

    4. Replace Netmask with the IPv4 network mask that corresponds with the address range.

      For example, a valid network mask for 203.0.113.0 is 255.255.255.0.

    5. Save the file and exit the editor.

    6. Stop Control Center.
    systemctl stop serviced
    
  5. Enable and start the NTP service.

    systemctl enable ntpd && systemctl start ntpd
    
  6. Start Control Center.

    systemctl start serviced
    

Configuring NTP for public time servers

This procedure uses the default configuration of NTP to synchronize system clocks with public time servers. If all Control Center hosts can access the internet, repeat this procedure on each host, starting with the Control Center master host.

  1. Gain access to the Control Center host, through the console interface of your hypervisor, or through a remote shell utility such as PuTTY.
  2. Start a command-line session as root.

    1. In the Appliance Administration menu, select Root Shell.
    2. Select Run, and then press Enter.

    The menu is replaced by a command prompt similar to the following example:

    [root@hostname ~]#
    
  3. Stop Control Center.

    systemctl stop serviced
    
  4. Synchronize the system clock, and then enable and start the NTP service.

    1. Set the system time.

      ntpd -gq
      
    2. Enable and start the ntpd service.

      systemctl enable ntpd && systemctl start ntpd
      
  5. Start Control Center.

    systemctl start serviced