Support nested VM folders
This commit is contained in:
parent
17f7a973d6
commit
de58c87878
|
@ -2,4 +2,6 @@
|
|||
.glide/
|
||||
vendor/
|
||||
packer-builder-vsphere
|
||||
packer-builder-vsphere.exe
|
||||
bin/
|
||||
test*.json
|
||||
|
|
|
@ -85,7 +85,7 @@ Post-processing:
|
|||
"password": "{{user `vsphere_password`}}",
|
||||
|
||||
"template": "ubuntu",
|
||||
"folder_name": "folder",
|
||||
"folder_name": "folder1/folder2",
|
||||
"vm_name": "vm-1",
|
||||
"host": "esxi-1.domain.com",
|
||||
"resource_pool": "pool1/pool2",
|
||||
|
|
|
@ -36,7 +36,7 @@ func (s *StepCloneVM) Run(state multistep.StateBag) multistep.StepAction {
|
|||
ui.Say("start cloning...")
|
||||
|
||||
// Get folder
|
||||
folder, err := finder.FolderOrDefault(ctx, s.config.FolderName)
|
||||
folder, err := finder.FolderOrDefault(ctx, fmt.Sprintf("/%v/vm/%v", dc.Name(), s.config.FolderName))
|
||||
if err != nil {
|
||||
state.Put("error", err)
|
||||
return multistep.ActionHalt
|
||||
|
|
Loading…
Reference in New Issue