Bug 679949

Summary: typo mac in virtinst.util.randomMAC for xen
Product: Red Hat Enterprise Linux 5 Reporter: Greg Swift <gregswift>
Component: python-virtinstAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: high    
Version: 5.6CC: dallan, dyuan, mzhan, nzhang, xen-maint, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
There was a typo in the randomMAC method for the Xen utility defined in the util.py file. The randomly generated MAC addresses incorrectly started with the prefix 00:16:36. This could have caused some tools depending on the expected MAC prefix to not work with guests created by the virt-install tool. This has been fixed and the MAC addresses now correctly start with the prefix 00:16:3E.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 11:14:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Greg Swift 2011-02-23 22:55:21 UTC
In the following block, you start saying 3e, but finish the rest with 36.

Also, should there be a rhev mac generator added in? 00-1A-4A

def randomMAC(type = "xen"):
    """Generate a random MAC address.

    00-16-3E allocated to xensource
    54-52-00 used by qemu/kvm

    The OUI list is available at http://standards.ieee.org/regauth/oui/oui.txt.

    The remaining 3 fields are random, with the first bit of the first
    random field set 0.

    >>> randomMAC().startswith("00:16:36")
    True
    >>> randomMAC("foobar").startswith("00:16:36")
    True
    >>> randomMAC("xen").startswith("00:16:36")
    True
    >>> randomMAC("qemu").startswith("52:54:00")
    True

    @return: MAC address string
    """
    ouis = { 'xen': [ 0x00, 0x16, 0x36 ], 'qemu': [ 0x54, 0x52, 0x00 ] }
<snip>

Comment 1 Cole Robinson 2011-03-09 22:41:59 UTC
Thanks for the report, fixed upstream:

http://hg.fedorahosted.org/hg/python-virtinst/rev/0bbec7372924

As far as virtinst is concerned, RHEV == KVM, so we wouldn't use anything other than the default qemu/kvm prefix.

Comment 2 Cole Robinson 2011-04-29 14:01:34 UTC
Fixed in python-virtinst-0.400.3-12.el5

Comment 5 Cole Robinson 2011-05-05 14:41:09 UTC
You can test by creating a xen guest via virt-install and checking the MAC address we randomly generate (will be in the --debug output). It should now be starting with 00:16:3E when previously it started with 00:16:36

Comment 6 zhe peng 2011-05-06 02:32:03 UTC
thanks
verified on python-virtinst-0.400.3-12.el5
#virt-install -n demo -r 1024 -f /tmp/demo.img -s 6 -l http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL5.7-Server-20110409.3/tree-x86_64/ --debug

......
 <interface type='bridge'>
      <source bridge='xenbr0'/>
      <mac address='00:16:3e:5c:45:e1'/>
    </interface>
.....
#virsh dumpxml demo
.....
<interface type='bridge'>
      <mac address='00:16:3e:5c:45:e1'/>
      <source bridge='xenbr0'/>
      <script path='vif-bridge'/>
      <target dev='vif1.0'/>
    </interface>
.....
the guest installed successful, login guest
#ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:16:3E:5C:45:E1 
......
the bug fixed. move to verified

Comment 7 Eliska Slobodova 2011-06-29 11:46:21 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
There was a typo in the randomMAC method for the Xen utility defined in the util.py file. The randomly generated MAC addresses incorrectly started with the prefix 00:16:36. This could have caused some tools depending on the expected MAC prefix to not work with guests created by the virt-install tool. This has been fixed and the MAC addresses now correctly start with the prefix 00:16:3E.

Comment 8 errata-xmlrpc 2011-07-21 11:14:33 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1054.html