Why does the AMT power type ask me to type in a MAC address?

Bug #1382258 reported by Christian Reis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Newell Jensen

Bug Description

The AMT power template asks me for a MAC address. But isn't AMT by definition always on the same MAC as the main host interface? If so, we could fill out the MAC address automatically, and even try to guess what the IP address was based on the ARP table.

Tags: amt power ui

Related branches

Revision history for this message
Julian Edwards (julian-edwards) wrote :

It already does arp guessing if you don't enter any IP. However this depends on the arp cache being primed, and consequently fails a lot.

Changed in maas:
status: New → Triaged
importance: Undecided → Low
tags: added: amt power ui
Revision history for this message
Raphaël Badin (rvb) wrote :

The bug about the ARP cache not being primed is bug bug 1279460.

Revision history for this message
Christian Reis (kiko) wrote :

What does ARP guessing have to do with anything? The MAC on AMT is exactly the same as the host MAC -- it's only the IP address which matters.

Changed in maas:
milestone: none → next
importance: Low → Medium
Revision history for this message
Christian Reis (kiko) wrote :

Is the problem AMT hosts with multiple MACs?

But even then it doesn't make sense, because you have to input an IP address, which you can then use to get the MAC.

Why do we care about the MAC anyway? amttool only requests the IP address.

Revision history for this message
Gavin Panella (allenap) wrote :

The MAC address is shared between the AMT controller and the host, so we can't configure the controller's IP address independently of the host's, and it may change as MAAS does its thing. MAAS doesn't know that there's a relationship there, but always working from the MAC address is always going to get you to the right controller. This lookup is done by the power driver; amttool is only ever given an IP address.

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 1382258] Re: Why does the AMT power type ask me to type in a MAC address?

On Saturday 18 Oct 2014 12:58:02 you wrote:
> What does ARP guessing have to do with anything? The MAC on AMT is
> exactly the same as the host MAC -- it's only the IP address which
> matters.

Well you mentioned ARP in the bug description ...

If the user doesn't supply any IP address for the MAC then it needs to be
looked up from the MAC. And the current code that tries to do this often
fails because the cache is empty. It could be improved for that reason.
However, see my reply to Gavin's comment, coming up.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Saturday 18 Oct 2014 12:59:36 you wrote:
> Is the problem AMT hosts with multiple MACs?
>
> But even then it doesn't make sense, because you have to input an IP
> address, which you can then use to get the MAC.
>
> Why do we care about the MAC anyway? amttool only requests the IP
> address.

It was a convenience, but one which I think makes less sense nowadays. See
next comment.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Saturday 18 Oct 2014 14:12:26 you wrote:
> The MAC address is shared between the AMT controller and the host, so we
> can't configure the controller's IP address independently of the host's,
> and it may change as MAAS does its thing. MAAS doesn't know that there's
> a relationship there, but always working from the MAC address is always
> going to get you to the right controller. This lookup is done by the
> power driver; amttool is only ever given an IP address.

Actually this is wrong, you can configure a separate IP address on the same
MAC for the AMT controller. In fact I do so, because otherwise it makes it
very hard to keep consistent power parameters otherwise as the IP address
changes on each user acquisition and boot (now that we have the static IP
stuff done).

So ultimately I agree that the MAC address on the form can be removed, it's
always the same as the host's for AMT.

Revision history for this message
Gavin Panella (allenap) wrote :

> Actually this is wrong, you can configure a separate IP address on the
> same MAC for the AMT controller. In fact I do so, because otherwise it
> makes it very hard to keep consistent power parameters otherwise as
> the IP address changes on each user acquisition and boot (now that we
> have the static IP stuff done).

I meant within MAAS, but your point stands.

> So ultimately I agree that the MAC address on the form can be removed,
> it's always the same as the host's for AMT.

If a host that uses AMT has multiple NICs, do we know which one to use?

Revision history for this message
Julian Edwards (julian-edwards) wrote :

We can loop through until one connects. It will nearly always be the first one anyway, and most likely the one returned by get_pxe_mac().

Revision history for this message
Christian Reis (kiko) wrote :

I still don't get what we need the MAC for if we are using only the IP address in amttool. What does our power driver use the MAC for?

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Thursday 30 Oct 2014 20:22:47 you wrote:
> I still don't get what we need the MAC for if we are using only the IP
> address in amttool. What does our power driver use the MAC for?

Right now it can use it instead of the IP, it uses ARP to look up the IP.
This is flaky as it depends on the ARP cache being primed.

Revision history for this message
Christian Reis (kiko) wrote :

Note that the IP address was added in bug 1308772 -- we should have removed MAC in the same step.

Revision history for this message
Jeff Lane  (bladernr) wrote :

I don't know if that's necessarily true, at least in some cases, it can be somewhat confusing. . (Regarding the MAC being the MAIN network device)

For example, a Lenovo server I have here shows this:

fc:4d:d4:f4:98:11 (PXE) 10.0.0.59 (dynamic)
44:39:c4:45:6b:aa
44:39:c4:45:6b:ab
(Taken from UI of MAAS 1.8)

the fc:4d device is the ME mac address. It lives on the first physical port which is shared with 44.39:c4:45:6b:aa
BUT those are two different devices, so assuming that "eth0" is the primary port would fail because "eth0" MAC is completely different. As far as the OS is concerned (and you need the OS to determine the MACs during discovery), the AMT port is the LAST device on my system:

ubuntu@paltry-island:~$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 44:39:c4:45:6b:aa

eth1 Link encap:Ethernet HWaddr 44:39:c4:45:6b:ab

eth2 Link encap:Ethernet HWaddr fc:4d:d4:f4:98:11

Then again, it could be that this is is just a red herring.

Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
Changed in maas:
milestone: next → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.