Question
Which are the Versa shell aliases?
Solution
When you log into any Versa device with shell (bash) access, you can find aliases/shortcuts provided under vsh (Versa Shell) to check system status, management, and troubleshooting. These options are seen with a TAB completion after typing vsh.
NOTE: Options differ across FlexVNF, Versa Director, Versa Analytics nodes, and across versions.
Status Checks
These are the aliases to check system status:
Use this option.. | To.. |
vsh details | Show the hardware and software details of the node as well as the validity/key-status. This is an amalgamation of the following CLI commands:
|
vsh <status | cstatus> | Show the status of all Versa processes (services) and their process IDs. status: gives a detailed listing of processes with their privilege levels (* for privileged) and full process name. cstatus: shows a brief coloured 2-column output. It processes that are shown in red). |
vsh confd ha-status | Show the HA status of config daemon. |
vsh netns | List the network namespace under which each application is running. |
vsh get-nodeid | Generate a node-id file, which should be sent to Versa support to generate a new license/key file. |
Mvsh show-serialnum | Display the serial number of the device. |
vsh watch | Display a full-screen listing of vsh status (refreshed every 2 seconds). This is useful when restarting the services to keep a tab on the processes. |
vsh vsboot-chk | Show a parsed dump of the boot time configuration (legacy) called vsboot.conf. This is useful when there are manual edits to the configuration and to ensure that the format is intact. FlexVNF uses a boot time configuration (legacy) called vsboot.conf. |
Administration Management
These are the aliases for administration management:
Use this option.. | To.. |
vsh connect <process-name> | Connect to the VTY CLIs of the process (the process names are shown on TAB completion). On FlexVNF, some processes have an inbuilt telnet-based command-line called VTY. |
vsh rollback-to | Rollback the device to a known good state when the CLI is not accessible, or when the device is stuck after an upgrade or some maintenance operation. The states are shown on TAB completion. |
vsh ncconsole | Open up a Netconf console to ConfD, where Netconf XMLs can be directly sent to ConfD. |
vsh <start | stop | restart> | Start-up, stop or restart all FlexVNF services (processes). This is equivalent to running: sudo service versa-flexvnf <start | stop | restart> command. |
Troubleshooting
These are the aliases for troubleshooting:
Use this option.. | To.. |
vsh allow-nc-port | Ensure Netconf traffic is allowed if the port is blocked on FlexVNFdue to erroneous condition. The config process (ConfD) uses port 2022 (Netconf) to communicate with Versa Director. |
vsh banner-reset | Reset the SSH, CLI and MOTD banners to default. |
vsh load-key <key-file> | Refresh the key-file when the CLI is not accessible. In a normal scenario, run the request system trial-key <file> CLI command: |
vsh load-psk <psk-file> | Load a pre-shared key (.pem) file on to the appliance. This is required if automatic key push from Versa Director has failed for some reason and one has to manually add the key so that Versa Director can communicate. |
vsh <log | rlog | tail> <process-name> | View or monitor log files by giving the process name (instead of path). The process names appear on completing the TAB key. log: view the log file with default editor (picked from EDITOR environment variable or defaulting to vim). rlog: similar to log but treats the input as a regular expression pattern to open the file. tail: runs a tail -f on the log file for continuous monitoring, coloring the output based on the log severity. |
vsh fixgrub | Fix grub parameters. Refer to the article "How to fix grub parameters". |
vsh memdebug <enable | disable> | Enable/disable memory debugging, to track memory allocations/de-allocations. |
vsh setcap <service-name> | Set the right capability on the service in case of missing capability if a Versa service binary is replaced. You can auto-complete the name by pressing TAB. |
vsh tech-support [ name ] | Generate tech support dump, using an optional name, if the CLI is not accessible. In a normal scenario, use request system tech-support CLI command. |
vsh gcore <process-name> | Generate a core dump, without process restart, for the given Versa process TAB completion shows the current running process. |