Configure PTP Service Using the CLI¶
You can use the CLI to configure PTP services.
For information on configuring the PTP service for clock synchronization using the Horizon Web interface see Configure PTP Service Using Horizon.
You can also specify the PTP service for clock_synchronization using the OpenStack Horizon interface.
PTP Service
To view the existing PTP status, use the following command.
~(keystone_admin)]$ system ptp-show
+--------------+--------------------------------------+
| Property | Value |
+--------------+--------------------------------------+
| uuid | 4844eca1-13bb-471e-9162-e5f2bb97d650 |
| mode | hardware |
| transport | l2 |
| mechanism | e2e |
| isystem_uuid | a16d7b07-1d42-41cf-b001-04bc25216a2b |
| created_at | 2019-12-09T16:08:34.319374+00:00 |
| updated_at | None |
+--------------+--------------------------------------+
Warning
NTP and PTP are mutually exclusive on a particular host; only one can be enabled at any time.
The default value for clock_synchronization is ntp. Use the following command to change the clock synchronization on the host. NTP and PTP are configured per host. Lock/unlock the host when updating.
~(keystone_admin)]$ system host-update controller-0 clock_synchronization=ptp
+-----------------------+---------------------------------------+
| Property | Value |
+-----------------------+---------------------------------------+
| action | none |
| administrative | unlocked |
| availability | available |
| bm_ip | None |
| bm_type | None |
| bm_username | None |
| boot_device | /dev/disk/by-path/pci-0000:04:00.0-sas|
| | -0x5001e6754aa38000-lun-0 |
| capabilities | {u'stor_function': u'monitor'} |
| clock_synchronization | ptp |
| config_applied | 590f29ad-19e2-43ee-855e-f765814e3ecd |
| config_status | None |
| config_target | 590f29ad-19e2-43ee-855e-f765814e3ecd |
| console | ttyS0,115200n8 |
| created_at | 2019-12-07T18:32:58.752361+00:00 |
| hostname | controller-0 |
| id | 1 |
| install_output | text |
| install_state | None |
| install_state_info | None |
| inv_state | inventoried |
| invprovision | provisioned |
| location | {} |
| mgmt_ip | 192.168.204.3 |
| mgmt_mac | 00:1e:67:54:aa:39 |
| operational | enabled |
| personality | controller |
| reserved | False |
| rootfs_device | /dev/disk/by-path/pci-0000:04:00.0 |
| | -sas-0x5001e6754aa38000-lun-0 |
| serialid | None |
| software_load | nn.nn |
| task | |
| tboot | false |
| ttys_dcd | None |
| updated_at | 2019-12-07T21:17:28.627489+00:00 |
| uptime | 9020 |
| uuid | 92c86da2-adb7-4fb2-92fc-82759e25108d |
| vim_progress_status | services-enabled |
+-----------------------+---------------------------------------+
To view the PTP service configuration, use the following command:
~(keystone_admin)]$ system host-show controller-0
+-----------------------+------------------------------------------------+
| Property | Value |
+-----------------------+------------------------------------------------+
| action | none |
| administrative | unlocked |
| availability | available |
| bm_ip | None |
| bm_type | None |
| bm_username | None |
| boot_device | /dev/disk/by-path/pci-0000:04:00.0-sas |
| |-0x5001e6754aa38000-lun-0 |
| capabilities | {u'stor_function': u'monitor', u'Personality': |
| | u'Controller-Active'} |
| clock_synchronization | ptp |
| config_applied | 590f29ad-19e2-43ee-855e-f765814e3ecd |
| config_status | Config out-of-date |
| config_target | cd18ec25-c030-4b0c-862b-c39726275743 |
| console | ttyS0,115200n8 |
| created_at | 2019-12-09T16:10:19.143372+00:00 |
| hostname | controller-0 |
| id | 1 |
| install_output | text |
| install_state | None |
| install_state_info | None |
| inv_state | inventoried |
| invprovision | provisioned |
| location | {} |
| mgmt_ip | 192.168.204.3 |
| mgmt_mac | 00:1e:67:54:aa:39 |
| operational | enabled |
| personality | controller |
| reserved | False |
| rootfs_device | /dev/disk/by-path/pci-0000:04:00.0-sas |
| | -0x5001e6754aa38000-lun-0 |
| serialid | None |
| software_load | nn.nn |
| task | |
| tboot | false |
| ttys_dcd | None |
| updated_at | 2019-12-10T14:55:58.595239+00:00 |
| uptime | 159970 |
| uuid | 92c86da2-adb7-4fb2-92fc-82759e25108d |
| vim_progress_status | services-enabled |
+-----------------------+------------------------------------------------+
PTP Time Stamping Mode: NTP and PTP are configured per host. Lock/unlock the host when Hardware time stamping is the default option, and achieves best time synching. Use the following command:
~(keystone_admin)]$ system ptp-modify --mode=<hardware/software/legacy>
PTP Network Transport: Switch between IEEE 802.3 network transport (L2) or UDP IPv4/v6 network transport for PTP messaging. Use the following command:
~(keystone_admin)]$ system ptp-modify --transport=<l2/UDP>
Note
L2 is the default option.
If you use UDP for PTP transport, each PTP interface must have an IP assigned. This is enforced during host unlock, and when switching PTP transport to UDP.
PTP Delay Mechanism
Set the PTP delay mechanism, the options are:
E2E: default delay request-response
P2P: peer delay
Use the following command:
~(keystone_admin)]$ system ptp-modify --mechanism=<e2e/p2p>
PTP Role
PTP primary/secondary interfaces are not defined by default. They must be specified by the administrator for each host.
The ptp_role option can be added to interfaces, and can be defined for primary, secondary, and none. This option allows administrators to configure interfaces that can be used for PTP services. The primary and secondary roles are limited to OAM, platform or data interfaces. Any number of primary and secondary interfaces can be specified per host.
If a host has clock_synchronization=ptp, there must be at least one host interface with a PTP role specified. This is enforced during host unlock.
For example, this service can be specified using the following commands:
~(keystone_admin)]$ system host-if-modify compute-3 ens803f0 -n sriovptp --ptp-role slave
To apply changes to hosts, use the following command:
~(keystone_admin)]$ system ptp-apply
PTP changes will be applied to all unlocked hosts configured with ptp clock_synchronization.
Advanced Configuration¶
Using service parameters, you can customize a wide range of linuxptp module settings to use the system in a much wider range of PTP configurations.
Caution
These parameters are written to the ptp4l configuration file without error checking. Caution must be taken to ensure that parameter names and values are correct as errors will cause ptp4l launch failures.
The following service parameters are available:
- ptp global default_sync=0
This service parameter disables the selection of a default port by phc2sys. This option should be used when there are three or more PTP ports configured in order to prevent phc2sys from synchronizing the time across all ports before they have become synchronized with the primary clock.
- ptp global <name>=<value>
This service parameter allows you to write or overwrite values found in the global section of the ptp4l configuration file. For example, the command
~(keystone_admin)]$ system service-parameter-add ptp global domainNumber=24
results in the following being written to the configuration file:
domainNumber 24
PTP global service parameters take precedence over the system PTP values. For example, if the system PTP delay mechanism is E2E, and you subsequently run the command
~(keystone_admin)]$ system service-parameter-add ptp global delay_mechanism=P2P
Then the P2P will be used instead.
- ptp phc2sys update-rate=<value>
This parameter controls the update-rate of the phc2sys service, in seconds.
- ptp phc2sys summary-updates=<value>
This parameter controls the number of clock updates to be included in summary statistics.
To apply service parameter changes to hosts, use the following command:
~(keystone_admin)]$ system service-parameter-apply ptp
PTP changes will be applied to all unlocked hosts configured with ptp clock_synchronization.
PTP Limitations¶
NICs using the Intel Ice NIC driver may report the following in the ptp4l
logs, which might coincide with a PTP port switching to FAULTY
before
re-initializing.
ptp4l[80330.489]: timed out while polling for tx timestamp
ptp4l[80330.489]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug
This is due to a limitation of the Intel Ice driver. The recommended workaround
is to set the tx_timestamp_timeout
parameter to 700 (ms) in the ptp4l
config.
~(keystone_admin)]$ system ptp-instance-parameter-add ptp-inst1 tx_timestamp_timeout=700