COT.platforms module

Handles behavior that varies between guest platforms.

Classes

GenericPlatform Generic class for operations that depend on guest platform.
CSR1000V Platform-specific logic for Cisco CSR1000V platform.
IOSv Platform-specific logic for Cisco IOSv.
IOSXRv Platform-specific logic for Cisco IOS XRv platform.
IOSXRvRP Platform-specific logic for Cisco IOS XRv HA-capable RP.
IOSXRvLC Platform-specific logic for Cisco IOS XRv line card.
NXOSv Platform-specific logic for Cisco NX-OSv (Titanium).
class GenericPlatform[source]

Bases: object

Generic class for operations that depend on guest platform.

To be used whenever the guest is unrecognized or does not need special handling.

classmethod controller_type_for_device(device_type)[source]

Get the default controller type for the given device type.

classmethod guess_nic_name(nic_number)[source]

Guess the name of the Nth NIC for this platform.

Note that this counts from 1, not from 0!

classmethod valid_list_only(desc, val, supported_list)[source]

Error if the given value is not an item in the provided list.

classmethod validate_cpu_count(cpus)[source]

Throw an error if the number of CPUs is not a supported value.

classmethod validate_memory_amount(megabytes)[source]

Throw an error if the amount of RAM is not supported.

classmethod validate_nic_count(count)[source]

Throw an error if the number of NICs is not supported.

classmethod validate_nic_type(type_string)[source]

Throw an error if the NIC type string is not supported.

classmethod validate_serial_count(count)[source]

Throw an error if the number of serial ports is not supported.

BOOTSTRAP_DISK_TYPE = 'cdrom'
CONFIG_TEXT_FILE = 'config.txt'
LITERAL_CLI_STRING = 'config'
PLATFORM_NAME = '(unrecognized platform, generic)'
SECONDARY_CONFIG_TEXT_FILE = None
class CSR1000V[source]

Bases: COT.platforms.GenericPlatform

Platform-specific logic for Cisco CSR1000V platform.

classmethod controller_type_for_device(device_type)[source]

CSR1000V uses SCSI for hard disks and IDE for CD-ROMs.

classmethod guess_nic_name(nic_number)[source]

GigabitEthernet1, GigabitEthernet2, etc.

Warning

In all current CSR releases, NIC names start at “GigabitEthernet1”. Some early versions started at “GigabitEthernet0” but we don’t support that.

classmethod validate_cpu_count(cpus)[source]

CSR1000V supports 1, 2, or 4 CPUs.

classmethod validate_memory_amount(megabytes)[source]

Minimum 2.5 GB, max 8 GB.

classmethod validate_nic_count(count)[source]

CSR1000V requires 3 NICs and supports up to 26.

classmethod validate_serial_count(count)[source]

CSR1000V supports 0-2 serial ports.

CONFIG_TEXT_FILE = 'iosxe_config.txt'
LITERAL_CLI_STRING = 'ios-config'
PLATFORM_NAME = 'Cisco CSR1000V'
class IOSv[source]

Bases: COT.platforms.GenericPlatform

Platform-specific logic for Cisco IOSv.

classmethod guess_nic_name(nic_number)[source]

GigabitEthernet0/0, GigabitEthernet0/1, etc.

classmethod validate_cpu_count(cpus)[source]

IOSv only supports a single CPU.

classmethod validate_memory_amount(megabytes)[source]

IOSv has minimum 192 MB (with minimal feature set), max 3 GB.

classmethod validate_nic_count(count)[source]

IOSv supports up to 16 NICs.

classmethod validate_nic_type(type_string)[source]

IOSv only supports E1000 NICs.

classmethod validate_serial_count(count)[source]

IOSv requires 1-2 serial ports.

BOOTSTRAP_DISK_TYPE = 'harddisk'
CONFIG_TEXT_FILE = 'ios_config.txt'
LITERAL_CLI_STRING = None
PLATFORM_NAME = 'Cisco IOSv'
class IOSXRv[source]

Bases: COT.platforms.GenericPlatform

Platform-specific logic for Cisco IOS XRv platform.

classmethod guess_nic_name(nic_number)[source]

MgmtEth0/0/CPU0/0, GigabitEthernet0/0/0/0, Gig0/0/0/1, etc.

classmethod validate_cpu_count(cpus)[source]

IOS XRv supports 1-8 CPUs.

classmethod validate_memory_amount(megabytes)[source]

Minimum 3 GB, max 8 GB of RAM.

classmethod validate_nic_count(count)[source]

IOS XRv requires at least one NIC.

classmethod validate_nic_type(type_string)[source]

IOS XRv supports E1000 and virtio NICs.

classmethod validate_serial_count(count)[source]

IOS XRv supports 1-4 serial ports.

CONFIG_TEXT_FILE = 'iosxr_config.txt'
LITERAL_CLI_STRING = None
PLATFORM_NAME = 'Cisco IOS XRv'
SECONDARY_CONFIG_TEXT_FILE = 'iosxr_config_admin.txt'
class IOSXRvRP[source]

Bases: COT.platforms.IOSXRv

Platform-specific logic for Cisco IOS XRv HA-capable RP.

classmethod guess_nic_name(nic_number)[source]

Fabric and management only.

  • fabric
  • MgmtEth0/{SLOT}/CPU0/0
classmethod validate_nic_count(count)[source]

Fabric plus an optional management NIC.

PLATFORM_NAME = 'Cisco IOS XRv route processor card'
class IOSXRvLC[source]

Bases: COT.platforms.IOSXRv

Platform-specific logic for Cisco IOS XRv line card.

classmethod guess_nic_name(nic_number)[source]

Fabric interface plus slot-appropriate GigabitEthernet interfaces.

  • fabric
  • GigabitEthernet0/{SLOT}/0/0
  • GigabitEthernet0/{SLOT}/0/1
  • etc.
classmethod validate_serial_count(count)[source]

No serial ports are needed but up to 4 can be used for debugging.

CONFIG_TEXT_FILE = None
PLATFORM_NAME = 'Cisco IOS XRv line card'
SECONDARY_CONFIG_TEXT_FILE = None
class NXOSv[source]

Bases: COT.platforms.GenericPlatform

Platform-specific logic for Cisco NX-OSv (Titanium).

classmethod guess_nic_name(nic_number)[source]

NX-OSv names its NICs a bit interestingly...

  • mgmt0
  • Ethernet2/1
  • Ethernet2/2
  • ...
  • Ethernet2/48
  • Ethernet3/1
  • Ethernet3/2
  • ...
classmethod validate_cpu_count(cpus)[source]

NX-OSv requires 1-8 CPUs.

classmethod validate_memory_amount(megabytes)[source]

NX-OSv requires 2-8 GB of RAM.

classmethod validate_nic_type(type_string)[source]

NX-OSv supports only E1000 and virtio NICs.

classmethod validate_serial_count(count)[source]

NX-OSv requires 1-2 serial ports.

CONFIG_TEXT_FILE = 'nxos_config.txt'
LITERAL_CLI_STRING = None
PLATFORM_NAME = 'Cisco NX-OSv'