Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Add possibility to specify a resource pool #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ Add ```"remove_floppy": "true", "remove_ethernet": "true", "remove_optical_drive

NOTE: This makes the ```"vm_network": "vmware_network_name"``` parameter optional.

### Specifying a Resource Pool when Uploading to Vsphere

Add ```"resource_pool": "my_pool"``` to the post-processor config in your packer template. If not specified, the default Resource Pool will be used.
3 changes: 2 additions & 1 deletion post-processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Config struct {
RemoveFloppy string `mapstructure:"remove_floppy"`
RemoveOpticalDrive string `mapstructure:"remove_optical_drive"`
VirtualHardwareVer string `mapstructure:"virtual_hardware_version"`
ResourcePool string `mapstructure:"resource_pool"`
ctx interpolate.Context
}

Expand Down Expand Up @@ -397,7 +398,7 @@ func doRegistration(ui packer.Ui, config Config, vmx string, clonerequired bool)
return err
}

resourcePool, err := finder.DefaultResourcePool(context.TODO())
resourcePool, err := finder.ResourcePoolOrDefault(context.TODO(), config.ResourcePool)

if err != nil {
return err
Expand Down