vm boot failure because of wrong mac address

Bug #1720046 reported by Samuel Chen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Boden R

Bug Description

Hi,
   I used same base_mac configuration as previous release. It is "base_mac = 00:05:86:00:00:00".

As the comments in /etc/neutron.conf, the mac address should be fixed in first 3 octets.
# The base MAC address Neutron will use for VIFs. The first 3 octets will
# remain unchanged. If the 4th octet is not 00, it will also be used. The
# others will be randomly generated. (string value)

But in my case, it generated below mac address(9d:05:86:ba:64:a5) and failed to boot vm.
It complains "expected unicast mac address, found multicast '9d:05:86:ba:64:a5'"

Below is nova-compute log:
2017-09-28 10:16:13.553 18290 INFO os_vif [req-9047022d-dcb0-4a6d-bb17-d3cb1a530dd7 928cd394b6414f30ada45587ea5eb1a7 3577dbdee580484eac05b3e89d37b00f - default default] Successfully plugged vif VIFBridge(active=False,address=9d:05:86:ba:64:a5,bridge_name='brqb8c050bf-16',has_traffic_filtering=True,id=56595ff5-080b-481d-93ce-09ccdd943a42,network=Network(b8c050bf-16e3-4fb0-8376-96dd1974b4ea),plugin='linux_bridge',port_profile=<?>,preserve_on_delete=False,vif_name='tap56595ff5-08')
2017-09-28 10:16:13.555 18290 ERROR nova.virt.libvirt.guest [req-9047022d-dcb0-4a6d-bb17-d3cb1a530dd7 928cd394b6414f30ada45587ea5eb1a7 3577dbdee580484eac05b3e89d37b00f - default default] Error defining a guest with XML: <domain type="kvm">
  <uuid>b4f36284-2537-455f-b0f3-5562ac7f7d83</uuid>
  <name>instance-0000000b</name>
  <memory>8388608</memory>
  <vcpu>2</vcpu>
  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
      <nova:package version="16.0.0-1.el7"/>
      <nova:name>test-vm</nova:name>
      <nova:creationTime>2017-09-28 02:16:13</nova:creationTime>
      <nova:flavor name="2x8x60">
        <nova:memory>8192</nova:memory>
        <nova:disk>60</nova:disk>
        <nova:swap>0</nova:swap>
        <nova:ephemeral>0</nova:ephemeral>
        <nova:vcpus>2</nova:vcpus>
      </nova:flavor>
      <nova:owner>
        <nova:user uuid="928cd394b6414f30ada45587ea5eb1a7">xmchen</nova:user>
        <nova:project uuid="3577dbdee580484eac05b3e89d37b00f">xmchen</nova:project>
      </nova:owner>
      <nova:root type="image" uuid="9f3c23db-5d67-4aba-9dd2-aec5287f5f1c"/>
    </nova:instance>
  </metadata>
  <sysinfo type="smbios">
    <system>
      <entry name="manufacturer">RDO</entry>
      <entry name="product">OpenStack Compute</entry>
      <entry name="version">16.0.0-1.el7</entry>
      <entry name="serial">1e15f5b2-e204-43bd-8377-e4804db44e5d</entry>

      <entry name="uuid">b4f36284-2537-455f-b0f3-5562ac7f7d83</entry>
      <entry name="family">Virtual Machine</entry>
    </system>
  </sysinfo>
  <os>
    <type>hvm</type>
    <boot dev="hd"/>
    <smbios mode="sysinfo"/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cputune>
    <shares>2048</shares>
  </cputune>
  <clock offset="utc">
    <timer name="pit" tickpolicy="delay"/>
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="hpet" present="no"/>
  </clock>
  <cpu mode="host-model" match="exact">
    <topology sockets="2" cores="1" threads="1"/>
  </cpu>
  <devices>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2" cache="none"/>
      <source file="/var/lib/nova/instances/b4f36284-2537-455f-b0f3-5562ac7f7d83/disk"/>
      <target bus="virtio" dev="vda"/>
    </disk>
    <interface type="bridge">
      <mac address="9d:05:86:ba:64:a5"/>
      <model type="virtio"/>
      <source bridge="brqb8c050bf-16"/>
      <target dev="tap56595ff5-08"/>
    </interface>
    <serial type="file">
      <source path="/var/lib/nova/instances/b4f36284-2537-455f-b0f3-5562ac7f7d83/console.log"/>
    </serial>
    <serial type="pty"/>
    <input type="tablet" bus="usb"/>
    <graphics type="vnc" autoport="yes" keymap="en-us" listen="10.0.0.110"/>
    <video>
      <model type="cirrus"/>
    </video>
    <memballoon model="virtio">
      <stats period="10"/>
    </memballoon>
  </devices>
</domain>
: libvirtError: XML error: expected unicast mac address, found multicast '9d:05:86:ba:64:a5'
2017-09-28 10:16:13.556 18290 ERROR nova.virt.libvirt.driver [req-9047022d-dcb0-4a6d-bb17-d3cb1a530dd7 928cd394b6414f30ada45587ea5eb1a7 3577dbdee580484eac05b3e89d37b00f - default default] [instance: b4f36284-2537-455f-b0f3-5562ac7f7d83] Failed to start libvirt guest: libvirtError: XML error: expected unicast mac address, found multicast '9d:05:86:ba:64:a5'

Version:
Pike on CentOS 7:
openstack-neutron-11.0.0-1.el7.noarch
openstack-neutron-common-11.0.0-1.el7.noarch
openstack-neutron-linuxbridge-11.0.0-1.el7.noarch
python-neutron-lib-1.9.1-1.el7.noarch
python-neutron-11.0.0-1.el7.noarch
openstack-neutron-ml2-11.0.0-1.el7.noarch

Tags: lib
description: updated
summary: - vm boot failure because wrong mac address
+ vm boot failure because of wrong mac address
Revision history for this message
Brian Haley (brian-haley) wrote :

I think I see the problem. The configuration option in neutron has the comment you posted above:

 "The first 3 octets will remain unchanged. If the 4th "
 "octet is not 00, it will also be used. The others "
 "will be randomly generated."

Neutron now uses the get_random_mac() code in neutron-lib, which has a different comment:

 """Get a random MAC address string of the specified base format.

    Any part that is '00' will be randomized

That's obviously not going to produce the same results.

It was broken in this change:

commit 4a78c722aa4c6cbf6fafb5c1c5773531710ab013
Author: Martin Roy <email address hidden>
Date: Mon Nov 21 16:15:50 2016 -0500

    Make the get_random_mac more versatile

    The past version was not well documented and could use
    a little dusting. This new version offers a custom OUI size.

    This is a random code enhancement.

Changed in neutron:
status: New → Confirmed
Revision history for this message
Boden R (boden) wrote :

It's possible we can revert https://review.openstack.org/#/c/400408/ as I doubt anyone is relying on the new behavior it introduced.

I can try it out and see if any of the main consuming projects break.

Revision history for this message
Brian Haley (brian-haley) wrote :

https://review.openstack.org/#/c/400408/ was the review, we are checking if we can just revert it.

Boden R (boden)
Changed in neutron:
assignee: nobody → Boden R (boden)
importance: Undecided → Medium
tags: added: lib
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)

Fix proposed to branch: master
Review: https://review.openstack.org/509836

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lib (master)

Reviewed: https://review.openstack.org/509836
Committed: https://git.openstack.org/cgit/openstack/neutron-lib/commit/?id=5deda57e17546cd14eb07f2bb1fae4b4ab4e8d67
Submitter: Jenkins
Branch: master

commit 5deda57e17546cd14eb07f2bb1fae4b4ab4e8d67
Author: Boden R <email address hidden>
Date: Thu Oct 5 11:00:14 2017 -0600

    revert get_random_mac behavior from review 400408

    Commit If2539f94b5479f0d6afa64c973082cbe8c5309ac made get_random_mac
    more versatile. However, in the process it introduced incompatibilities
    with the current behavior of randomizing mac as outlined in the
    respective bug report.

    This patch reverts the logic of get_random_mac back to its original
    behavior for backwards compatibility as we suspect no one is relying
    on the new behavior from If2539f94b5479f0d6afa64c973082cbe8c5309ac.

    Change-Id: I047ff3e17c19fc80a47d3c73ee955103a71d2b30
    Closes-Bug: #1720046

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Samuel Chen (samuel.chen) wrote :

Thanks for the fix

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lib 1.11.0

This issue was fixed in the openstack/neutron-lib 1.11.0 release.

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.