On Tue, 2010-04-27 at 15:47 -0400, Itamar Heim wrote:
> From: Mark McLoughlin [mailto:markmc@redhat.com]
> > One could also later attach it to another storage domain.
> > Btw - a storage domain can be attached to multiple data centers,
>
> And all hosts within the multiple datacenters should have access to the
> storage, right?
>
> > and may have a different status in each of them.
>
> Huh? That would suggest a storage domain's status needs to be modelled
> like:
>
> <datacenter>
> ....
> <storage_domain_statuses>
> <storage_domain_status>
> <storage_domain href="..."/>
> <status>....</status>
> </storage_domain_status>
> </storage_domain_statuses>
>
> How is this expressed with the powershell API - do you get a different
> storage domain object from get-storagedomain depending on which
> datacenter ID you supply?
[IH] yes. A storage domain may have an error in one data center (hosts not
able to access it, moved to maintenance, lockes, etc., but be viable in
another).
>
> Also, which of the two statuses do you mean:
>
> StorageDomainStatus { Unknown, Uninitialized, Unattached, Active,
> InActive, Locked }
[IH] this is per domain, and is shown per data center.
> StorageDomainSharedStatus { Unattached, Active, InActive, Mixed, Locked
[IH] this is an aggregation of the per data center statuses, to show a
single status for the data center, without drilling down to different data
centers it is attached to.
> }
>
> What is the difference between the two?
[IH] first is shown on the storage domain tab, data center subtab (or data
center tab, storage domain subtab). Second is shown in the main storage
domain tab.
Okay, I've modelled this by adding a collection of storage domains as a
sub-resource of each data center.
So, attaching a storage domain to a data center is done by e.g.:
POST /datacenters/1234/storagedomains
<storage_domain><id>5678</id></storage_domain>
HTTP/1.1 201 Created
Location: http://{resource}/datacenters/1234-abcd-6789-ef00/storagedomains/1111
When you query the returned URI it will show you the per-datacenter
status instead of the shared status shown by doing e.g.
GET /storagedomains/5678
This is pretty wacky stuff for a REST API, though. I really wish the
per-datacenter status had been separated from the storage domain object.
See:
https://fedorahosted.org/rhevm-api/wiki/DataCentersCollection
Eoghan and I are still going back and forth about different ways of
doing this, but this at least gives an idea of what we're thinking.
Cheers,
Mark.