Allow running the template VM in a Proxmox resource pool

This commit is contained in:
Calle Pettersson 2019-07-10 22:04:10 +02:00
parent f4dca172e3
commit 8a443a7e21
3 changed files with 6 additions and 0 deletions

View File

@ -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"`

View File

@ -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 {

View File

@ -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.