Merge pull request #778 from aspring/vmware-post-processor-disk-mode
post-processor/vsphere: Add disk mode configuration to allow users to specify the desired diskMo...
This commit is contained in:
commit
b5e551d930
|
@ -20,6 +20,7 @@ type Config struct {
|
||||||
Cluster string `mapstructure:"cluster"`
|
Cluster string `mapstructure:"cluster"`
|
||||||
Datacenter string `mapstructure:"datacenter"`
|
Datacenter string `mapstructure:"datacenter"`
|
||||||
Datastore string `mapstructure:"datastore"`
|
Datastore string `mapstructure:"datastore"`
|
||||||
|
DiskMode string `mapstructure:"diskmode"`
|
||||||
Host string `mapstructure:"host"`
|
Host string `mapstructure:"host"`
|
||||||
Password string `mapstructure:"password"`
|
Password string `mapstructure:"password"`
|
||||||
ResourcePool string `mapstructure:"resource_pool"`
|
ResourcePool string `mapstructure:"resource_pool"`
|
||||||
|
@ -47,6 +48,11 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||||
}
|
}
|
||||||
p.config.tpl.UserVars = p.config.PackerUserVars
|
p.config.tpl.UserVars = p.config.PackerUserVars
|
||||||
|
|
||||||
|
// Defaults
|
||||||
|
if p.config.DiskMode == "" {
|
||||||
|
p.config.DiskMode = "thick"
|
||||||
|
}
|
||||||
|
|
||||||
// Accumulate any errors
|
// Accumulate any errors
|
||||||
errs := new(packer.MultiError)
|
errs := new(packer.MultiError)
|
||||||
|
|
||||||
|
@ -59,6 +65,7 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||||
"cluster": &p.config.Cluster,
|
"cluster": &p.config.Cluster,
|
||||||
"datacenter": &p.config.Datacenter,
|
"datacenter": &p.config.Datacenter,
|
||||||
"datastore": &p.config.Datastore,
|
"datastore": &p.config.Datastore,
|
||||||
|
"diskmode": &p.config.DiskMode,
|
||||||
"host": &p.config.Host,
|
"host": &p.config.Host,
|
||||||
"vm_network": &p.config.VMNetwork,
|
"vm_network": &p.config.VMNetwork,
|
||||||
"password": &p.config.Password,
|
"password": &p.config.Password,
|
||||||
|
@ -110,6 +117,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
|
||||||
"--acceptAllEulas",
|
"--acceptAllEulas",
|
||||||
fmt.Sprintf("--name=%s", p.config.VMName),
|
fmt.Sprintf("--name=%s", p.config.VMName),
|
||||||
fmt.Sprintf("--datastore=%s", p.config.Datastore),
|
fmt.Sprintf("--datastore=%s", p.config.Datastore),
|
||||||
|
fmt.Sprintf("--diskMode=%s", p.config.DiskMode),
|
||||||
fmt.Sprintf("--network=%s", p.config.VMNetwork),
|
fmt.Sprintf("--network=%s", p.config.VMNetwork),
|
||||||
fmt.Sprintf("--vmFolder=%s", p.config.VMFolder),
|
fmt.Sprintf("--vmFolder=%s", p.config.VMFolder),
|
||||||
fmt.Sprintf("%s", vmx),
|
fmt.Sprintf("%s", vmx),
|
||||||
|
|
Loading…
Reference in New Issue