Unable to have two devices with same names but different domains
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
As part of scheduled roadmap work for this cycle, LXD is expanding our MAAS support and testing.
Part of this is adding support for LXD projects. We hit a bit of a problem when testing two instances with the same name but in different projects. LXD handles this at a DNS level by using <name>.<project>.
After fighting with gomaasapi for a bit (https:/
- c1 (default project) => c1.maas.
- c1 (foo project) => c1.foo.
That's when we hit a MAAS problem. It's currently impossible for two devices to have the same name even when they're not on the same domain.
In this case, we've got:
POST /MAAS/api/
=> domain=
=> 400 Bad Request, "Node with this Hostname already exists."
In this case, that is because "vm01-c3.
For good measure I also tried using "vm01-c3" in the "foo" project (foo.maas.
I can see how this may make sense at the machine level but it's rather problematic when enforced across all devices on those machines too.
When MAAS was created the decision was made that hostnames must be unique across MAAS[1]. The reason for this is that a user can easily move a machine from one domain to another which may result in duplicates.
Leaving this open as a feature request as we may want to reevaluate this decision.
[1] https:/ /git.launchpad. net/maas/ tree/src/ maasserver/ models/ node.py# n942