← Back to team overview

maas-devel team mailing list archive

Re: Progress on cobbler stuff

 

On 12 March 2012 06:08, Julian Edwards <julian.edwards@xxxxxxxxxxxxx> wrote:
> On Sunday 11 Mar 2012 21:40:48 Gavin Panella wrote:
>> I managed to get a test to reproduce the problem we've been seeing
>> with Cobbler when starting stuff from Juju. It was as simple as
>> calling add_node() twice for the same object. The following branch
>> includes this test and changes the behaviour of pserv to never clobber
>> (instead of always) when calling Cobbler:
>>
>>   lp:~allenap/maas/test-papi-with-real-cobbler-stories
>>
>> It has lp:~allenap/maas/test-maas-separate-media-for-dev as a
>> prerequisite.
>>
>> I think this approach is better than trying to work around Cobbler's
>> behaviour, or fetching before updating.
>>
>> It's becoming more apparent (well, to my warped mind) that we're going
>> to need some way to reconcile between MaaS's database and Cobbler's,
>> so I think this is a safe move. Think about it though and we can
>> discuss it tomorrow.
>>
>> Also, lp:~allenap/maas/pserv-cobbler-reconcile has some rudimentary
>> and untested reconciling code (though it does seem to work fine).
>>
>> Gavin.
>
>
> Ok so I got it working better with these changes:
>
> http://pastebin.ubuntu.com/879951/
>
> Basically, using "edit" not "add" makes it not overwrite anything.  I've also
> set some extra 'required_attributes' and my basic strategy is to try and
> supply *everything* we care about in the edit operation, and leaving
> everything else alone.  This means anything set by odev will be unchanged, but
> our required modifications are set.

Unfortunately, switching from add to edit causes real adds to fail
("... unknown distro name ..."). Either we:

- Catch the "unknown" error and revert to an add operation.

- Fetch first, then do an add or edit depending if something was found
  or not.

The first is probably more efficient in terms of chattiness. Both will
probably clutter Cobbler's logs though; it adds three log records at
INFO level, including a stack trace, for each missing object! I'll go
with the former approach for now.

Gavin.