COT.edit_hardware module

Module for editing hardware details of a VM.

Classes

COTEditHardware Edit hardware information (CPUs, RAM, NICs, etc.).
class COTEditHardware(UI)[source]

Bases: COT.submodule.COTSubmodule

Edit hardware information (CPUs, RAM, NICs, etc.).

Inherited attributes: UI, package, output

Attributes: profiles, delete_all_other_profiles, cpus, memory, nics, nic_types, mac_addresses_list, nic_networks, nic_names, serial_ports, serial_connectivity, scsi_subtypes, ide_subtypes, virtual_system_type

create_subparser()[source]

Create ‘edit-hardware’ CLI subparser.

expand_list_wildcard(name_list, length)[source]

Expand a list containing a wildcard to the desired length.

Since various items (NIC names, network names, etc.) are often named or numbered sequentially, we provide this API to allow the user to specify a wildcard value to permit automatically expanding a list of input strings to the desired length. The syntax for the wildcard option is { followed by a number (indicating the starting index for the name) followed by }. Examples:

["eth{0}"]
Expands to ["eth0", "eth1", "eth2", ...]
["mgmt0" "eth{10}"]
Expands to ["mgmt0", "eth10", "eth11", "eth12", ...]
Parameters:
  • name_list (list) – List of names to assign.
  • length (list) – Length to expand to
Returns:

Expanded list

ready_to_run()[source]

Check whether the module is ready to run().

Returns:(True, ready_message) or (False, reason_why_not)
run()[source]

Do the actual work of this submodule.

Raises:InvalidInputError – if ready_to_run() reports False
cpus

Number of CPUs to set.

delete_all_other_profiles = None

Delete all profiles other than those set in profiles.

ide_subtype

IDE controller subtype string to set.

Deprecated since version 1.5: Use ide_subtypes instead.

ide_subtypes

IDE controller subtype string(s) to set.

mac_addresses_list = None

List of MAC addresses to set.

memory

Amount of RAM (in megabytes) to set.

nic_names = None

List of NIC name strings.

Can use wildcards as described in expand_list_wildcard().

nic_networks = None

List of NIC-to-network mappings.

Can use wildcards as described in expand_list_wildcard().

nic_type

NIC type string to set.

Deprecated since version 1.5: Use nic_types instead.

nic_types

List of NIC type strings to set.

nics

Number of NICs to set.

profiles = None

Configuration profile(s) to edit.

scsi_subtype

SCSI controller subtype string to set.

Deprecated since version 1.5: Use scsi_subtypes instead.

scsi_subtypes

SCSI controller subtype string(s) to set.

serial_connectivity = None

List of serial connection strings.

serial_ports

Serial port count to set.

virtual_system_type = None

Virtual system type