github.com/phobos182/packer@v0.2.3-0.20130819023704-c84d2aeffc68/website/source/docs/builders/digitalocean.html.markdown (about) 1 --- 2 layout: "docs" 3 --- 4 5 # DigitalOcean Builder 6 7 Type: `digitalocean` 8 9 The `digitalocean` builder is able to create new images for use with 10 [DigitalOcean](http://www.digitalocean.com). The builder takes a source 11 image, runs any provisioning necessary on the image after launching it, 12 then snapshots it into a reusable image. This reusable image can then be 13 used as the foundation of new servers that are launched within DigitalOcean. 14 15 The builder does _not_ manage images. Once it creates an image, it is up to 16 you to use it or delete it. 17 18 ## Configuration Reference 19 20 There are many configuration options available for the builder. They are 21 segmented below into two categories: required and optional parameters. Within 22 each category, the available configuration keys are alphabetized. 23 24 Required: 25 26 * `api_key` (string) - The API key to use to access your account. You can 27 retrieve this on the "API" page visible after logging into your account 28 on DigitalOcean. Alternatively, the builder looks for the environment 29 variable `DIGITALOCEAN_API_KEY`. 30 31 * `client_id` (string) - The client ID to use to access your account. You can 32 find this on the "API" page visible after logging into your account on 33 DigitalOcean. Alternatively, the builder looks for the environment 34 variable `DIGITALOCEAN_CLIENT_ID`. 35 36 Optional: 37 38 * `event_delay` (string) - The delay, as a duration string, before checking 39 the status of an event. DigitalOcean's current API has consistency issues 40 where events take time to appear after being created. This defaults to "5s" 41 and generally shouldn't have to be changed. 42 43 * `image_id` (int) - The ID of the base image to use. This is the image that 44 will be used to launch a new droplet and provision it. Defaults to "284203", 45 which happens to be "Ubuntu 12.04 x64 Server." 46 47 * `region_id` (int) - The ID of the region to launch the droplet in. Consequently, 48 this is the region where the snapshot will be available. This defaults to 49 "1", which is "New York." 50 51 * `size_id` (int) - The ID of the droplet size to use. This defaults to "66," 52 which is the 512MB droplet. 53 54 * `snapshot_name` (string) - The name of the resulting snapshot that will 55 appear in your account. This must be unique. 56 To help make this unique, use a function like `timestamp` (see 57 [configuration templates](/docs/templates/configuration-templates.html) for more info) 58 59 * `ssh_port` (int) - The port that SSH will be available on. Defaults to port 60 22. 61 62 * `ssh_timeout` (string) - The time to wait for SSH to become available 63 before timing out. The format of this value is a duration such as "5s" 64 or "5m". The default SSH timeout is "1m". 65 66 * `ssh_username` (string) - The username to use in order to communicate 67 over SSH to the running droplet. Default is "root". 68 69 * `state_timeout` (string) - The time to wait, as a duration string, 70 for a droplet to enter a desired state (such as "active") before 71 timing out. The default state timeout is "6m". 72 73 ## Basic Example 74 75 Here is a basic example. It is completely valid as soon as you enter your 76 own access tokens: 77 78 <pre class="prettyprint"> 79 { 80 "type": "digitalocean", 81 "client_id": "YOUR CLIENT ID", 82 "api_key": "YOUR API KEY" 83 } 84 </pre> 85 86 ## Finding Image, Region, and Size IDs 87 88 Unfortunately, finding a list of available values for `image_id`, `region_id`, 89 and `size_id` is not easy at the moment. Basically, it has to be done through 90 the [DigitalOcean API](https://www.digitalocean.com/api_access) using the 91 `/images`, `/regions`, and `/sizes` endpoints. You can use `curl` for this 92 or request it in your browser. 93 94 If you're comfortable installing RubyGems, [Tugboat](https://github.com/pearkes/tugboat) 95 is a fantastic DigitalOcean command-line client that has commands to 96 find the available images, regions, and sizes. For example, to see all the 97 global images, you can run `tugboat images --global`.