deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Another take on machine creation
Date Thu, 07 Feb 2013 20:32:41 GMT

These patches represent another take on machine creation from what Michal
posted earlier - I've had them lying around for a while, and should have
sent them earlier.

There are a myriad ways in which an object can be created, especially for
machines; I introduced a new 'ref' keyword to the model DSL to indicate
that an object can be a reference to an existing object plus local

All the gyrations of machine creations aren't implemented in this yet,
mostly because our unit test setup is too weak to write tests
effectively. These are some of the variations of what the machine template
inside a machine create ca nlook like:

(1) By reference only:

  <machineTemplate href="..."/>

(2) By value:

    <machineConfig href="..."/>
    <machineImage href="..."/>

(3) By reference with overrides:

  <machineTemplate href="...">
    <machineImage href="..."/>

(4) by value with overrides

    <machineConfig href="...">
    <machineImage href="..."/>

.. and I think there are lots more variations on how to mix and match
references and value overrides.

To make this work in a sane way, the implicitly generated
MachineTemplateRef class would need to do the following upon

  * if href is provided look up and load the referenced template
  * if there are any overrides in the body, modify the
    loaded template accordingly

This two-step behavior can cascade down to the entities enclosed in the
machine template. Hence the need for a common mechanism to do this.

The problems with our tests is that we don't have a convenient way to do
the lookups needed to instantiate all the templates listed above.


View raw message