Bug 798909 - Cloned kvm virtual machine's mac address starts with '00:16:3e' like Xen.
Cloned kvm virtual machine's mac address starts with '00:16:3e' like Xen.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst (Show other bugs)
6.3
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-01 04:06 EST by Geyang Kong
Modified: 2013-08-04 23:43 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 08:35:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
This is what I got from terminal with --debug option (5.17 KB, text/plain)
2012-03-01 04:08 EST, Geyang Kong
no flags Details

  None (edit)
Description Geyang Kong 2012-03-01 04:06:18 EST
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 04:08:58 EST
Created attachment 566783 [details]
This is what I got from terminal with --debug option
Comment 2 Alex Jia 2012-03-01 04:39:57 EST
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 05:44:47 EST
Patch for upstream:
https://www.redhat.com/archives/virt-tools-list/2012-March/msg00001.html
Comment 4 Cole Robinson 2012-03-02 11:09:17 EST
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 08:41:46 EST
(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 18:38:24 EDT
Fixed in python-virtinst-0.600.0-8.el6
Comment 8 Geyang Kong 2012-04-05 03:22:53 EDT
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 08:35:39 EDT
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

Note You need to log in before you can comment on or make changes to this bug.