Hi All,

I have been testing NovaApi against HP Cloud and have been working with both per AZ endpoint model and a region wide endpoint model in different zones.

For clarity I would define the two terms:

Per AZ endpoint model : I call it so as we get a per AZ compute endpoint url. Using this URL we could only work with a particular AZ of a cloud provider (e.g. HP Cloud region-a has az1.region-a.geo-1 as one AZ and has its own compute endpoint)

Region wide endpoint model: I call it so as we have one compute endpoint for the entire zone. All the openstack services work region wide and compute instance can be placed on all AZs within the region selectively. (e.g. HPCloud region-b.geo-1, which will have a single endpoint for compute for the entire region. This is still in private beta stage.)

The existing framework with JClouds doesn't seem to fit the region wide model and below I describe 3 issues I see.

So start with I can create a single connection for HP Cloud as below
NovaApi api =
                 .credentials(identity, password)
                 .apiVersion("2") //The api version of region-b.geo-1 is 2 which is required for next steps


1. But to get a Handle to the ServerApi under this region I need to give the name of a region!

//So now we have a new connection to region-b-geo-1

//But to get a ServerApi handle I need to do
//This looks ugly, as i need to provide the name of region for a zone!
serverApi = this.novaApi.getServerApiForZone("region-b.geo-1");

//As the below throws error
serverApi = this.novaApi.getServerApiForZone("az1");

2. Also now that I have a ServerApi to the region, I don't get to select the an AZ to place a instance as there is no CreateServerOption to specifiy an AZ name!

3. And the below call should return all AZs (az1, az2, az3), but it only returns region-b.geo-1

I think this is due to the fact that the implementation of getConfiguredZones() is mapped to the endpoints in the service catalogue rather than the below API extension:

curl -i https://region-b.geo-1.compute.hpcloudsvc.com/v2/<tenant-id>/os-availability-zone -X GET -H "Accept: application/json" -H "X-Auth-Token: <token>"

RESP: [200] CaseInsensitiveDict({'date': 'Mon, 05 Aug 2013 10:35:03 GMT', 'content-length': '236', 'content-type': 'application/json', 'x-compute-request-id': 'req-c19dcfba-8a21-4a7e-b463-19943267c9bb'})
RESP BODY: {"availabilityZoneInfo": [{"zoneState": {"available": true}, "hosts": null, "zoneName": "az1"}, {"zoneState": {"available": true}, "hosts": null, "zoneName": "az2"}, {"zoneState": {"available": true}, "hosts": null, "zoneName": "az3"}]}

If people agree I could file a bug on this.