github.com/mmcquillan/packer@v1.1.1-0.20171009221028-c85cf0483a5d/website/source/docs/builders/triton.html.md (about)

     1  ---
     2  description: |
     3      The triton Packer builder is able to create new images for use with Triton.
     4      These images can be used with both the Joyent public cloud (which is powered
     5      by Triton) as well with private Triton installations. This builder uses the
     6      Triton Cloud API to create images.
     7  layout: docs
     8  page_title: 'Triton - Builders'
     9  sidebar_current: 'docs-builders-triton'
    10  ---
    11  
    12  # Triton Builder
    13  
    14  Type: `triton`
    15  
    16  The `triton` Packer builder is able to create new images for use with Triton.
    17  These images can be used with both the [Joyent public
    18  cloud](https://www.joyent.com/) (which is powered by Triton) as well with
    19  private [Triton](https://github.com/joyent/triton) installations.
    20  
    21  This builder uses the Triton Cloud API to create these images. Triton also
    22  supports the Docker API however this builder does *not*. If you want to create
    23  Docker images on Triton you should use the Packer Docker builder.
    24  
    25  The builder creates and launches a temporary VM based on a specified source
    26  image, runs any provisioning necessary, uses the Triton "VM to image"
    27  functionality to create a reusable image and finally destroys the temporary VM.
    28  This reusable image can then be used to launch new machines.
    29  
    30  The builder does *not* manage images. Once it creates an image, it is up to you
    31  to use it or delete it.
    32  
    33  ~> **Private installations of Triton must have custom images enabled!** To use
    34  the Triton builder with a private/on-prem installation of Joyent's Triton
    35  software, you'll need an operator to manually
    36  [enable custom images](https://docs.joyent.com/private-cloud/install/image-management)
    37  after installing Triton. This is not a requirement for Joyent's public cloud
    38  offering of Triton.
    39  
    40  ## Configuration Reference
    41  
    42  There are many configuration options available for the builder. They are
    43  segmented below into two categories: required and optional parameters.
    44  
    45  In addition to the options listed here, a
    46  [communicator](/docs/templates/communicator.html) can be configured for this
    47  builder.
    48  
    49  ### Required:
    50  
    51  -   `triton_account` (string) - The username of the Triton account to use when
    52      using the Triton Cloud API.
    53  -   `triton_key_id` (string) - The fingerprint of the public key of the SSH key
    54      pair to use for authentication with the Triton Cloud API. If
    55      `triton_key_material` is not set, it is assumed that the SSH agent has the
    56      private key corresponding to this key ID loaded.
    57  
    58  -   `source_machine_image` (string) - The UUID of the image to base the new
    59      image on. Triton supports multiple types of images, called 'brands' in
    60      Triton / Joyent lingo, for contains and VM's. See the chapter [Containers
    61      and virtual machines](https://docs.joyent.com/public-cloud/instances) in the
    62      Joyent Triton documentation for detailed information. The following brands
    63      are currently supported by this builder:`joyent` and`kvm`. The choice of
    64      base image automatically decides the brand. On the Joyent public cloud a
    65      valid `source_machine_image` could for example be
    66      `70e3ae72-96b6-11e6-9056-9737fd4d0764` for version 16.3.1 of the 64bit
    67      SmartOS base image (a 'joyent' brand image).
    68  
    69  -   `source_machine_package` (string) - The Triton package to use while building
    70      the image. Does not affect (and does not have to be the same) as the package
    71      which will be used for a VM instance running this image. On the Joyent
    72      public cloud this could for example be `g3-standard-0.5-smartos`.
    73  
    74  -   `image_name` (string) - The name the finished image in Triton will be
    75      assigned. Maximum 512 characters but should in practice be much shorter
    76      (think between 5 and 20 characters). For example `postgresql-95-server` for
    77      an image used as a PostgreSQL 9.5 server.
    78  -   `image_version` (string) - The version string for this image. Maximum 128
    79      characters. Any string will do but a format of `Major.Minor.Patch` is
    80      strongly advised by Joyent. See [Semantic Versioning](http://semver.org/)
    81      for more information on the `Major.Minor.Patch` versioning format.
    82  
    83  ### Optional:
    84  
    85  -   `triton_url` (string) - The URL of the Triton cloud API to use. If omitted
    86      it will default to the `us-sw-1` region of the Joyent Public cloud. If
    87      you are using your own private Triton installation you will have to supply
    88      the URL of the cloud API of your own Triton installation.
    89  
    90  -   `triton_key_material` (string) - Path to the file in which the private key
    91      of `triton_key_id` is stored. For example `/home/soandso/.ssh/id_rsa`. If
    92      this is not specified, the SSH agent is used to sign requests with the
    93      `triton_key_id` specified.
    94  
    95  -   `source_machine_firewall_enabled` (boolean) - Whether or not the firewall of
    96      the VM used to create an image of is enabled. The Triton firewall only
    97      filters inbound traffic to the VM. All outbound traffic is always allowed.
    98      Currently this builder does not provide an interface to add specific
    99      firewall rules. Unless you have a global rule defined in Triton which allows
   100      SSH traffic enabling the firewall will interfere with the SSH provisioner.
   101      The default is `false`.
   102  -   `source_machine_metadata` (object of key/value strings) - Triton metadata
   103      applied to the VM used to create the image. Metadata can be used to pass
   104      configuration information to the VM without the need for networking. See
   105      [Using the metadata
   106      API](https://docs.joyent.com/private-cloud/instances/using-mdata) in the
   107      Joyent documentation for more information. This can for example be used to
   108      set the `user-script` metadata key to have Triton start a user supplied
   109      script after the VM has booted.
   110  -   `source_machine_name` (string) - Name of the VM used for building the image.
   111      Does not affect (and does not have to be the same) as the name for a VM
   112      instance running this image. Maximum 512 characters but should in practice
   113      be much shorter (think between 5 and 20 characters). For example
   114      `mysql-64-server-image-builder`. When omitted defaults to
   115      `packer-builder-[image_name]`.
   116  -   `source_machine_networks` (array of strings) - The UUID's of Triton networks
   117      added to the source machine used for creating the image. For example if any
   118      of the provisioners which are run need Internet access you will need to add
   119      the UUID's of the appropriate networks here. If this is not specified,
   120      instances will be placed into the default Triton public and internal
   121      networks.
   122  -   `source_machine_tags` (object of key/value strings) - Tags applied to the VM
   123      used to create the image.
   124  
   125  -   `image_acls` (array of strings) - The UUID's of the users which will have
   126      access to this image. When omitted only the owner (the Triton user whose
   127      credentials are used) will have access to the image.
   128  -   `image_description` (string) - Description of the image. Maximum 512
   129      characters.
   130  -   `image_eula_url` (string) - URL of the End User License Agreement (EULA) for
   131      the image. Maximum 128 characters.
   132  -   `image_homepage` (string) - URL of the homepage where users can find
   133      information about the image. Maximum 128 characters.
   134  -   `image_tags` (object of key/value strings) - Tag applied to the image.
   135  
   136  ## Basic Example
   137  
   138  Below is a minimal example to create an joyent-brand image on the Joyent public
   139  cloud:
   140  
   141  ``` json
   142  {
   143    "builders": [
   144      {
   145        "type": "triton",
   146  
   147        "triton_account": "triton_username",
   148        "triton_key_id": "6b:95:03:3d:d3:6e:52:69:01:96:1a:46:4a:8d:c1:7e",
   149  
   150        "source_machine_name": "image-builder",
   151        "source_machine_package": "g4-highcpu-128M",
   152        "source_machine_image": "f6acf198-2037-11e7-8863-8fdd4ce58b6a",
   153  
   154        "ssh_username": "root",
   155  
   156        "image_name": "my_new_image",
   157        "image_version": "1.0.0"
   158      }
   159    ]
   160  }
   161  ```
   162  
   163  In the above example the SSH key used for `triton_key_material` (connecting to
   164  the Cloud API) and the `ssh_private_key_file` (connecting to the VM once it has
   165  started) are the same. This is because Triton automatically configures the root
   166  users to be able to login via SSH with the same key used to create the VM via
   167  the Cloud API. In more advanced scenarios for example when using a
   168  `source_machine_image` one might use different credentials.
   169  
   170  Available `triton_key_id`, `source_machine_package`, `source_machine_image`, and
   171  `source_machine_networks` can be found by using the following
   172  [Triton CLI](https://docs.joyent.com/public-cloud/api-access/cloudapi)
   173  commands: `triton key list`, `triton package list`, `triton image list`, and
   174  `triton network list` respectively.