Simpler startInstance & friends?
Jeroen Vermeulen
jtv at canonical.com
Tue Mar 12 16:24:35 UTC 2013
On 03/12/2013 06:37 PM, William Reade wrote:
>> 3. The startInstanceParams struct type is effectively a wrapper for
>> cloudinit.MachineConfig. Once it's no longer shared between
>> startInstance() and userData(), it becomes easier just to use MachineConfig.
>
> I tried something very much like this and decided it was a bad idea: I
> don't want MachineConfig in the Environ interface at all, because it's
> the wrong level of abstraction.
Well I'm not advocating putting it in the Environ interface. But
neither is startInstanceParams in there. This is about startInstance(),
not StartInstance(). If startInstance needs to move into the interface,
it's worth looking into in more detail as you did below.
(I know others feel differently but I still find these names that differ
only in capitalization awkward to converse about!)
For what it's worth, these changes are already in the MAAS provider. We
hope this won't cause too much pain as the API evolves. Then again, the
result is a bit simpler so it may also be easier to maintain as the API
evolves.
> All the work that goes into creating
> that MachineConfig is currently performed way too early, I think:
> there's *very* little in there that cannot be expressed with something
> like:
>
> type InstanceConfig struct {
Something like that could work just fine; my main drive is that once
this parameter object is no longer intimately shared between
startInstance and userData, its purpose becomes clearer and it can be
defined more effectively.
> I'm finishing off my swap days today, but please hit me (fwereade) up in
> irc for more discussion tomorrow if you're interested in exploring this
> further. The costs of implementing a new provider are significant, and
> the unhealthy mix of business logic and provider-specific work is a big
> part of the problem; while we don't have space in core and blue to do
> everything we'd like to, we'd really appreciate it if you guys would fix
> what you can as you need to make your own work easier :).
We're in Deadline Corner at the moment, so realistically, we do not
expect to have much time for this. But it may be worth a quick
walk-through of how the code looks in our provider.
Jeroen
More information about the Juju-dev
mailing list