Failure to alter VM's MAC address with virsh

Bug #629247 reported by Jerome Potts
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Expired
Medium
Unassigned

Bug Description

Binary package hint: libvirt-bin

$ virsh detach-interface myvm bridge
error: Requested operation is not valid: cannot detach device on inactive domain

$ virsh start myvm
Domain myvm started

$ virsh detach-interface myvm bridge
error: operation failed: network device cannot be detached - device state missing

$ virsh attach-interface myvm bridge br0 --mac '00:16:3e:10:34:31'
Interface attached successfully

$ virsh detach-interface myvm bridge --mac '52:54:00:e0:5d:cc'
error: operation failed: network device cannot be detached - device state missing

$ lsb_release -rd
Description: Ubuntu 10.04 LTS
Release: 10.04

This may all be normal, working as designed ; i just can't find any information on that "missing state" of a "device", what that means, and how to correct that. This is a VM created with the wrong MAC address and i wish to correct that ; i have also tried "virsh edit myvm", performed the desired change, but the VM still does not connect to its host the way it is supposed to. This is perhaps a problem on the host side, however this "device state missing" err msg is annoying, keeping me from moving ahead in my search for a solution to my problem. Thanks in advance.

Changed in libvirt (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hi,

Thanks for reporting this bug and helping to make Ubuntu better.

Could you please say a bit more about what you are trying to do and what exactly you are expecting to happen?

You say

 'but the VM still does not connect to its host the way it is supposed to. '

How is it supposed to, and how is it actually doing it (i.e. actual xml for the libvirt network config and VM)?

Changed in libvirt (Ubuntu):
status: New → Incomplete
Revision history for this message
Jerome Potts (jerome-potts) wrote :

$ virsh dumpxml myvm | grep address
      <mac address='52:54:00:fa:c8:17'/>
$ virsh detach-interface myvm bridge --mac '52:54:00:fa:c8:17'
error: operation failed: network device cannot be detached - device state missing
$ virsh attach-interface myvm bridge br0 --mac '00:16:3e:10:34:31'
Interface attached successfully
$ virsh dumpxml myvm | grep address
      <mac address='52:54:00:fa:c8:17'/>
      <mac address='00:16:3e:10:34:31'/>
$ virsh detach-interface myvm bridge --mac '52:54:00:fa:c8:17'
error: operation failed: network device cannot be detached - device state missing
$ virsh detach-interface myvm bridge --mac '00:16:3e:10:34:31'
Interface detached successfully
$ virsh net-list --all
Name State Autostart
-----------------------------------------

$ ping -c1 myvm
PING myvm.inside.mydomain.net (10.10.10.38) 56(84) bytes of data.
64 bytes from myvm.inside.mydomain.net (10.10.10.38): icmp_seq=1 ttl=64 time=12.7 ms

--- myvm.inside.mydomain.net ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 12.718/12.718/12.718/0.000 ms
$ virsh shutdown myvm
Domain myvm is being shutdown
$ virsh dumpxml myvm
<domain type='kvm'>
  <name>myvm</name>
  <uuid>594c38f9-bf5f-7cf2-53f4-d6d1d6fa0da3</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>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>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/opt/vm/myvm/tmpQPc9uI.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:fa:c8:17'/>
      <source bridge='br0'/>
      <target dev='vnet7'/>
      <model type='virtio'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
    </video>
  </devices>
</domain>

$

The problem is the inability to remove the original MAC address of a VM, whereas removing a 2nd MAC that was added with a "virsh attach-interface" works. Why is that?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Would it suffice to do:

   virsh edit myvm

and change the mac address in the definition? Note that if the mac address doesn't show up in the definition in the editor, you should be able to add it (using the mac address you want) and it will be respected the next time.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(I suspect the 'device state missing' message is wrong, and should actually read 'device busy')

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

[Expired for libvirt (Ubuntu) because there has been no activity for 60 days.]

Changed in libvirt (Ubuntu):
status: Incomplete → Expired
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.