/srv/irclogs.ubuntu.com/2014/11/06/#maas.txt

=== CyberJacob|Away is now known as CyberJacob
=== CyberJacob is now known as CyberJacob|Away
=== MasterPieceF is now known as MasterPiece
=== jfarschman is now known as MilesDenver
jgrasslerHello15:58
jgrasslerDoes anybody know how MAAS determines the IP address it hardwires into boot images as its iscsi server address?15:59
jgrasslerIt seems to disregard the IP address configured for maas-region-controller/maas-cluster-controller15:59
jgrasslerWhich is a bit of an issue in my case: I'm deploying MAAS in an openstack instance, and its eth0 IP address is different from its public floating IP address16:01
jtvjgrassler: that sounds pretty exciting.16:02
jtvI think the address you want is the one that we call the "MAAS URL."16:03
jtvIt's defined as the URL where cluster controllers and nodes can reach the region controller.16:03
jtvSo whenever we need to tell cluster controllers or nodes the address where they can reach the region controller, that's the address we give.16:03
jtvYou can change it through "dpkg-reconfigure maas-cluster-controller" on the cluster controller machine.16:04
jtv(Usually the cluster controller and the region controller run on the same machine.)16:04
jgrasslerYes, that's what I tried.16:04
jgrasslerAfter which I deleted the images and had maas rebuild them.16:04
jgrasslerBut they still end up with the internal IP address.16:05
jtvThat shouldn't be needed.  Unless it was changed while I was doing other things, we don't encode the address into the images.16:05
jgrasslerInteresting...how is the address communicated to the PXE booted system then?16:06
jgrasslerDoes it just use the DHCP-Server's next-address value?16:06
jtvIIRC we pass it on the kernel parameter.16:06
jtvAhem.16:06
jtvKernel command line, I mean.16:06
jtvThe next-address (next-server?  I forget) setting is only used for the PXE boot itself.16:07
jgrasslerOk, that's good to know.16:08
jtvOff the top of my head, it goes something like...  Node wakes up; goes into PXE; gets DHCP address; requests PXE config from cluster controller; PXE config netboots the node into an install image.16:09
jgrasslerSounds sensible, yes16:09
jtvI really don't recall but presumably the iscsi address is in the PXE config there somewhere.16:09
jtvAh, maybe what we pass on the kernel command line is just for rsyslog.16:10
jgrasslerAnd that's what it looked like on the serial console back when we had our MAAS controller on a hardware node, too16:10
jtvI guess you're not using MAAS as the DHCP server?16:10
jgrasslerNo, that would take some dirty, dirty hacks in that scenario :-)16:11
jtvSo you serve DHCP to nodes that are also on EC2?16:12
jgrasslerBut our hardware MAAS controller was not in charge of DHCP either16:12
jgrasslerNo, not at all16:12
jtvAh, I misread the "no."  :)16:12
jtv(My fault for asking a negative question — "no" can mean that you agree or that you disagree!)16:13
jgrasslerNo worries :-)16:13
jtvWe don't normally test in that situation, so it's quite possible to run into trouble.16:14
jgrasslerYeah, it is somewhat unusual16:14
jgrasslerBut we didn't want to keep wasting a - fairly sizeable - hardware node on serving boot images16:15
jgrasslerHmm, interesting: https://gist.github.com/jgrassler/6567ce9aee97f8d5491816:16
jgrasslerApparently the internal IP address does show up in the root images.16:17
jgrasslerNever mind. I'm to close to calling it a day for now to properly escape meta characters in my regexes :-)16:19
jgrasslerI.e. the grep triggered on this kind of thing: /boot/System.map-3.13.0-27-generic:c1020080 t cyrix_identify16:21
jtvjgrassler: the images import system _was_ recently rewritten, so I may be behind the times.  But it seems strange to me to see the IP address in there.16:21
jtvOh...16:21
jtvNow I see what you mean about the regexes.  :)16:22
jtvYeah, escaping those dots might change things.  :)16:22
jtvOr use fgrep I guess.16:22
jgrasslerAt least now I know where not to look :-)16:27
jgrasslerSo I guess I'll delve into the code then - where would I start that?16:28
jtvI think in src/maasserver/pxeconfig.py.16:28
jtvOr maybe it's src/maasserver/api/... hang on.16:28
jtvWhen the node requests its PXE config from the cluster controller, the cluster controller asks the region controller "please compose a PXE config file for this node."16:29
jtvAh: src/maasserver/api/pxeconfig.py16:29
jgrasslerOk...let's see where that ended up in the file system...16:30
jtvIn there, look for the pxeconfig function.  That's the region-controller function that ends up handling that request.16:30
jtvOh, on an installed machine:16:30
jtv/usr/lib/python2.7/dist-packages/maasserver/api/16:30
jtv(On older versions, the api subdir would not exist and you'd have to get... either pxeconfig.py or api.py.)16:31
jgrasslerThanks16:32
jgrasslerI think 1.5.4 qualifies as an older version then16:32
jtvWhoops yes it does16:32
jtvOn the bright side, fewer unfamiliar changes.  :)16:32
jgrasslerThat's something :-)16:33
jtvIt may have been /usr/lib/python2.7/dist-packages/maasserver/pxeconfig.py in that version.16:33
jgrasslerIt appears to be api.py16:33
jtvThat's a shame.  It was huge.16:33
jgrasslerIt's a bit problematic though...it's invoked from somewhere else16:34
jtvBut come to think of it... why would 1.5 not give the MAAS_URL..?16:34
jtvYes, it's invoked from the cluster controller, as part of its handling of the node's TFTP request.16:34
jgrasslerAnd "somewhere else" supplies a local parameter. Said parameter is the cluster controller's IP address.16:35
* jtv looks...16:35
jgrasslerSo apparently the cluster controller is the confused party16:35
jtvThat would be the party where the MAAS_URL is configured...16:36
jtvThe cluster controller passes the parameters through its API request.16:37
jtvThe cluster-controller code is, for hysterical raisins, in /usr/lib/python2.7/dist-packages/provisioningserver.16:37
jtvThis is where it all gets a bit hard to follow.16:38
jgrasslerFrom a quick glance it looks fairly messy, yes16:39
jgrasslerI think I'll put that bit off until tomorrow. Here in UTC+2istan it's getting to be the time where my wife calls asking why I'm not home, yet :-)16:40
jtvAh, I know that one.16:40
jtvAnyway, it comes from /etc/maas/pserv.yaml.16:40
jtvThat's where it gets the URL.16:40
jtvAnd "dpkg-reconfigure maas-cluster-controller" rewrites that bit of YAML with the URL you enter.16:40
jgrasslerOdd.16:40
jgrasslerThat file contains the public IP address.16:41
jtv@!#16:41
jtvOld instance still running for whatever reason..?16:41
jtvAnyway, run home.  :)16:41
jgrasslerNo16:41
jgrasslerI configured the packages with a preseed, no chance of that happening :-)16:41
jtvOh make sure it's a URL you see there, not just an IP address.16:42
jgrasslerYes, it's an URL16:42
jtvGrrr16:42
jtv"Have you tried turning it off and on again?"16:42
jgrasslerIt's getting to be tricky, yes...16:42
jgrasslerCountless time :-)16:42
jgrasslers/time/times/16:42
jtvNo that's fine for us binary types: zero, one, countless.16:43
jgrasslerThat box is provisioned through heat/puppet and rebuilds from scratch in ~10 minutes16:43
jgrasslerHeh16:43
jgrasslerAnd I made use of that mechanism a couple of times - to no avail16:44
jtvOops, and I have to run!16:44
jgrasslerAlright, let's run then :-)16:44
jgrasslerThanks for the help16:44
jtvnp16:44
* jtv runs16:44
=== roadmr is now known as roadmr_afk
=== jfarschman is now known as MilesDenver
=== jfarschman is now known as MilesDenver
=== CyberJacob|Away is now known as CyberJacob
=== jfarschman is now known as MilesDenver
=== CyberJacob is now known as CyberJacob|Away
=== CyberJacob|Away is now known as CyberJacob
=== roadmr_afk is now known as roadmr
=== CyberJacob is now known as CyberJacob|Away
=== CyberJacob|Away is now known as CyberJacob
=== jfarschman is now known as MilesDenver

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!