0

I would like to pre-populate MAAS with new machines for future OS deployments. For example, I have 10 servers, each with a quad port nic. I know the MAC addresses (40) that belong to the servers (10), but don't know which MAC will get connected when the server is wired up. How do I add these by script or CLI to MAAS.

Same question but for devices too. (routers, unmanaged hosts, etc.)

Currently, MAAS can discovery them, and I can add them to the database from the dashboard. But this is time consuming, and has to be re-done everytime we trial out a new MAAS server.

Unless I am missing something, or the --help is incomplete, the CLI commands don't have add/create functions.

Seems odd to me that this command doesn't exist:

maas <user> nodes create

...so I am wondering if this is just not implemented yet, there is another way to handle this, or I am making a conceptual/workflow error.

James
  • 1,063
  • 2
  • 13
  • 27

1 Answers1

1

maas <user> nodes is a read-only endpoint to read nodes. Nodes are a generic term for all Machines, Devices, and Controllers in MAAS. To be able to add a machine or device you must use the correct endpoint.

Add a machine:

maas <user> machines create [params]...

Add a device:

maas <user> devices create [params]...

Blake R
  • 431
  • 2
  • 6
  • Thank you. Could you help me with what are the minimum parameters to add a machine using the CLI? In the UI, we add a machine with a name, mac address, IPMI 2, IPMI ip address, username and password. I can't seem to sort out the right parameters to automate this for new machines. – James Jul 25 '17 at 16:30
  • answered own question: https://askubuntu.com/questions/939698/how-do-you-add-a-machine-to-maas-with-ipmi-power-using-cli – James Jul 25 '17 at 18:43