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_type, mac_addresses_list, nic_networks, nic_names, serial_ports, serial_connectivity, scsi_subtype, ide_subtype, virtual_system_type

create_subparser(parent, storage)[source]

Add subparser for the CLI of this submodule.

Parameters:
  • parent (object) – Subparser grouping object returned by ArgumentParser.add_subparsers()
  • storage (dict) – Dict of { ‘label’: subparser } to be updated with subparser(s) created, if any.
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 = None

Subtype string for IDE controllers

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.

nics

Number of NICs to set.

profiles = None

Configuration profile(s) to edit.

scsi_subtype = None

Subtype string for SCSI controllers

serial_connectivity = None

List of serial connection strings.

serial_ports

Serial port count to set.

virtual_system_type = None

Virtual system type