For details on how to use baremetal, see Using OpenStack Baremetal
The baremetal high-level interface is available through the baremetal
member of a Connection
object.
The baremetal
member will only be added if the service is detected.
openstack.baremetal.v1._proxy.
Proxy
(*args, **kwargs)¶create_node
(**attrs)¶Create a new node from attributes.
Parameters: | attrs (dict) – Keyword arguments that will be used to create a
Node . |
---|---|
Returns: | The results of node creation. |
Return type: | Node . |
update_node
(node, retry_on_conflict=True, **attrs)¶Update a node.
Parameters: |
|
---|---|
Returns: | The updated node. |
Return type: |
delete_node
(node, ignore_missing=True)¶Delete a node.
Parameters: |
|
---|---|
Returns: | The instance of the node which was deleted. |
Return type: |
|
get_node
(node)¶Get a specific node.
Parameters: | node – The value can be the name or ID of a node or a
Node instance. |
---|---|
Returns: | One Node |
Raises: | ResourceNotFound when no
node matching the name or ID could be found. |
find_node
(name_or_id, ignore_missing=True)¶Find a single node.
Parameters: |
|
---|---|
Returns: | One |
nodes
(details=False, **query)¶Retrieve a generator of nodes.
Parameters: |
|
---|---|
Returns: | A generator of |
set_node_power_state
(node, target)¶Run an action modifying node’s power state.
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
Parameters: |
|
---|
set_node_provision_state
(node, target, config_drive=None, clean_steps=None, rescue_password=None, wait=False, timeout=None)¶Run an action modifying node’s provision state.
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
Parameters: |
|
---|---|
Returns: | The updated |
Raises: | ValueError if |
wait_for_nodes_provision_state
(nodes, expected_state, timeout=None, abort_on_failed_state=True)¶Wait for the nodes to reach the expected state.
Parameters: |
|
---|---|
Returns: | The list of |
wait_for_node_reservation
(node, timeout=None)¶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.
Parameters: |
|
---|---|
Returns: | The updated |
validate_node
(node, required=('boot', 'deploy', 'power'))¶Validate required information on a node.
Parameters: |
|
---|---|
Returns: | dict mapping interface names to
|
Raises: |
|
openstack.baremetal.v1._proxy.
Proxy
(*args, **kwargs)create_port
(**attrs)¶Create a new port from attributes.
Parameters: | attrs (dict) – Keyword arguments that will be used to create a
Port . |
---|---|
Returns: | The results of port creation. |
Return type: | Port . |
update_port
(port, **attrs)¶Update a port.
Parameters: |
|
---|---|
Returns: | The updated port. |
Return type: |
delete_port
(port, ignore_missing=True)¶Delete a port.
Parameters: |
|
---|---|
Returns: | The instance of the port which was deleted. |
Return type: |
|
get_port
(port, **query)¶Get a specific port.
Parameters: |
|
---|---|
Returns: | One |
Raises: |
|
find_port
(name_or_id, ignore_missing=True)¶Find a single port.
Parameters: |
|
---|---|
Returns: | One |
ports
(details=False, **query)¶Retrieve a generator of ports.
Parameters: |
|
---|---|
Returns: | A generator of port instances. |
openstack.baremetal.v1._proxy.
Proxy
(*args, **kwargs)create_port_group
(**attrs)¶Create a new portgroup from attributes.
Parameters: | attrs (dict) – Keyword arguments that will be used to create a
PortGroup . |
---|---|
Returns: | The results of portgroup creation. |
Return type: | PortGroup . |
update_port_group
(port_group, **attrs)¶Update a port group.
Parameters: |
|
---|---|
Returns: | The updated port group. |
Return type: |
delete_port_group
(port_group, ignore_missing=True)¶Delete a port group.
Parameters: |
|
---|---|
Returns: | The instance of the port group which was deleted. |
Return type: |
get_port_group
(port_group, **query)¶Get a specific port group.
Parameters: |
|
---|---|
Returns: | One |
Raises: |
|
find_port_group
(name_or_id, ignore_missing=True)¶Find a single port group.
Parameters: |
|
---|---|
Returns: | One |
port_groups
(details=False, **query)¶Retrieve a generator of port groups.
Parameters: |
|
---|---|
Returns: | A generator of port group instances. |
openstack.baremetal.v1._proxy.
Proxy
(*args, **kwargs)drivers
(details=False)¶Retrieve a generator of drivers.
Parameters: | details (bool) – A boolean indicating whether the detailed information for every driver should be returned. |
---|---|
Returns: | A generator of driver instances. |
openstack.baremetal.v1._proxy.
Proxy
(*args, **kwargs)create_chassis
(**attrs)¶Create a new chassis from attributes.
Parameters: | attrs (dict) – Keyword arguments that will be used to create a
Chassis . |
---|---|
Returns: | The results of chassis creation. |
Return type: | Chassis . |
update_chassis
(chassis, **attrs)¶Update a chassis.
Parameters: |
|
---|---|
Returns: | The updated chassis. |
Return type: |
delete_chassis
(chassis, ignore_missing=True)¶Delete a chassis.
Parameters: |
|
---|---|
Returns: | The instance of the chassis which was deleted. |
Return type: |
get_chassis
(chassis)¶Get a specific chassis.
Parameters: | chassis – The value can be the ID of a chassis or a
Chassis instance. |
---|---|
Returns: | One Chassis |
Raises: | ResourceNotFound when no
chassis matching the name or ID could be found. |
find_chassis
(name_or_id, ignore_missing=True)¶Find a single chassis.
Parameters: |
|
---|---|
Returns: | One |
chassis
(details=False, **query)¶Retrieve a generator of chassis.
Parameters: |
|
---|---|
Returns: | A generator of chassis instances. |
openstack.baremetal.v1._proxy.
Proxy
(*args, **kwargs)attach_vif_to_node
(node, vif_id, retry_on_conflict=True)¶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.
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
detach_vif_from_node
(node, vif_id, ignore_missing=True)¶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.
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
list_node_vifs
(node)¶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.
Parameters: | node – The value can be either the name or ID of a node or
a Node instance. |
---|---|
Returns: | List of VIF IDs as strings. |
Raises: | NotSupported if the server
does not support the VIF API. |
openstack.baremetal.v1._proxy.
Proxy
(*args, **kwargs)create_allocation
(**attrs)¶Create a new allocation from attributes.
Parameters: | attrs (dict) – Keyword arguments that will be used to create a
Allocation . |
---|---|
Returns: | The results of allocation creation. |
Return type: | Allocation . |
delete_allocation
(allocation, ignore_missing=True)¶Delete an allocation.
Parameters: |
|
---|---|
Returns: | The instance of the allocation which was deleted. |
Return type: |
get_allocation
(allocation)¶Get a specific allocation.
Parameters: | allocation – The value can be the name or ID of an allocation or
a Allocation instance. |
---|---|
Returns: | One Allocation |
Raises: | ResourceNotFound when no
allocation matching the name or ID could be found. |
allocations
(**query)¶Retrieve a generator of allocations.
Parameters: | query (dict) – Optional query parameters to be sent to restrict the allocation to be returned. Available parameters include:
|
---|---|
Returns: | A generator of allocation instances. |
wait_for_allocation
(allocation, timeout=None, ignore_error=False)¶Wait for the allocation to become active.
Parameters: |
|
---|---|
Returns: | The instance of the allocation. |
Return type: |
Helpers for building configdrive compatible with the Bare Metal service.
openstack.baremetal.configdrive.
populate_directory
(metadata, user_data=None, versions=None, network_data=None)¶Populate a directory with configdrive files.
Parameters: |
|
---|---|
Returns: | a context manager yielding a directory with files |
openstack.baremetal.configdrive.
build
(metadata, user_data=None, versions=None, network_data=None)¶Make a configdrive compatible with the Bare Metal service.
Requires the genisoimage utility to be available.
Parameters: |
|
---|---|
Returns: | configdrive contents as a base64-encoded string. |
openstack.baremetal.configdrive.
pack
(path)¶Pack a directory with files into a Bare Metal service configdrive.
Creates an ISO image with the files and label “config-2”.
Parameters: | path (str) – Path to directory with files |
---|---|
Returns: | configdrive contents as a base64-encoded string. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.