- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with cnos
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - CNOS Versions, GEM dependency, etc.
- Development - Guide for contributing to the module
This module uses REST to manage various Network management aspects of Lenovo CNOS Switches and acts as a foundation for building higher level abstractions within Puppet. The cnos module provides a set of types and providers for managing Lenovo CNOS switches. The module provides resources for the VLAN provisioning, Vlag provisioning, Arp, Telemetry, LAG, LACP, IP-Interface Mapping, VLAN-Port Mapping etc . The module allows you to manage CNOS Switches deployed in a network, in order to manage much of your CNOS configuration through Puppet.
Before you can use the CNOS module, you must create a proxy system able to run puppet device. Your Puppet agent will serve as the "proxy system" for the puppet device subcommand.
Create a device.conf file in the Puppet conf directory (either /etc/puppet or /etc/puppetlabs/puppet) on the Puppet agent. Within your device.conf, you must have:
[cnos.switch.labs.lenovo.com]
type cnos
url https://<USERNAME>:<PASSWORD>@<IP ADDRESS OF CNOS Switch>/
In the above example, <USERNAME>
and <PASSWORD>
refer to Puppet's login for the device. And cnos.switch.labs.lenovo.com is the domain name of the switch
Additionally, you must install the lenovo-rbapi gem into the Puppet Ruby environment on the proxy host (Puppet agent) by declaring the cnos-rbapi class on that host. If you do not install the lenovo-rbapi gem, version 0.0.5, the module will not work.
The following pre-existing infrastructure is required for the use of cnos module:
- A server running as a Puppet master.
- A Puppet agent running as a proxy or controller to the CNOS device.
- A CNOS device that has been registered with the Puppet master via the proxy or controller.
- Download CNOS Module from Puppet forge and install it into your Pupet master
- Classify the CNOS device with the required resource types.
- Apply classification to the device from the proxy or controller by running
puppet device -v --user=root
.
See below for the detailed steps.
In case, you have installed the puppet master in server with domain name, say, server.labs.lenovo.com, then you will be able to access the UI of puppet master with the following URL. https://server.labs.lenovo.com/ This will prompt you for a username and password which u have set up during the master installation. On successful login you will be lead to Overview page. On the right handside you will be able to find menu item for Classification under Configure section. Click on that. In case your CNOS installation has gone successfully you will be able to find your CNOS Module under "All Nodes"
Click on the CNOS Nodes and your will be reach a page where the default tab is Rules. In the page u should be able to find the the nodes pinned to this group. You will be able to find the node u added to the puppet device in this section, if not u have to run the puppet device command to generate certificate and add your device to this classification.
Click on the Configuration tab and click on Add new class text area to list all the classes available for your to execute onto a switch. If you cannot find the classes starting with cnos:: then your manifests are not listing your which means your installation of cnos module is not successful.
Run the following command to have the device proxy node generate a certificate and apply your classifications to the CNOS device.
$ puppet device -v --user=root
If you do not run this command, clients cannot issue REST Commands to the CNOS Switches.
At this point, your set up should be up and fielding requests.
(Note: Due to a bug, passing --user=root
is required, even though the command is already run as root.)
Handles Arp on Lenovo CNOS for interfaces. For details regarding parameters, please refer to cnos_arp.
class cnos::arp {
cnos_arp{'Ethernet1/13':
ageout_time => 1500,
}
}
Handles Arp on Lenovo CNOS for system For details regarding parameters, please refer to cnos_arp_sys.
class cnos::arp_sys {
cnos_arp_sys{'arp_sys':
ageout_time => 1000
}
}
Handles BST feature on Lenovo CNOS. For details regarding parameters, please refer to cnos_telemetry.
class cnos::bst_feature {
cnos_telemetry{ 'bst_feature':
collection_interval => 70,
send_async_reports => 0,
send_snapshot_on_trigger => 1,
trigger_rate_limit => 1,
async_full_report => 1,
trigger_rate_limit_interval => 10,
bst_enable => 0,
}
}
Handles BST Tracking on Lenovo CNOS. For details regarding parameters, please refer to cnos_telemetry_track.
class cnos::bst_track {
cnos_telemetry_track{'bst':
track_egress_port_service_pool => 0,
track_egress_uc_queue => 0,
track_egress_rqe_queue => 0,
track_egress_cpu_queue => 0,
track_ingress_port_service_pool => 0,
track_ingress_service_pool => 0,
track_egress_mc_queue => 0,
track_peak_stats => 1,
track_ingress_port_priority_group => 0,
track_egress_service_pool => 0,
track_device => 0,
}
}
Handles IP interfaces on Lenovo CNOS For details regarding parameters, please refer to cnos_ip_intf.
class cnos::ip_intf {
cnos_ip_intf{'Ethernet1/11':
ensure => present,
ip_addr => '1.2.3.4',
bridge_port => 'no',
if_name => 'Ethernet1/11',
mtu => 1402,
vrf_name => 'default',
admin_state => 'up',
ip_prefix_len => 24
}
}
Handles Lacp on Lenovo CNOS For details regarding parameters, please refer to cnos_lacp.
class cnos::lacp {
cnos_lacp {'sys_prio':
sys_prio => '32769',
}
}
Handles lag on Lenovo CNOS For details regarding parameters, please refer to cnos_lag.
class cnos::lag {
cnos_lag { '11':
ensure => 'present',
interfaces => [ {
'lacp_prio' => 32769,
'lacp_timeout' => 'long',
'lag_mode' => 'lacp_active',
'if_name' => 'Ethernet1/23',
}],
min_links => 2,
}
}
Handles Telemetry System properties on Lenovo CNOS For details regarding parameters, please refer to cnos_sys.
class cnos::sys {
cnos_sys{'sys':
ensure => present,
msg_interval => 15,
heartbeat_enable => 1
}
}
Handles Vlag_health on Lenovo CNOS For details regarding parameters, please refer to cnos_vlag_health.
class cnos::vlag_health {
cnos_vlag_hc {'vlag':
ensure => absent,
keepalive_interval => 5,
retry_interval => 10,
keepalive_attempts => 15,
}
}
Handles vlag isl on Lenovo cnos For details regarding parameters, please refer to cnos_vlag_isl.
class cnos::vlag_isl {
cnos_vlag_isl {'vlag_isl':
port_aggregator => 10
}
}
Handles Vlags on Lenovo cnos. For details regarding parameters, please refer to cnos_vlag.
class cnos::vlag {
cnos_vlag { '2':
ensure => 'present',
status => 'disable',
port_aggregator => 20,
}
}
Handles Vlan -Interface mapping on Lenovo cnos. For details regarding parameters, please refer to cnos_vlan_intf.
class cnos::vlan_intf {
cnos_vlan_intf { 'Ethernet1/92':
ensure => 'present',
bridgeport_mode => 'trunk',
pvid => 1,
vlans => [10],
}
}
Handles VLAN on Lenovo cnos. For details regarding parameters, please refer to cnos_vlan.
class cnos::vlan {
cnos_vlan { '11':
ensure => 'present',
admin_state => 'down',
vlan_name => 'test11',
}
}
Handles Vrrp on Lenovo cnos.
For details regarding parameters, please refer to cnos_vrrp.
class cnos::vrrp {
cnos_vrrp{ '1' :
ensure => present,
prio => 99,
vr_id => 1,
if_name => 'Ethernet1/11',
preempt => 'no',
admin_state => 'down',
ip_addr => '1.1.1.2',
switch_back_delay => 1,
accept_mode => 'no',
v2_compt => 'no',
ad_intvl => 200,
}
}
None.
- cnos_arp: Manage ARP properties on interfaces of Lenovo cnos.
- cnos_arp_sys: Manage Arp propertiesof system on Lenovo cnos.
- cnos_ip_intf: Manage Ip intf on Lenovo cnos.
- cnos_lacp: Manage Lacp on Lenovo cnos.
- cnos_lag: Manage lags on Lenovo cnos.
- cnos_sys: Manage Telemetry system properties on Lenovo cnos.
- cnos_telemetry: Manage Telemetry feature on Lenovo cnos.
- cnos_telemetry_track: Manage Telemetry tracking on Lenovo cnos.
- cnos_vlag_conf: Manage Vlag Configuration on Lenovo cnos.
- cnos_vlag_hc: Manage Vlag Health on Lenovo cnos.
- cnos_vlag_isl: Manage vlag isl on Lenovo cnos.
- cnos_vlag: Manage Vlags on Lenovo cnos.
- cnos_vrrp: Manage Vrrp on Lenovo cnos.
- cnos_vlan_intf: Manage Vlan -Interface mapping on Lenovo cnos.
- cnos_vlan: Manage Vlans on Lenovo cnos.
Manage ARP properties on interfaces of Lenovo cnos.
IP interface name.
Valid options: String
Note: The interface must exist.
The global ARP entry age-out time, in seconds
Valid options: An integer from 60-28800. Default value: 1500 seconds.
Manage Arp properties of system on Lenovo cnos.
Name of parameter
Valid options: None
The global ARP entry age-out time, in seconds
Valid options: An integer from 60-28800. Default value: 1500 seconds.
Manage Ip intf on Lenovo cnos.
Ethernet interface name
Valid options: Valid String Note: The interface must exist.
The name of the VRF to which the interface belongs.
Valid options: String Note: The named VRF must exist.
Whether or not the port is a bridge port.
Valid options: One of yes (default), no.
The maximum transmission unit, in bytes.
Valid options: An integer from 64-9216. Default value: 1500.
IP address for the interface.
Valid options: IP Address
IP address mask.
Valid options: A positive integer from 1-32.
The admin status.
Valid options: One of up, down.
Manage Lacp on Lenovo cnos.
Name of parameter.
Valid options: None
LACP priority for the physical port.
Valid options: An integer from 1-65535. Default value: 32768.
Manage lags on Lenovo cnos.
LAG identifier.
Valid options: An integer from 1-65535
Array of interfaces dictionary.
Valid options: Physical interface members of the LAG; an integer from 1-32.
LACP minimum links number.
Valid options: An integer from 1-32. Default value: 1
Manage Telemetry system properties on Lenovo cnos.
Setting system feature - should be "sys"
Valid options: sys.
When enabled, the Agent asynchronously sends the registration and heartbeat message to the collector.
Valid options: One of: 0: disable heartbeat 1: enable heartbeat (default value)
Determines the interval with which the registration and heartbeat messages are sent to the collector; units of seconds from 1-600. Default value: 5 seconds.
Valid options: See above.
Manage Telemetry feature on Lenovo cnos
setting bst feature - should be "bst
Valid options: None.
Set to 1 to enable BST, 0 to disable it. Enabling BST allows the switch to track buffer utilization statistics.
Valid options: See above.
Set to 1 to enable the transmission of periodic asynchronous reports, 0 to disable this feature.
Valid options: See above.
Set to 1 to enable the async full report feature, 0 to disable it.
Valid options: See above. Note : When this feature is enabled, the agent sends full reports containing data related to all counters. When the feature is disabled, the agent sends incremental reports containing only the counters that have changed since the last report.
The collection interval, in seconds. This defines how frequently periodic reports will be sent to the configured controller.
Valid options: See above.
The trigger rate limit, which defines the maximum number of threshold-driven triggered reports that the agent is allowed to send to the controller per trigger-rate-limit-interval; an integer from 1-5. Valid options: See above
The trigger rate limit interval, in seconds; an integer from 10-60.
Valid options: See above.
Set to 1 to enable sending a complete snapshot of all buffer statistics counters when a trigger happens, 0 to disable this feature.
Valid options: See above
Set to 1 to enable the async full report feature, 0 to disable it. Valid options: See above. Note: When this feature is enabled, the agent sends full reports containing data related to all counters. When the feature is disabled, the agent sends incremental reports containing only the counters that have changed since the last report.
Manage Telemetry tracking on Lenovo cnos
Setting bst tracking - should be "bst
Valid options: bst
1 to peak statistics tracking, 0 to disable this feature Valid options: See above.
1 to enable ingress port priority group tracking, 0 to disable this feature
Valid options: See above.
1 to enable ingress port service pool tracking, 0 to disable this feature
Valid options: See above.
1 to enable ingress service pool tracking, 0 to disable this feature
Valid options: See above.
1 to enable egress port service pool tracking, 0 to disable this feature
Valid options: See above
1 to enable egress service pool tracking, 0 to disable this feature
Valid options: See above.
Set to 1 to enable egress unicast queue tracking, 0 to disable this feature
Valid options: See above.
1 to enable egress RQE queue tracking, 0 to disable this feature
Valid options: See above.
Set to 1 to enable egress CPU queue tracking, 0 to disable this feature
Valid options: See above.
Set to 1 to enable egress multicast queue tracking, 0 to disable this feature
Valid options: See above.
1 to enable tracking of this device, 0 to disable this feature
Valid options: See above
Manage Vlag Configuration on Lenovo cnos
name of parameter
Valid options: None.
Whether the vLAG is enabled or disabled.
Valid options: One of enable, disable. Default value; disable
vLAG tier ID value.
Valid options: An intger from 1-512. Default value: 0.
vLAG priority value.
Valid options: An integer from 0-65535. Default value: 0.
Time interval, in seconds.
Valid options: An integer from 240-3600. Default value: 300.
Delay time, in seconds.
Valid options: An integer from 0-3600. Default value: 120.
Manage Vlag Health on Lenovo cnos.
name of parameter
Valid options: None.
IP address of peer switch. This can be the management IP address of the peer switch.
Valid options: IP Address.
VRF context string.
Valid options: String.
Number of keepalive attempts made before declaring the peer is down.
Valid options: An integer from 1-24. Default value: 3.
Time interval, in seconds
Valid options: an integer from 2-300. Default value: 5.
Time interval, in seconds.
Valid options: An integer from 1-300. Default value:30.
Manage vlag isl on Lenovo cnos.
name of parameter
Valid options: None.
LAG identifier.
Valid options: An integer from 1-4096.
Manage Vlags on Lenovo cnos.
vLAG instance ID number.
Valid options: An integer from 1-64.
LAG identifier.
Valid options: An integer from 1-4096.
vLAG status.
Valid range: One of enable, disable. Default value: disable.
Manage Vrrp on Lenovo cnos.
The VRRP session Virtual Router (VR) ID.
Valid options: An integer from 1-255. Default value is 0.
Interface name.
Valid options: A valid interface name.
Note: The interface must exist.
Advertisement interval (The number of centi-seconds between advertisements for VRRPv3);
Valid options: a multiple of 5 from 5-4095. Default value: 100 centi-seconds.
Enable the preemption of a lower priority master
Valid range: of yes (default) , no.
The priority of the VR on the switch
Valid options: An integer from 1-254.Default value: 100.
Enable the VR
Valid options: one of up (default), down.
The interface to track by this VR
Valid options: Default value: none. Note: If an interface is specified, it must exist.
Enable the VR
Valid options: one of up (default), down.
The interface to track by this VR
Valid options: Default value: none. Note: If an interface is specified, it must exist.
Enables or disables the accept mode for this session.
Valid options: one of yes (default), no.
Enables backward compatibility for VRRPv2 for the VR
Valid options: one of yes, no (default).
The switch back delay interval
Valid options: an integer from 1-500000, or 0 to disable (default).
Manage Vlan -Interface mapping on Lenovo cnos.
Ethernet interface name.
Valid options: A valid Ethernet interface name.
Note: The Ethernet interface must exist.
Sets the bridgeport mode value.
Valid options: 'access' or 'trunk'.
Native VLAN for a port (he access VLAN for access ports or the native VLAN for trunk ports).
Valid range: an integer from 1-3999. Default value is 1
VLAN memberships
Valid options: either all, none, or an integer from 1-3999
Manages virtual LANs on the CNOS device.
Specifies the Name of VLAN.
Valid options: The name must be between 1 and 64 characters long.
Sets the vlan id.
Valid options: An integer value within limit (1-3999).
Specifies the Name of VLAN.
Valid range: The name must be between 1 and 64 characters long.
Specifies the state of vlan.
Valid options: 'up' or 'down'.
Lenovo CNOS version v10.4 or greater. Puppet Enterprise: 5.4.0 or greater. Lenovo Ruby Gem (lenovo-rbapi) : 0.0.5 or greater
Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. Please follow our guidelines when contributing changes. For more information, see our module contribution guide.
Support for this module is provided by Lenovo. To file an issue, please visit this link