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