Merge pull request #7862 from carlpett/proxmox-pool-support

Allow running the template VM in a Proxmox resource pool
This commit is contained in:
Adrien Delorme 2019-09-30 12:09:52 +02:00 committed by GitHub
commit a6c8440150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

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

View File

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

View File

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