Bug 865805 - [RFE] Improve error handling when unable to contact libvirtd
Summary: [RFE] Improve error handling when unable to contact libvirtd
Keywords:
Status: CLOSED EOL
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: imagefactory
Version: 1.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
Assignee: Ian McLeod
QA Contact: Rehana
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-12 13:38 UTC by Matt Wagner
Modified: 2020-03-27 18:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 18:34:05 UTC
Embargoed:


Attachments (Terms of Use)

Description Matt Wagner 2012-10-12 13:38:49 UTC
Description of problem:
This error was encountered when a user ran Image Factory in a virtual machine, unaware that this was not supported. This is the error that appeard in the logs:


2012-10-12 09:56:30,660 DEBUG
   imgfac.builders.BaseBuilder.Fedora_rhevm_Builder thread(a236ac0d) Message:
   Exception caught in ImageFactory
   2012-10-12 09:56:30,960 DEBUG
   imgfac.builders.BaseBuilder.Fedora_rhevm_Builder thread(a236ac0d) Message:
   Traceback (most recent call last):
     File
   "/usr/lib/python2.7/site-packages/imgfac/builders/Fedora_rhevm_Builder.py",
   line 66, in build_image
       self.build_upload(build_id)
     File
   "/usr/lib/python2.7/site-packages/imgfac/builders/Fedora_rhevm_Builder.py",
   line 113, in build_upload
       libvirt_xml = guest.install(self.app_config["timeout"])
     File "/usr/lib/python2.7/site-packages/oz/Guest.py", line 1516, in
   install
       return self._do_install(timeout, force, 0)
     File "/usr/lib/python2.7/site-packages/oz/Guest.py", line 1497, in
   _do_install
       dom = self.libvirt_conn.createXML(xml, 0)
     File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2420, in
   createXML
       if ret is None:raise libvirtError('virDomainCreateXML() failed',
   conn=self)
   libvirtError: Unable to read from monitor: Connection reset by peer

While we may not support building in VMs, the error doesn't make it very clear what is wrong. It would be fantastic if the log included a more readable error, indicating that it failed to connect to libvirt (?) and that the user should make sure it is running, and that they are not inside of a virtual machine.


Version-Release number of selected component (if applicable):
imagefactory-1.1.1-1.fc17.noarch


Steps to Reproduce:
1. Attempt to build an image inside a VM


Actual results:
The error message, while correct, doesn't really give the user an indication of what might be wrong.


Expected results:
The error message indicates to the user what is wrong and how it might be remedied.


Additional info:


Note You need to log in before you can comment on or make changes to this bug.