Merge pull request #8935 from zaventh/feature/start-on-boot

feat(proxmox): add onboot directive support
This commit is contained in:
Megan Marsh 2020-03-23 11:21:06 -07:00 committed by GitHub
commit b81800db2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View File

@ -52,6 +52,7 @@ type Config struct {
ISOStoragePool string `mapstructure:"iso_storage_pool"`
Agent bool `mapstructure:"qemu_agent"`
SCSIController string `mapstructure:"scsi_controller"`
Onboot bool `mapstructure:"onboot"`
TemplateName string `mapstructure:"template_name"`
TemplateDescription string `mapstructure:"template_description"`

View File

@ -91,6 +91,7 @@ type FlatConfig struct {
ISOStoragePool *string `mapstructure:"iso_storage_pool" cty:"iso_storage_pool"`
Agent *bool `mapstructure:"qemu_agent" cty:"qemu_agent"`
SCSIController *string `mapstructure:"scsi_controller" cty:"scsi_controller"`
Onboot *bool `mapstructure:"onboot" cty:"onboot"`
TemplateName *string `mapstructure:"template_name" cty:"template_name"`
TemplateDescription *string `mapstructure:"template_description" cty:"template_description"`
UnmountISO *bool `mapstructure:"unmount_iso" cty:"unmount_iso"`
@ -190,6 +191,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec {
"iso_storage_pool": &hcldec.AttrSpec{Name: "iso_storage_pool", Type: cty.String, Required: false},
"qemu_agent": &hcldec.AttrSpec{Name: "qemu_agent", Type: cty.Bool, Required: false},
"scsi_controller": &hcldec.AttrSpec{Name: "scsi_controller", Type: cty.String, Required: false},
"onboot": &hcldec.AttrSpec{Name: "onboot", Type: cty.Bool, Required: false},
"template_name": &hcldec.AttrSpec{Name: "template_name", Type: cty.String, Required: false},
"template_description": &hcldec.AttrSpec{Name: "template_description", Type: cty.String, Required: false},
"unmount_iso": &hcldec.AttrSpec{Name: "unmount_iso", Type: cty.Bool, Required: false},

View File

@ -44,6 +44,7 @@ func (s *stepStartVM) Run(ctx context.Context, state multistep.StateBag) multist
QemuNetworks: generateProxmoxNetworkAdapters(c.NICs),
QemuDisks: generateProxmoxDisks(c.Disks),
Scsihw: c.SCSIController,
Onboot: c.Onboot,
}
if c.VMID == 0 {

View File

@ -181,6 +181,9 @@ builder.
- `unmount_iso` (bool) - If true, remove the mounted ISO from the template
after finishing. Defaults to `false`.
`onboot` (boolean) - Specifies whether a VM will be started during system
bootup. Defaults to `false`.
- `qemu_agent` (boolean) - Disables QEMU Agent option for this VM. When enabled,
then `qemu-guest-agent` must be installed on the guest. When disabled, then
`ssh_host` should be used. Defaults to `true`.