github.com/rahart/packer@v0.12.2-0.20161229105310-282bb6ad370f/website/source/docs/builders/cloudstack.html.md (about) 1 --- 2 description: | 3 The `cloudstack` Packer builder is able to create new templates for use with 4 CloudStack. The builder takes either an ISO or an existing template as it's 5 source, runs any provisioning necessary on the instance after launching it 6 and then creates a new template from that instance. 7 layout: docs 8 page_title: CloudStack Builder 9 ... 10 11 # CloudStack Builder 12 13 Type: `cloudstack` 14 15 The `cloudstack` Packer builder is able to create new templates for use with 16 [CloudStack](https://cloudstack.apache.org/). The builder takes either an ISO 17 or an existing template as it's source, runs any provisioning necessary on the 18 instance after launching it and then creates a new template from that instance. 19 20 The builder does *not* manage templates. Once a template is created, it is up 21 to you to use it or delete it. 22 23 ## Configuration Reference 24 25 There are many configuration options available for the builder. They are 26 segmented below into two categories: required and optional parameters. Within 27 each category, the available configuration keys are alphabetized. 28 29 In addition to the options listed here, a 30 [communicator](/docs/templates/communicator.html) can be configured for this 31 builder. 32 33 ### Required: 34 35 - `api_url` (string) - The CloudStack API endpoint we will connect to. 36 37 - `api_key` (string) - The API key used to sign all API requests. 38 39 - `cidr_list` (array) - List of CIDR's that will have access to the new 40 instance. This is needed in order for any provisioners to be able to 41 connect to the instance. Usually this will be the NAT address of your 42 current location. Only required when `use_local_ip_address` is `false`. 43 44 - `instance_name` (string) - The name of the instance. Defaults to 45 "packer-UUID" where UUID is dynamically generated. 46 47 - `network` (string) - The name or ID of the network to connect the instance 48 to. 49 50 - `secret_key` (string) - The secret key used to sign all API requests. 51 52 - `service_offering` (string) - The name or ID of the service offering used 53 for the instance. 54 55 - `soure_iso` (string) - The name or ID of an ISO that will be mounted before 56 booting the instance. This option is mutual exclusive with `source_template`. 57 58 - `source_template` (string) - The name or ID of the template used as base 59 template for the instance. This option is mutual explusive with `source_iso`. 60 61 - `template_name` (string) - The name of the new template. Defaults to 62 "packer-{{timestamp}}" where timestamp will be the current time. 63 64 - `template_display_text` (string) - The display text of the new template. 65 Defaults to the `template_name`. 66 67 - `template_os` (string) - The name or ID of the template OS for the new 68 template that will be created. 69 70 - `zone` (string) - The name or ID of the zone where the instance will be 71 created. 72 73 ### Optional: 74 75 - `async_timeout` (int) - The time duration to wait for async calls to 76 finish. Defaults to 30m. 77 78 - `disk_offering` (string) - The name or ID of the disk offering used for the 79 instance. This option is only available (and also required) when using 80 `source_iso`. 81 82 - `disk_size` (int) - The size (in GB) of the root disk of the new instance. 83 This option is only available when using `source_template`. 84 85 - `http_get_only` (boolean) - Some cloud providers only allow HTTP GET calls to 86 their CloudStack API. If using such a provider, you need to set this to `true` 87 in order for the provider to only make GET calls and no POST calls. 88 89 - `hypervisor` (string) - The target hypervisor (e.g. `XenServer`, `KVM`) for 90 the new template. This option is required when using `source_iso`. 91 92 - `keypair` (string) - The name of the SSH key pair that will be used to 93 access the instance. The SSH key pair is assumed to be already available 94 within CloudStack. 95 96 - `project` (string) - The name or ID of the project to deploy the instance to. 97 98 - `public_ip_address` (string) - The public IP address or it's ID used for 99 connecting any provisioners to. If not provided, a temporary public IP 100 address will be associated and released during the Packer run. 101 102 - `ssl_no_verify` (boolean) - Set to `true` to skip SSL verification. Defaults 103 to `false`. 104 105 - `template_featured` (boolean) - Set to `true` to indicate that the template 106 is featured. Defaults to `false`. 107 108 - `template_public` (boolean) - Set to `true` to indicate that the template is 109 available for all accounts. Defaults to `false`. 110 111 - `template_password_enabled` (boolean) - Set to `true` to indicate the template 112 should be password enabled. Defaults to `false`. 113 114 - `template_requires_hvm` (boolean) - Set to `true` to indicate the template 115 requires hardware-assisted virtualization. Defaults to `false`. 116 117 - `template_scalable` (boolean) - Set to `true` to indicate that the template 118 contains tools to support dynamic scaling of VM cpu/memory. Defaults to `false`. 119 120 - `user_data` (string) - User data to launch with the instance. 121 122 - `use_local_ip_address` (boolean) - Set to `true` to indicate that the 123 provisioners should connect to the local IP address of the instance. 124 125 ## Basic Example 126 127 Here is a basic example. 128 129 ``` {.javascript} 130 { 131 "type": "cloudstack", 132 "api_url": "https://cloudstack.company.com/client/api", 133 "api_key": "YOUR_API_KEY", 134 "secret_key": "YOUR_SECRET_KEY", 135 136 "disk_offering": "Small - 20GB", 137 "cidr_list": ["0.0.0.0/0"] 138 "hypervisor": "KVM", 139 "network": "management", 140 "service_offering": "small", 141 "source_iso": "CentOS-7.0-1406-x86_64-Minimal", 142 "zone": "NL1", 143 144 "template_name": "Centos7-x86_64-KVM-Packer", 145 "template_display_text": "Centos7-x86_64 KVM Packer", 146 "template_featured": true, 147 "template_password_enabled": true, 148 "template_scalable": true, 149 "template_os": "Other PV (64-bit)" 150 } 151 ```