The Node
class inherits from Resource
.
The base resource
_synchronized (bool) – This is not intended to be used directly. See
new()
and
existing()
.
connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow
Resource objects to be used without an active Connection, such as
in unit tests. Use of self._connection
in Resource code should
protect itself with a check for None.
Plural form of key for resource.
The base part of the URI for this resource.
Allow create operation for this resource.
Allow get operation for this resource.
Allow update operation for this resource.
Allow delete operation for this resource.
Allow list operation for this resource.
Allow patch operation for this resource.
Method for committing a resource (PUT, PATCH, POST)
Whether commit uses JSON patch format.
The UUID of the allocation associated with this node. Added in API microversion 1.52.
A string or UUID of the tenant who owns the baremetal node. Added in API microversion 1.50.
The current boot mode state (uefi/bios). Added in API microversion 1.75.
The UUID of the chassis associated wit this node. Can be empty or None.
The current clean step.
Conductor group this node is managed by. Added in API microversion 1.46.
Timestamp at which the node was last updated.
The current deploy step. Added in API microversion 1.44.
The description of the node. Added in API microversion 1.51.
The name of the driver.
All the metadata required by the driver to manage this node. List of
fields varies between drivers, and can be retrieved from the
openstack.baremetal.v1.driver.Driver
resource.
Internal metadata set and stored by node’s driver. This is read-only.
A set of one or more arbitrary metadata key and value pairs.
Fault type that caused the node to enter maintenance mode. Introduced in API microversion 1.42.
The UUID of the node resource.
Information used to customize the deployed image, e.g. size of root partition, config drive in the form of base64 encoded string and other metadata.
UUID of the nova instance associated with this node.
Override enabling of automated cleaning. Added in API microversion 1.47.
Whether console access is enabled on this node.
Whether node is currently in “maintenance mode”. Nodes put into maintenance mode are removed from the available resource pool.
Whether the node is marked for retirement. Added in API microversion 1.61.
Whether the node is currently booted with secure boot turned on. Added in API microversion 1.75.
Any error from the most recent transaction that started but failed to finish.
Field indicating if the node is leased to a specific project. Added in API version 1.65
A list of relative links, including self and bookmark links.
user settable description of the reason why the node was placed into maintenance mode.
Human readable identifier for the node. May be undefined. Certain words are reserved. Added in API microversion 1.5
The node which serves as the parent_node for this node. Added in API version 1.83
Links to the collection of ports on this node.
Links to the collection of portgroups on this node. Available since API microversion 1.24.
The current power state. Usually “power on” or “power off”, but may be “None” if service is unable to determine the power state.
Physical characteristics of the node. Content populated by the service during inspection.
The current provisioning state of the node.
The reason why the node is marked for retirement. Added in API microversion 1.61.
The current RAID configuration of the node.
The name of an service conductor host which is holding a lock on this node, if a lock is held.
A string to be used by external schedulers to identify this node as a unit of a specific type of resource. Added in API microversion 1.21.
A string represents the current service step being executed upon. Added in API microversion 1.87.
A string indicating the shard this node belongs to. Added in API microversion 1,82.
Links to the collection of states.
The requested state if a provisioning action has been requested. For
example, AVAILABLE
, DEPLOYING
, DEPLOYWAIT
, DEPLOYING
,
ACTIVE
etc.
The requested state during a state transition.
The requested RAID configuration of the node which will be applied when the node next transitions through the CLEANING state.
Traits of the node. Introduced in API microversion 1.37.
Timestamp at which the node was last updated.
BIOS interface to use when setting BIOS properties of the node. Introduced in API microversion 1.40.
Boot interface to use when configuring boot of the node. Introduced in API microversion 1.31.
Console interface to use when working with serial console. Introduced in API microversion 1.31.
Deploy interface to use when deploying the node. Introduced in API microversion 1.31.
Firmware interface to be used when managing the node. Introduced in API microversion 1.86
Inspect interface to use when inspecting the node. Introduced in API microversion 1.31.
Management interface to use for management actions on the node. Introduced in API microversion 1.31.
Network interface provider to use when plumbing the network connections for this node. Introduced in API microversion 1.20.
Power interface to use for power actions on the node. Introduced in API microversion 1.31.
RAID interface to use for configuring RAID on the node. Introduced in API microversion 1.31.
Rescue interface to use for rescuing of the node. Introduced in API microversion 1.38.
Storage interface to use when attaching remote storage. Introduced in API microversion 1.33.
Vendor interface to use for vendor-specific actions on the node. Introduced in API microversion 1.31.
Create a remote resource based on this instance.
The overridden version is capable of handling the populated
provision_state
field of one of three values: enroll
,
manageable
or available
. If not provided, the server default
is used (enroll
in newer versions of Ironic).
This call does not cause a node to go through automated cleaning.
If you need it, use provision_state=manageable
followed by
a call to set_provision_state()
.
Note that Bare Metal API 1.4 is required for manageable
and
1.11 is required for enroll
.
Warning
Using provision_state=available
is only possible with API
versions 1.1 to 1.10 and thus is incompatible with setting any
fields that appeared after 1.11.
session (Adapter
) – The session to use for making this request.
This Resource
instance.
ValueError if the Node’s provision_state
is not one of
None
, enroll
, manageable
or available
.
NotSupported
if
the provision_state
cannot be reached with any API version
supported by the server.
Commit the state of the instance to the remote resource.
session (Adapter
) – The session to use for making this request.
This Node
instance.
Run an action modifying this node’s provision state.
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
session (Adapter
) – The session to use for making this request.
target – Provisioning action, e.g. active
, provide
.
See the Bare Metal service documentation for available actions.
config_drive – Config drive to pass to the node, only valid
for active` and ``rebuild
targets. You can use functions from
openstack.baremetal.configdrive
to build it.
clean_steps – Clean steps to execute, only valid for clean
target.
rescue_password – Password for the rescue operation, only valid
for rescue
target.
wait – Whether to wait for the target state to be reached.
timeout – Timeout (in seconds) to wait for the target state to be
reached. If None
, wait without timeout.
deploy_steps – Deploy steps to execute, only valid for active
and rebuild
target.
service_steps – Service steps to execute, only valid for
service
target.
This Node
instance.
ValueError if config_drive
, clean_steps
,
deploy_steps
or rescue_password
are provided with an
invalid target
.
ResourceFailure
if the node
reaches an error state while waiting for the state.
ResourceTimeout
if timeout
is reached while waiting for the state.
Wait for the node to reach the expected power state.
session (Adapter
) – The session to use for making this request.
expected_state – The expected power state to reach.
timeout – If wait
is set to True
, specifies how much (in
seconds) to wait for the expected state to be reached. The value of
None
(the default) means no client-side timeout.
This Node
instance.
ResourceTimeout
on timeout.
Wait for the node to reach the expected state.
session (Adapter
) – The session to use for making this request.
expected_state – The expected provisioning state to reach.
timeout – If wait
is set to True
, specifies how much (in
seconds) to wait for the expected state to be reached. The value of
None
(the default) means no client-side timeout.
abort_on_failed_state – If True
(the default), abort waiting
if the node reaches a failure state which does not match the
expected one. Note that the failure state for enroll
->
manageable
transition is enroll
again.
This Node
instance.
ResourceFailure
if the node
reaches an error state and abort_on_failed_state
is True
.
ResourceTimeout
on timeout.
Wait for a lock on the node to be released.
Bare metal nodes in ironic have a reservation lock that is used to represent that a conductor has locked the node while performing some sort of action, such as changing configuration as a result of a machine state change.
This lock can occur during power syncronization, and prevents updates to objects attached to the node, such as ports.
Note that nothing prevents a conductor from acquiring the lock again after this call returns, so it should be treated as best effort.
Returns immediately if there is no reservation on the node.
session (Adapter
) – The session to use for making this request.
timeout – How much (in seconds) to wait for the lock to be
released. The value of None
(the default) means no timeout.
This Node
instance.
Inject NMI.
session – The session to use for making this request.
None
Run an action modifying this node’s power state.
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
session (Adapter
) – The session to use for making this request.
target – Target power state, as a PowerAction
or
a string.
wait – Whether to wait for the expected power state to be reached.
timeout – Timeout (in seconds) to wait for the target state to be
reached. If None
, wait without timeout.
Attach a VIF to the node.
The exact form of the VIF ID depends on the network interface used by the node. In the most common case it is a Network service port (NOT a Bare Metal port) ID. A VIF can only be attached to one node at a time.
session (Adapter
) – The session to use for making this request.
vif_id – Backend-specific VIF ID.
retry_on_conflict – Whether to retry HTTP CONFLICT errors. This can happen when either the VIF is already used on a node or the node is locked. Since the latter happens more often, the default value is True.
port_id – The UUID of the port to attach the VIF to. Only one of port_id or port_group_id can be provided.
port_group_id – The UUID of the portgroup to attach to. Only one of port_group_id or port_id can be provided.
None
NotSupported
if the server
does not support the VIF API.
InvalidRequest
if both port_id
and port_group_id are provided.
Detach a VIF from the node.
The exact form of the VIF ID depends on the network interface used by the node. In the most common case it is a Network service port (NOT a Bare Metal port) ID.
session (Adapter
) – The session to use for making this request.
vif_id (string) – Backend-specific VIF ID.
ignore_missing (bool) – When set to False
NotFoundException
will be
raised when the VIF does not exist. Otherwise, False
is returned.
True
if the VIF was detached, otherwise False
.
NotSupported
if the server
does not support the VIF API.
List IDs of VIFs attached to the node.
The exact form of the VIF ID depends on the network interface used by the node. In the most common case it is a Network service port (NOT a Bare Metal port) ID.
session (Adapter
) – The session to use for making this request.
List of VIF IDs as strings.
NotSupported
if the server
does not support the VIF API.
Validate required information on the node.
session (Adapter
) – The session to use for making this request.
required – List of interfaces that are required to pass validation. The default value is the list of minimum required interfaces for provisioning.
dict mapping interface names to ValidationResult
objects.
ValidationException
if validation
fails for a required interface.
Enable maintenance mode on the node.
session (Adapter
) – The session to use for making this request.
reason – Optional reason for maintenance.
This Node
instance.
Disable maintenance mode on the node.
session (Adapter
) – The session to use for making this request.
This Node
instance.
Get node boot device.
session – The session to use for making this request.
The HTTP response.
Set node boot device
session – The session to use for making this request.
boot_device – Boot device to assign to the node.
persistent – If the boot device change is maintained after node reboot
None
Get supported boot devices for the node.
session – The session to use for making this request.
The HTTP response.
Make a request to change node’s boot mode
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
session – The session to use for making this request.
target – Boot mode to set for node, one of either ‘uefi’/’bios’.
None
ValueError if target
is not one of ‘uefi or ‘bios’.
Make a request to change node’s secure boot state
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
session – The session to use for making this request.
target (bool) – Boolean indicating secure boot state to set. True/False corresponding to ‘on’/’off’ respectively.
None
ValueError if target
is not boolean.
Add a trait to the node.
session – The session to use for making this request.
trait – The trait to add to the node.
None
Remove a trait from the node.
session – The session to use for making this request.
trait – The trait to remove from the node.
ignore_missing (bool) – When set to False
NotFoundException
will be
raised when the trait does not exist.
Otherwise, False
is returned.
True on success removing the trait. False when the trait does not exist already.
Set traits for the node.
Removes any existing traits and adds the traits passed in to this method.
session – The session to use for making this request.
traits – list of traits to add to the node.
None
Call a vendor passthru method.
session – The session to use for making this request.
verb – The HTTP verb, one of GET, SET, POST, DELETE.
method – The method to call using vendor_passthru.
body – The JSON body in the HTTP call.
The HTTP response.
List vendor passthru methods for the node.
session – The session to use for making this request.
The HTTP response.
Get the node console.
session – The session to use for making this request.
The HTTP response.
Set the node console mode.
session – The session to use for making this request.
enabled – Whether the console should be enabled or not.
None
Get a node’s inventory.
session – The session to use for making this request.
node_id – The ID of the node.
The HTTP response.
List firmware components associated with the node.
session – The session to use for making this request.
The HTTP response.
Patch the remote resource.
Allows modifying the resource by providing a list of JSON patches to apply to it. The patches can use both the original (server-side) and SDK field names.
session (Adapter
) – The session to use for making this request.
patch – Additional JSON patch as a list or one patch item. If provided, it is applied on top of any changes to the current resource.
prepend_key – A boolean indicating whether the resource_key should be prepended in a resource update request. Default to True.
retry_on_conflict (bool) – Whether to enable retries on HTTP
CONFLICT (409). Value of None
leaves the Adapter defaults.
base_path (str) – Base part of the URI for modifying resources, if
different from base_path
.
microversion (str) – API version to override the negotiated one.
This Resource
instance.
MethodNotSupported
if
Resource.allow_patch
is not set to True
.
The PowerAction
enumeration represents known power actions.
Mapping from an action to a target power state.
Power on the node.
Power off the node (using hard power off).
Reboot the node (using hard power off).
Power off the node using soft power off.
Reboot the node using soft power off.
The ValidationResult
class represents the result of a validation.
Result of a single interface validation.
result – Result of a validation, True
for success, False
for
failure, None
for unsupported interface.
reason – If result
is False
or None
, explanation of
the result.
The WaitResult
class represents the result of waiting for several nodes.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.