CVT as a Service
The Cable Validation Tool (CVT) can be deployed and managed as a service, providing automated cable validation capabilities with persistent operation, automatic startup, and web-based management. This document covers the service architecture, configuration, deployment, and management of CVT in service mode.
The CVT service architecture consists of multiple components managed by supervisord.
CVT Container <p></p>┌──────────────────────────────────────────┐<p></p>│ supervisord │<p></p>│ ┌─────────────────────────────────────┐ │<p></p>│ │ CVT Service │ │<p></p>│ │ ┌─────────────────────────────────┐│ │<p></p>│ │ │ BringupCLI Engine ││ │<p></p>│ │ │ • Topology Management ││ │<p></p>│ │ │ • Agent Deployment ││ │<p></p>│ │ │ • Validation Orchestration ││ │<p></p>│ │ └─────────────────────────────────┘│ │<p></p>│ │ ┌─────────────────────────────────┐│ │<p></p>│ │ │ Web Service ││ │<p></p>│ │ │ • REST API ││ │<p></p>│ │ │ • Web UI ││ │<p></p>│ │ │ • Authentication ││ │<p></p>│ │ └─────────────────────────────────┘│ │<p></p>│ └─────────────────────────────────────┘ │<p></p>│ ┌─────────────────────────────────────┐ │<p></p>│ │ Apache Web Server │ │<p></p>│ │ • HTTPS/SSL Support │ │<p></p>│ │ • Reverse Proxy │ │<p></p>│ │ • Static Content Serving │ │<p></p>│ └─────────────────────────────────────┘ │<p></p>│ ┌─────────────────────────────────────┐ │<p></p>│ │ CV Controller │ │<p></p>│ │ • Service Management API │ │<p></p>│ │ • System Administration │ │<p></p>│ └─────────────────────────────────────┘ │<p></p>└──────────────────────────────────────────┘
CVT Service (cvt-service)
Purpose: Main CVT application running in daemon mode
Command:
/usr/local/bin/cvt-service --daemonFeatures:
Automatic topology loading
Validation orchestration
Agent management
Signal handling (SIGTERM, SIGINT)
Apache Web Server (apache)
Purpose: HTTPS frontend and reverse proxy
Command:
/usr/local/bin/apache2_wrapper.shFeatures:
SSL/TLS termination
Web UI serving
API reverse proxy
Authentication handling
CV Controller (cv_controller)
Purpose: Service management and system administration
Command:
/usr/local/bin/run_cv_controller.shFeatures:
Service start/stop operations
System status monitoring
Configuration management
Cron Service (cron)
Purpose: Scheduled tasks and maintenance
Command:
cron -fFeatures:
Log rotation
Periodic cleanup
Scheduled reports
Docker Deployment for CVT Service
The CVT service is deployed using a pre-built Docker image (bringup service image). This allows for a consistent and isolated runtime environment.
Load the CVT Collector Service Image.
If you have a local Docker image file (
.tar.gz), load it using:docker load -i /path/to/cables_bringup_{version}.tar.gz
[Optional] Pull the Image from a Registry
If the image is available in a Docker registry, you can pull it directly:
docker pull mellanox/cables_bringup:{version}
Run the CVT Service Container: Use the following command to start the CVT service:
docker run -itd \ --name cables_bringup \ --network=host \ {override/add env variables} \ -v /path/to/data:/cable_bringup_root \ mellanox/cables_bringup:{version}
Options:
Option
Description
-itd
Run container in interactive mode, allocate a pseudo-TTY, and run in detached mode
--name cables_bringup
Assigns a name to the container for easier management.
--network=host
Shares the host’s network stack for the container.
{override/add env variables}
Specify any environment variables needed by the service.
-v /path/to/data:/cable_bringup_root
Mounts a host directory into the container for persistent data.
mellanox/cables_bringup:{version}
The Docker image and version tag to run.
Environment Variables
The CVT service behavior is controlled through environment variables and configuration files:
Configuration File (/etc/cablevalidation/cvt_env.conf)
Run the following command to edit the file and restart cvt-service:
supervisorctl restart cvt-service
For more information, refer to CVT Configuration.
Environment Variable Configuration
Run the following command to configure environment variables:
docker run
Web Service Configuration
Web service configuration can be done only in the docker run command.
# Web service interface and ports
export CVT_WEB_INTERFACE=127.0.0.1
export CVT_WEB_SERVICE_PORT=8251
export APACHE_HTTPS_PORT=443
# Controller service port
export CV_CONTROLLER_PORT=8252
UFM Plugin Mode
Install the CVT UFM plugin using the UFM CLI or Web UI, like any other plugin.
NetQ Plugin Mode
TBD
Supervisord Configuration
The service is managed by supervisordwith the following configuration:
Directive | Description |
| Command to start the CVT service in daemon mode. |
| Automatically starts the service when Supervisor starts. |
| Restarts the service automatically if it exits unexpectedly. |
| Number of retry attempts if the service fails to start. |
| Number of seconds the service must stay running to be considered started. |
| Path to the log file for standard error output. |
| Path to the log file for standard output. |
| Maximum size of each log file before rotation. |
| Number of rotated log backups to keep. |
| The user under which the service runs. |
| Terminates all processes in the service’s process group on stop. |
| Sends stop signals to the entire process group. |
| Sets environment variables for the service ( |
CVT Service Management with Supervisor
The CVT service is managed through Supervisor, which allows you to start, stop, restart, and monitor services on your appliance. Below are the common commands:
Service | Description | Command |
Start CVT Service | Starts the CVT service if it is not already running. |
|
Stop CVT Service | Stops the CVT service gracefully. |
|
Restart CVT Service | Stops and then starts the CVT service. Useful for applying configuration changes. |
|
Check Service Status | Displays the current status of the CVT service (e.g., RUNNING, STOPPED, FATAL). |
|
View Service Logs | Displays real-time logs from the CVT service. Useful for troubleshooting. |
|
Start All Services | Starts all services managed by Supervisor. |
|
Reload Configuration |
| supervisorctl reread && supervisorctl update |
CVT Service Commands
Command | Description |
| Starts the CVT service if it is not already running. |
| Stops the CVT service gracefully. |
| Restarts the CVT service. Useful for applying configuration changes. |
| Displays the current status of the CVT service (RUNNING, STOPPED, FATAL). |
| Displays real-time logs from the CVT service for troubleshooting. |
| Starts all services managed by Supervisor. |
| Reloads configuration |
Using CVT Controller API
The CVT Controller provides programmatic service management:
Command | Description |
| Starts the CVT service via the controller. |
| Stops the CVT service via the controller. |
| Retrieves the CVT service status via the controller. Note: This feature is not supported yet. |
Legacy Mode Operation
For troubleshooting, development, or manual operations, you can stop the CVT service and run the traditional interactive CLI:
Stop Service and Run Legacy CLI
Stop the CVT Service
supervisorctl stop cvt-service
Run the Legacy Bringup CLI:
bringupcli
Legacy CLI Features
When running in legacy mode, you get:
Interactive Command Shell: Full command-line interface with tab completion
Manual Control: Step-by-step topology loading and validation control
Real-time Feedback: Immediate command output and status updates
Debugging: Easier debugging with direct command execution
Common Legacy Mode Workflow
Stop the CVT service:
supervisorctl stop cvt-service
Start interactive CLI:
bringupcli
Perform manual operations:
Cable Bringup: load_topo /path/to/topology.topo Cable Bringup: deploy_all_agents Cable Bringup: start_validation Cable Bringup: show_switches Cable Bringup: exit
Restart service when done:
upervisorctl start cvt-service
When to Use Legacy Mode
Initial Setup: First-time configuration and testing
Troubleshooting: Debugging connectivity or configuration issues
Manual Operations: One-time tasks that don't require automation
Development: Testing new topologies or validation scenarios
Training: Learning CVT commands and workflows
Switching Back to Service Mode
Exit the legacy CLI:
Cable Bringup: exit
Restart the CVT service:
supervisorctl start cvt-service
Verify that the service is running:
supervisorctl status cvt-service
While in legacy mode, automatic features (e.g., topology loading and validation) are disabled. The web UI remains accessible. Restarting the service restores full automatic functionality.
Command Line Options
The CVT service supports several command line options:
Command | Description |
| Runs the CVT service as a background daemon. |
| Terminates any other running CVT sessions before starting a new one. |
| Displays the current version of the CVT service. |
| Starts the CVT service in interactive mode, useful for debugging. |
Topology Loading
The CVT service can automatically load topology files on startup based on the STARTUP_TOPOLOGY configuration:
Load Last Topology
STARTUP_TOPOLOGY=last
Loads the most recently used topology from history
Supports all topology formats (.topo, .dot, .xlsx, .json)
Load Specific File
STARTUP_TOPOLOGY=/path/to/topology.topo
Loads a specific topology file on startup
Supports absolute and relative paths
Auto-detects file format based on extension
Supported Formats
.topo: Native topology format.dot: Graphviz DOT format.xlsx: Unified topology Excel format.json: JSON topology format
Automatic Validation
Enable automatic validation start after topology loading:
AUTO_START_VALIDATION=true
Behavior:
Only starts if topology was successfully loaded
Uses validation settings from history
Logs all activities for monitoring
Signal Handling
The service handles system signals gracefully:
SIGTERM: Graceful shutdown with cleanup
SIGINT:
Daemon mode: Graceful shutdown
Interactive mode: Cancel current operation (double Ctrl-C to exit)
Monitoring and Logging
Log Files
All service logs are centrally managed:
/cable_bringup_root/log/<p></p>├── cvt-service.log # Main service logs<p></p>├── cv_controller_service.log # Controller logs<p></p>├── apache2/<p></p>│ ├── access.log # Web access logs<p></p>│ └── error.log # Apache error logs<p></p>└── supervisord.log # Supervisor logs
Log Rotation
Logs are automatically rotated with the following settings:
Max size: 10MB per log file
Backups: 7 historical files
Format: Timestamped entries with log levels
Health Monitoring
Monitor service health using:
Command | Description |
| Checks the status of all services managed by Supervisor. |
| Monitors CVT service logs in real-time. |
| Displays the current status of the Apache web server. |
| Interactive tool to monitor system processes and resource usage. |
| Displays detailed I/O statistics for devices every 1 second. |
Common Issues
Issue | Troubleshooting |
Service Won't Start |
|
Port Conflicts |
|
Permission Issues |
|
Memory/Performance Issues |
|
Topology Loading Failures |
|
Debug Mode
For detailed debugging, run CVT in interactive mode:
Command | Description |
| Stops the CVT service managed by Supervisor. |
| Runs the CVT service in interactive mode. |
| Runs the CVT service interactively with debug logging enabled. |
Log Analysis
Analyze logs for common patterns:
Command | Description |
| Searches the CVT service log for error messages. |
| Monitors the startup sequence of the CVT service. |
| Checks log entries related to topology loading. |
| Monitors validation activities and their start/stop events. |
Flow | |
Security |
|
Performance |
|
Reliability |
|
Maintenance |
|
Development and Testing |
|