generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 106
Labels
bugBugBugbuilder/vsphere-isoBuilder: vsphere-isoBuilder: vsphere-isocrashCrashCrashstage/awaiting-replyStage: Awaiting ReplyStage: Awaiting Reply
Milestone
Description
Upstream Issue Draft: packer-plugin-vsphere Resource Pool Path/Panic
Title
vsphere-iso: resource pool path handling can panic or fail with malformed lookup path
Repository
hashicorp/packer-plugin-vsphere
Version/Environment
- Packer:
1.15.0 - Plugin:
github.com/hashicorp/vsphere2.1.1 - vCenter:
7.0.3 - Builder:
vsphere-iso
Problem Summary
When resource_pool is provided as a full inventory path (or contains slashes), pool lookup can be malformed and later fail/panic at VM create.
Observed symptoms:
- malformed path shape in logs like:
vSAN Cluster 1/Resources//Datacenter /host/vSAN 1/vSAN Cluster 1/Resources
- failure around
Creating virtual machine... - in some runs: plugin crash /
unexpected EOF
Repro (high level)
- Configure
vsphere-isowithresource_poolset to absolute inventory path:/Datacenter/host/vSAN 1/vSAN Cluster 1/Resources
- Run
packer build. - Observe failure in resource pool resolution / VM create phase.
Expected
resource_pool handling should:
- accept absolute inventory paths as-is
- accept slash-containing paths as-is
- only prefix relative pool names with
<cluster>/Resources/... - fail with explicit error if default pool cannot be resolved
- avoid nil pool flow that can cascade into panic
Suggested Fix Area
builder/vsphere/driver/resource_pool.go- function
FindResourcePool(...)
Suggested Logic
TrimSpaceon input.- If empty:
- try
<cluster>/Resources - fallback
DefaultResourcePool - return explicit error if unresolved.
- try
- If starts with
/: resolve as absolute path (with trimmed fallback). - If contains
/: resolve directly as provided path. - Else: treat as relative name under
<cluster>/Resources/<name>. - Guard against
nilpool before returning.
Patch Validation
After patch:
- no malformed doubled-path behavior
- no panic at create phase from nil/invalid pool resolution
- run advances to:
Creating virtual machine...Powering on virtual machine...Typing boot command...
Additional Note
If build later fails at timeout waiting for IP, that is guest installer/network/tools path, not this resource-pool resolution bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBugBugbuilder/vsphere-isoBuilder: vsphere-isoBuilder: vsphere-isocrashCrashCrashstage/awaiting-replyStage: Awaiting ReplyStage: Awaiting Reply