CloudShell TRex Traffic Generator Shell #1626
Quali-Community
started this conversation in
Integrations
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
CloudShell TRex Traffic Generator Shell
A Shell implements integration of a device model, application or other technology with CloudShell. A shell consists of a data-model that defines how the device and its properties are modeled in CloudShell along with an automation that enables interaction with the device via CloudShell.
This Shell provides traffic controller capabilities such as loading test configuration, start traffic, stop traffic and more. The traffic controller shell should be used with a traffic chassis shell.
This Shell is based on the Shell Traffic Standard.
Shell Documentation
The shell documentation can be found at: CloudShell TRex Traffic Generator Shell ReadMe.
Repository
Latest Release
README.md
Name
cloudshell-tg-trex
Owner
QualiSystems
Type
1st Gen Shell
Category
Traffic Generators
Min. Compatible CloudShell Version
8.0
Total Downloads
(All Releases)
13
Link
1.0.0
(Version / Tag)
TAR / ZIP
1.0.0 (TAR)
1.0.0 (ZIP)
Author
alexquali
Published On
02/27/2018 05:09 PM
Assets
cloudshell-tg-trex-1.0.0.zip
[29 KB]
Cisco TRex Shells
Release date: March 2018
Shell version: 1.0.0
Document version: 1.0
In This Guide
Overview
A shell integrates a device model, application or other technology with CloudShell. A shell consists of a data model that defines how the device and its properties are modeled in CloudShell, along with automation that enables interaction with the device via CloudShell.
Note: We recommend using a 2nd gen shell where possible. Using a 1st gen shell may limit some shell management capabilities. For more information, see Shell Overview – “Our Shell”.
Traffic Generator Shells
CloudShell's traffic generator shells enable you to conduct traffic test activities on Devices Under Test (DUT) or Systems Under Test (SUT) from a sandbox. In CloudShell, a traffic generator is typically modeled using a chassis resource, which represents the traffic generator device and ports, and a controller service that runs the chassis commands, such as Load Configuration File, Start Traffic and Get Statistics. Chassis and controllers are modeled by different shells, allowing you to accurately model your real-life architecture. For example, scenarios where the chassis and controller are located on different machines.
For additional information on traffic generator shell architecture, and setting up and using a traffic generator in CloudShell, see the Traffic Generators Overiew online help topic.
Cisco TRex Shells
To model a Cisco TRex device in CloudShell, use one of the following options for either a standard or virtual configuration:
Standard Option
▪ Cisco TRex Chassis 2 Gen Shell, which provides data model and autoload functionality to model and load the Cisco TRex Chassis to resource management.
▪ Cisco TRex Controller 1G Shell (service), which provides functionality to load test configuration, run tests, get test results, etc.
Virtual Option
▪ CloudShell TRex Virtual Traffic Generator 1G Shell, which creates a CloudShell TRex virtual traffic generator shell. Using this shell, you can create an App that, once deployed in a sandbox, will spin up a VM that models a Cisco TRex traffic generator.
• Cisco TRex Controller 1G Shell (service), which provides functionality to load test configuration, run tests, get tests results, etc.
For more information on the Cisco TRex traffic generators, see the official Cisco TRex product documentation.
Standard version
For detailed information about the shell’s structure and attributes, see the Traffic Shell Standard in GitHub.
Requirements
Release: Cisco TRex Shells
▪ CloudShell version: 8.2 and above
▪ Cisco TRex versions: 2.35 and above
▪ Cisco TRex server versions: 2.35 and above
Data Model
The shell data models include all shell metadata, families, and attributes.
CloudShell TRex Chassis 2G Families and Models
The chassis families and models are listed in the following table:
CloudShell TRex Virtual Traffic Generator 1G Families and Models
The virtual traffic generator families and models are listed in the following table:
Attributes
Cloudshell TRex Chassis 2G Attributes
The chassis attribute names and types are listed in the following table:
Possible values are: Fiber and/or Copper (comma-separated).
CloudShell TRex Virtual Traffic Generator Attributes
The CloudShell TRex virtual traffic generator attribute names and types are listed in the following table:
The path should include the protocol type, for example http://trex-tgn.cisco.com/trex/release/latest.
CloudShell TRex Controller Attributes
The Cloudshell TRex controller attribute names and types are listed in the following table:
Automation
This section describes the automation (driver) associated with the data model. The shell’s driver is provided as part of the shell package. There are two types of automation processes, Autoload and Resource. Autoload is executed when creating the resource in the Inventory dashboard, while resource commands are run in the sandbox.
For Traffic Generator shells, commands are configured and executed from the controller service in the sandbox, with the exception of the Autoload command, which is executed when creating the resource.
The following table describes the process that occurrs during Autoload for the different TRex shells:
CloudShell TRex Controller 1G Shell
Note: For detailed information on running a traffic test in CloudShell, see Traffic Generators Overview.
The load configuration file includes the settings to run the traffic test, for example, packet size, number of packets to send in parallel, interval at which to send packet batches, etc. The file also reserves the necessary ports.
The load configuration file must be accessible from the Execution Server, see Traffic Generators Overview.
Downloading the Shells
The Cisco TRex shells are available from the Quali Community Integrations page.
Download the files into a temporary location on your local machine.
The shells comprise:
Importing and Configuring the Shells
This section describes how to import the Cisco TRex shells and configure and modify the shell devices.
Importing the shells into CloudShell
To import the CloudShell TRex Controller and the CloudShell TRex Virtual Traffic Generator 1G shells into CloudShell
Make sure you have the shell’s zip package. If not, download the shell from the Quali Community's Integrations page.
Backup your database.
Log in to CloudShell Portal as administrator and access the relevant domain.
In the user menu select Import Package.
Browse to the location of the downloaded shell file, select the relevant .zip file and Click Open. Alternatively, drag the shell’s .zip file into CloudShell Portal.
Import the second shell by repeating steps 4 and 5.
The CloudShell TRex controller shell is displayed in the App/Service>Applications section of your blueprint, and can be used to run custom code and automation processes in the sandbox. For more information, see Services Overview.
You can now use the CloudShell TRex virtual traffic generator shell to create Apps that, once deployed in a sandbox, will spin up VMs that model a Cisco TRex traffic generator. See Configuring a new App. For more information, see Apps Overview.
To import the CloudShell TRex Chassis 2G shell into CloudShell
Make sure you have the shell’s zip package. If not, download the shell from the Quali Community's Integrations page.
In CloudShell Portal, as Global administrator, open the Manage – Shells page.
Click Import.
In the dialog box, navigate to the shell's zip package, select it and click Open.
The shell is displayed in the Shells page and can be used by domain administrators in all CloudShell domains to create new inventory resources, as explained in Adding Inventory Resources.
Download the Cisco TRex Controller 1G shell, if you have not already done so. See To import the CloudShell TRex Controller
Offline installation of a shell
Note: Offline installation instructions are relevant only if CloudShell Execution Server has no access to PyPi. You can skip this section if your execution server has access to PyPi. For additional information, see the online help topic on offline dependencies.
In offline mode, import the shell into CloudShell and place any dependencies in the appropriate dependencies folder. The dependencies folder may differ, depending on the CloudShell version you are using:
For CloudShell version 8.3 and above, see Adding Shell and script packages to the local PyPi Server repository.
For CloudShell version 8.2, perform the appropriate procedure: Adding Shell and script packages to the local PyPi Server repository or Setting the python pythonOfflineRepositoryPath configuration key.
Adding shell and script packages to the local PyPi Server repository
If your Quali Server and/or execution servers work offline, you will need to copy all required Python packages, including the out-of-the-box ones, to the PyPi Server's repository on the Quali Server computer (by default C:\Program Files (x86)\QualiSystems\CloudShell\Server\Config\Pypi Server Repository).
For more information, see Configuring CloudShell to Execute Python Commands in Offline Mode.
To add Python packages to the local PyPi Server repository:
If you haven't created and configured the local PyPi Server repository to work with the execution server, perform the steps in Add Python packages to the local PyPi Server repository (offline mode).
For each shell or script you add into CloudShell, do one of the following (from an online computer):
Connect to the Internet and download each dependency specified in the requirements.txt file with the following command:
pip download -r requirements.txt
.The shell or script's requirements are downloaded as zip files.
In the Quali Community's Integrations page, locate the shell and click the shell's Download link. In the page that is displayed, from the Downloads area, extract the dependencies package zip file.
Place these zip files in the local PyPi Server repository.
Setting the python PythonOfflineRepositoryPath configuration key
Before PyPi Server was introduced as CloudShell’s python package management mechanism, the
PythonOfflineRepositoryPath
key was used to set the default offline package repository on the Quali Server machine, and could be used on specific Execution Server machines to set a different folder.To set the offline python repository:
Download the relevant offline_dependencies.zip file, see Downloading the Shell:
• virtual-trex-offline-packages-1.0.0.zip
• trex_controller-offline-dependencies-1.0.0.zip
• trex_chassis_2g_offline_dependencies-1.0.0.zip
• cloudshell-tg-trex-1.0.0.zip
Unzip it to a local repository. Make sure the execution server has access to this folder.
On the Quali Server machine, in the ~\CloudShell\Server\customer.config file, add the following key to specify the path to the default python package folder (for all Execution Servers):
<add key="PythonOfflineRepositoryPath" value="repository full path"/>
If you want to override the default folder for a specific Execution Server, on the Execution Server machine, in the ~TestShell\Execution Server\customer.config file, add the following key:
<add key="PythonOfflineRepositoryPath" value="repository full path"/>
Restart the Execution Server.
Configuring a new resource
This section explains how to create a new resource from the CloudShell TRex Chassis 2G shell.
In CloudShell, the component that models the device is called a resource. It is based on the shell that models the device and allows the CloudShell user and API to remotely control the device from CloudShell.
You can also modify existing resources, see Managing Resources in the Inventory.
To create a resource for the device:
In the CloudShell Portal, in the Inventory dashboard, click Add New.
From the list, select Cisco TRex Chassis.
Enter the Name and IP address of the Cisco TRex Chassis.
Click Create.
In the Resource dialog box, enter the device's settings. For details, see Device Name Attributes.
Click Continue.
CloudShell validates the device’s settings and updates the new resource with the device’s structure.
Configuring the setup script
This section explains how to modify the setup script to work with the CloudShell TRex Virtual Traffic Generator shell.
To modify the setup script:
Log in to CloudShell Portal as administrator of the relevant domain.
Go to the Manage dashboard and click Scripts>Blueprint.
Download the current setup script.
Browse to the location of the downloaded file.
Add cloudshell-orch-trex>=1.0.0,<1.1.0 into the requirements.txt file.
Add the following code in the main.py file:
from cloudshell.workflow.orchestration.setup.trex.configuration_commands import configure_virtual_chassis, execute_autoload_on_trexsandbox.workflow.add_to_configuration(function=configure_virtual_chassis, components=sandbox.components.apps) sandbox.workflow.on_configuration_ended(function=execute_autoload_on_trex, components=sandbox.components.apps))
Update the setup script in CloudShell.
Updating Python Dependencies for Shells
This section explains how to update your Python dependencies folder. This is required when you upgrade a shell that uses new/updated dependencies. It applies to both online and offline dependencies.
Updating offline Python dependencies
To update offline Python dependencies:
Download the latest Python dependencies package zip file locally.
Extract the zip file to the suitable offline package folder(s).
Terminate the shell’s instance, as explained here.
Updating online Python dependencies
In online mode, the execution server automatically downloads and extracts the appropriate dependencies file to the online Python dependencies repository every time a new instance of the driver or script is created.
To update online Python dependencies:
Typical Workflows
Workflow 1 - Creating a new blueprint
Log in to CloudShell Portal and create a new blueprint (Blueprint Catalog>Create Blueprint).
Give the blueprint a name.
Add resources and services to the blueprint.
Workflow 2 - Getting the TRex server configuration file
Log in to CloudShell Portal and reserve the blueprint.
Hover over the TRex Controller resource and select the Commands button from the context menu.
Run the Upload Server Configuration command and specify the input value as follows:
Run the Upload Server Configuration command.
Enter the FTP/TFTP server folder and verify that the TRex server configuration was copied successfully.
Workflow 3 - Setting the TRex server configuration file
Log in to CloudShell Portal and reserve the blueprint.
Hover over the TRex Controller resource and select the Commands button from the context menu.
Run the Download Server Configuration command and specify the input value as follows:
Run the Download Server Configuration command.
Workflow 4 - Loading the TRex test configuration file
Log in to CloudShell Portal and reserve the blueprint.
Hover over the TRex Controller resource and select the Commands button from the context menu.
Run the Load Test Configuration command and specify the input value as follows:
The path can be accessed in two ways:
• Path to the configuration file on the FTP/TFTP server
• Relative path to the configuration file under Test Files Location.
Run the Load Test Configuration command.
Workflow 5 - Running a test
Reserve a blueprint that is configured to run traffic tests, like the one configured in Workflow 1.
Run the Start Test command.
Hover over the TRex Controller resource and select the Commands button from the context menu.
Run the Start Traffic command and specify the required parameters:
• Block: Set to True to execute the command when the TRex state changes from Starting to either Idle or Running.
• Timeout: Maximum time (in seconds) to wait in the Block state until the TRex state changes from Starting to either Idle or Running.
• Latency: Latency packets rate (Hz).
Execute the Start Traffic command.
Run Stop Test.
Hover over the TRex Controller resource and select the Commands button from the context menu.
Run the Stop Traffic command and enter the Run menu.
Specify the following parameter, as required:
• Force: Forces the TRex process (if it exists) to stop running on the server.
Run the Stop Traffic command.
Run Get Result command.
References
To download and share integrations, see Quali Community's Integrations.
For instructional training and documentation, see Quali University.
To suggest an idea for the product, see Quali's Idea box.
To connect with Quali users and experts from around the world, ask questions and discuss issues, see Quali's Community forums.
Release Notes
What's New
For release updates, see the shell's GitHub release pages as follows:
▪ Cisco TRex Chassis 2 Gen Shell release page
▪ Cisco TRex Controller 1G Shell release page
▪ CloudShell TRex Virtual Traffic Generator 1G Shell release page
* Please allow 30-60 seconds for manual update changes to take effect.
ofir eldar 03/04/2018 05:51 PM
· 3413 ·
Beta Was this translation helpful? Give feedback.
All reactions