Bug 865805

Summary: [RFE] Improve error handling when unable to contact libvirtd
Product: [Retired] CloudForms Cloud Engine Reporter: Matt Wagner <matt.wagner>
Component: imagefactoryAssignee: Ian McLeod <imcleod>
Status: CLOSED EOL QA Contact: Rehana <aeolus-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: athomas, morazi
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 18:34:05 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:

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: