Code Monkey home page Code Monkey logo

Comments (4)

tenthirtyam avatar tenthirtyam commented on May 31, 2024 1

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.

tenthirtyam avatar tenthirtyam commented on May 31, 2024

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.

akatukiyou avatar akatukiyou commented on May 31, 2024

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.

github-actions avatar github-actions commented on May 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.