diff --git a/builder/proxmox/config.go b/builder/proxmox/config.go index e84d81d2c..6889c8c07 100644 --- a/builder/proxmox/config.go +++ b/builder/proxmox/config.go @@ -32,6 +32,7 @@ type Config struct { Username string `mapstructure:"username"` Password string `mapstructure:"password"` Node string `mapstructure:"node"` + Pool string `mapstructure:"pool"` VMName string `mapstructure:"vm_name"` VMID int `mapstructure:"vm_id"` diff --git a/builder/proxmox/step_start_vm.go b/builder/proxmox/step_start_vm.go index 82358efb2..76663b33f 100644 --- a/builder/proxmox/step_start_vm.go +++ b/builder/proxmox/step_start_vm.go @@ -62,6 +62,9 @@ func (s *stepStartVM) Run(ctx context.Context, state multistep.StateBag) multist } vmRef := proxmox.NewVmRef(c.VMID) vmRef.SetNode(c.Node) + if c.Pool != "" { + vmRef.SetPool(c.Pool) + } err := config.CreateVm(vmRef, client) if err != nil { diff --git a/website/source/docs/builders/proxmox.html.md b/website/source/docs/builders/proxmox.html.md index e97279a73..ca7c99ea3 100644 --- a/website/source/docs/builders/proxmox.html.md +++ b/website/source/docs/builders/proxmox.html.md @@ -55,6 +55,8 @@ builder. ### Optional: - `insecure_skip_tls_verify` (bool) - Skip validating the certificate. +- `pool` (string) - Name of resource pool to create virtual machine in. + - `vm_name` (string) - Name of the virtual machine during creation. If not given, a random uuid will be used.