Steps for running the AMI migration script:


1) Download the zip file to a location on the machine running CycleCloud:

$ cd /tmp
$ wget http://download.cyclecomputing.com.s3.amazonaws.com/import_ami-1.14.zip

2) Change to the CycleServer install location and unzip the import_ami package. Make sure to replace /opt/cycle_server with the correct location for your installation.

$ cd /opt/cycle_server
$ sudo unzip /tmp/import_ami-1.14.zip

3) Run the import_ami script without any arguments to execute it in "dry run" mode. This will print out the list of AMIs that will be copied to your AWS account and show any changes to cluster nodes and node arrays. Check for any errors and that all of your clusters and nodes are listed in the output. If you have any questions about whether the output is correct, feel free to send the output to support@cyclecomputing.com and someone will confirm its correctness.

$ sudo ./import_ami.sh
      Skipped image ami-3dc5ba2b into account beta [cycle.image.win2012-hvm-6.5.6-2] - Windows images cannot be copied
      Would copy image ami-21c2bd37 into account beta [cycle.image.centos7-hvm-6.5.6-2 => jetpack.image.centos7-hvm-6.5.6-2]

      Cluster TestTestTest:
        Would convert nodearray execute using account beta in us-east-1 from cycle.image.centos7 (ami-21c2bd37) to imported.beta.image.centos7 (ami-21c2bd37-COPY)
        Would convert node master using account beta in us-east-1 from cycle.image.centos7 (ami-21c2bd37) to imported.beta.image.centos7 (ami-21c2bd37-COPY)
      Cluster Zookeeper:
        No nodes found using applicable AMIs

      -- New Package Mapping--
      beta: cycle.image.centos7 (Cycle CentOS 7) => imported.beta.image.centos7 (CentOS 7/beta)

      Run this command with --confirm to actually perform the changes shown above.

4) After verifying the output of the script with dryrun, run the import_ami script with with the `--confirm` option:

$ sudo ./import_ami.sh --confirm
      Skipped image ami-3dc5ba2b into account beta [cycle.image.win2012-hvm-6.5.6-2] - Windows images cannot be copied
      Copying image ami-21c2bd37 into account beta [cycle.image.centos7-hvm-6.5.6-2 => jetpack.image.centos7-hvm-6.5.6-2]

      Cluster TestTestTest:
        Converting nodearray execute using account beta in us-east-1 from cycle.image.centos7 (ami-21c2bd37) to imported.beta.image.centos7 (ami-21c2bd37-COPY)
        Converting node master using account beta in us-east-1 from cycle.image.centos7 (ami-21c2bd37) to imported.beta.image.centos7 (ami-21c2bd37-COPY)
      Cluster Zookeeper:
        No nodes found using applicable AMIs

      Note that running instances will not be affected until restart.

      -- New Package Mapping--
      beta: cycle.image.centos7 (Cycle CentOS 7) => imported.beta.image.centos7 (CentOS 7/beta)

      This change can be undone by running the following command:
      /opt/cycle_server/import_ami/undo.sh /opt/cycle_server/work/import_ami-backup-2017-07-03T09:26:34.239775.json

NOTE: You may see messages like the following when running the script with --confirm. You can safely ignore these:

Ignored attempt to modify the following readonly attributes on Cloud.Node: [PhaseMap]

5) Launch a new execute node in the cluster to verify that the new AMI was used and the node converges successfully.


6) Update any cluster templates and properties files to use the new image names according to the "New Package Mapping" section of the script output. If the templates are not updated, the cluster will revert to the old shared images upon re-import


7) You can re-run the script at any time in the future and it will update any new clusters or nodes that reference old images.