Ticket #1843 (closed defect: fixed)
LibVirtSlave fails to destroy domain on buildFinished
| Reported by: | fr4nk | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.8.+ |
| Version: | 0.8.3p1 | Keywords: | virtualization |
| Cc: |
Description
[root@eridu ~]# libvirtd --version libvirtd (libvirt) 0.8.8 [root@eridu ~]# qemu-kvm --version QEMU emulator version 0.14.0 (qemu-kvm-0.14.0), Copyright (c) 2003-2008 Fabrice Bellard [root@eridu ~]#
master.cfg snippet:
from buildbot.libvirtbuildslave import LibVirtSlave
from buildbot.libvirtbuildslave import Connection
connection = Connection("qemu:///system")
c['slaves'] = []
[...]
slave = LibVirtSlave("arch32", "<password>", connection,
"/data/vms/snapshots/arch32.tmp", base_image="/data/vms/arch32.img",
max_builds=1, missing_timeout=30, build_wait_timeout=30)
c['slaves'].append(slave)
A builder associated with this slave will cause the (qemu-kvm) virtual machine to start, from a snapshot overlay disk, just fine. The buildslave on the VM starts, connects, the build starts, and finishes, or fails.. this is not the issue here..
The problem is that after the build, it doesn't manage to stop/destroy the VM, leaving it running. Apart from taking up memory, this also de-syncs the states between libvirt and buildbot, so that you can't start the build again.
below is a stacktrace from a manually interrupted build (but the last line is the same regardless of how the build terminates:
2011-02-26 16:33:56+0100 [-] setting expectations for next time
2011-02-26 16:33:56+0100 [-] new expectations: 367.477597952 seconds
2011-02-26 16:33:56+0100 [-] Got buildFinished notification - attempting
to insubstantiate
2011-02-26 16:33:56+0100 [-] Attempting to stop 'arch32'
2011-02-26 16:33:56+0100 [-] Unhandled Error
Traceback (most recent call last):
File
"/usr/lib/python2.7/site-packages/buildbot/process/base.py", line 478,
in allStepsDone
return self.buildFinished(text, self.result)
File
"/usr/lib/python2.7/site-packages/buildbot/process/base.py", line 511,
in buildFinished
self.deferred.callback(self)
File
"/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 361,
in callback
self._startRunCallbacks(result)
File
"/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 455,
in _startRunCallbacks
self._runCallbacks()
--- <exception caught here> ---
File
"/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 542,
in _runCallbacks
current.result = callback(current.result, *args, **kw)
File
"/usr/lib/python2.7/site-packages/buildbot/process/base.py", line 225,
in _release_slave
self.slavebuilder.buildFinished()
File
"/usr/lib/python2.7/site-packages/buildbot/process/builder.py", line
317, in buildFinished
self.slave.buildFinished(self)
File
"/usr/lib/python2.7/site-packages/buildbot/libvirtbuildslave.py", line
264, in buildFinished
self.insubstantiate()
File
"/usr/lib/python2.7/site-packages/buildbot/buildslave.py", line 715, in
insubstantiate
d = self.stop_instance(fast)
File
"/usr/lib/python2.7/site-packages/buildbot/libvirtbuildslave.py", line
239, in stop_instance
d = domain.destroy()
exceptions.AttributeError: 'int' object has no attribute 'destroy'
Change History
comment:1 Changed 2 years ago by dustin
- Keywords virtualization added
- Milestone changed from undecided to 0.8.+
comment:2 Changed 22 months ago by nlmills
I have uploaded a patch that fixes this bug into my github repository at nlmills/buildbot on branch fix-1843. I have also sent a pull request for this patch to buildbot/buildbot.
comment:3 Changed 22 months ago by Nick Mills
- Status changed from new to closed
- Resolution set to fixed
Fix #1843.
The `domain' member of LibVirtSlave? was incorrectly initialized.
Changeset: a0be2288a88fa05a34c9aaaa9f9b9086151b0b1b
comment:4 Changed 22 months ago by Dustin J. Mitchell
Merge branch 'fix-1843' of git://github.com/nlmills/buildbot
- 'fix-1843' of git://github.com/nlmills/buildbot: Fix #1843. Changeset: 7872eb696a6ab81b87785b24807be49f66702124
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)