Conjuring CDK to LXD on a MAAS Cloud


Hey folks!

I’m getting setup to deploy CDK. My goal being that units are deployed to LXD containers across several MAAS machines. I could accomplish this fairly simply using Juju alone, but I’ve read that it’s advisable to use conjure-up as the spell includes some LXD configuration that doesn’t get applied via Juju. What’s the best approach here? I figure some sort of spell configuration to set constraints is in order, but it’s unclear to me how I should go about it.


Digging deeper, it seems like I can perform most constraints in the charm bundle, and then pass that bundle to conjure-up. I’ll see how I get on…


Is there syntax for adding a MAAS machine in a bundle?

Something like:


I didn’t find anything in the docs so far.


nope, that’s not the way. It looks like I could use contraints and specify tags that I can add to each machine in MAAS. Let’s see!


I’m wrestling with interactive vs headless conjure-up now. I want to set application constraints so that units are placed where I need them, and I also want to specify an existing Juju controller (or at least specify some bootstrap constraints so the controller goes where I want it to). It seems contraints are only set in interactive mode, and I can only specify an existing controller in headless mode within a conjurefile. And I don’t see any way to set bootstrap constraints on the controller.

Perhaps I need to fork the spell from Github and roll my own?


wait, there’s a flag on headless mode to --bootstrap-to <host>.maas. I’ll remove my existing controller and do that I guess!


So we don’t really support targeting specific nodes in MAAS. We want folks to use constraints of the “type of machine” vs a specific one. A bundle that specifies specific nodes isn’t reusable and treats machines too much like pets vs a herd of cattle to be put to work.

You can get around it a little bit by adding tags to the machines and using the tags constraint in Juju to target things but ideally it’d be more generic.


Yep, I figured out the tagging part, that’s ideal and fits well with the rest of our process. Thanks!

Can I specify constraints in headless?


I think you’re right that in that case you’d need to pull down the bundle and save it and feed that into conjure-up. Maybe @adam-stokes or @kwmonroe can speak to the best way to do that.