Virsh pod creation failed with "Node with hostname already exists."

Bug #1687487 reported by Newell Jensen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Newell Jensen

Bug Description

Running MAAS within a Virsh node and then trying to add a Virsh pod fails with the below stacktrace:

2017-05-01 22:19:35 maasserver.websockets.protocol: [critical] Error on request (33) pod.create: {'hostname': ['Node with this Hostname already exists.']}

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 1203, in mainLoop
    self.runUntilCurrent()
  File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 798, in runUntilCurrent
    f(*a, **kw)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 434, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 501, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 588, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3/dist-packages/maasserver/forms/pods.py", line 249, in wrap_errors
    raise PodProblem(str(failure.value))

Related branches

Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
Changed in maas:
status: Confirmed → In Progress
Revision history for this message
Newell Jensen (newell-jensen) wrote :

There is already code in MAAS that checks for the validity and uniqueness of hostnames when a Pod is added. However, currently the check is against Machine's in the database and the reason Mike hit this bug is because his MAAS server had a hostname that matched one of his VMs.

Revision history for this message
Andres Rodriguez (andreserl) wrote : Re: [Bug 1687487] Re: Virsh pod creation failed with "Node with hostname already exists."

IIRC, I thought we agreed we were gonna do a deterministic name scheme.
Thinking about it, we should auto create a name unless the user specifies
it to be sticky.

Thoughts?
On Thu, May 4, 2017 at 6:05 PM Newell Jensen <email address hidden>
wrote:

> There is already code in MAAS that checks for the validity and
> uniqueness of hostnames when a Pod is added. However, currently the
> check is against Machine's in the database and the reason Mike hit this
> bug is because his MAAS server had a hostname that matched one of his
> VMs.
>
> --
> You received this bug notification because you are subscribed to MAAS.
> https://bugs.launchpad.net/bugs/1687487
>
> Title:
> Virsh pod creation failed with "Node with hostname already exists."
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/maas/+bug/1687487/+subscriptions
>
--
Andres Rodriguez (RoAkSoAx)
Ubuntu Server Developer
MSc. Telecom & Networking
Systems Engineer

Revision history for this message
Newell Jensen (newell-jensen) wrote :

I like the way we have it now, if there is a conflict in validity or uniqueness with one of the Pod's machines, we create a random hostname. My branch fixes the issue that Mike ran into with his MAAS server hostname clashing with one of his VM's hostnames.

Revision history for this message
Newell Jensen (newell-jensen) wrote :

But then again, doing something deterministic, like appending something to the conflicting hostname could be done as well. That way, the Pod admin will most likely notice which machine is which without too much investigation. Since we use random hostnames in other places, that is more in line with what is currently done.

Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers