Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Command Reference] Document CLI commands related to container auto-restart feature #802

Merged
merged 9 commits into from
Feb 7, 2020
146 changes: 144 additions & 2 deletions doc/Command-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
* [BGP](#bgp)
* [BGP show commands](#bgp-show-commands)
* [BGP config commands](#bgp-config-commands)
* [Container Auto-restart](#container-autorestart-commands)
* [Container Auto-restart show commands](#container-autorestart-show-commands)
* [Container Auto-restart config command](#container-autorestart-config-command)
* [DHCP Relay](#dhcp-relay)
* [DHCP Relay config commands](#dhcp-relay-config-commands)
* [Drop Counters](#drop-counters)
Expand Down Expand Up @@ -106,7 +109,6 @@
* [Routing Stack](#routing-stack)
* [Quagga BGP Show Commands](#Quagga-BGP-Show-Commands)


## Document History

| Version | Modification Date | Details |
Expand Down Expand Up @@ -264,6 +266,7 @@ This command lists all the possible configuration commands at the top level.
vlan VLAN-related configuration tasks
warm_restart warm_restart-related configuration tasks
watermark Configure watermark
container Modify configuration of containers
```
Go Back To [Beginning of the document](#) or [Beginning of this section](#getting-help)

Expand Down Expand Up @@ -325,6 +328,7 @@ This command displays the full list of show commands available in the software;
vlan Show VLAN information
warm_restart Show warm restart configuration and state
watermark Show details of watermark
container Show details of container
```

The same syntax applies to all subgroups of `show` which themselves contain subcommands, and subcommands which accept options/arguments.
Expand Down Expand Up @@ -1730,6 +1734,145 @@ This command is used to remove particular IPv4 or IPv6 BGP neighbor configuratio

Go Back To [Beginning of the document](#) or [Beginning of this section](#bgp)

## Container Auto-restart
SONiC introduced a feature about auto-restarting docker containers
if one of critical processes accidently crashed or exited. The motivation behind
this feature is that if one critical process in a docker container crashed, then
the whole container will not work correctly and we can try to restart to make
it enter into the healthy state.
jleveque marked this conversation as resolved.
Show resolved Hide resolved

### Container Auto-restart show commands

**show container feature autorestart**

This command will display the status of auto-restart feature for containers.

- Usage:
```
show container feature autorestart [<container_name>]
```

- Example:
```
admin@sonic:~$ show container
Usage: show container [OPTIONS] COMMAND [ARGS]...

Show container

Options:
-?, -h, --help Show this message and exit.

Commands:
feature Show container feature
```

```
admin@sonic:~$ show container feature
Usage: show container feature [OPTIONS] COMMAND [ARGS]...

Show container feature

Options:
-?, -h, --help Show this message and exit.

Commands:
autorestart Show whether the auto-restart feature for container(s) is
enabled or disabled
```
jleveque marked this conversation as resolved.
Show resolved Hide resolved

```
admin@sonic:~$ show container feature autorestart
Container Name Status
-------------- --------
database enabled
syncd enabled
teamd disabled
dhcp_relay enabled
lldp enabled
pmon enabled
bgp enabled
swss disabled
telemetry enabled
sflow enabled
snmp enabled
radv disabled
```

Optionally, you can specify a container name in order to display the auto-restart
feature status for that container only.

- Usage:
```
show container feature autorestart database
```
jleveque marked this conversation as resolved.
Show resolved Hide resolved

- Example:
```
admin@sonic:~$ show container feature autorestart database
Container Name Status
-------------- --------
database enabled
```
### Container Auto-restart config command

**config container feature autorestart <container_name> <autorestart_status>**

This command will configure the status of auto-restart feature for a specific container.

- Usage:
```
sudo config container feature autorestart container_name autorestart_status
jleveque marked this conversation as resolved.
Show resolved Hide resolved
```

- Example:
```
admin@sonic:~$ sudo config container
Usage: config container [OPTIONS] COMMAND [ARGS]...

Modify configuration of container

Options:
-?, -h, --help Show this message and exit.

Commands:
feature Modify configuration of container features
```

```
admin@sonic:~$ sudo config container feature
Usage: config container feature [OPTIONS] COMMAND [ARGS]...

Modify configuration of container features

Options:
-?, -h, --help Show this message and exit.

Commands:
autorestart Configure the status of autorestart feature for specific
container
```

```
admin@sonic:~$ sudo config container feature autorestart
Usage: config container feature autorestart [OPTIONS] <container_name>
<autorestart_status>

Error: Missing argument "container_name".
```

```
admin@sonic:~$ sudo config container feature database
Usage: config container feature autorestart [OPTIONS] <container_name>
<autorestart_status>

Error: Missing argument "autorestart_status". Choose from enabled, disabled.
```
jleveque marked this conversation as resolved.
Show resolved Hide resolved

```
admin@sonic:~$ sudo config container feature autorestart database disabled
```
Go Back To [Beginning of the document](#) or [Beginning of this section](#container-autorestart-commands)

## DHCP Relay

### DHCP Relay config commands
Expand Down Expand Up @@ -5603,5 +5746,4 @@ This command displays the routing policy that takes precedence over the other ro
Action:
Exit routemap
```

Go Back To [Beginning of the document](#) or [Beginning of this section](#quagga-bgp-show-commands)