COT.platforms module

Handles behavior that varies between guest platforms.

Functions

platform_from_product_class Get the class of Platform corresponding to a product class string.

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.
IOSXRv9000 Platform-specific logic for Cisco IOS XRv 9000 platform.
NXOSv Platform-specific logic for Cisco NX-OSv (Titanium).

Constants

PRODUCT_PLATFORM_MAP Mapping of known product class strings to Platform classes.
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

This method counts from 1, not from 0!

classmethod validate_cpu_count(cpus)[source]

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

classmethod validate_memory_amount(mebibytes)[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_nic_types(type_list)[source]

Throw an error if any NIC type string in the list is unsupported.

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
SUPPORTED_NIC_TYPES = ['E1000e', 'E1000', 'PCNet32', 'virtio', 'VMXNET3']
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(mebibytes)[source]

Minimum 2.5 GiB, max 8 GiB.

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'
SUPPORTED_NIC_TYPES = ['E1000', 'virtio', 'VMXNET3']
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(mebibytes)[source]

IOSv has minimum 192 MiB (with minimal feature set), max 3 GiB.

classmethod validate_nic_count(count)[source]

IOSv supports up to 16 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'
SUPPORTED_NIC_TYPES = ['E1000']
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(mebibytes)[source]

Minimum 3 GiB, max 8 GiB of RAM.

classmethod validate_nic_count(count)[source]

IOS XRv requires at least one NIC.

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'
SUPPORTED_NIC_TYPES = ['E1000', 'virtio']
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(mebibytes)[source]

NX-OSv requires 2-8 GiB of RAM.

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'
SUPPORTED_NIC_TYPES = ['E1000', 'virtio']