Using MAAS-CLI to deploy machines

I’m also looking into use the Terraform MAAS module ( not sure if this is associated with Ubuntu MAAS) but it’s got me going

Stormrider seems to be offline


thanks for the answer .
but i would like to do it with ansible and URI call .

api documentationis not clear… i upset i need to work with a " cli" . and for automation i don t find really easy . to work with .


i try to use API too, in order to manage machine( creation/update)
but i don t find the way to configure the network part od the new machine. below my json file a load on my API call

did you know how to definet FABRIC ans DHCP mode on a machine with a API CALL ?


it sounds like there are some feature requests here, targeted toward the API. IIUC, you’ll want to explain the issues you’re having in more detail in the feature requests section of the forum, since that’s how these requests get picked up and noticed. obviously, we can’t respond to every feature request, but we do try, when we can work it into our roadmap.

i do it :

I stopped using the API as the documentation is not that great.

after some digging session , i arrvive to manage MAAS by ansible and call API , for the moment.
I look at some module but i prefer to do it myself ^^

Hi, yes, we deploy servers, both physical and virtual using the KVM hosts nightly:
This is where the process starts, but:
For our physical servers:
For our KVM hosts/virtual servers:

But that said, our physical servers have static IP’s. But the whole process is there.

@cmills, what’s offline?

Wow, i don’t even understand why I posted that? must of been a typo (late night working on MAAS), during the last month/half I have been using the MAAS API ( to automate hardware provisioning.

I was able to commission but Having issues deploying a server, more specifically passing the osystem parameters

POST /MAAS/api/2.0/machines/{system_id}/?op=deploy

Passing the optionally parameters is not straightforward. It would be helpful it you guys were to provide examples of how this would be done!!!

Thanks again for your help in the past

1 Like

Actually, I remember now, I think stormrider was a website that you posted a while back that had documentation on.

taken under advisement. the api reference is automagically generated, but it does need some examples, i agree.

1 Like

and is back, along with the doc you’re referencing. my boss’ boss asked me to put it back up, as others were linking to it. be careful what you post!

1 Like

@cmills, i’m going to try and bring this up with my team in a couple of weeks. can you give me some more detailed examples of where the API doc is failing?

1 Like

Hello Bill,

Sorry for the late reply.
Let’s start with the api docs page, this page mentions the various methods for doing updates, post, get(s) and so forth. This page should include at the top of the page This reference is very important and the only reference to this is on the side halfway down the page. The contents of that reference I think should be place at the top of this page.

I also include some coding examples of how to use the methods mentioned; It took me some time to figure a lot of this out

update_srv = maas.put(MAAS_HOST + “/api/2.0/machines/” + machine.get(“system_id”) + “/”,data={“zone”: zone_info, “pool”: resource_pool, “description”: description})

set_storage = ( + “/api/2.0/machines/” + machine.get(“system_id”) + “/?op=set_storage_layout”, data={“storage_layout”: “lvm”, “root_device”: root_fs}))

Having references like this for each option or even some of the options mentioned would be very helpful

Hello Bill,

replied below

brilliant, @cmills! would OpenAPI conformance help with this, you think?

Yes, that will help greatly.