Bug 988065

Summary: Migration fails - AttributeError: 'ConsoleDevice' object has no attribute 'alias'
Product: [Retired] oVirt Reporter: Martin Sivák <msivak>
Component: vdsmAssignee: Vinzenz Feenstra [evilissimo] <vfeenstr>
Status: CLOSED NEXTRELEASE QA Contact: Haim <hateya>
Severity: high Docs Contact:
Priority: urgent    
Version: unspecifiedCC: abaron, acathrow, amuller, bazulay, danken, dfediuck, iheim, mgoldboi, michal.skrivanek, mpavlik, vfeenstr, yeylon
Target Milestone: ---   
Target Release: 3.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-08 16:44:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 918494    
Attachments:
Description Flags
The log from my test machine dev-01. none

Description Martin Sivák 2013-07-24 16:06:09 UTC
Created attachment 777855 [details]
The log from my test machine dev-01.

Description of problem:

Migration fails with the following error on the destination host.

Thread-1079::ERROR::2013-07-24 16:52:16,498::BindingXMLRPC::998::vds::(wrapper) unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/BindingXMLRPC.py", line 984, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/BindingXMLRPC.py", line 345, in vmMigrationCreate
    return vm.migrationCreate(params)
  File "/usr/share/vdsm/API.py", line 507, in migrationCreate
    if not v.waitForMigrationDestinationPrepare():
  File "/usr/share/vdsm/vm.py", line 4789, in waitForMigrationDestinationPrepare
    self._updateDevicesDomxmlCache(srcDomXML)
  File "/usr/share/vdsm/vm.py", line 4758, in _updateDevicesDomxmlCache
    aliasToDevice[dev.alias] = dev
AttributeError: 'ConsoleDevice' object has no attribute 'alias'


Version-Release number of selected component (if applicable):

engine: latest checkout from engine git 7d16422d22cf1995545b6a99d0fcaf9c64dc8619
host OS: F18

Linux dev-01.rhev.lab.eng.brq.redhat.com 3.9.11-200.fc18.x86_64 #1 SMP Mon Jul 22 21:04:50 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Linux dev-22.rhev.lab.eng.brq.redhat.com 3.9.10-200.fc18.x86_64 #1 SMP Sun Jul 14 01:36:53 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

libvirt-1.1.0-1.fc18.x86_64
vdsm-4.12.0-rc3.3.git06ed3cc.fc18.x86_64
glusterfs-3.4.0alpha-2.fc18.x86_64

How reproducible:

Always on my setup

Steps to Reproduce:

Install two hosts, add the following repositories:

http://fedorapeople.org/groups/virt/virt-preview/fedora-$releasever/$basearch

http://download.gluster.org/pub/gluster/glusterfs/qa-releases/3.4.0beta4/Fedora/fedora-$releasever/$basearch/
http://download.gluster.org/pub/gluster/glusterfs/qa-releases/3.4.0beta4/Fedora/fedora-$releasever/noarch/
http://download.gluster.org/pub/gluster/glusterfs/qa-releases/3.4.0alpha/Fedora/fedora-$releasever/$basearch/
http://download.gluster.org/pub/gluster/glusterfs/qa-releases/3.4.0alpha/Fedora/fedora-$releasever/noarch/
http://download.gluster.org/pub/gluster/glusterfs/LATEST/Fedora/fedora-18/x86_64/
http://resources.ovirt.org/releases/nightly/rpm/Fedora/18/

yum update
setup engine somewhere
disable Gluster in the Cluster settings
add the two hosts and let engine install them
start a VM
try to migrate it

Actual results:

Migration failed due to Error: unexpected (VM: mom_test, Source: dev-22, Destination: dev-01).

Expected results:

Migration successful.

Other info:

The log contains data from couple of test runs where the bug happened couple of times. I also tried to workaround it by adding if hasattr(dev, "alias") around the failing block so you will find one other failure there. Just use what you need.

Comment 1 Michal Skrivanek 2013-07-25 07:54:32 UTC
assaf, I think this is again related to your change regarding "alias"

Comment 2 Dan Kenigsberg 2013-07-25 08:18:45 UTC
Note that console devices HAS an alias. The fix should be to read it properly from the domxml, not to ignore it.

    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='virtio' port='0'/>
      <alias name='console0'/>
    </console>

Vinzenz, could you help Assaf with it?

Comment 3 Vinzenz Feenstra [evilissimo] 2013-07-29 14:53:28 UTC
The problem is not libvirt, libvirt does create aliases for everything, but we did not read the aliases for all devices from libvirt.

For example the ConsoleDevice does not retrieve the 'underlying device info' and does not set the alias.
When the migration is sent, the 'devices' dictionary does not contain an alias for the ConsoleDevice object.

It also seems like that the BalloonDevice in older oVirt versions (pre 3.1) do not have an alias, which would basically break migrations from that VDSM to this one as well.

I can fix it for now for ConsoleDevices by adding an alias member in the '__init__' of the class after the base class was initialized.
Not a big fan, however it solves that for migrations from older versions.

Comment 4 Michal Skrivanek 2013-07-30 10:07:11 UTC
it doesn't solve the balloon, though

Comment 6 Assaf Muller 2013-08-08 16:44:09 UTC
Closing as the bug has been fixed via patches merged on upstream master and ovirt-3.3 branches.

Comment 7 Michal Skrivanek 2013-09-05 12:57:29 UTC
*** Bug 987496 has been marked as a duplicate of this bug. ***