Hi,


I was trying to understand how JClouds (esp. the api/nova) maps AZs to the
ServerApi API it provides.



For example, consider the service catalog below for HP Cloud below which
has 3 AZs in "region-a.geo-1" as endpoints and one endpoint for the whole
region for "region-b.geo-1":

---------------------------------

{

      "name": "Compute",

      "type": "compute",

      "endpoints": [

        {

          "tenantId": "tenantID",

          "publicURL": "
https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/tenantID<https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/tenantID>
",

          "publicURL2": "
https:\/\/az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com\/services\/Cloud<https://az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com/services/Cloud>
",

          "region": "az-1.region-a.geo-1",

          "versionId": "1.1",

          "versionInfo": "
https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/<https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/>
",

          "versionList": "
https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com<https://az-1.region-a.geo-1.compute.hpcloudsvc.com>
"

        },

        {

          "tenantId": "tenantID",

          "publicURL": "
https:\/\/az-2.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/tenantID<https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/tenantID>
",

          "publicURL2": "
https:\/\/az-2.region-a.geo-1.ec2-compute.hpcloudsvc.com\/services\/Cloud<https://az-2.region-a.geo-1.ec2-compute.hpcloudsvc.com/services/Cloud>
",

          "region": "az-2.region-a.geo-1",

          "versionId": "1.1",

          "versionInfo": "
https:\/\/az-2.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/<https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/>
",

          "versionList": "
https:\/\/az-2.region-a.geo-1.compute.hpcloudsvc.com<https://az-2.region-a.geo-1.compute.hpcloudsvc.com>
"

        },

        {

          "tenantId": "tenantID",

          "publicURL": "
https:\/\/az-3.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/tenantID<https://az-3.region-a.geo-1.compute.hpcloudsvc.com/v1.1/tenantID>
",

          "publicURL2": "
https:\/\/az-3.region-a.geo-1.ec2-compute.hpcloudsvc.com\/services\/Cloud<https://az-3.region-a.geo-1.ec2-compute.hpcloudsvc.com/services/Cloud>
",

          "region": "az-3.region-a.geo-1",

          "versionId": "1.1",

          "versionInfo": "
https:\/\/az-3.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/<https://az-3.region-a.geo-1.compute.hpcloudsvc.com/v1.1/>
",

          "versionList": "
https:\/\/az-3.region-a.geo-1.compute.hpcloudsvc.com<https://az-3.region-a.geo-1.compute.hpcloudsvc.com>
"

        },

        {

          "tenantId": "tenantID",

          "publicURL": "
https:\/\/region-b.geo-1.compute.hpcloudsvc.com\/v2\/tenantID<https://region-b.geo-1.compute.hpcloudsvc.com/v2/tenantID>
",

          "region": "region-b.geo-1",

          "versionId": "2",

          "versionInfo": "
https:\/\/region-b.geo-1.compute.hpcloudsvc.com\/v2\/<https://region-b.geo-1.compute.hpcloudsvc.com/v2/>
",

          "versionList":
"https:\/\/region-b.geo-1.compute.hpcloudsvc.com<https://region-b.geo-1.compute.hpcloudsvc.com>
"

        }

      ]

    }



---------------------------------





1. HP Cloud US-WEST :

This region exposes all the 3 AZs as separate endpoints. So the mapping for
endpoint to AZs is very clear. But this was the old style of representing
AZs, possibly due to how HP chose to do it or was inherent of Diablo code.
This means that all the resources you create for an AZ are restricted to
that AZ and can be accessed using the endpoint for that AZ.



To get a context and API handle I would create a Context using one of the
AZ endpoints above and build a NovaApi view. I can get relevant API handles
for a zone as below:



--------------------------------------

ServerApi az1ServerApi =
this.novaApi.getServerApiForZone("az-3.region-a.geo-1");

--------------------------------------



2. HP Clolud US-EAST:



This region is still in private beta and testing, but uses a region wide
endpoint (the last one in the catalog above).



To get a context and API handle I would create a Context using the region
wide endpoint (region-b.geo-1) as in the catalog and build a NovaApi view.
But I can't get a ServerApi for say "az1".



PROBLEM: The problem I face here, is how to choose a specific AZ for
creating, accessing servers for a particular AZ (say az1).



The below code though gets me a working handle to the server API, but it is
region wide, and if I list servers all the servers in this region are
listed:

--------------------------------------

ServerApi serverApi = this.novaApi.getServerApiForZone("region-b.geo-1");

--------------------------------------



The Nova API (REST api from OpenStack) and Nova CLI provide a
--availability-zone option while creating a server to place the VM/server
in a specific zone. I don't see such an option available under
org.jclouds.openstack.nova.v2_0.features.ServerApi class or
org.jclouds.openstack.nova.v2_0.options.CreateServerOptions.



Is this a problem that needs to be addressed only for the "hpcloud-compute"
provider or is it an issue across api/nova in JClouds? Or am I missing
something?



I am sure other OpenStack based providers who have moved to Grizzly have
had to make similar adjustments.



Any help in this regard will be valuable.



Regards,

Kavan

Reply via email to