BSDPY Help Needed

Philsto
New Contributor II

I know this is kind of off topic, even through I see an increasing footprint of folks working with BSDPY here...

If there is a better forum to post, please let me know and I will post there, not seeing a lot, but maybe I missed something.

We're running a test instance of BSDPY to tie into our casper infrastructure on a VM using CentOS 7. VM is not in our netboot subnet, so we are using IP helper tables.

So far so good, netboot instance shows up in sys prefs, but no boot love. Here are the abbreviated logs below, and it seems strange to me that the IP is defined at 127.0.0.1, so I'm wondering if that might be the issue?

  • /usr/bin/env python /bsdpy/bsdpserver.py 01/15/2016 04:16:42 PM - DEBUG: Return ACK[LIST] to 0:3e:e1:bf:2b:fc - xxx.xxx.xxx.xxx on port 616 01/15/2016 04:16:42 PM - DEBUG: Default boot image ID: [129, 0, 3, 200] 01/15/2016 04:16:59 PM - DEBUG: -=========================================- 01/15/2016 04:16:59 PM - DEBUG: Got BSDP INFORM[LIST] packet: 01/15/2016 04:16:59 PM - DEBUG: Using provided clientip 10.42.91.11 01/15/2016 04:16:59 PM - DEBUG: Determining image list for system ID MacPro6,1 01/15/2016 04:16:59 PM - DEBUG: Found enabled system ID MacPro6,1 - adding "10.10.4 Image" to list 01/15/2016 04:16:59 PM - DEBUG: -=========================================- 01/15/2016 04:16:59 PM - DEBUG: Return ACK[LIST] to 0:3e:e1:bf:2b:fc - 10.42.91.11 on port 616 01/15/2016 04:16:59 PM - DEBUG: Default boot image ID: [129, 0, 3, 200] 01/15/2016 04:24:41 PM - DEBUG: ------- Start Docker env vars ------- 01/15/2016 04:24:41 PM - DEBUG: BSDPY_IFACE: eth0 01/15/2016 04:24:41 PM - DEBUG: BSDPY_PROTO: http 01/15/2016 04:24:41 PM - DEBUG: BSDPY_IP: 127.0.0.1 01/15/2016 04:24:41 PM - DEBUG: ------- End Docker env vars ------- 01/15/2016 04:24:41 PM - DEBUG: tftprootpath is /nbi 01/15/2016 04:24:41 PM - INFO: Server priority: [114, 209] 01/15/2016 04:24:41 PM - DEBUG: Found $BSDPY_IP - using custom external IP 127.0.0.1 01/15/2016 04:24:41 PM - DEBUG: Using HTTP basedmgpath http://127.0.0.1/ 01/15/2016 04:24:41 PM - INFO: Server IP: 127.0.0.1 01/15/2016 04:24:41 PM - INFO: Server FQDN: 127.0.0.1 01/15/2016 04:24:41 PM - INFO: Serving on eth0 01/15/2016 04:24:41 PM - INFO: Using http to serve boot image 01/15/2016 04:24:41 PM - DEBUG:
5 REPLIES 5

Bruienne
New Contributor II

Hi Phil, it looks like BSDPy was started with the default IP assignment, localhost or 127.0.0.1 as you noted. First make sure that you are providing BSDPy with the correct network interface to listen on (default is eth0) by using the -i flag: python bsdpserver.py -i <interface>

If the interface is correct you'll want to make sure to provide the IP of the host BSDPy is running on so that clients will contact it for later steps like TFTP and HTTP/NFS.

When running BSDPy as a Docker container you would pass -e BSDPY_IP=<your host external IP> at run time for example.

If you're not using Docker you can also pass the variable at runtime like this:

$ BSDPY_IP=<your host external IP> python bsdpserver.py

or you can set it globally with export:

$ export BSDPY_IP=<your host external IP>
$ python bsdpserver.py -i <interface>

BSDPy will note it is using your provided IP at startup as well.

Philsto
New Contributor II

Hey @Bruienne Thanks for the response. Looks like I have not assigned the correct network interface, as you surmised. We are using Docker.

I'm a python newbie, I'm afraid, running:

python bsdpserver.py -i <interface>

and, after replacing with correct interface, getting output:

python: can't open file 'bsdpserver.py': [Errno 2] No such file or directory

Philsto
New Contributor II

BTW, did a find, and ran the following as well, with no results:

sudo python /var/lib/docker/devicemapper/mnt/7d987eacc0849f77f2d7f6f8892f714c4e22aaf47306e48753b11d09c7951165/rootfs/bsdpy/bsdpserver.py -i eno16780032

output

bsdpy/bsdpserver.py", line 72, in <module> from docopt import docopt
ImportError: No module named docopt

Bruienne
New Contributor II

You can ignore my directions for running it directly with Python, I wanted to give the procedure for both Docker and non-Docker methods. To run with Docker you'll want to append either one of the following extra flags to your docker run command: -e BSDPY_IP=<external IP> or -e BSDPY_IFACE=<interface>

The former will directly set the IP to use for replying to clients, while the latter will retrieve the IP of the given interface and send that to clients. It is not necessary to use both, clearly BSDPY_IP is the more direct method.

As part of an example complete Docker run statement for both options:

$ docker run -d -e BSDPY_IP=1.2.3.4 --name bsdpy (...) bruienne/bsdpy:1.0 # Direct IP
$ docker run -d -e BSDPY_IFACE=eth0 --name bsdpy (...) bruienne/bsdpy:1.0 # Get IP from interface

Philsto
New Contributor II

Great, thanks for the info, I'll check it out.