Comments (4)
I suspect that the system which you are initializing the build on has >1 network interface, of which one is disconnected / not disabled is being selected for binding.
Unfortunately, I've not had much luck using http_bind_address or http_ip with the vsphere-iso
Packer provisioner.
Ryan
from packer-examples-for-vsphere.
I'm assuming that the host from which you are running the Packer builds is not the same network on which the images are being built. Based on the information provided I suspect that the IP is not being reported back or not routable back to the Packer host.
Today, I verified that the examples for Ubuntu work as expected by cloning the repo and only changing the vsphere.pkrvars.hcl
file with my testbed vSphere settings and by running it on an L3 routable network. (I already das the .iso
files.)
You can see below that Packer initializes the HTTP server on http://172.16.11.254:8257/
...
Building a Ubuntu Sever 20.04 LTS Template for VMware vSphere ...
Applying the HashiCorp Packer Build ...
vsphere-iso.linux-ubuntu-server: output will be in this color.
==> vsphere-iso.linux-ubuntu-server: Creating VM...
==> vsphere-iso.linux-ubuntu-server: Customizing hardware...
==> vsphere-iso.linux-ubuntu-server: Adding SATA controller...
==> vsphere-iso.linux-ubuntu-server: Mounting ISO images...
==> vsphere-iso.linux-ubuntu-server: Adding configuration parameters...
==> vsphere-iso.linux-ubuntu-server: Starting HTTP server on port 8257
==> vsphere-iso.linux-ubuntu-server: Set boot order...
==> vsphere-iso.linux-ubuntu-server: Power on VM...
==> vsphere-iso.linux-ubuntu-server: Waiting 5s for boot...
==> vsphere-iso.linux-ubuntu-server: HTTP server is working at http://172.16.11.254:8257/
==> vsphere-iso.linux-ubuntu-server: Typing boot command...
And then the machine comes online via DHCP with the IP of 172.16.14.191
...
==> vsphere-iso.linux-ubuntu-server: Waiting for IP...
==> vsphere-iso.linux-ubuntu-server: IP address: 172.16.14.191
==> vsphere-iso.linux-ubuntu-server: Using SSH communicator to connect: 172.16.14.191
==> vsphere-iso.linux-ubuntu-server: Waiting for SSH to become available...
And then connects via SSH with the build_username
and build_password
...
==> vsphere-iso.linux-ubuntu-server: Connected to SSH!
==> vsphere-iso.linux-ubuntu-server: Uploading ../../../keys/id_ecdsa.pub => /tmp/id_ecdsa.pub
vsphere-iso.linux-ubuntu-server: id_ecdsa.pub 269 B / 269 B [==============================================================] 100.00%
I recommend ensuring that the host running Packer is accessible from your DHCP range.
Ryan
from packer-examples-for-vsphere.
Thanks for your investigation !
Indeed !!! since you posted your log, i noticed your line
==> vsphere-iso.linux-ubuntu-server: HTTP server is working at http://172.16.11.254:8257/
compared to my line
==> vsphere-iso.linux-ubuntu-server: HTTP server is working at http://169.254.103.4:8954/
aha !!! 169.254.x.x Automatic Private IP address !!!
So I made a vm in the targeting subnet and run packer again from the target subnet, HTTP server works in the target network
==> vsphere-iso.linux-<sensitive>-server: HTTP server is working at http://10.10.110.253:8679/
==> vsphere-iso.linux-<sensitive>-server: Typing boot command...
==> vsphere-iso.linux-<sensitive>-server: Waiting for IP...
==> vsphere-iso.linux-<sensitive>-server: IP address: 10.10.110.242
==> vsphere-iso.linux-<sensitive>-server: Using SSH communicator to connect: 10.10.110.242
Everything start working, Nice work !
But it brings me another question, why the http server got an auto private ip address? I can't setup a machine in the target subnet each time I run packer.
I couldn't find the doc for how that http server works with packer? do you mind if you can link me a reference? I want to understand that part.
Thanks
from packer-examples-for-vsphere.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
from packer-examples-for-vsphere.
Related Issues (20)
- Photon Build Failures HOT 8
- Server 2016 Needs HOT 3
- can't mount centos 7 iso HOT 3
- Not able to create Rhel-8 Image its getting timed out after IP allocation HOT 2
- PowerShell provisioner error on Windows 10 and 11 HOT 1
- Add Fedora Server Linux distribution HOT 7
- Add Amazon Linux distribution HOT 3
- Add Ubuntu Server 24.04 LTS HOT 1
- can't find product key from Unattended file HOT 1
- Windows 11 and 10 Evaluation builds fail to start HOT 3
- Ansible gather problem with Fedora 40 HOT 6
- Windows Server 2022 Failed to read ProducKey from unattend file HOT 2
- Windows Server 2025 wrong variables HOT 4
- WinRMOperationTimeoutError
- Correct a typo in builds/linux/ubuntu/24-04-lts/data/user-data.pkrtpl.hc HOT 1
- Add variable validation for build user case and length HOT 6
- WinRM Operation Timeout HOT 2
- Debian 12 instalation halts with the message that no network mirror was selected, and then fails if manually advanced. HOT 5
- Syntax error in one of the Linux ansible playbook HOT 4
- develop: Error ansible with RHEL 9.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer-examples-for-vsphere.