docs/doc/source/system_configuration/kubernetes/configuring-ptp-service-using-the-cli.rst
Keane Lim bdae1a827b New system service parameter for phc2sys
Change-Id: I6e02d51f22f179e38aadd99e2b1c62b1674dc38a
Signed-off-by: Keane Lim <keane.lim@windriver.com>
2021-08-12 10:13:07 -04:00

13 KiB

Configure PTP Service Using the CLI

You can use the CLI to configure services.

For information on configuring the service for clock synchronization using the Horizon Web interface see Configure PTP Service Using Horizon <configuring-ptp-service-using-horizon>.

You can also specify the service for clock_synchronization using the interface.

PTP Service

To view the existing 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

and 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. and 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 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: and 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 IPv4/v6 network transport for messaging. Use the following command:

    ~(keystone_admin)]$ system ptp-modify --transport=<l2/UDP>

    Note

    L2 is the default option.

    If you use for transport, each interface must have an IP assigned. This is enforced during host unlock, and when switching transport to .

  • PTP Delay Mechanism

    Set the 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

    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 services. The primary and secondary roles are limited to platform, , and VF 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 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

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 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 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

global service parameters take precedence over the system values. For example, if the system 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

changes will be applied to all unlocked hosts configured with ptp clock_synchronization.