<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div style="-webkit-text-size-adjust: auto;">Hi Cole,</div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">Thanks for the suggestions. <span style="background-color: rgba(255, 255, 255, 0);">Here's where I'm at now:</span></div><div><font color="#000000"><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br>[root@oel63-virt tmp]# virt-install --name=minimal --ram=512 --vcpus=1 --accelerate --hvm --network network:default --disk=/var/lib/libvirt/images/minimal.img,size=3 --location=<a href="http://192.168.122.1/OracleLinux-R6-U3-Server-x86_64-dvd" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="2">http://192.168.122.1/OracleLinux-R6-U3-Server-x86_64-dvd</a> --graphics=none --noautoconsole --wait=-1 --serial=file,path=/tmp/minimal.log '--extra-args=ks=<a href="http://192.168.122.1/kickstart/minimal-ks.cfg" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="3">http://192.168.122.1/kickstart/minimal-ks.cfg</a> console=ttyS0'<br><br>Starting install...<br>Retrieving file .treeinfo...                                                                                 | 3.0 kB     <a href="x-apple-data-detectors://5" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="5">00:00</a> ... <br>Retrieving file vmlinuz...                                                                                   | 7.6 MB     <a href="x-apple-data-detectors://7" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="7">00:00</a> ... <br>Retrieving file initrd.img...                                                                                |  58 MB     <a href="x-apple-data-detectors://8" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="8">00:00</a> ... <br>Allocating 'minimal.img'                                                                                     | 3.0 GB     <a href="x-apple-data-detectors://10" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="10">00:00</a>     <br>Creating domain...                                                                                           |    0 B     <a href="x-apple-data-detectors://11" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="11">00:00</a>     <br>Domain installation still in progress. Waiting for installation to complete.<br><br>... I added "--serial=file,..." in order to log in the install, which ends as follows:</span></font></div><div><font color="#000000"><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></font></div><div><font color="#000000"><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">.</span></font></div><div><font color="#000000"><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">,</span></font></div><div><span style="-webkit-text-size-adjust: auto;">.</span></div><div><font color="#000000"><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">terminating anaconda...done<br>sending termination signals...done<br>sending kill signals...Done<br>disabling swap...<br>       /dev/dm-1<br>unmounting filesystems...<br>       /mnt/runtime done<br>       disabling /dev/loop0<br>       /dev/pts done<br>       /selinux done<br>       /mnt/sysimage/boot done<br>       /mnt/sysimage/dev/pts done<br>       /mnt/sysimage/dev/shm done<br>       /mnt/sysimage/dev done<br>       /mnt/sysimage/proc/bus/usb done<br>       /mnt/sysimage/proc done<br>       /mnt/sysimage/sys done<br>       /mnt/sysimage/selinux done<br>       /mnt/sysimage done<br>waiting for mdraid sets to become clean...<br>halting system<br>System halted.</span></font></div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">... the new Linux system is halted since I included the "shutdown" (<a href="http://fedoraproject.org/wiki/Anaconda/Kickstart#shutdown" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="1">http://fedoraproject.org/wiki/Anaconda/Kickstart#shutdown</a>) option in the Kickstart file, but virt-install still does not exit.</div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">What event signals completion of domain installation? How can it be triggered from within the guest (which has the thread of execution with Kickstart)? Or do I need to wrap all this in a script, set wait=0, track the logged output and use some sort of virsh command to signal domain installation completion?</div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">Thanks,</div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">Anthony.</div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">On Jan 19, 2014, at 5:32 AM, Cole Robinson <<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>> wrote:<br><br></div><blockquote type="cite" style="-webkit-text-size-adjust: auto;"><div><span>On 01/19/2014 02:59 AM, Anthony Shortland wrote:</span><br><blockquote type="cite"><span>We're running version 0.600.0 of virt-install with version 0.10.2 of libvert and version 0.12.1.2 of qemu-kvm on RHEL 6.3.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>We're trying to script an automated image build process and want virt-install to exit when Kickstart completes and halts the guest virtual machine (using the "shutdown" option).</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>The thing is that virt-install hangs indefinitely staying connected to the text console (on ttyS0 with --graphics=none) and only exits on timeout if the --wait option is specified.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Is there any way virt-install can simply wait for the Kickstart to complete and halt the guest and then exit gracefully? </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span></span><br><span>That's what it should be doing already: when anaconda finishes, it runs</span><br><span>'shutdown' in the guest. My guess is that the shutdown request isn't working here.</span><br><span></span><br><span>Also, if you are doing an automated kickstart install, you don't necessarily</span><br><span>need to connect to the serial console: virt-install --noautoconsole --wait -1</span><br><span>will do that.</span><br><span></span><br><span>Though a crazier option: if you can't find out why the guest OS isn't shutting</span><br><span>down properly, you could wrap virt-install with a shell script, watch the</span><br><span>output on the serial console, and when you see some string like 'requesting</span><br><span>shutdown' or whatever anaconda/init prints, do 'virsh destroy $vmname'</span><br><span></span><br><span>- Cole</span><br><span></span><br></div></blockquote></body></html>