<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;">You're quite right, it was a poweroff issue. Well done! Once I realized that it's critical for the domain to end up in "shut off" state in order for virt-install to exit, things all fell into place.</div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">Here's what I ended up with virt-install wise:</div><div style="-webkit-text-size-adjust: auto;"><br></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">[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="0">http://192.168.122.1/OracleLinux-R6-U3-Server-x86_64-dvd</a> --graphics=none --noautoconsole --wait=-1 --noreboot --serial=file,path=/tmp/minimal.log --initrd-inject=/tmp/minimal-ks.cfg '--extra-args=ks=file:/minimal-ks.cfg console=ttyS0'<br><br>Starting install...<br>Retrieving file .treeinfo...                                                               | 3.0 kB     <a href="x-apple-data-detectors://2" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="2">00:00</a> ... <br>Retrieving file vmlinuz...                                                                 | 7.6 MB     <a href="x-apple-data-detectors://4" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="4">00:00</a> ... <br>Retrieving file initrd.img...                                                              |  58 MB     <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>Allocating 'minimal.img'                                                                   | 3.0 GB     <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>Creating domain...                                                                         |    0 B     <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>Domain installation still in progress. Waiting for installation to complete.<br>.<br>.<br>.<br><br>Checking the domain state during installation:<br><br>[root@oel63-virt tmp]# virsh list --all<br>Id    Name                           State<br>----------------------------------------------------<br>52    minimal                        running<br><br><br>It is critical to make sure that the "poweroff" option is specified in Kickstart culminating in logging: </span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">.</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">.</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">.<br>powering off system<br>Power down.<br><br>... so that virt-install automatically exits with:</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br>.<br>.<br>.<br>Domain has shutdown. Continuing.<br>Domain creation completed. You can restart your domain by running:<br> virsh --connect qemu:///system start minimal<br>[root@oel63-virt tmp]# echo $?<br>0<br><br>... leaving the domain "shut off" state:</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br>[root@oel63-virt tmp]# virsh list --all<br>Id    Name                           State<br>----------------------------------------------------<br>-     minimal                        shut off<br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="-webkit-text-size-adjust: auto;">Thanks for all your help,</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>On Jan 20, 2014, at 6:45 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 05:05 PM, Anthony Shortland wrote:</span><br><blockquote type="cite"><span>Hi Cole,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Thanks for the suggestions. Here's where I'm at now:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>[root@oel63-virt tmp]# virt-install --name=minimal --ram=512 --vcpus=1</span><br></blockquote><blockquote type="cite"><span>--accelerate --hvm --network network:default</span><br></blockquote><blockquote type="cite"><span>--disk=/var/lib/libvirt/images/minimal.img,size=3</span><br></blockquote><blockquote type="cite"><span>--location=<a href="http://192.168.122.1/OracleLinux-R6-U3-Server-x86_64-dvd">http://192.168.122.1/OracleLinux-R6-U3-Server-x86_64-dvd</a> --graphics=none</span><br></blockquote><blockquote type="cite"><span>--noautoconsole --wait=-1 --serial=file,path=/tmp/minimal.log</span><br></blockquote><blockquote type="cite"><span>'--extra-args=ks=<a href="http://192.168.122.1/kickstart/minimal-ks.cfg">http://192.168.122.1/kickstart/minimal-ks.cfg</a> console=ttyS0'</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Starting install...</span><br></blockquote><blockquote type="cite"><span>Retrieving file .treeinfo...</span><br></blockquote><blockquote type="cite"><span>                                                                                |</span><br></blockquote><blockquote type="cite"><span>3.0 kB     00:00 <x-apple-data-detectors://5> ... </span><br></blockquote><blockquote type="cite"><span>Retrieving file vmlinuz...</span><br></blockquote><blockquote type="cite"><span>                                                                                  |</span><br></blockquote><blockquote type="cite"><span>7.6 MB     00:00 <x-apple-data-detectors://7> ... </span><br></blockquote><blockquote type="cite"><span>Retrieving file initrd.img...</span><br></blockquote><blockquote type="cite"><span>                                                                               |</span><br></blockquote><blockquote type="cite"><span> 58 MB     00:00 <x-apple-data-detectors://8> ... </span><br></blockquote><blockquote type="cite"><span>Allocating 'minimal.img'</span><br></blockquote><blockquote type="cite"><span>                                                                                    |</span><br></blockquote><blockquote type="cite"><span>3.0 GB     00:00 <x-apple-data-detectors://10>     </span><br></blockquote><blockquote type="cite"><span>Creating domain...</span><br></blockquote><blockquote type="cite"><span>                                                                                          |</span><br></blockquote><blockquote type="cite"><span>   0 B     00:00 <x-apple-data-detectors://11>     </span><br></blockquote><blockquote type="cite"><span>Domain installation still in progress. Waiting for installation to complete.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>... I added "--serial=file,..." in order to log in the install, which ends as</span><br></blockquote><blockquote type="cite"><span>follows:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>.</span><br></blockquote><blockquote type="cite"><span>,</span><br></blockquote><blockquote type="cite"><span>.</span><br></blockquote><blockquote type="cite"><span>terminating anaconda...done</span><br></blockquote><blockquote type="cite"><span>sending termination signals...done</span><br></blockquote><blockquote type="cite"><span>sending kill signals...Done</span><br></blockquote><blockquote type="cite"><span>disabling swap...</span><br></blockquote><blockquote type="cite"><span>       /dev/dm-1</span><br></blockquote><blockquote type="cite"><span>unmounting filesystems...</span><br></blockquote><blockquote type="cite"><span>       /mnt/runtime done</span><br></blockquote><blockquote type="cite"><span>       disabling /dev/loop0</span><br></blockquote><blockquote type="cite"><span>       /dev/pts done</span><br></blockquote><blockquote type="cite"><span>       /selinux done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/boot done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/dev/pts done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/dev/shm done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/dev done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/proc/bus/usb done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/proc done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/sys done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage/selinux done</span><br></blockquote><blockquote type="cite"><span>       /mnt/sysimage done</span><br></blockquote><blockquote type="cite"><span>waiting for mdraid sets to become clean...</span><br></blockquote><blockquote type="cite"><span>halting system</span><br></blockquote><blockquote type="cite"><span>System halted.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>... the new Linux system is halted since I included the "shutdown"</span><br></blockquote><blockquote type="cite"><span>(<a href="http://fedoraproject.org/wiki/Anaconda/Kickstart#shutdown">http://fedoraproject.org/wiki/Anaconda/Kickstart#shutdown</a>) option in the</span><br></blockquote><blockquote type="cite"><span>Kickstart file, but virt-install still does not exit.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>What event signals completion of domain installation? How can it be triggered</span><br></blockquote><blockquote type="cite"><span>from within the guest (which has the thread of execution with Kickstart)? Or</span><br></blockquote><blockquote type="cite"><span>do I need to wrap all this in a script, set wait=0, track the logged output</span><br></blockquote><blockquote type="cite"><span>and use some sort of virsh command to signal domain installation completion?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span></span><br><span>Maybe it's some halt vs poweroff issue? Not sure.</span><br><span></span><br><span><a href="https://stackoverflow.com/questions/15460754/halt-and-poweroff">https://stackoverflow.com/questions/15460754/halt-and-poweroff</a></span><br><span></span><br><span>Try sticking a 'shutdown' at the end of your kickstart?</span><br><span></span><br><span>Whatever the issue is, it's unlikely a virt-install or libvirt issue, since</span><br><span>they aren't in play if the VM tries to shut itself down.</span><br><span></span><br><span>Watching the serial output was only a suggestion if you can't get the VM to</span><br><span>shutdown on its own, typically that shouldn't be required.</span><br><span></span><br><span>- Cole</span><br></div></blockquote></body></html>