vmbuilder ignores mac option when using bridge network

Bug #392097 reported by Jarl
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
vm-builder (Ubuntu)
Fix Released
Low
Soren Hansen
Declined for Karmic by Mathias Gug
Nominated for Maverick by Jarl
Lucid
Fix Released
Undecided
Bartosz Kosiorek
Precise
Won't Fix
Undecided
Unassigned
Raring
Won't Fix
Undecided
Unassigned
Saucy
Fix Released
Low
Soren Hansen

Bug Description

=====================
Impact: specified macaddrs are ignored when using a bridge
Development fix: always specify the mac addr when it has been specified
Stable fix: same as development fix
Regression potential: if misapplied, networking for vmbuilder-built guests could be wrong.
Test case: build a vm using '--bridge br0 --max <somemac>' and check the resulting .xml
======================

On Jaunty 9.04

When using Bridge networking and specifying --bridge br0, vmbuilder ignores the --mac option.

Here is a patch:
--- /etc/vmbuilder/libvirt/libvirtxml.tmpl.org 2009-06-25 13:57:55.000000000 +0200
+++ /etc/vmbuilder/libvirt/libvirtxml.tmpl 2009-06-25 13:58:16.000000000 +0200
@@ -20,11 +20,11 @@
       <source bridge='$bridge'/>
 #else
     <interface type='network'>
+ <source network='default'/>
+#end if
 #if $mac
       <mac address='$mac'/>
 #end if
- <source network='default'/>
-#end if
 #if $virtio_net
       <model type='virtio'/>
 #end if

Jarl

Jarl (jarl-dk)
tags: added: patch
Revision history for this message
Chuck Short (zulcss) wrote :

Thanks Ill take a look at this closer.

Regards
chuck

Changed in vm-builder (Ubuntu):
assignee: nobody → Chuck Short (zulcss)
status: New → Triaged
Chuck Short (zulcss)
Changed in vm-builder (Ubuntu):
importance: Undecided → Low
Revision history for this message
Jarl (jarl-dk) wrote :

I am dissappointed to see this problem is still present in Karmic, especially when I have provided a patch. The fix is a no -bariner with the patch provided.

Jarl

Revision history for this message
Soren Hansen (soren) wrote :

I understand your frustration. I'm not sure why this has slipped below my radar. I'll make sure to add this patch next time I have a VMBuilder hacking session. Thanks!

Changed in vm-builder (Ubuntu):
assignee: Chuck Short (zulcss) → Soren Hansen (soren)
Revision history for this message
Soren Hansen (soren) wrote :

I think this was fixed a long time ago.

Changed in vm-builder (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Keith (krbaker-metacarta) wrote :

Are you sure? this looks still broken in Lucid for me.

Most recent files in the archive are 0.12.3 which was released the day the 'fixed' comment was posted but...

apt-get source python-vm-builder
cat vm-builder-0.12.3/VMBuilder/plugins/libvirt/templates/libvirtxml.tmpl
<domain type='kvm'>
  <name>$hostname</name>
  <memory>#echo int($mem) * 1024 #</memory>
  <vcpu>$cpus</vcpu>
  <os>
    <type>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
#if $bridge
    <interface type='bridge'>
      <source bridge='$bridge'/>
#else
    <interface type='network'>
#if $mac
      <mac address='$mac'/>
#end if
#if $network
      <source network='$network'/>
#end if
#end if
#if $virtio_net
      <model type='virtio'/>
#end if
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' listen='127.0.0.1'/>
#for $disk in $disks
    <disk type='file' device='disk'>
      <source file='$disk.filename' />
      <target dev='hd$disk.devletters()' />
    </disk>
#end for
  </devices>
</domain>

I think the file has changed a bit and still has the bug, here's a new diff:
--- vm-builder-0.12.3/VMBuilder/plugins/libvirt/templates/libvirtxml.tmpl 2010-02-24 17:05:47.000000000 -0500
+++ /etc/vmbuilder/libvirt/libvirtxml.tmpl 2010-05-07 14:56:32.000000000 -0400
@@ -20,9 +20,6 @@
       <source bridge='$bridge'/>
 #else
     <interface type='network'>
-#if $mac
- <mac address='$mac'/>
-#end if
 #if $network
       <source network='$network'/>
 #end if
@@ -30,6 +27,9 @@
 #if $virtio_net
       <model type='virtio'/>
 #end if
+#if $mac
+ <mac address='$mac'/>
+#end if
     </interface>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' listen='127.0.0.1'/>

Revision history for this message
Jarl (jarl-dk) wrote :

This bug is not fixed in 10.04.

Running
sudo vmbuilder kvm ubuntu --libvirt=qemu:///system --bridge=br0 --mac=52:54:a4:61:98:34
followed by
sudo grep 'mac address' /etc/libvirt/qemu/ubuntu.xml
results in
      <mac address='52:54:00:98:6c:12'/>
which shows that the requested MAC address (52:54:a4:61:98:34) is ignored.

This is quite frustrating, especially taking in consideration that a patch has been provided more than a year ago, and it is very easy to reproduce and hence verify/reject whether it is fixed or not.

Jarl

Changed in vm-builder (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Jarl (jarl-dk) wrote :

Why has this bug been declined for Karmic and Lucid?

Revision history for this message
Jerome Potts (jerome-potts) wrote :

Keith's patch, applied to 0.12.4, works for me ; my problem is described in bug 629242, now a duplicate of this one. (How do i create a hypertext link to it in this text ? 'can't find out how)

Revision history for this message
Jerome Potts (jerome-potts) wrote :

Ah, it creates the link on its own. Nice, but should be documented somewhere.

Revision history for this message
Jarl (jarl-dk) wrote :

This fix has been verified in Maverick 10.10.

3 releases and 1 year and 4 months after the bug report (which included a patch): This bug has now been fixed on Maverick

Thanks.

Changed in vm-builder (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Lee Maguire (leemaguire) wrote :

I still see the issue in Natty. the "--mac" argument is ignored if bridging is used.

 python-vm-builder=0.12.4+bzr464-0ubuntu1

I've needed to make the following local modification to get it working.

--- /etc/vmbuilder/libvirt/libvirtxml.tmpl.dist 2010-11-17 15:00:44.000000000 +0000
+++ /etc/vmbuilder/libvirt/libvirtxml.tmpl 2011-06-02 11:58:46.365678998 +0100
@@ -21,10 +21,8 @@
 #else
     <interface type='network'>
-#if $mac
- <mac address='$mac'/>
-#end if
-#if $network
       <source network='$network'/>
 #end if
+#if $mac
+ <mac address='$mac'/>
 #end if
 #if $virtio_net

Revision history for this message
Pascal Ehlert (d3-pascal-57) wrote :

Came here to point out that the bug is still present in Precise and has caused lots of confusion to me.

Revision history for this message
Frank Glinka (glinkaf) wrote :

This bug took me a long time to figure out, unfortunately for the second time (I encountered it a year ago but didn't remember). Very frustrating to see that a patch is available since years yet it is not applied.

Changed in vm-builder (Ubuntu):
status: Fix Released → Fix Committed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for the patch. My guess would be it was applied in the package source, but not in the bzr tree, so after the next bzr tree update the fix was lost. But I'm not sure.

Patch pushed to bzr and to the saucy tree. There are vmbuilder packages awaiting verification in all the prior releases except lucid, so we can't push SRU for this right now.

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vm-builder - 0.12.4+bzr488-0ubuntu1

---------------
vm-builder (0.12.4+bzr488-0ubuntu1) saucy; urgency=low

  * Incorporate fix to specify macaddr when using bridge (LP: #392097)
 -- Serge Hallyn <email address hidden> Mon, 24 Jun 2013 14:40:27 -0500

Changed in vm-builder (Ubuntu Saucy):
status: Fix Committed → Fix Released
Revision history for this message
Dave Walker (davewalker) wrote : Please test proposed package

Hello Jarl, or anyone else affected,

Accepted vm-builder into lucid-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/vm-builder/0.12.4-0ubuntu0.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in vm-builder (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [vm-builder/lucid] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for lucid for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

After installing from proposed it is working for me (Lucid Lynx).
Thanks!

tags: added: verification-done-lucid
removed: verification-needed
tags: removed: removal-candidate
Changed in vm-builder (Ubuntu Lucid):
assignee: nobody → Bartosz Kosiorek (gang65)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vm-builder - 0.12.4-0ubuntu0.4

---------------
vm-builder (0.12.4-0ubuntu0.4) lucid-proposed; urgency=low

  * Incorporate fix to specify macaddr when using bridge (LP: #392097)
 -- Serge Hallyn <email address hidden> Mon, 24 Jun 2013 14:45:45 -0500

Changed in vm-builder (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of the Stable Release Update for vm-builder has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

raring has seen the end of its life and is no longer receiving any updates. Marking the raring task for this ticket as "Won't Fix".

Changed in vm-builder (Ubuntu Raring):
status: New → Won't Fix
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in vm-builder (Ubuntu Precise):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.