Duplicate link layer device entries when running on AWS

Bug #1855263 reported by Achilleas Anagnostopoulos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Joseph Phillips

Bug Description

Unfortunately, the ec2 API does not report the device names for network interfaces. Currently, the ec2 provider implementation populates the device names with a placeholder value which is generated by concatenating the string "unsupported" with the device index.

The machiner worker periodically sends its own view of the machine network devices (with the correct names) to the controller where this information gets merged together with the information obtained by the environment and is used to upsert the entries in the "link layer device" and "ip.address" collections.

It seems that on both 2.6.x and 2.7.x lines, the merge logic does not work as expected since we end up with duplicate entries in these collections. For example, after bootstrapping on ec2 the relevant collections contain entries like:

Link layer devices:

```
{
        "_id" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0:m#0#d#unsupported0",
        "name" : "unsupported0",
        "model-uuid" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0",
        "mtu" : 0,
        "providerid" : "eni-067314af609749f26",
        "machine-id" : "0",
        "type" : "ethernet",
        "mac-address" : "0e:89:85:5c:80:47",
        "is-auto-start" : true,
        "is-up" : true,
        "parent-name" : "",
        "txn-revno" : NumberLong(2),
        "txn-queue" : [
                "5de64e7d90f35328503a5868_33348be2",
                "5de64e7d90f35328503a5869_d8534326"
        ]
}
...
{
        "_id" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0:m#0#d#ens5",
        "name" : "ens5",
        "model-uuid" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0",
        "mtu" : 9001,
        "machine-id" : "0",
        "type" : "ethernet",
        "mac-address" : "0e:89:85:5c:80:47",
        "is-auto-start" : true,
        "is-up" : true,
        "parent-name" : "",
        "txn-revno" : NumberLong(2),
        "txn-queue" : [
                "5de64e7d90f35328503a586d_0056020f",
                "5de64e7d90f35328503a586f_b036dc72"
        ]
}
```

IP Addresses (also note that the provider version specifies a different "config-method" and lacks a gateway value):

```
{
        "_id" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0:m#0#d#unsupported0#ip#172.31.36.2",
        "model-uuid" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0",
        "device-name" : "unsupported0",
        "machine-id" : "0",
        "subnet-cidr" : "172.31.32.0/20",
        "config-method" : "dynamic",
        "value" : "172.31.36.2",
        "txn-revno" : NumberLong(2),
        "txn-queue" : [
                "5de64e7d90f35328503a5869_d8534326"
        ]
}
...
{
        "_id" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0:m#0#d#ens5#ip#172.31.36.2",
        "model-uuid" : "181280d3-d776-4790-82bc-fd7f7b7bd8a0",
        "device-name" : "ens5",
        "machine-id" : "0",
        "subnet-cidr" : "172.31.32.0/20",
        "config-method" : "static",
        "value" : "172.31.36.2",
        "gateway-address" : "172.31.32.1",
        "is-default-gateway" : true,
        "txn-revno" : NumberLong(2),
        "txn-queue" : [
                "5de64e7d90f35328503a586f_b036dc72"
        ]
}
```

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Joseph Phillips (manadart)
milestone: none → 2.8-beta1
Revision history for this message
Joseph Phillips (manadart) wrote :

In discussions with John, it was suggested that we should be merging based on MAC address.

Ian Booth (wallyworld)
Changed in juju:
milestone: 2.8-beta1 → 2.8-rc1
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.8-rc1 → 2.8.1
Revision history for this message
Joseph Phillips (manadart) wrote :
Changed in juju:
status: Triaged → Fix Committed
Changed in juju:
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.