Adding static memory config to the template.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
This commit is contained in:
parent
74cfea407d
commit
1daab4ef1a
@ -26,6 +26,7 @@ type config struct {
|
|||||||
IsoUrl string `mapstructure:"iso_url"`
|
IsoUrl string `mapstructure:"iso_url"`
|
||||||
|
|
||||||
InstanceName string `mapstructure:"instance_name"`
|
InstanceName string `mapstructure:"instance_name"`
|
||||||
|
InstanceMemory string `mapstructure:"instance_memory"`
|
||||||
RootDiskSize string `mapstructure:"root_disk_size"`
|
RootDiskSize string `mapstructure:"root_disk_size"`
|
||||||
CloneTemplate string `mapstructure:"clone_template"`
|
CloneTemplate string `mapstructure:"clone_template"`
|
||||||
IsoName string `mapstructure:"iso_name"`
|
IsoName string `mapstructure:"iso_name"`
|
||||||
@ -125,6 +126,7 @@ func (self *Builder) Prepare (raws ...interface{}) (params []string, retErr erro
|
|||||||
"host_ip": &self.config.HostIp,
|
"host_ip": &self.config.HostIp,
|
||||||
"iso_url": &self.config.IsoUrl,
|
"iso_url": &self.config.IsoUrl,
|
||||||
"instance_name": &self.config.InstanceName,
|
"instance_name": &self.config.InstanceName,
|
||||||
|
"instance_memory": &self.config.InstanceMemory,
|
||||||
"root_disk_size": &self.config.RootDiskSize,
|
"root_disk_size": &self.config.RootDiskSize,
|
||||||
"clone_template": &self.config.CloneTemplate,
|
"clone_template": &self.config.CloneTemplate,
|
||||||
"iso_name": &self.config.IsoName,
|
"iso_name": &self.config.IsoName,
|
||||||
@ -212,6 +214,10 @@ func (self *Builder) Prepare (raws ...interface{}) (params []string, retErr erro
|
|||||||
errs, errors.New("An insatnce name must be specified."))
|
errs, errors.New("An insatnce name must be specified."))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.config.InstanceMemory == "" {
|
||||||
|
self.config.InstanceMemory = "1024000000"
|
||||||
|
}
|
||||||
|
|
||||||
if self.config.RootDiskSize == "" {
|
if self.config.RootDiskSize == "" {
|
||||||
errs = packer.MultiErrorAppend(
|
errs = packer.MultiErrorAppend(
|
||||||
errs, errors.New("A root disk size must be specified."))
|
errs, errors.New("A root disk size must be specified."))
|
||||||
|
@ -39,7 +39,7 @@ func (self *stepCreateInstance) Run(state multistep.StateBag) multistep.StepActi
|
|||||||
// Clone that VM template
|
// Clone that VM template
|
||||||
instance, _ := template.Clone(config.InstanceName)
|
instance, _ := template.Clone(config.InstanceName)
|
||||||
instance.SetIsATemplate(false)
|
instance.SetIsATemplate(false)
|
||||||
instance.SetStaticMemoryRange("1024000000", "1024000000")
|
instance.SetStaticMemoryRange(config.InstanceMemory, config.InstanceMemory)
|
||||||
instance.SetPlatform(config.PlatformArgs)
|
instance.SetPlatform(config.PlatformArgs)
|
||||||
|
|
||||||
// Create VDI for the instance
|
// Create VDI for the instance
|
||||||
|
Loading…
Reference in New Issue
Block a user