HELP - OpenStack Guide v0
HELP - OpenStack Guide v0
The two channels you can use to get help debugging a MAAS issue are:
A big step on the way to doing this is by using sosreport, an automated information-gathering
utility. It is available in the Ubuntu archives:
This will create a tarball containing MAAS log files, MAAS configuration files and a dump of
the MAAS database. By default, the tarball will end up in /tmp but you can change the location.
See the sosreport man page for details. If there are things you do not wish to share publicly, feel
free to edit the tarball.
The last step is to make this file available by any means at your disposal (openly accessible FTP
server, Dropbox, etc.) in order for helpers to be able to get their hands on it.
MAAS API
Restful MAAS API.
This is the documentation for the API that lets you control and query MAAS. The API is
"Restful", which means that you access it through normal HTTP requests.
API versions
At any given time, MAAS may support multiple versions of its API. The version number is
included in the API's URL, e.g. /api/2.0/
The current API version number can be retrieved by issuing a GET to "/api/version/". Accessing
an old or unknown API version URL will result in a "410 GONE" being returned, along with a
descriptive error message. Both the error message and the api version are returned as plaintext.
All methods except DELETE may take parameters, but they are not all passed in the same way.
GET parameters are passed in the URL, as is normal with a GET: "/item/?foo=bar" passes
parameter "foo" with value "bar".
POST and PUT are different. Your request should have MIME type "multipart/form-data"; each
part represents one parameter (for POST) or attribute (for PUT). Each part is named after the
parameter or attribute it contains, and its contents are the conveyed value.
All parameters are in text form. If you need to submit binary data to the API, don't send it as any
MIME binary format; instead, send it as a plain text part containing base64-encoded data.
Most resources offer a choice of GET or POST operations. In those cases these methods will take
one special parameter, called op, to indicate what it is you want to do.
Operations
Logged-in user
param token Can be the whole token or only the token key.
type token unicode
param name New name of the token.
type name unicode
DELETE /api/2.0/nodes/{system_id}/bcache-cache-set/{id}/
GET /api/2.0/nodes/{system_id}/bcache-cache-set/{id}/
PUT /api/2.0/nodes/{system_id}/bcache-cache-set/{id}/
Returns 404 if the machine or the cache set is not found. Returns 409 if the machine is not Ready.
GET /api/2.0/nodes/{system_id}/bcache-cache-sets/
POST /api/2.0/nodes/{system_id}/bcache-cache-sets/
Returns 404 if the machine is not found. Returns 409 if the machine is not Ready.
Bcache Device
Returns 404 if the machine or bcache is not found. Returns 409 if the machine is not Ready.
GET /api/2.0/nodes/{system_id}/bcache/{id}/
PUT /api/2.0/nodes/{system_id}/bcache/{id}/
Specifying both a device and a partition for a given role (cache or backing) is not allowed.
Returns 404 if the machine or the bcache is not found. Returns 409 if the machine is not Ready.
Bcache Devices
GET /api/2.0/nodes/{system_id}/bcaches/
POST /api/2.0/nodes/{system_id}/bcaches/
Creates a Bcache.
Specifying both a device and a partition for a given role (cache or backing) is not allowed.
Returns 404 if the machine is not found. Returns 409 if the machine is not Ready.
Block device
DELETE /api/2.0/nodes/{system_id}/blockdevices/{id}/
Returns 404 if the machine or block device is not found. Returns 403 if the user is not allowed to
delete the block device. Returns 409 if the machine is not Ready.
GET /api/2.0/nodes/{system_id}/blockdevices/{id}/
Returns 404 if the machine or block device is not found. Returns 403 if the user is not allowed to
update the block device. Returns 409 if the machine is not Ready.
Returns 403 when the user doesn't have the ability to format the block device. Returns 404 if the
machine or block device is not found. Returns 409 if the machine is not Ready or Allocated.
Returns 403 when the user doesn't have the ability to mount the block device. Returns 404 if the
machine or block device is not found. Returns 409 if the machine is not Ready or Allocated.
Returns 404 if the machine or block device is not found. Returns 403 if the user is not allowed to
update the block device. Returns 409 if the machine is not Ready.
Set this block device as the boot disk for the machine.
Returns 400 if the block device is a virtual block device. Returns 404 if the machine or block
device is not found. Returns 403 if the user is not allowed to update the block device. Returns
409 if the machine is not Ready or Allocated.
Returns 400 if the block device is not formatted, currently mounted, or part of a filesystem group.
Returns 403 when the user doesn't have the ability to unformat the block device. Returns 404 if
the machine or block device is not found. Returns 409 if the machine is not Ready or Allocated.
Returns 400 if the block device is not formatted or not currently mounted. Returns 403 when the
user doesn't have the ability to unmount the block device. Returns 404 if the machine or block
device is not found. Returns 409 if the machine is not Ready or Allocated.
PUT /api/2.0/nodes/{system_id}/blockdevices/{id}/
Machines must have a status of Ready to have access to all options. Machines with Deployed
status can only have the name, model, serial, and/or id_path updated for a block device. This is
intented to allow a bad block device to be replaced while the machine remains deployed.
Fields for physical block device:
Returns 404 if the machine or block device is not found. Returns 403 if the user is not allowed to
update the block device. Returns 409 if the machine is not Ready.
Block devices
GET /api/2.0/nodes/{system_id}/blockdevices/
POST /api/2.0/nodes/{system_id}/blockdevices/
Boot resource
GET /api/2.0/boot-resources/{id}/
Boot resources
GET /api/2.0/boot-resources/
POST /api/2.0/boot-resources/
Boot source
GET /api/2.0/boot-sources/{id}/
PUT /api/2.0/boot-sources/{id}/
DELETE /api/2.0/boot-sources/{boot_source_id}/selections/{id}/
GET /api/2.0/boot-sources/{boot_source_id}/selections/{id}/
PUT /api/2.0/boot-sources/{boot_source_id}/selections/{id}/
GET /api/2.0/boot-sources/{boot_source_id}/selections/
Boot sources
GET /api/2.0/boot-sources/
POST /api/2.0/boot-sources/
Commissioning script
DELETE /api/2.0/commissioning-scripts/{name}
GET /api/2.0/commissioning-scripts/{name}
Commissioning scripts
GET /api/2.0/commissioning-scripts/
POST /api/2.0/commissioning-scripts/
By convention the name should consist of a two-digit number, a dash, and a brief descriptive
identifier consisting only of ASCII characters. You don't need to follow this convention, but not
doing so opens you up to risks w.r.t. encoding and ordering. The name must not contain any
whitespace, quotes, or apostrophes.
A commissioning machine will run each of the scripts in lexicographical order. There are no
promises about how non-ASCII characters are sorted, or even how upper-case letters are sorted
relative to lower-case letters. So where ordering matters, use unique numbers.
Scripts built into MAAS will have names starting with "00-maas" or "99-maas" to ensure that
they run first or last, respectively.
Usually a commissioning script will be just that, a script. Ideally a script should be ASCII text to
avoid any confusion over encoding. But in some cases a commissioning script might consist of a
binary tool provided by a hardware vendor. Either way, the script gets passed to the
commissioning machine in the exact form in which it was uploaded.
param name Unique identifying name for the script. Names should follow the pattern of
"25-burn-in-hard-disk" (all ASCII, and with numbers greater than zero, and generally no
"weird" characters).
param content A script file, to be uploaded in binary form. Note: this is not a normal
parameter, but a file upload. Its filename is ignored; MAAS will know it by the name you
pass to the request.
DHCP Snippet
DELETE /api/2.0/dhcp-snippets/{id}/
GET /api/2.0/dhcp-snippets/{id}/
param to What revision in the DHCP snippet's history to revert to. This can either be an
ID or a negative number representing how far back to go.
type to integer
PUT /api/2.0/dhcp-snippets/{id}/
DHCP Snippets
GET /api/2.0/dhcp-snippets/
POST /api/2.0/dhcp-snippets/
param name The name of the DHCP snippet. This is required to create a new DHCP
snippet.
type name unicode
param value The snippet of config inserted into dhcpd.conf. This is required to create a
new DHCP snippet.
type value unicode
param description A description of what the snippet does.
type description unicode
param enabled Whether or not the snippet is currently enabled.
type enabled boolean
param node The node this snippet applies to. Cannot be used withsubnet or
global_snippet.
type node unicode
param subnet The subnet this snippet applies to. Cannot be used with node or
global_snippet.
type subnet unicode
param global_snippet Whether or not this snippet is to be applied globally. Cannot be
used with node or subnet.
type global_snippet boolean
DNSResource
Manage dnsresource.
DELETE /api/2.0/dnsresources/{id}/
Delete dnsresource.
Returns 403 if the user does not have permission to delete the dnsresource. Returns 404 if the
dnsresource is not found.
GET /api/2.0/dnsresources/{id}/
Read dnsresource.
PUT /api/2.0/dnsresources/{id}/
Update dnsresource.
Returns 403 if the user does not have permission to update the dnsresource. Returns 404 if the
dnsresource is not found.
DNSResourceRecord
Manage dnsresourcerecord.
DELETE /api/2.0/dnsresourcerecords/{id}/
Delete dnsresourcerecord.
Returns 403 if the user does not have permission to delete the dnsresourcerecord. Returns 404 if
the dnsresourcerecord is not found.
GET /api/2.0/dnsresourcerecords/{id}/
Read dnsresourcerecord.
PUT /api/2.0/dnsresourcerecords/{id}/
Update dnsresourcerecord.
DNSResourceRecords
Manage dnsresourcerecords.
GET /api/2.0/dnsresourcerecords/
POST /api/2.0/dnsresourcerecords/
Create a dnsresourcerecord.
param fqdn Hostname (with domain) for the dnsresource. Either fqdn or (name, domain)
must be specified. Fqdn is ignored if either name or domain is given.
param name Hostname (without domain)
param domain Domain (name or id)
param rrtype resource type to create
param rrdata resource data (everything to the right of resource type.)
DNSResources
Manage dnsresources.
GET /api/2.0/dnsresources/
POST /api/2.0/dnsresources/
Create a dnsresource.
param fqdn Hostname (with domain) for the dnsresource. Either fqdn or (name, domain)
must be specified. Fqdn is ignored if either name or domain is given.
param name Hostname (without domain)
param domain Domain (name or id)
param address_ttl Default ttl for entries in this zone.
param ip_addresses (optional) Address (ip or id) to assign to the dnsresource.
Device
DELETE /api/2.0/devices/{system_id}/
Returns 404 if the device is not found. Returns 403 if the user does not have permission to delete
the device. Returns 204 if the device is successfully deleted.
GET /api/2.0/devices/{system_id}/
Returns a {detail_type: xml, ...} map, where detail_type is something like "lldp" or
"lshw".
Note that this is returned as BSON and not JSON. This is for efficiency, but mainly because
JSON can't do binary content without applying additional encoding like base-64.
This method is reserved for admin users and returns a 403 if the user is not one.
This returns the power parameters, if any, configured for a node. For some types of power control
this will include private information such as passwords and secret keys.
Returns 404 if the device is not found. Returns 403 if the user does not have permission to reset
the device.
Returns 404 if the device is not found Returns 403 if the user does not have permission to reset
the device.
Pass any key/value data to this method to add, modify, or remove. A key is removed when the
value for that key is set to an empty string.
This operation will not remove any previous keys unless explicitly passed with an empty string.
All owner data is removed when the machine is no longer allocated to a user.
Returns 404 if the machine is not found. Returns 403 if the user does not have permission.
PUT /api/2.0/devices/{system_id}/
Returns 404 if the device is not found. Returns 403 if the user does not have permission to update
the device.
Devices
Nodes are sorted by id (i.e. most recent last) and grouped by type.
param hostname An optional hostname. Only nodes relating to the node with the
matching hostname will be returned. This can be specified multiple times to see multiple
nodes.
type hostname unicode
param mac_address An optional MAC address. Only nodes relating to the node owning
the specified MAC address will be returned. This can be specified multiple times to see
multiple nodes.
type mac_address unicode
param id An optional list of system ids. Only nodes relating to the nodes with matching
system ids will be returned.
type id unicode
param domain An optional name for a dns domain. Only nodes relating to the nodes in
the domain will be returned.
type domain unicode
param zone An optional name for a physical zone. Only nodes relating to the nodes in
the zone will be returned.
type zone unicode
param agent_name An optional agent name. Only nodes relating to the nodes with
matching agent names will be returned.
type agent_name unicode
Returns whether or not the given MAC address is registered within this MAAS (and attached to a
non-retired node).
POST /api/2.0/devices/
param zone Zone name. If omitted, the zone is "none" and the nodes will be taken out of
their physical zones.
param nodes system_ids of the nodes whose zones are to be set. (An empty list is
acceptable).
Discoveries
GET /api/2.0/discovery/
Discoveries are listed in the order they were last observed on the network (most recent first).
Filters the list of discovered devices by excluding any discoveries where a known MAAS node is
configured with the IP address of the discovery, or has been observed using it after it was
assigned by a MAAS-managed DHCP server.
Discoveries are listed in the order they were last observed on the network (most recent first).
Filters the list of discovered devices by excluding any discoveries where a known MAAS node is
configured with either the MAC address or the IP address of the discovery.
Discoveries are listed in the order they were last observed on the network (most recent first).
GET /api/2.0/discovery/ op=by_unknown_mac
Filters the list of discovered devices by excluding any discoveries where an interface known to
MAAS is configured with MAC address of the discovery.
Discoveries are listed in the order they were last observed on the network (most recent first).
This command causes each connected rack controller to execute the 'maas-rack scan-network'
command, which will scan all CIDRs configured on the rack controller using 'nmap' (if it is
installed) or 'ping'.
Network discovery must not be set to 'disabled' for this command to be useful.
Scanning will be started in the background, and could take a long time on rack controllers that do
not have 'nmap' installed and are connected to large networks.
If the call is a success, this method will return a dictionary of results as follows:
failed_to_connect_to: A list of rack 'system_id' values where the RPC connection failed.
scan_started_on: A list of rack 'system_id' values where a scan was successfully started.
scan_failed_on: A list of rack 'system_id' values where a scan was attempted, but failed because a
scan was already in progress.
rpc_call_timed_out_on: A list of rack 'system_id' values where the RPC connection was made,
but the call timed out before a ten second timeout elapsed.
param cidr The subnet CIDR(s) to scan (can be specified multiple times). If not
specified, defaults to all networks.
param force If True, will force the scan, even if all networks are specified. (This may
not be the best idea, depending on acceptable use agreements, and the politics of the
organization that owns the network.) Default: False.
param always_use_ping If True, will force the scan to use 'ping' even if 'nmap' is
installed. Default: False.
param slow If True, and 'nmap' is being used, will limit the scan to nine packets per
second. If the scanner is 'ping', this option has no effect. Default: False.
param threads The number of threads to use during scanning. If 'nmap' is the scanner,
the default is one thread per 'nmap' process. If 'ping' is the scanner, the default is four
threads per CPU.
Discovery
GET /api/2.0/discovery/{discovery_id}/
Domain
Manage domain.
DELETE /api/2.0/domains/{id}/
Delete domain.
Returns 403 if the user does not have permission to update the dnsresource. Returns 404 if the
domain is not found.
GET /api/2.0/domains/{id}/
Read domain.
PUT /api/2.0/domains/{id}/
Update domain.
Returns 403 if the user does not have permission to update the dnsresource. Returns 404 if the
domain is not found.
Domains
Manage domains.
GET /api/2.0/domains/
POST /api/2.0/domains/
Create a domain.
Events
A specific Node's events is identified by specifying one or more ids, hostnames, or mac addresses
as a list.
List Node events, optionally filtered by various criteria via URL query parameters.
param hostname An optional hostname. Only events relating to the node with the
matching hostname will be returned. This can be specified multiple times to get events
relating to more than one node.
param mac_address An optional list of MAC addresses. Only nodes with matching
MAC addresses will be returned.
param id An optional list of system ids. Only nodes with matching system ids will be
returned.
param zone An optional name for a physical zone. Only nodes in the zone will be
returned.
param agent_name An optional agent name. Only nodes with matching agent names will
be returned.
param level Desired minimum log level of returned events. Returns this level of events
and greater. Choose from: CRITICAL, DEBUG, ERROR, INFO, WARNING. The
default is INFO.
param limit Optional number of events to return. Default 100. Maximum: 1000.
param before Optional event id. Defines where to start returning older events.
param after Optional event id. Defines where to start returning newer events.
Fabric
Manage fabric.
DELETE /api/2.0/fabrics/{id}/
Delete fabric.
GET /api/2.0/fabrics/{id}/
Read fabric.
PUT /api/2.0/fabrics/{id}/
Update fabric.
Fabrics
Manage fabrics.
GET /api/2.0/fabrics/
POST /api/2.0/fabrics/
Create a fabric.
DELETE /api/2.0/fannetworks/{id}/
Delete fannetwork.
GET /api/2.0/fannetworks/{id}/
Read fannetwork.
PUT /api/2.0/fannetworks/{id}/
Update fannetwork.
Fan Networks
GET /api/2.0/fannetworks/
POST /api/2.0/fannetworks/
Create a fannetwork.
File
DELETE /api/2.0/files/{filename}/
GET /api/2.0/files/{filename}/
Files
DELETE /api/2.0/files/
GET /api/2.0/files/
The returned files are ordered by file name and the content is excluded.
param prefix Optional prefix used to filter out the returned files.
type prefix string
param filename The exact name of the file you want to get.
type filename string
return The file is returned in the response content.
param key The exact key of the file you want to get.
type key string
return The file is returned in the response content.
POST /api/2.0/files/
Returns 400 if any of these conditions apply: - The filename is missing from the parameters - The
file data is missing - More than one file is supplied
IP Addresses
GET /api/2.0/ipaddresses/
param ip If specified, will only display information for the specified IP address.
type ip unicode (must be an IPv4 or IPv6 address)
If the requesting user is a MAAS administrator, the following options may also be supplied:
param all If True, all reserved IP addresses will be shown. (By default, only addresses
of type 'User reserved' that are assigned to the requesting user are shown.)
type all bool
param owner If specified, filters the list to show only IP addresses owned by the specified
username.
type user unicode
Returns an IP adddress, which MAAS will not allow any of its known nodes to use; it is free for
use by the requesting user until released by the user.
The user may supply either a subnet or a specific IP address within a subnet.
param subnet CIDR representation of the subnet on which the IP reservation is required.
e.g. 10.1.2.0/24
param ip The IP address, which must be within a known subnet.
param ip_address (Deprecated.) Alias for 'ip' parameter. Provided for backward
compatibility.
param hostname The hostname to use for the specified IP address. If no domain
component is given, the default domain will be used.
param mac The MAC address that should be linked to this reservation.
Returns 400 if there is no subnet in MAAS matching the provided one, or a ip_address is
supplied, but a corresponding subnet could not be found. Returns 503 if there are no more IP
addresses available.
IP Range
Manage IP range.
DELETE /api/2.0/ipranges/{id}/
Delete IP range.
Returns 403 if not owner of IP range. Returns 404 if the IP range is not found.
GET /api/2.0/ipranges/{id}/
Read IP range.
PUT /api/2.0/ipranges/{id}/
Update IP range.
Returns 403 if not owner of IP range. Returns 404 if the IP Range is not found.
IP Ranges
Manage IP ranges.
GET /api/2.0/ipranges/
POST /api/2.0/ipranges/
Create an IP range.
Interface
DELETE /api/2.0/nodes/{system_id}/interfaces/{id}/
Returns 404 if the node or interface is not found. Returns 403 if the user is not allowed to update
the interface.
Disconnect an interface.
Deletes any linked subnets and IP addresses, and disconnects the interface from any associated
VLAN.
Mode definitions: AUTO - Assign this interface a static IP address from the provided subnet. The
subnet must be a managed subnet. The IP address will not be assigned until the node goes to be
deployed.
DHCP - Bring this interface up with DHCP on the given subnet. Only one subnet can be set to
DHCP. If the subnet is managed this interface will pull from the dynamic IP range.
STATIC - Bring this interface up with a STATIC IP address on the given subnet. Any number of
STATIC links can exist on an interface.
LINK_UP - Bring this interface up only on the given subnet. No IP address will be assigned to
this interface. The interface cannot have any current AUTO, DHCP or STATIC links.
Returns 404 if the node or interface is not found. Returns 403 if the user is not allowed to update
the interface.
If this interface has more than one subnet with a gateway IP in the same IP address family then
specifying the ID of the link on this interface is required.
param link_id ID of the link on this interface to select the default gateway IP address from.
Returns 400 if the interface has not AUTO or STATIC links. Returns 404 if the node or interface
is not found.
PUT /api/2.0/nodes/{system_id}/interfaces/{id}/
Machines must have a status of Ready or Broken to have access to all options. Machines with
Deployed status can only have the name and/or mac_address updated for an interface. This is
intented to allow a bad interface to be replaced while the machine remains deployed.
Following are extra parameters that can be set on all interface types:
balance-rr - Transmit packets in sequential order from the first available slave through the last.
This mode provides load balancing and fault tolerance.
active-backup - Only one slave in the bond is active. A different slave becomes active if, and only
if, the active slave fails. The bond's MAC address is externally visible on only one port (network
adapter) to avoid confusing the switch.
balance-xor - Transmit based on the selected transmit hash policy. The default policy is a simple
[(source MAC address XOR'd with destination MAC address XOR packet type ID) modulo slave
count].
broadcast - Transmits everything on all slave interfaces. This mode provides fault tolerance.
802.3ad - IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the
same speed and duplex settings. Utilizes all slaves in the active aggregator according to the
802.3ad specification.
balance-tlb - Adaptive transmit load balancing: channel bonding that does not require any special
switch support.
balance-alb - Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for
IPV4 traffic, and does not require any special switch support. The receive load balancing is
achieved by ARP negotiation.
Interfaces
GET /api/2.0/nodes/{system_id}/interfaces/
Supported bonding modes (bond-mode): balance-rr - Transmit packets in sequential order from
the first available slave through the last. This mode provides load balancing and fault tolerance.
active-backup - Only one slave in the bond is active. A different slave becomes active if, and only
if, the active slave fails. The bond's MAC address is externally visible on only one port (network
adapter) to avoid confusing the switch.
balance-xor - Transmit based on the selected transmit hash policy. The default policy is a simple
[(source MAC address XOR'd with destination MAC address XOR packet type ID) modulo slave
count].
broadcast - Transmits everything on all slave interfaces. This mode provides fault tolerance.
802.3ad - IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the
same speed and duplex settings. Utilizes all slaves in the active aggregator according to the
802.3ad specification.
balance-tlb - Adaptive transmit load balancing: channel bonding that does not require any special
switch support.
balance-alb - Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for
IPV4 traffic, and does not require any special switch support. The receive load balancing is
achieved by ARP negotiation.
License Key
DELETE /api/2.0/license-key/{osystem}/{distro_series}
GET /api/2.0/license-key/{osystem}/{distro_series}
PUT /api/2.0/license-key/{osystem}/{distro_series}
License Keys
POST /api/2.0/license-keys/
MAAS server
Machine
DELETE /api/2.0/machines/{system_id}/
GET /api/2.0/machines/{system_id}/
Returns a {detail_type: xml, ...} map, where detail_type is something like "lldp" or
"lshw".
Note that this is returned as BSON and not JSON. This is for efficiency, but mainly because
JSON can't do binary content without applying additional encoding like base-64.
Returns 404 if the machine could not be found. Returns 403 if the user does not have permission
to get the curtin configuration.
This method is reserved for admin users and returns a 403 if the user is not one.
This returns the power parameters, if any, configured for a node. For some types of power control
this will include private information such as passwords and secret keys.