Merge lp://staging/~chad.smith/charms/precise/storage/storage-ec2-support into lp://staging/~dpb/charms/precise/storage/trunk

Proposed by Chad Smith
Status: Merged
Merged at revision: 32
Proposed branch: lp://staging/~chad.smith/charms/precise/storage/storage-ec2-support
Merge into: lp://staging/~dpb/charms/precise/storage/trunk
Diff against target: 223 lines (+151/-7)
2 files modified
hooks/common_util.py (+32/-4)
hooks/test_common_util.py (+119/-3)
To merge this branch: bzr merge lp://staging/~chad.smith/charms/precise/storage/storage-ec2-support
Reviewer Review Type Date Requested Status
David Britton Approve
Fernando Correa Neto (community) Approve
Review via email: mp+206834@code.staging.launchpad.net

Description of the change

Allow get_instance_id to work on both Openstack and EC2 instances.

To do this we first attempt a curl of the OS_METADATA_URL to pull the instance uuid which is used by nova commands for volume attachment.

If curl of OS_METADATA_URL fails to return valid JSON, we then try to curl EC2_METADATA_URL to grab the EC2 instance id.

This branch adds missing unit tests for get_instance_id as well.

To post a comment you must log in.
35. By Chad Smith

docstring fix

36. By Chad Smith

support attached devices that are already partitioned, such as old postgresql charm upgrade_charm path

Revision history for this message
Fernando Correa Neto (fcorrea) wrote :

Code looks good but we have an issue because in order to mount an existing volume, the BSB service must be running on the same id.
That means that we must know upfront in which EC2 AZ the volume is, and if possible, deploy the BSB service in the same AZ so it can be successfully be attached.

review: Approve
Revision history for this message
David Britton (dpb) wrote :

On Tue, Mar 04, 2014 at 09:43:16AM -0000, Fernando Correa Neto wrote:
> Review: Approve
>
> Code looks good but we have an issue because in order to mount an
> existing volume, the BSB service must be running on the same id. That
> means that we must know upfront in which EC2 AZ the volume is, and if
> possible, deploy the BSB service in the same AZ so it can be
> successfully be attached.

Should the AZ be specified in the BSB config?

--
David Britton <email address hidden>

Revision history for this message
David Britton (dpb) wrote :

[0] Can we get rid of the 'else' clauses (two of them) in the get_instance_id() method? Just return directly from the try block?

Otherwise, +1.

review: Approve

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

to all changes: