Cannot specify Mac address for bridge

Bug #1781727 reported by adamretter
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
uvtool
Fix Committed
Wishlist
Unassigned

Bug Description

My hosting provider requires me to use Mac addresses provided by themselves so that their network will accept my ethernet packets. They also require a strict proscribed static IP allocation. Without the correct Mac address, my VM cannot send/receive data to/from the network.

I am running uvt-kvm like this:

uvt-kvm create --password changeme --memory 4096 --disk 40 --cpu 2 --bridge br0 --packages openssh-server,mosh,git,vim,puppet,screen,ufw --meta-data /tmp/22720db9-abaf-4ab4-a602-fe16e76715bd-meta-data my-vm123 release=bionic

With a meta-data file that looks like:

instance-id: 22720db9-abaf-4ab4-a602-fe16e76715bd
local-hostname: my-vm123
network-interfaces: |
  iface ens3 inet static
  hwaddress ether 06:00:00:42:9b:44
  address 54.36.67.139
  network 54.36.67.139
  netmask 255.255.255.255
  broadcast 5.196.205.132
  gateway 91.121.89.254
  dns-nameservers 213.186.33.99
  dns-search mydomain.com

However, the problem that I have when using the `--bridge br0` is that the Mac address for the vnet adapter created for that bridge is seemingly randomly assigned.

I attach a patch that adds a `--mac` parameter to uvt-kvm which allows the user to specify the Mac address for the interface. I have tested it here and it sets the Mac correctly, both when using a bridge and when not using a bridge.

With the patch I can execute uvt-kvm like:

uvt-kvm create --password changeme --memory 4096 --disk 40 --cpu 2 --bridge br0 --mac 06:00:00:42:9b:44 --packages openssh-server,mosh,git,vim,puppet,screen,ufw --meta-data /tmp/22720db9-abaf-4ab4-a602-fe16e76715bd-meta-data my-vm123 release=bionic

Tags: mac patch static

Related branches

Revision history for this message
adamretter (adam-retter) wrote :
Revision history for this message
Robie Basak (racb) wrote :

Thank you for the patch! This looks reasonable. I'll add this to my review queue.

Changed in uvtool:
status: New → Triaged
importance: Undecided → Wishlist
Robie Basak (racb)
Changed in uvtool:
status: Triaged → Fix Committed
Revision history for this message
adamretter (adam-retter) wrote :

Awesome thanks :-)

Revision history for this message
Piotr Morgwai Kotarbiński (morgwai) wrote :

Hi, was it released? if so, starting with which version? Thanks!

Revision history for this message
Robie Basak (racb) wrote :

Since 0~git148-0ubuntu1, available in Ubuntu 19.10 or the daily PPA at https://launchpad.net/~uvtool-dev/+archive/ubuntu/master (best effort only).

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.