Merge lp://staging/~axwalk/goose/nova-availability-zones into lp://staging/goose

Proposed by Andrew Wilkins
Status: Merged
Approved by: Martin Packman
Approved revision: 127
Merged at revision: 125
Proposed branch: lp://staging/~axwalk/goose/nova-availability-zones
Merge into: lp://staging/goose
Diff against target: 634 lines (+301/-70)
10 files modified
errors/errors.go (+22/-6)
errors/errors_test.go (+14/-0)
nova/live_test.go (+37/-20)
nova/local_test.go (+45/-0)
nova/nova.go (+45/-6)
testservices/errors.go (+4/-0)
testservices/novaservice/service.go (+62/-20)
testservices/novaservice/service_http.go (+47/-18)
testservices/novaservice/service_http_test.go (+21/-0)
testservices/service.go (+4/-0)
To merge this branch: bzr merge lp://staging/~axwalk/goose/nova-availability-zones
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+222275@code.staging.launchpad.net

Commit message

Add support for Availability Zones

- Added ListAvailabilityZones to Nova client
- Added AvailabilityZone field to RunServerOpts
- Added AvailabilityZone field to ServerDetail
- Updated nova test-service to support all of the above

Availability zones are an OpenStack extension,
so I've made it so that ListAvailabilityZones will
ignore any 404 to the os-availability-zone URL.

https://codereview.appspot.com/103900045/

R=gz

Description of the change

Add support for Availability Zones

- Added ListAvailabilityZones to Nova client
- Added AvailabilityZone field to RunServerOpts
- Added AvailabilityZone field to ServerDetail
- Updated nova test-service to support all of the above

Availability zones are an OpenStack extension,
so I've made it so that ListAvailabilityZones will
ignore any 404 to the os-availability-zone URL.

https://codereview.appspot.com/103900045/

To post a comment you must log in.
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+222275_code.launchpad.net,

Message:
Please take a look.

Description:
Add support for Availability Zones

- Added ListAvailabilityZones to Nova client
- Added AvailabilityZone field to RunServerOpts
- Added AvailabilityZone field to ServerDetail
- Updated nova test-service to support all of the above

Availability zones are an OpenStack extension,
so I've made it so that ListAvailabilityZones will
ignore any 404 to the os-availability-zone URL.

https://code.launchpad.net/~axwalk/goose/nova-availability-zones/+merge/222275

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/103900045/

Affected files (+260, -64 lines):
   A [revision details]
   M nova/live_test.go
   M nova/local_test.go
   M nova/nova.go
   M testservices/novaservice/service.go
   M testservices/novaservice/service_http.go
   M testservices/novaservice/service_http_test.go

Revision history for this message
Dave Cheney (dave-cheney) wrote :

https://codereview.appspot.com/103900045/diff/1/nova/local_test.go
File nova/local_test.go (right):

https://codereview.appspot.com/103900045/diff/1/nova/local_test.go#newcode251
nova/local_test.go:251: c.Assert(err, IsNil)
Are these zones guaranteed to be returned in order? Should this be
jc.SameContents

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service.go
File testservices/novaservice/service.go (right):

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service.go#newcode826
testservices/novaservice/service.go:826: sort.Sort(azByName(zones))
Please document the order of az's is stored.

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service_http_test.go
File testservices/novaservice/service_http_test.go (right):

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service_http_test.go#newcode1196
testservices/novaservice/service_http_test.go:1196:
c.Assert(expected.Zones, DeepEquals, zones)
jc.SameContents

https://codereview.appspot.com/103900045/

126. By Andrew Wilkins

Add comment on ordering of zones

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Please take a look.

https://codereview.appspot.com/103900045/diff/1/nova/local_test.go
File nova/local_test.go (right):

https://codereview.appspot.com/103900045/diff/1/nova/local_test.go#newcode251
nova/local_test.go:251: c.Assert(err, IsNil)
On 2014/06/06 04:33:17, dfc wrote:
> Are these zones guaranteed to be returned in order? Should this be
> jc.SameContents

Yes, they are sorted by the server.

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service.go
File testservices/novaservice/service.go (right):

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service.go#newcode826
testservices/novaservice/service.go:826: sort.Sort(azByName(zones))
On 2014/06/06 04:33:17, dfc wrote:
> Please document the order of az's is stored.

Added to the doc comment of this function. There's no user-facing place
to add a comment.

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service_http_test.go
File testservices/novaservice/service_http_test.go (right):

https://codereview.appspot.com/103900045/diff/1/testservices/novaservice/service_http_test.go#newcode1196
testservices/novaservice/service_http_test.go:1196:
c.Assert(expected.Zones, DeepEquals, zones)
On 2014/06/06 04:33:17, dfc wrote:
> jc.SameContents

They are sorted by the server. No need to introduce a dependency on
juju/testing/checkers here.

https://codereview.appspot.com/103900045/

Revision history for this message
Martin Packman (gz) wrote :

Do any of our openstack clouds actually support this extension? Neither
canonistack nor HP seem to. I'm not totally up to dat on current plans,
but this seemed to be a dead end a year ago, with different mechanisms
talked about as fulfilling the role that weren't availabilty zone based.

https://codereview.appspot.com/103900045/

Revision history for this message
Andrew Wilkins (axwalk) wrote :

On 2014/06/07 14:54:10, gz wrote:
> Do any of our openstack clouds actually support this extension?
Neither
> canonistack nor HP seem to. I'm not totally up to dat on current
plans, but this
> seemed to be a dead end a year ago, with different mechanisms talked
about as
> fulfilling the role that weren't availabilty zone based.

HP's US West has 4 availability zones. I've tested this live.

https://codereview.appspot.com/103900045/

Revision history for this message
Martin Packman (gz) wrote :

Ah, interesting. I wasn't on their 12.12 deployment (which is being
retired Monday), so must have been added for the 13.5 one.

https://codereview.appspot.com/103900045/

Revision history for this message
Martin Packman (gz) wrote :

LGTM.

https://codereview.appspot.com/103900045/diff/20001/nova/local_test.go
File nova/local_test.go (right):

https://codereview.appspot.com/103900045/diff/20001/nova/local_test.go#newcode231
nova/local_test.go:231: s.openstack.Nova.SetAvailabilityZones()
This is pretty magical test server behaviour, but you have a nice big
comment at least.

https://codereview.appspot.com/103900045/diff/20001/nova/nova.go
File nova/nova.go (right):

https://codereview.appspot.com/103900045/diff/20001/nova/nova.go#newcode695
nova/nova.go:695: return nil, nil
I'd prefer we return a specific error that can be checked, but that's
not really a job for this proposal, we need better goose-wide handling
of extensions and errors.

https://codereview.appspot.com/103900045/diff/20001/testservices/novaservice/service_http.go
File testservices/novaservice/service_http.go (right):

https://codereview.appspot.com/103900045/diff/20001/testservices/novaservice/service_http.go#newcode228
testservices/novaservice/service_http.go:228:
errAvailabilityZoneIsNotAvailable = &errorResponse{
Rather than doing this the old way, you should use the new
testservices/errors.go method of creating the error.

https://codereview.appspot.com/103900045/

127. By Andrew Wilkins

Address review comments

- Return an error if AZ extension is not supported
- Use new testservices/errors

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Please take a look.

https://codereview.appspot.com/103900045/diff/20001/nova/nova.go
File nova/nova.go (right):

https://codereview.appspot.com/103900045/diff/20001/nova/nova.go#newcode695
nova/nova.go:695: return nil, nil
On 2014/06/07 17:13:03, gz wrote:
> I'd prefer we return a specific error that can be checked, but that's
not really
> a job for this proposal, we need better goose-wide handling of
extensions and
> errors.

I think you're right, and I'd prefer to get the API right to begin with.
The error type/method of checking may change later, but at least we
should start out with propagating the error.

I've created a error code in goose/errors for "not implemented".

https://codereview.appspot.com/103900045/diff/20001/testservices/novaservice/service_http.go
File testservices/novaservice/service_http.go (right):

https://codereview.appspot.com/103900045/diff/20001/testservices/novaservice/service_http.go#newcode228
testservices/novaservice/service_http.go:228:
errAvailabilityZoneIsNotAvailable = &errorResponse{
On 2014/06/07 17:13:03, gz wrote:
> Rather than doing this the old way, you should use the new
> testservices/errors.go method of creating the error.

Done.

https://codereview.appspot.com/103900045/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches