I'm looking at what the best way would be to design a cimi system's 
subcollections (SystemMachine and SystemVolume in particular), and their 
mapping to the drivers.

Retrieval of a system (or collection of systems), gives a response that 
includes e.g. its machines:

  <machines href="http://cimi.example.org/systems/system1/machines"; />

Listing the system's machines, should return a collection of SystemMachines, 
with references to the actual machines.

<Collection xmlns="http://schemas.dmtf.org/cimi/1"; 
resourceURI="http://schemas.dmtf.org/cimi/1/SystemMachineCollection";>
  <id>http://localhost:3001/cimi/systems/system1/machines</id>
  <count>2</count>
  <SystemMachine>
    <id>http://localhost:3001/cimi/systems/system1/machines/inst0</id>
    <name>Mock Instance With Profile Change</name>
    <description>SystemMachine inst0 for System system1</description>
    <machine href="http://localhost:3001/cimi/machines/inst0"; />
   <operation rel="delete" 
href="http://localhost:3001/cimi/systems/system1/machines/inst0"; />
  </SystemMachine>
...

I'm considering several ways to implement this:
1. From system_machine#self.find, passing the system_id to the existing 
driver.instances method to list only the instances of that system, then convert 
the instances into a SystemMachineCollection. This would be the most efficient 
way for fgcp.

2. Introduce a driver.system_machines method and leave it up to the driver how 
to retrieve the instances. A disadvantage is that each supporting driver 
relying on instances() would have to do the instance->machine conversion 
themselves.

3. Introduce a driver.system_instances method and leave it up to the driver how 
to retrieve the instances belonging to this system. The instance->machine 
conversion would be done in system_machine#self.find as in 1. A disadvantage of 
this is the mixture of cimi and DC concepts.

I prefer 1. Possibly by adding a "system" feature for the drivers that support 
this in their instances (and storage_volumes, keys?) methods, so that we can 
use the DB for drivers that don't.

What do you think?

Regards,
Dies Koper

--
Dies KÖPER
Software & Solutions Architect

Fujitsu Australia Software Technology (FAST) - Cloud Computing
Tel. +61 2 9452 9061 (Fujitsu internal 7985-29061)
di...@fast.au.fujitsu.com


Reply via email to