Bug 798909

Summary: Cloned kvm virtual machine's mac address starts with '00:16:3e' like Xen.
Product: Red Hat Enterprise Linux 6 Reporter: Geyang Kong <gkong>
Component: python-virtinstAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.3CC: ajia, jwu, mjenner, mzhan, rwu, syeghiay, yupzhang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 12:35:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
This is what I got from terminal with --debug option none

Description Geyang Kong 2012-03-01 09:06:18 UTC
Version-Release number of selected component (if applicable):

python-virtinst-0.600-7.el6.noarch

How reproducible:
100%

Steps to Reproduce:

1. Make sure there is a kvm guest with NIC, its mac address should be start with '52:54:00'.

2. Clone the guest using "virt-clone -o demo -n newdemo --mac=RANDOM -f /var/lib/libvirt/images/newdemo.img --debug"

3. Waiting for clone task finished.

4. Check the cloned guest's mac address

Actual results:

1. Cloned guest's mac address starts with '00:16:3e' like Xen.

Expected results:

1. Cloned guest's mac address starts with '52:54:00'.

Additional info:

1. Don't do this through virt-manager, if you do that, everything will be OK.

2. Since there is nothing in libvirtd.log, so I didn't attach it.

Comment 1 Geyang Kong 2012-03-01 09:08:58 UTC
Created attachment 566783 [details]
This is what I got from terminal with --debug option

Comment 2 Alex Jia 2012-03-01 09:39:57 UTC
Hi Cole,

The python-virtinst only judges 'xen' and 'qemu' domain type, and 'xen' is a default domain type. If a guest is 'kvm' domain type,  python-virtinst thinks it's invalid/KeyError then set default 'xen' type:

# virtinst/util.py:

def randomMAC(type="xen"):
<snip>
    ouis = { 'xen': [ 0x00, 0x16, 0x3E ], 'qemu': [ 0x52, 0x54, 0x00 ] }

    try:
        oui = ouis[type]
    except KeyError:
        oui = ouis['xen']

</snip>

Regards,
Alex

Comment 3 Alex Jia 2012-03-01 10:44:47 UTC
Patch for upstream:
https://www.redhat.com/archives/virt-tools-list/2012-March/msg00001.html

Comment 4 Cole Robinson 2012-03-02 16:09:17 UTC
Thanks for the patch, but there was already a fix for this upstream:

http://git.fedorahosted.org/git?p=python-virtinst.git;a=commit;h=8060feeb26be4cd0ab36feca88e8a92db54b09e2

Comment 5 Alex Jia 2012-03-03 13:41:46 UTC
(In reply to comment #4)
> Thanks for the patch, but there was already a fix for this upstream:
> 
> http://git.fedorahosted.org/git?p=python-virtinst.git;a=commit;h=8060feeb26be4cd0ab36feca88e8a92db54b09e2

Hello Cole, Welcome. Hmm, we haven't backported the patch to RHEL.

Comment 6 Cole Robinson 2012-04-02 22:38:24 UTC
Fixed in python-virtinst-0.600.0-8.el6

Comment 8 Geyang Kong 2012-04-05 07:22:53 UTC
Verified pass with the packages:

python-virtinst-0.600.0-8.el6
virt-manager-0.9.0-11.el6

Test steps:

Same as the description.

Test results:

1. The cloned kvm domain now has mac address starts with '52:54:00'.

And change this bug to VERIFIED

Comment 10 errata-xmlrpc 2012-06-20 12:35:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0784.html