Merge pull request #7862 from carlpett/proxmox-pool-support
Allow running the template VM in a Proxmox resource pool
This commit is contained in:
commit
a6c8440150
|
@ -32,6 +32,7 @@ type Config struct {
|
||||||
Username string `mapstructure:"username"`
|
Username string `mapstructure:"username"`
|
||||||
Password string `mapstructure:"password"`
|
Password string `mapstructure:"password"`
|
||||||
Node string `mapstructure:"node"`
|
Node string `mapstructure:"node"`
|
||||||
|
Pool string `mapstructure:"pool"`
|
||||||
|
|
||||||
VMName string `mapstructure:"vm_name"`
|
VMName string `mapstructure:"vm_name"`
|
||||||
VMID int `mapstructure:"vm_id"`
|
VMID int `mapstructure:"vm_id"`
|
||||||
|
|
|
@ -62,6 +62,9 @@ func (s *stepStartVM) Run(ctx context.Context, state multistep.StateBag) multist
|
||||||
}
|
}
|
||||||
vmRef := proxmox.NewVmRef(c.VMID)
|
vmRef := proxmox.NewVmRef(c.VMID)
|
||||||
vmRef.SetNode(c.Node)
|
vmRef.SetNode(c.Node)
|
||||||
|
if c.Pool != "" {
|
||||||
|
vmRef.SetPool(c.Pool)
|
||||||
|
}
|
||||||
|
|
||||||
err := config.CreateVm(vmRef, client)
|
err := config.CreateVm(vmRef, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -55,6 +55,8 @@ builder.
|
||||||
### Optional:
|
### Optional:
|
||||||
- `insecure_skip_tls_verify` (bool) - Skip validating the certificate.
|
- `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
|
- `vm_name` (string) - Name of the virtual machine during creation. If not
|
||||||
given, a random uuid will be used.
|
given, a random uuid will be used.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue