[Rdo-list] [foreman-dev] Re: [OFI] data model reusing Foreman's AR models

Petr Chalupa pchalupa at redhat.com
Thu Mar 6 21:24:31 UTC 2014



On 06.03.14 21:46, Hugh O. Brock wrote:
> On Thu, Mar 06, 2014 at 03:19:30PM -0500, Marek Hulan wrote:
>> Hello,
>>
>> we haven't mentioned layout as a specific entity yet because we think we don't
>> need it for first version. In fact we think we'll use quickstack modules,
>> so layouts are just simple groups of roles (for first version) and can be
>> hardcoded. But we would like to introduce a layout entity later, this is something
>> that foreman does not have yet.
>
> Hmm... I have to tell you guys, I'm really skeptical about changing the
> direction. I like the idea of a plugin with OpenStack-specific models
> that sits on top of the Foreman data structures. While I'm all for doing
> something that is reusable later in Foreman, I have a feeling we're
> talking about another week of work to get that modeling done... on a
> plugin that I want to be largely code complete *in two weeks*.
>
> I've asked Scott to go ahead and start implementing the design we've
> already worked out. If you guys can show me how we can get to the same
> point he's aiming for using a different model, in two weeks, then I'm
> willing to look at it... but even then I'm not sure it makes
> sense. Moreover I can't afford to wait for anything here, right now,
> that is in any way tied to a future feature in Foreman. We have to work
> with what we have right now.
>
> If you guys want I'm happy to talk further on this tomorrow morning, let
> me know.
>
> Take care,
> --Hugh

Our main motivation is not to things reusable later by Foreman, but we 
think we could actually save some time. Re-usability is just nice 
side-effect. If Scott thinks there's no benefit of using existing 
Foreman models we don't insist on our design for sure. We've already 
finished answers for Scott's comments so we are sending in parallel, 
we'll try to make this discussion as short as possible.

Petr

>
>>
>> ----- Original Message -----
>>> From: "Hugh O. Brock" <hbrock at redhat.com>
>>> To: "Petr Chalupa" <pchalupa at redhat.com>
>>> Cc: "foreman-dev" <foreman-dev at googlegroups.com>, rdo-list at redhat.com
>>> Sent: Thursday, March 6, 2014 8:14:38 PM
>>> Subject: [foreman-dev] Re: [Rdo-list] [OFI] data model reusing Foreman's AR models
>>>
>>> On Thu, Mar 06, 2014 at 05:54:08PM +0100, Petr Chalupa wrote:
>>>> Hi guys,
>>>>
>>>> After yesterdays IRC talk we (Marek and Petr) started to look at OFI
>>>> models design. Unfortunately I haven't received any email with link
>>>> to that so we jumped in quite late. Anyway we've tried to decode as
>>>> much information as possible about staypuft model from etherpad [1].
>>>> Here's ER diagram we were able to construct from those information.
>>>
>>> Hey Petr and Marek. First of all I really appreciate the effort you have
>>> put into understanding the problem we're trying to solve and trying to
>>> work out the best way to solve it with existing Foreman data
>>> structures.
>>>
>>> Unfortunately there are a couple of important bits of the model that you
>>> missed that will make it considerably more difficult to implement using
>>> stock Foreman data structures. (I think Scott has already outlined some
>>> of these bits.) In particular, an OpenStackLayout is actually an entire
>>> reference architecture (think HA vs. non-HA vs -- later --
>>> HA-with-separate-neutron-networker vs. HA-with-one-node-per-service)
>>> that will map to a set of roles, which in turn contain 1..n
>>> services. (This is a change we made from the original model he put
>>> together). In this sense an OpenStackLayout is a kind of template that
>>> we will, on deployment, *realize* by the creation and provisioning of
>>> hostgroups. For this reason, I think there is quite substantial value in
>>> modeling the layout as an entirely separate data structure from the
>>> hostgroups that we will generate in the deploy stage.
>>>
>>> For these reasons, I would like to press forward with Scott's original
>>> approach for now. If we arrive post-April and we decide we want to
>>> refactor to use more Foreman-centric data structures, let's revisit it
>>> at that time.
>>>
>>> Take care,
>>> --Hugh
>>>
>>>>
>>>> <see model A>
>>>>
>>>> Our main concern is that we are recreating models that are already
>>>> present in Foreman. We understand Astapor issue that it was very
>>>> hard for user understand all Foreman specifics so now we try to do
>>>> it Openstack way and use Foreman as provisioning and configuration
>>>> backend. However we still think that we should built on top of
>>>> existing and tested models and just create a new easy to use and
>>>> intuitive UI.
>>>>
>>>> inecas: +1 on reusing the Foreman model: the foreman model seems to
>>>> have most of the things to support what is required, building
>>>> something custom means:
>>>>    * duplication of what is already there
>>>>    * writing throw-away code, that nobody except the OFI itself will
>>>> use: the power of Foreman is in the community: building it on the
>>>> Foreman model (and enhancing it when needed) means the same work
>>>> will be used outside of OFI with all the benefits that come with it
>>>> I would like to avoid doing that, especially when it doesn't seem
>>>> that much work to use the existing model
>>>>
>>>> So what we propose is following DB schema:
>>>>
>>>> <see model B>
>>>>
>>>> Each deployment is contained under an Organization for separation.
>>>> Which also means that same Foreman instance could be normally used
>>>> when user leaves the wizard.
>>>>
>>>> Left side is ER model right side is representing relationships
>>>> between Hostgroups instances. The one called 'Deploy' is lets say an
>>>> common parent Hostgroup for all other hostgroups in the deployment.
>>>> 'Deploy' allows sharing of configuration to the other hostgroups.
>>>> Other hostgroups are representing Roles (like controller, compute,
>>>> etc.)
>>>>
>>>> Basically we'd map:
>>>> OpenStackDeployment -> Organization
>>>> OpenStackLayout -> organization's parameter
>>>> OpenStackRole -> Hostgroup (*)
>>>> OpenStackService -> N/A (at least for April)
>>>> OpenStackSeviceParam -> LookupKey (aka Smart Variable)
>>>> OpenStackDeployService -> N/A
>>>> OpenStackDeployServiceParam -> LookupKey (aka Smart Variable Value)
>>>> OpenStackDeployRole -> assignment of Host to Hostgroup (*)
>>>>
>>>> At the moment, the only thing that's missing is that Foreman 1.4.1
>>>> does not allow us to set one hostgroup to be used in two parent
>>>> hostgroups (one service in two roles). This is going to change in
>>>> 1.5 when ConfigRoles will be merged. We suppose to use quickstack
>>>> modules for April version so we still have just puppet classes on
>>>> role level (not on service level) and therefore we won't allow user
>>>> to customize services in roles. Since we need this post April we can
>>>> stick with current Foreman model. Later we could either back-port
>>>> ConfigRoles or base on newer Foreman.
>>>>
>>>> Benefits we see by reusing foreman models
>>>> + we save work on need to model everything again
>>>> + we save work on writing logic that will copy all
>>>> (Deploy)Service/Role (Deploy)ServiceParameters values to
>>>> Hostgroup/LookupKey/LookupValue
>>>> + ability to turn off the wizard plugin (something like removing the
>>>> training wheels) and keeping the Foreman instance still usable
>>>>
>>>> Cons
>>>> - people may spend some time to better understand existing Foreman code
>>>> inecas: that should be under Pros, and by people I don't mean the
>>>> actual users of OFI, but its developers
>>>>
>>>> Potential concerns we understood from yesterday
>>>> 1. too foreman specific
>>>> 2. need of doing some business logic before Deploy is triggered
>>>> 3. writing some easy UI around existing models is bigger pain that
>>>> creating new objects from scratch
>>>> 4. to able to delay host provisioning until whole deployment is configured
>>>>
>>>> Our answers to those
>>>> 1. this is just about building new UI that we'll need anyway and
>>>> re-labeling (we already have Smart Variable which in fact is
>>>> LookupKey model), we could use STI or composition to modify Foreman
>>>> objects behavior if they are too restricting
>>>> 2. It's easy to extend Dynflow process with a plugin injecting any
>>>> additional steps into the deployment process.
>>>> 3. if this really becomes a problem we could always wrap existing
>>>> models by some other classes
>>>> 4. If the hosts are kept in unmanaged state nothing gets applied to
>>>> them. Until orchestration takes over and switches them to managed
>>>> state.
>>>>
>>>> Are we sure that we need to allow user to prepare changes to an
>>>> existing-deployment-configuration and then apply them all at the
>>>> same time in April? I think we can postpone this for later and keep
>>>> Foreman's behavior for now that changes made to a hostgroup are
>>>> immediately applied.
>>>>
>>>> [1]: http://etherpad.corp.redhat.com/staypuft-model-design-notes
>>>>
>>>> Looking forward to your feedback Petr and Marek.
>>>>
>>>
>>>
>>>
>>>> _______________________________________________
>>>> Rdo-list mailing list
>>>> Rdo-list at redhat.com
>>>> https://www.redhat.com/mailman/listinfo/rdo-list
>>>
>>>
>>> --
>>> == Hugh Brock, hbrock at redhat.com                                   ==
>>> == Senior Engineering Manager, Cloud Engineering                   ==
>>> == Tuskar: Elastic Scaling for OpenStack                           ==
>>> == http://github.com/tuskar                                        ==
>>>
>>> "I know that you believe you understand what you think I said, but I’m
>>> not sure you realize that what you heard is not what I meant."
>>> --Robert McCloskey
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "foreman-dev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to foreman-dev+unsubscribe at googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "foreman-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe at googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>




More information about the dev mailing list