Bug 1785643

Summary: virt-install with --noautoconsole --transient --wait always reports failure
Product: [Community] Virtualization Tools Reporter: Lars Kellogg-Stedman <lars>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, gscrivan, tburke
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-22 23:06:44 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 Lars Kellogg-Stedman 2019-12-20 14:23:22 UTC
Description of problem:

I'm using virt-install to build images using Kickstart. I'm trying to run virt-install like this:

  virt-install --noautoconsole --noreboot --transient --wait ...
  
But this always reports a failure at the end of the install:

  Domain installation still in progress.
  Waiting for installation to complete.
  ERROR    Domain not found: no domain with matching uuid 'b8d6aa9c-1548-4e63-9cbb-bf171899960d' (ovn-base)
  Domain installation does not appear to have been successful.
  If it was, you can restart your domain by running:
    virsh --connect qemu:///system start ovn-base
  otherwise, please restart your installation.

This is problematic because it makes it impossible to differentiate between "virt-install failed because you passed a bad option" vs "the virtual machine exited".

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

  virt-install-2.2.1-2.fc31.noarch

How reproducible:

  The specific command line I'm using is:
  
  virt-install -n ovn-base -r 2500 -w network=default --os-variant rhel7.7 \
    --noautoconsole \
    --noreboot \
    --initrd-inject ovn-base.ks \
    --graphics none \
    --extra-args="console=ttyS0,115200n8 ks=file:/ovn-base.ks" \
    --disk vol=default/ovn-base.qcow2 \
    --location http://mirror.math.princeton.edu/pub/fedora/linux/releases/31/Everything/x86_64/os/ \
    --transient --wait \
    --console file,path=$PWD/ovn-base.log

Comment 1 Cole Robinson 2019-12-22 23:06:44 UTC
Thanks for the report, should be fixed upstream now:

commit 6bec5474db0cb82ff8f0299febcbf302729553a5 (HEAD -> master)
Author: Cole Robinson <crobinso>
Date:   Sun Dec 22 18:03:19 2019 -0500

    virt-install: Check --transient status in domain --wait