rhtconsulting / rhc-ose

OpenShift Automation and Utilities by Red Hat Consulting
42 stars 34 forks source link

First cut at a promote script for the ose3 base image #72

Closed oybed closed 8 years ago

oybed commented 9 years ago

What does this PR do?

This PR introduces the "osc-manage-image" tool. This tool is meant to be the one used to promote a newly created test image to be the main ose3 base image.

How should this be manually tested?

NOTE: to avoid disruption to the already in-use "ose3-base" image, make sure to follow these steps carefully.

  1. Make sure 2 test images are available, e.g.: At time of writing, these two images are available: ose-test-img-0000-28-Oct-2015 and ose-test-img-1039-27-Oct-2015
    1. Capture the ID of these images - used to validate the steps below
  2. Change the value of "image_name" in provisioning/lib/constants to one of the above images, e.g.: ose-test-img-0000-28-Oct-2015
    1. For the purpose of this test, this image becomes the "base" image to be retired and the name of the newly promoted image
    2. Also make sure a instance/vm is using the image before doing the promotion
  3. Run the "osc-manage-image" tool to promote the other image, e.g.: ./osc-manage-image --action=promote --image-name=ose-test-img-1039-27-Oct-2015
  4. Verify that the original "ose-test-img-0000-28-Oct-2015" has been renamed something like "ose3-delete-after-X-Y-Z", verify "ose-test-img-1039-27-Oct-2015" has been renamed to "ose-test-img-0000-28-Oct-2015"
    1. Use the image IDs from step 1a above to validate the images
  5. Verify that the instance/vm using the former "base image" is now using the image named "ose3-delete-after...."
  6. Verify that the newly become "base image" is marked with Public set to "Yes"

    Is there a relevant Issue open for this?

N/A

Who would you like to review this?

/cc @etsauer

etsauer commented 9 years ago

@oybed before I test this, can you confirm you mention the right image name in Step 3? I'm thinking that --image-name=ose-test-img-0000-28-Oct-2015 should actually be --image-name=ose-test-img-1039-27-Oct-2015

oybed commented 9 years ago

@etsauer you are correct - I have updated the above instructions.

etsauer commented 9 years ago

@oybed great, will test shortly

etsauer commented 9 years ago

@oybed two comments off the bat:

  1. I would like to have the user experience be more consistent with our other scripts, namely:
    1. A --help option which displays script usage
    2. support for shorthand options (-a|--action=)
    3. Invalid parameters should also show the usage output
  2. I think this script actually belongs in ./provisioning/openstack/ since its stack specific, and also because it has the same client setup requirements that are documented in the readme for openstack.
etsauer commented 9 years ago

@oybed test worked great.

I think we should have the output cleaned up, and rather than outputting the nova image output, provide some kind of description of what's happening, like:

./osc-manage-image --action=promote --image-name=ose-test-img-1039-27-Oct-2015
Renaming image X to image Y...
Renaming image A to image X...
Done
oybed commented 9 years ago

@etsauer agree with your comment ... will work on that.

oybed commented 8 years ago

Please see #73 for final version