github.com/StackPointCloud/packer@v0.10.2-0.20180716202532-b28098e0f79b/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  
    54  -   `triton_key_id` (string) - The fingerprint of the public key of the SSH key
    55      pair to use for authentication with the Triton Cloud API. If
    56      `triton_key_material` is not set, it is assumed that the SSH agent has the
    57      private key corresponding to this key ID loaded.
    58  
    59  -   `source_machine_image` (string) - The UUID of the image to base the new
    60      image on. Triton supports multiple types of images, called 'brands' in
    61      Triton / Joyent lingo, for contains and VM's. See the chapter [Containers
    62      and virtual machines](https://docs.joyent.com/public-cloud/instances) in the
    63      Joyent Triton documentation for detailed information. The following brands
    64      are currently supported by this builder:`joyent` and`kvm`. The choice of
    65      base image automatically decides the brand. On the Joyent public cloud a
    66      valid `source_machine_image` could for example be
    67      `70e3ae72-96b6-11e6-9056-9737fd4d0764` for version 16.3.1 of the 64bit
    68      SmartOS base image (a 'joyent' brand image). `source_machine_image_filter` can
    69      be used to populate this UUID.
    70  
    71  -   `source_machine_package` (string) - The Triton package to use while building
    72      the image. Does not affect (and does not have to be the same) as the package
    73      which will be used for a VM instance running this image. On the Joyent
    74      public cloud this could for example be `g3-standard-0.5-smartos`.
    75  
    76  -   `image_name` (string) - The name the finished image in Triton will be
    77      assigned. Maximum 512 characters but should in practice be much shorter
    78      (think between 5 and 20 characters). For example `postgresql-95-server` for
    79      an image used as a PostgreSQL 9.5 server.
    80  -   `image_version` (string) - The version string for this image. Maximum 128
    81      characters. Any string will do but a format of `Major.Minor.Patch` is
    82      strongly advised by Joyent. See [Semantic Versioning](http://semver.org/)
    83      for more information on the `Major.Minor.Patch` versioning format.
    84  
    85  ### Optional:
    86  
    87  -   `triton_url` (string) - The URL of the Triton cloud API to use. If omitted
    88      it will default to the `us-sw-1` region of the Joyent Public cloud. If
    89      you are using your own private Triton installation you will have to supply
    90      the URL of the cloud API of your own Triton installation.
    91  
    92  -   `triton_key_material` (string) - Path to the file in which the private key
    93      of `triton_key_id` is stored. For example `/home/soandso/.ssh/id_rsa`. If
    94      this is not specified, the SSH agent is used to sign requests with the
    95      `triton_key_id` specified.
    96      
    97  -   `triton_user` (string) - The username of a user who has access to your Triton
    98      account. 
    99      
   100  -   `insecure_skip_tls_verify` - (bool) This allows skipping TLS verification of 
   101      the Triton endpoint. It is useful when connecting to a temporary Triton 
   102      installation such as Cloud-On-A-Laptop which does not generally use a 
   103      certificate signed by a trusted root CA. The default is `false`.
   104  
   105  -   `source_machine_firewall_enabled` (boolean) - Whether or not the firewall of
   106      the VM used to create an image of is enabled. The Triton firewall only
   107      filters inbound traffic to the VM. All outbound traffic is always allowed.
   108      Currently this builder does not provide an interface to add specific
   109      firewall rules. Unless you have a global rule defined in Triton which allows
   110      SSH traffic enabling the firewall will interfere with the SSH provisioner.
   111      The default is `false`.
   112  -   `source_machine_metadata` (object of key/value strings) - Triton metadata
   113      applied to the VM used to create the image. Metadata can be used to pass
   114      configuration information to the VM without the need for networking. See
   115      [Using the metadata
   116      API](https://docs.joyent.com/private-cloud/instances/using-mdata) in the
   117      Joyent documentation for more information. This can for example be used to
   118      set the `user-script` metadata key to have Triton start a user supplied
   119      script after the VM has booted.
   120  -   `source_machine_name` (string) - Name of the VM used for building the image.
   121      Does not affect (and does not have to be the same) as the name for a VM
   122      instance running this image. Maximum 512 characters but should in practice
   123      be much shorter (think between 5 and 20 characters). For example
   124      `mysql-64-server-image-builder`. When omitted defaults to
   125      `packer-builder-[image_name]`.
   126  -   `source_machine_networks` (array of strings) - The UUID's of Triton networks
   127      added to the source machine used for creating the image. For example if any
   128      of the provisioners which are run need Internet access you will need to add
   129      the UUID's of the appropriate networks here. If this is not specified,
   130      instances will be placed into the default Triton public and internal
   131      networks.
   132  -   `source_machine_tags` (object of key/value strings) - Tags applied to the VM
   133      used to create the image.
   134  
   135  -   `image_acls` (array of strings) - The UUID's of the users which will have
   136      access to this image. When omitted only the owner (the Triton user whose
   137      credentials are used) will have access to the image.
   138  -   `image_description` (string) - Description of the image. Maximum 512
   139      characters.
   140  -   `image_eula_url` (string) - URL of the End User License Agreement (EULA) for
   141      the image. Maximum 128 characters.
   142  -   `image_homepage` (string) - URL of the homepage where users can find
   143      information about the image. Maximum 128 characters.
   144  -   `image_tags` (object of key/value strings) - Tag applied to the image.
   145  
   146  -   `source_machine_image_filter` (object) - Filters used to populate the `source_machine_image` field.
   147      Example:
   148  
   149      ``` json
   150      {
   151        "source_machine_image_filter": {
   152          "name": "ubuntu-16.04",
   153          "type": "lx-dataset",
   154          "most_recent": true
   155        }
   156      }
   157      ```
   158  
   159  ## Basic Example
   160  
   161  Below is a minimal example to create an image on the Joyent public
   162  cloud:
   163  
   164  ``` json
   165  {
   166    "builders": [
   167      {
   168        "type": "triton",
   169  
   170        "triton_account": "triton_username",
   171        "triton_key_id": "6b:95:03:3d:d3:6e:52:69:01:96:1a:46:4a:8d:c1:7e",
   172  
   173        "source_machine_name": "image-builder",
   174        "source_machine_package": "g4-highcpu-128M",
   175        "source_machine_image_filter": {
   176          "name": "ubuntu-16.04",
   177          "type": "lx-dataset",
   178          "most_recent": "true"
   179        },
   180  
   181        "ssh_username": "root",
   182  
   183        "image_name": "my_new_image",
   184        "image_version": "1.0.0"
   185      }
   186    ]
   187  }
   188  ```
   189  
   190  In the above example the SSH key used for `triton_key_material` (connecting to
   191  the Cloud API) and the `ssh_private_key_file` (connecting to the VM once it has
   192  started) are the same. This is because Triton automatically configures the root
   193  users to be able to login via SSH with the same key used to create the VM via
   194  the Cloud API. In more advanced scenarios for example when using a
   195  `source_machine_image` one might use different credentials.
   196  
   197  Available `triton_key_id`, `source_machine_package`, `source_machine_image`, and
   198  `source_machine_networks` can be found by using the following
   199  [Triton CLI](https://docs.joyent.com/public-cloud/api-access/cloudapi)
   200  commands: `triton key list`, `triton package list`, `triton image list`, and
   201  `triton network list` respectively.