github.com/aspring/packer@v0.8.1-0.20150629211158-9db281ac0f89/website/source/docs/builders/openstack.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "OpenStack Builder"
     4  description: |-
     5    The `openstack` Packer builder is able to create new images for use with OpenStack. The builder takes a source image, runs any provisioning necessary on the image after launching it, then creates a new reusable image. This reusable image can then be used as the foundation of new servers that are launched within OpenStack. The builder will create temporary keypairs that provide temporary access to the server while the image is being created. This simplifies configuration quite a bit.
     6  ---
     7  
     8  # OpenStack Builder
     9  
    10  Type: `openstack`
    11  
    12  The `openstack` Packer builder is able to create new images for use with
    13  [OpenStack](http://www.openstack.org). The builder takes a source
    14  image, runs any provisioning necessary on the image after launching it,
    15  then creates a new reusable image. This reusable image can then be
    16  used as the foundation of new servers that are launched within OpenStack.
    17  The builder will create temporary keypairs that provide temporary access to
    18  the server while the image is being created. This simplifies configuration
    19  quite a bit.
    20  
    21  The builder does _not_ manage images. Once it creates an image, it is up to
    22  you to use it or delete it.
    23  
    24  ## Configuration Reference
    25  
    26  There are many configuration options available for the builder. They are
    27  segmented below into two categories: required and optional parameters. Within
    28  each category, the available configuration keys are alphabetized.
    29  
    30  In addition to the options listed here, a
    31  [communicator](/docs/templates/communicator.html)
    32  can be configured for this builder.
    33  
    34  ### Required:
    35  
    36  * `flavor` (string) - The ID, name, or full URL for the desired flavor for the
    37    server to be created.
    38  
    39  * `image_name` (string) - The name of the resulting image.
    40  
    41  * `source_image` (string) - The ID or full URL to the base image to use.
    42    This is the image that will be used to launch a new server and provision it.
    43    Unless you specify completely custom SSH settings, the source image must
    44    have `cloud-init` installed so that the keypair gets assigned properly.
    45  
    46  * `username` (string) - The username used to connect to the OpenStack service.
    47    If not specified, Packer will use the environment variable
    48    `OS_USERNAME`, if set.
    49  
    50  * `password` (string) - The password used to connect to the OpenStack service.
    51    If not specified, Packer will use the environment variables
    52    `OS_PASSWORD`, if set.
    53  
    54  ### Optional:
    55  
    56  * `api_key` (string) - The API key used to access OpenStack. Some OpenStack
    57    installations require this.
    58  
    59  * `availability_zone` (string) - The availability zone to launch the
    60    server in. If this isn't specified, the default enforced by your OpenStack
    61    cluster will be used. This may be required for some OpenStack clusters.
    62  
    63  * `floating_ip` (string) - A specific floating IP to assign to this instance.
    64    `use_floating_ip` must also be set to true for this to have an affect.
    65  
    66  * `floating_ip_pool` (string) - The name of the floating IP pool to use
    67    to allocate a floating IP. `use_floating_ip` must also be set to true
    68    for this to have an affect.
    69  
    70  * `insecure` (boolean) - Whether or not the connection to OpenStack can be done
    71    over an insecure connection. By default this is false.
    72  
    73  * `networks` (array of strings) - A list of networks by UUID to attach
    74    to this instance.
    75  
    76  * `tenant_id` or `tenant_name` (string) - The tenant ID or name to boot the
    77    instance into. Some OpenStack installations require this.
    78    If not specified, Packer will use the environment variable
    79    `OS_TENANT_NAME`, if set.
    80  
    81  * `security_groups` (array of strings) - A list of security groups by name
    82    to add to this instance.
    83  
    84  * `region` (string) - The name of the region, such as "DFW", in which
    85    to launch the server to create the AMI.
    86    If not specified, Packer will use the environment variable
    87    `OS_REGION_NAME`, if set.
    88  
    89  * `ssh_interface` (string) - The type of interface to connect via SSH. Values
    90    useful for Rackspace are "public" or "private", and the default behavior is
    91    to connect via whichever is returned first from the OpenStack API.
    92  
    93  * `use_floating_ip` (boolean) - Whether or not to use a floating IP for
    94    the instance. Defaults to false.
    95  
    96  * `rackconnect_wait` (boolean) - For rackspace, whether or not to wait for
    97    Rackconnect to assign the machine an IP address before connecting via SSH.
    98    Defaults to false.
    99  
   100  ## Basic Example: Rackspace public cloud
   101  
   102  Here is a basic example. This is a working example to build a
   103  Ubuntu 12.04 LTS (Precise Pangolin) on Rackspace OpenStack cloud offering.
   104  
   105  ```javascript
   106  {
   107    "type": "openstack",
   108    "username": "foo",
   109    "password": "foo",
   110    "region": "DFW",
   111    "ssh_username": "root",
   112    "image_name": "Test image",
   113    "source_image": "23b564c9-c3e6-49f9-bc68-86c7a9ab5018",
   114    "flavor": "2"
   115  }
   116  ```
   117  
   118  ## Basic Example: Private OpenStack cloud
   119  
   120  This example builds an Ubuntu 14.04 image on a private OpenStack cloud,
   121  powered by Metacloud.
   122  
   123  ```javascript
   124  {
   125    "type": "openstack",
   126    "ssh_username": "root",
   127    "image_name": "ubuntu1404_packer_test_1",
   128    "source_image": "91d9c168-d1e5-49ca-a775-3bfdbb6c97f1",
   129    "flavor": "2"
   130  }
   131  ```
   132  
   133  In this case, the connection information for connecting to OpenStack
   134  doesn't appear in the template. That is because I source a standard
   135  OpenStack script with environment variables set before I run this. This
   136  script is setting environment variables like:
   137  
   138  * `OS_AUTH_URL`
   139  * `OS_TENANT_ID`
   140  * `OS_USERNAME`
   141  * `OS_PASSWORD`