Base classes for storage engines
Bases: object
Base class for storage system connections.
Add tag to the node.
If the node_id and tag pair already exists, this should still succeed.
| Parameters: |
|
|---|---|
| Returns: | the NodeTag object. |
| Raises: | NodeNotFound if the node is not found. |
Create a new node.
| Parameters: | values – A dict containing several items used to identify and track the node, and several dicts which are passed into the Drivers when managing this node. For example: {
'uuid': uuidutils.generate_uuid(),
'instance_uuid': None,
'power_state': states.POWER_OFF,
'provision_state': states.AVAILABLE,
'driver': 'pxe_ipmitool',
'driver_info': { ... },
'properties': { ... },
'extra': { ... },
}
|
|---|---|
| Raises: | InvalidParameterValue if create a node with tags. |
| Returns: | A node. |
Create a new portgroup.
| Parameters: | values – Dict of values with the following keys: ‘id’ ‘uuid’ ‘name’ ‘node_id’ ‘address’ ‘extra’ ‘created_at’ ‘updated_at’ |
|---|---|
| Returns: | A portgroup |
| Raises: | PortgroupDuplicateName |
| Raises: | PortgroupMACAlreadyExists |
| Raises: | PortgroupAlreadyExists |
Create a new volume connector.
| Parameters: | connector_info – Dictionary containing information about the connector. Example: {
'uuid': '000000-..',
'type': 'wwnn',
'connector_id': '00:01:02:03:04:05:06',
'node_id': 2
}
|
|---|---|
| Returns: | A volume connector. |
| Raises: | VolumeConnectorTypeAndIdAlreadyExists If a connector already exists with a matching type and connector_id. |
| Raises: | VolumeConnectorAlreadyExists If a volume connector with the same UUID already exists. |
Create a new volume target.
| Parameters: | target_info – Dictionary containing the information about the volume target. Example: {
'uuid': '000000-..',
'node_id': 2,
'boot_index': 0,
'volume_id': '12345678-...'
'volume_type': 'some type',
}
|
|---|---|
| Returns: | A volume target. |
| Raises: | VolumeTargetBootIndexAlreadyExists if a volume target already exists with the same boot index and node ID. |
| Raises: | VolumeTargetAlreadyExists if a volume target with the same UUID exists. |
Delete specified tag from the node.
| Parameters: |
|
|---|---|
| Raises: | NodeNotFound if the node is not found. |
| Raises: | NodeTagNotFound if the tag is not found. |
Destroy a chassis.
| Parameters: | chassis_id – The id or the uuid of a chassis. |
|---|
Destroy a node and its associated resources.
Destroy a node, including any associated ports, port groups, tags, volume connectors, and volume targets.
| Parameters: | node_id – The ID or UUID of a node. |
|---|
Destroy a portgroup.
| Parameters: | portgroup_id – The UUID or MAC of a portgroup. |
|---|---|
| Raises: | PortgroupNotEmpty |
| Raises: | PortgroupNotFound |
Destroy a volume connector.
| Parameters: | ident – The UUID or integer ID of a volume connector. |
|---|---|
| Raises: | VolumeConnectorNotFound If a volume connector with the specified ident does not exist. |
Destroy a volume target.
| Parameters: | ident – The UUID or integer ID of a volume target. |
|---|---|
| Raises: | VolumeTargetNotFound if a volume target with the specified ident does not exist. |
Retrieve drivers for the registered and active conductors.
| Parameters: | interval – Seconds since last check-in of a conductor. |
|---|---|
| Returns: | A dict which maps driver names to the set of hosts
which support them. For example:{driverA: set([host1, host2]),
driverB: set([host2, host3])}
|
Retrieve hardware types for the registered and active conductors.
| Returns: | A dict which maps hardware type names to the set of hosts
which support them. For example:{hardware-type-a: set([host1, host2]),
hardware-type-b: set([host2, host3])}
|
|---|
Return a chassis representation.
| Parameters: | chassis_id – The id of a chassis. |
|---|---|
| Returns: | A chassis. |
Return a chassis representation.
| Parameters: | chassis_uuid – The uuid of a chassis. |
|---|---|
| Returns: | A chassis. |
Return a list of chassis.
| Parameters: |
|
|---|
Retrieve a conductor’s service record from the database.
| Parameters: | hostname – The hostname of the conductor service. |
|---|---|
| Returns: | A conductor. |
| Raises: | ConductorNotFound |
Return a node.
| Parameters: | node_id – The id of a node. |
|---|---|
| Returns: | A node. |
Return a node.
| Parameters: | instance – The instance uuid to search for. |
|---|---|
| Returns: | A node. |
| Raises: | InstanceNotFound if the instance is not found. |
| Raises: | InvalidUUID if the instance uuid is invalid. |
Return a node.
| Parameters: | node_name – The logical name of a node. |
|---|---|
| Returns: | A node. |
Find a node by any matching port address.
| Parameters: | addresses – list of port addresses (e.g. MACs). |
|---|---|
| Returns: | Node object. |
| Raises: | NodeNotFound if none or several nodes are found. |
Return a node.
| Parameters: | node_uuid – The uuid of a node. |
|---|---|
| Returns: | A node. |
Return a list of nodes.
| Parameters: |
|
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get node tags based on its id.
| Parameters: | node_id – The id of a node. |
|---|---|
| Returns: | A list of NodeTag objects. |
| Raises: | NodeNotFound if the node is not found. |
Get specific columns for matching nodes.
Return a list of the specified columns for all nodes that match the specified filters.
| Parameters: |
|
||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns: | A list of tuples of the specified columns. |
||||||||||||||||||||||
Get a list conductor hostnames that are offline (dead).
| Returns: | A list of conductor hostnames. |
|---|
Return a network port representation.
| Parameters: | address – The MAC address of a port. |
|---|---|
| Returns: | A port. |
Return a network port representation.
| Parameters: | port_id – The id of a port. |
|---|---|
| Returns: | A port. |
Return a network port representation.
| Parameters: | port_uuid – The uuid of a port. |
|---|---|
| Returns: | A port. |
Return a list of ports.
| Parameters: |
|
|---|
Return a network portgroup representation.
| Parameters: | address – The MAC address of a portgroup. |
|---|---|
| Returns: | A portgroup. |
| Raises: | PortgroupNotFound |
Return a network portgroup representation.
| Parameters: | portgroup_id – The id of a portgroup. |
|---|---|
| Returns: | A portgroup. |
| Raises: | PortgroupNotFound |
Return a network portgroup representation.
| Parameters: | name – The logical name of a portgroup. |
|---|---|
| Returns: | A portgroup. |
| Raises: | PortgroupNotFound |
Return a network portgroup representation.
| Parameters: | portgroup_uuid – The uuid of a portgroup. |
|---|---|
| Returns: | A portgroup. |
| Raises: | PortgroupNotFound |
Return a list of portgroups.
| Parameters: |
|
|---|---|
| Returns: | A list of portgroups. |
List all the portgroups for a given node.
| Parameters: |
|
|---|---|
| Returns: | A list of portgroups. |
List all the ports for a given node.
| Parameters: |
|
|---|---|
| Returns: | A list of ports. |
List all the ports for a given portgroup.
| Parameters: |
|
|---|---|
| Returns: | A list of ports. |
Return a volume connector representation.
| Parameters: | db_id – The integer database ID of a volume connector. |
|---|---|
| Returns: | A volume connector with the specified ID. |
| Raises: | VolumeConnectorNotFound If a volume connector with the specified ID is not found. |
Return a volume connector representation.
| Parameters: | connector_uuid – The UUID of a connector. |
|---|---|
| Returns: | A volume connector with the specified UUID. |
| Raises: | VolumeConnectorNotFound If a volume connector with the specified UUID is not found. |
Return a list of volume connectors.
| Parameters: |
|
|---|---|
| Returns: | A list of volume connectors. |
| Raises: | InvalidParameterValue If sort_key does not exist. |
List all the volume connectors for a given node.
| Parameters: |
|
|---|---|
| Returns: | A list of volume connectors. |
| Raises: | InvalidParameterValue If sort_key does not exist. |
Return a volume target representation.
| Parameters: | db_id – The database primary key (integer) ID of a volume target. |
|---|---|
| Returns: | A volume target. |
| Raises: | VolumeTargetNotFound if no volume target with this ID exists. |
Return a volume target representation.
| Parameters: | uuid – The UUID of a volume target. |
|---|---|
| Returns: | A volume target. |
| Raises: | VolumeTargetNotFound if no volume target with this UUID exists. |
Return a list of volume targets.
| Parameters: |
|
|---|---|
| Returns: | A list of volume targets. |
| Raises: | InvalidParameterValue if sort_key does not exist. |
List all the volume targets for a given node.
| Parameters: |
|
|---|---|
| Returns: | A list of volume targets. |
| Raises: | InvalidParameterValue if sort_key does not exist. |
List all registered hardware interfaces for a conductor.
| Parameters: | conductor_id – Database ID of conductor. |
|---|---|
| Returns: | List of ConductorHardwareInterfaces objects. |
List registered hardware interfaces for given hardware types.
This is restricted to only active conductors. :param hardware_types: list of hardware types to filter by. :returns: list of ConductorHardwareInterfaces objects.
Check if the specified tag exist on the node.
| Parameters: |
|
|---|---|
| Returns: | True if the tag exists otherwise False. |
Register an active conductor with the cluster.
| Parameters: |
|
|---|---|
| Returns: | A conductor. |
| Raises: | ConductorAlreadyRegistered |
Registers hardware interfaces for a conductor.
| Parameters: |
|
|---|---|
| Raises: | ConductorHardwareInterfacesAlreadyRegistered if at least one of the interfaces in the combination of all parameters is already registered. |
Release the reservation on a node.
| Parameters: |
|
|---|---|
| Raises: | NodeNotFound if the node is not found. |
| Raises: | NodeLocked if the node is reserved by another host. |
| Raises: | NodeNotLocked if the node was found to not have a reservation at all. |
Reserve a node.
To prevent other ManagerServices from manipulating the given Node while a Task is performed, mark it reserved by this host.
| Parameters: |
|
|---|---|
| Returns: | A Node object. |
| Raises: | NodeNotFound if the node is not found. |
| Raises: | NodeLocked if the node is already reserved. |
Replace all of the node tags with specified list of tags.
This ignores duplicate tags in the specified list.
| Parameters: |
|
|---|---|
| Returns: | A list of NodeTag objects. |
| Raises: | NodeNotFound if the node is not found. |
Mark a conductor as active by updating its ‘updated_at’ property.
| Parameters: | hostname – The hostname of this conductor service. |
|---|---|
| Raises: | ConductorNotFound |
Mark the node’s provisioning as running.
Mark the node’s provisioning as running by updating its ‘provision_updated_at’ property.
| Parameters: | node_id – The id of a node. |
|---|---|
| Raises: | NodeNotFound |
Remove this conductor from the service registry immediately.
| Parameters: | hostname – The hostname of this conductor service. |
|---|---|
| Raises: | ConductorNotFound |
Unregisters all hardware interfaces for a conductor.
| Parameters: | conductor_id – Database ID of conductor to unregister for. |
|---|
Remove all tags of the node.
| Parameters: | node_id – The id of a node. |
|---|---|
| Raises: | NodeNotFound if the node is not found. |
Update properties of an chassis.
| Parameters: |
|
|---|---|
| Returns: | A chassis. |
Update properties of a node.
| Parameters: |
|
|---|---|
| Returns: | A node. |
| Raises: | NodeAssociated |
| Raises: | NodeNotFound |
Update properties of an port.
| Parameters: |
|
|---|---|
| Returns: | A port. |
Update properties of a portgroup.
| Parameters: |
|
|---|---|
| Returns: | A portgroup. |
| Raises: | InvalidParameterValue |
| Raises: | PortgroupNotFound |
| Raises: | PortgroupDuplicateName |
| Raises: | PortgroupMACAlreadyExists |
Update properties of a volume connector.
| Parameters: |
|
|---|---|
| Returns: | A volume connector. |
| Raises: | VolumeConnectorTypeAndIdAlreadyExists If another connector already exists with a matching type and connector_id field. |
| Raises: | VolumeConnectorNotFound If a volume connector with the specified ident does not exist. |
| Raises: | InvalidParameterValue When a UUID is included in connector_info. |
Update information for a volume target.
| Parameters: |
|
|---|---|
| Returns: | A volume target. |
| Raises: | InvalidParameterValue if a UUID is included in target_info. |
| Raises: | VolumeTargetBootIndexAlreadyExists if a volume target already exists with the same boot index and node ID. |
| Raises: | VolumeTargetNotFound if no volume target with this ident exists. |