Commit e38ff2f8 authored by Ross Smith II's avatar Ross Smith II

Merge pull request #1021 from laggyluke/master

builder/amazon: configurable virtualization type
parents 55016b88 fc6e8c08
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
type AMIConfig struct { type AMIConfig struct {
AMIName string `mapstructure:"ami_name"` AMIName string `mapstructure:"ami_name"`
AMIDescription string `mapstructure:"ami_description"` AMIDescription string `mapstructure:"ami_description"`
AMIVirtType string `mapstructure:"ami_virtualization_type"`
AMIUsers []string `mapstructure:"ami_users"` AMIUsers []string `mapstructure:"ami_users"`
AMIGroups []string `mapstructure:"ami_groups"` AMIGroups []string `mapstructure:"ami_groups"`
AMIProductCodes []string `mapstructure:"ami_product_codes"` AMIProductCodes []string `mapstructure:"ami_product_codes"`
...@@ -29,6 +30,7 @@ func (c *AMIConfig) Prepare(t *packer.ConfigTemplate) []error { ...@@ -29,6 +30,7 @@ func (c *AMIConfig) Prepare(t *packer.ConfigTemplate) []error {
templates := map[string]*string{ templates := map[string]*string{
"ami_name": &c.AMIName, "ami_name": &c.AMIName,
"ami_description": &c.AMIDescription, "ami_description": &c.AMIDescription,
"ami_virtualization_type": &c.AMIVirtType,
} }
errs := make([]error, 0) errs := make([]error, 0)
......
...@@ -21,6 +21,7 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction { ...@@ -21,6 +21,7 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction {
ImageLocation: manifestPath, ImageLocation: manifestPath,
Name: config.AMIName, Name: config.AMIName,
BlockDevices: config.BlockDevices.BuildAMIDevices(), BlockDevices: config.BlockDevices.BuildAMIDevices(),
VirtType: config.AMIVirtType,
} }
registerResp, err := ec2conn.RegisterImage(registerOpts) registerResp, err := ec2conn.RegisterImage(registerOpts)
......
...@@ -78,6 +78,10 @@ Required: ...@@ -78,6 +78,10 @@ Required:
Optional: Optional:
* `ami_virtualization_type` (string) - The type of virtualization for the AMI
you are building. This option is required to register HVM images. Can be
"paravirtual" (default) or "hvm".
* `ami_description` (string) - The description to set for the resulting * `ami_description` (string) - The description to set for the resulting
AMI(s). By default this description is empty. AMI(s). By default this description is empty.
...@@ -115,7 +119,7 @@ Optional: ...@@ -115,7 +119,7 @@ Optional:
defaults to "{{.Command}}". This may be useful to set if you want to set defaults to "{{.Command}}". This may be useful to set if you want to set
environmental variables or perhaps run it with `sudo` or so on. This is a environmental variables or perhaps run it with `sudo` or so on. This is a
configuration template where the `.Command` variable is replaced with the configuration template where the `.Command` variable is replaced with the
command to be run.. command to be run.
* `mount_path` (string) - The path where the volume will be mounted. This is * `mount_path` (string) - The path where the volume will be mounted. This is
where the chroot environment will be. This defaults to where the chroot environment will be. This defaults to
......
...@@ -64,6 +64,10 @@ Optional: ...@@ -64,6 +64,10 @@ Optional:
"volume\_type" (string), "volume\_size" (int), "delete\_on\_termination" "volume\_type" (string), "volume\_size" (int), "delete\_on\_termination"
(bool), "no\_device" (bool), and "iops" (int). (bool), "no\_device" (bool), and "iops" (int).
* `ami_virtualization_type` (string) - The type of virtualization for the AMI
you are building. This option is required to register HVM images. Can be
"paravirtual" (default) or "hvm".
* `ami_description` (string) - The description to set for the resulting * `ami_description` (string) - The description to set for the resulting
AMI(s). By default this description is empty. AMI(s). By default this description is empty.
......
...@@ -87,6 +87,10 @@ Optional: ...@@ -87,6 +87,10 @@ Optional:
(bool), "no\_device" (bool), and "iops" (int). (bool), "no\_device" (bool), and "iops" (int).
See [amazon-ebs](/docs/builders/amazon-ebs.html) for an example template. See [amazon-ebs](/docs/builders/amazon-ebs.html) for an example template.
* `ami_virtualization_type` (string) - The type of virtualization for the AMI
you are building. This option is required to register HVM images. Can be
"paravirtual" (default) or "hvm".
* `ami_description` (string) - The description to set for the resulting * `ami_description` (string) - The description to set for the resulting
AMI(s). By default this description is empty. AMI(s). By default this description is empty.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment