Publishing and Registering the Machine ImageΒΆ

Once the machine image is generated, you can upload and register the machine image to the target environment, in this case AWS.

Warning

The image uploaded will be stored in AWS S3 storage. AWS does not charge you for any inbound data, however they will charge you for the storage used.

To get the id of the machine image generated, use the command image list

$ hammr image list
Getting all images and publications for [root] ...
Images:
+------+---------------+---------+------+-----------+---------------------+------+------------+-------------------+
|  Id  |     Name      | Version | Rev. |  Format   |       Created       | Size | Compressed | Generation Status |
+======+===============+=========+======+===========+=====================+======+============+===================+
| 1042 | generation    | 1.0     | 1    | kvm       | 2014-05-21 09:29:36 | 0B   | X          | Done              |
+------+---------------+---------+------+-----------+---------------------+------+------------+-------------------+
| 981  | wordpress     | 1.0     | 1    | vbox      | 2014-05-19 17:08:06 | 0B   | X          | Canceled          |
+------+---------------+---------+------+-----------+---------------------+------+------------+-------------------+
| 960  | nginx-muppets | 1.0     | 1    | vbox      | 2014-05-15 13:33:43 | 0B   | X          | Done              |
+------+---------------+---------+------+-----------+---------------------+------+------------+-------------------+

Found 3 images
No publication available

Now use the command publish to start the registration process. The following example assumes you are using YAML but you can also use JSON.

$ hammr image publish --id <the id> --file nginx-template.yml
Validating the template file [/tmp/centOS.yml] ...
OK: Syntax of template file [/tmp/centOS.yml] is ok
Publishing 'ami' image (1/1)
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 100%: Done, published o... |<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<|
OK: Publication to 'amazon' is ok
Cloud ID : ami-25aa6752