github.com/daniellockard/packer@v0.7.6-0.20141210173435-5a9390934716/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  ### Required:
    31  
    32  * `flavor` (string) - The ID or full URL for the desired flavor for the
    33    server to be created.
    34  
    35  * `image_name` (string) - The name of the resulting image.
    36  
    37  * `password` (string) - The password used to connect to the OpenStack service.
    38    If not specified, Packer will use the environment variables
    39    `SDK_PASSWORD` or `OS_PASSWORD` (in that order), if set.
    40  
    41  * `provider` (string) - The provider used to connect to the OpenStack service.
    42    If not specified, Packer will use the environment variable
    43    `SDK_PROVIDER`, if set.
    44    For Rackspace this should be `rackspace-us` or `rackspace-uk`.
    45  
    46  * `source_image` (string) - The ID or full URL to the base image to use.
    47    This is the image that will be used to launch a new server and provision it.
    48  
    49  * `username` (string) - The username used to connect to the OpenStack service.
    50    If not specified, Packer will use the environment variables
    51    `SDK_USERNAME` or `OS_USERNAME` (in that order), if set.
    52  
    53  ### Optional:
    54  
    55  * `api_key` (string) - The API key used to access OpenStack. Some OpenStack
    56    installations require this.
    57    If not specified, Packer will use the environment variables
    58    `SDK_API_KEY`, if set.
    59  
    60  * `floating_ip` (string) - A specific floating IP to assign to this instance.
    61    `use_floating_ip` must also be set to true for this to have an affect.
    62  
    63  * `floating_ip_pool` (string) - The name of the floating IP pool to use
    64    to allocate a floating IP. `use_floating_ip` must also be set to true
    65    for this to have an affect.
    66  
    67  * `insecure` (boolean) - Whether or not the connection to OpenStack can be done
    68    over an insecure connection. By default this is false.
    69  
    70  * `networks` (array of strings) - A list of networks by UUID to attach
    71    to this instance.
    72  
    73  * `openstack_provider` (string)
    74  
    75  * `project` (string) - The project name to boot the instance into. Some
    76    OpenStack installations require this.
    77    If not specified, Packer will use the environment variables
    78    `SDK_PROJECT` or `OS_TENANT_NAME` (in that order), if set.
    79  
    80  * `provider` (string) - A name of a provider that has a slightly
    81    different API model. Currently supported values are "openstack" (default),
    82    and "rackspace".
    83    If not specified, Packer will use the environment variables
    84    `SDK_PROVIDER` or `OS_AUTH_URL` (in that order), if set.
    85  
    86  * `proxy_url` (string)
    87  
    88  * `security_groups` (array of strings) - A list of security groups by name
    89    to add to this instance.
    90  
    91  * `region` (string) - The name of the region, such as "DFW", in which
    92    to launch the server to create the AMI.
    93    If not specified, Packer will use the environment variables
    94    `SDK_REGION` or `OS_REGION_NAME` (in that order), if set.
    95    For a `provider` of "rackspace", it is required to specify a region,
    96    either using this option or with an environment variable. For other
    97    providers, including a private cloud, specifying a region is optional.
    98  
    99  * `ssh_port` (integer) - The port that SSH will be available on. Defaults to port
   100    22.
   101  
   102  * `ssh_timeout` (string) - The time to wait for SSH to become available
   103    before timing out. The format of this value is a duration such as "5s"
   104    or "1m". The default SSH timeout is "5m".
   105  
   106  * `ssh_username` (string) - The username to use in order to communicate
   107    over SSH to the running server. The default is "root".
   108  
   109  * `tenant_id` (string) - Tenant ID for accessing OpenStack if your
   110    installation requires this.
   111  
   112  * `use_floating_ip` (boolean) - Whether or not to use a floating IP for
   113    the instance. Defaults to false.
   114  
   115  ## Basic Example: Rackspace public cloud
   116  
   117  Here is a basic example. This is a working example to build a
   118  Ubuntu 12.04 LTS (Precise Pangolin) on Rackspace OpenStack cloud offering.
   119  
   120  ```javascript
   121  {
   122    "type": "openstack",
   123    "username": "",
   124    "api_key": "",
   125    "openstack_provider": "rackspace",
   126    "provider": "rackspace-us",
   127    "openstack_provider":"rackspace",
   128    "region": "DFW",
   129    "ssh_username": "root",
   130    "image_name": "Test image",
   131    "source_image": "23b564c9-c3e6-49f9-bc68-86c7a9ab5018",
   132    "flavor": "2"
   133  }
   134  ```
   135  
   136  ## Basic Example: Private OpenStack cloud
   137  
   138  This example builds an Ubuntu 14.04 image on a private OpenStack cloud,
   139  powered by Metacloud.
   140  
   141  ```javascript
   142  {
   143    "type": "openstack",
   144    "ssh_username": "root",
   145    "image_name": "ubuntu1404_packer_test_1",
   146    "source_image": "91d9c168-d1e5-49ca-a775-3bfdbb6c97f1",
   147    "flavor": "2"
   148  }
   149  ```
   150  
   151  In this case, the connection information for connecting to OpenStack
   152  doesn't appear in the template. That is because I source a standard
   153  OpenStack script with environment variables set before I run this. This
   154  script is setting environment variables like:
   155  
   156  * `OS_AUTH_URL`
   157  * `OS_TENANT_ID`
   158  * `OS_USERNAME`
   159  * `OS_PASSWORD`
   160  
   161  ## Troubleshooting
   162  
   163  *I get the error "Missing or incorrect provider"*
   164  
   165  * Verify your "username", "password" and "provider" settings.
   166  
   167  *I get the error "Missing endpoint, or insufficient privileges to access endpoint"*
   168  
   169  * Verify your "region" setting.