Duplicate FQDN can be configured on MAAS via CLI or API

Bug #1349254 reported by Takenori MATSUMOTO
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Jason Hobbs

Bug Description

It makes sense to be able to:

1. Raise error response in case of user specify duplicated hostname via MAAS GUI or API.

But this can't be done, because MAAS can configure duplicated hostname.

Related branches

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 1349254] [NEW] Duplicate hostname can be configured on MAAS

Hi Takenori,

The database has a unique key on hostname, can you tell me exactly what you're
doing to achieve the duplicate please?

summary: - Duplicate hostname can be configured on MAAS
+ Duplicate hostname can be configured on MAAS via CLI or API
Revision history for this message
Takenori MATSUMOTO (takenori-matsumoto) wrote : Re: Duplicate hostname can be configured on MAAS via CLI or API

Hi Julian,

From MAAS GUI, you're right. I could not configure duplicated hostname from GUI.
The following is procedure.

Step-1
$ maas-cli maas nodes list
See [1] below. There are two entry "juju.master" and "ecndt.master"

Step-2
$ maas-cli maas node update node-cbcd5156-caaa-11e3-ac04-525400b9c4a2 hostname="juju.master"
I try to update hostname from "ecndt.master" to "juju.master", where "juju.master" is already there.

Step-3
$ maas-cli maas nodes list
See [2] below. As you can see, now there are two "juju.master".

[1]
[
    {
        "status": 4,
        "macaddress_set": [
            {
                "resource_uri": "/MAAS/api/1.0/nodes/node-2a19b962-8da1-11e3-923f-525400b9c4a2/macs/52:54:00:e9:66:d7/",
                "mac_address": "52:54:00:e9:66:d7"
            }
        ],
        "netboot": true,
        "hostname": "juju.master",
        "power_type": "virsh",
        "system_id": "node-2a19b962-8da1-11e3-923f-525400b9c4a2",
        "architecture": "i386/generic",
        "tag_names": [
            "juju",
            "virtual"
        ],
        "resource_uri": "/MAAS/api/1.0/nodes/node-2a19b962-8da1-11e3-923f-525400b9c4a2/"
    },
    {
        "status": 0,
        "macaddress_set": [
            {
                "resource_uri": "/MAAS/api/1.0/nodes/node-cbcd5156-caaa-11e3-ac04-525400b9c4a2/macs/52:54:00:f0:7e:24/",
                "mac_address": "52:54:00:f0:7e:24"
            }
        ],
        "netboot": true,
        "hostname": "ecndt.master",
        "power_type": "",
        "system_id": "node-cbcd5156-caaa-11e3-ac04-525400b9c4a2",
        "architecture": "i386/generic",
        "tag_names": [],
        "resource_uri": "/MAAS/api/1.0/nodes/node-cbcd5156-caaa-11e3-ac04-525400b9c4a2/"
    }
]

[2]
[
    {
        "status": 4,
        "macaddress_set": [
            {
                "resource_uri": "/MAAS/api/1.0/nodes/node-2a19b962-8da1-11e3-923f-525400b9c4a2/macs/52:54:00:e9:66:d7/",
                "mac_address": "52:54:00:e9:66:d7"
            }
        ],
        "netboot": true,
        "hostname": "juju.master",
        "power_type": "virsh",
        "system_id": "node-2a19b962-8da1-11e3-923f-525400b9c4a2",
        "architecture": "i386/generic",
        "tag_names": [
            "juju",
            "virtual"
        ],
        "resource_uri": "/MAAS/api/1.0/nodes/node-2a19b962-8da1-11e3-923f-525400b9c4a2/"
    },
    {
        "status": 0,
        "macaddress_set": [
            {
                "resource_uri": "/MAAS/api/1.0/nodes/node-cbcd5156-caaa-11e3-ac04-525400b9c4a2/macs/52:54:00:f0:7e:24/",
                "mac_address": "52:54:00:f0:7e:24"
            }
        ],
        "netboot": true,
        "hostname": "juju.master",
        "power_type": "",
        "system_id": "node-cbcd5156-caaa-11e3-ac04-525400b9c4a2",
        "architecture": "i386/generic",
        "tag_names": [],
        "resource_uri": "/MAAS/api/1.0/nodes/node-cbcd5156-caaa-11e3-ac04-525400b9c4a2/"
    }
]

Changed in maas:
assignee: nobody → Jason Hobbs (jason-hobbs)
Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

Hi Takenori, what version of MAAS is this?

Revision history for this message
Takenori MATSUMOTO (takenori-matsumoto) wrote :

Hi Jason, I verify it on 14.04LTS and MAAS version is 1.5

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

The issue is that when DNS is managed, MAAS replaces the domain name portion of a hostname with the domain name of the cluster, if the node has a hostname. So, when DNS management is enabled, nodes with hostnames "a", "a.b" and "a.c" all have the same FQDN. There is no uniqueness check for FQDN, only hostname.

There's another way to get into this state:

1) Start with DNS management disabled for the cluster.
2) Create two nodes: "a.b" and "a.c".
3) Enable DNS management for the cluster, with domain name "d".
4) Now you have two nodes with FQDN "a.d".

Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

Another way to get into this state:

1) Create two clusters, cluster_a and cluster_b. cluster_a has DNS management enabled with domain 'a'. cluster_b has DNS management disabled
2) On cluster_a, create a node with hostname "x". Its fqdn is now "x.a"
3) On cluster_b, create a node with hostname "x.a". Its fqdn is now "x.a"

summary: - Duplicate hostname can be configured on MAAS via CLI or API
+ Duplicate FQDN can be configured on MAAS via CLI or API
Changed in maas:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: none → 1.7.0
Changed in maas:
status: Fix Committed → Fix Released
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.