[virt-tools-list] virt-install doesn't reboot rhel6/7 VMs after install

Digimer lists at alteeve.ca
Fri Aug 15 14:56:18 UTC 2014


I'll try that, thank you!

Out of curiosity, why would other OSes (like all Windows installs) 
restart properly?

digimer

On 15/08/14 10:32 AM, Cole Robinson wrote:
> Sorry for the late response. I think the issue is that virt-viewer is failing
> to launch, probably because this is done on a TTY or over SSH.
>
> The default virt-install invocation kind of depends on virt-viewer running to
> detect when the VM starts up and shuts down. However you can force it to not
> work that way with --noautoconsole (don't launch virt-viewer) and --wait -1
> (wait indefinitely for the VM to shutdown, then restart it)
>
> - Cole
>
> On 08/06/2014 10:00 PM, Digimer wrote:
>> On 29/07/14 11:01 AM, Digimer wrote:
>>> On 29/07/14 10:36 AM, Cole Robinson wrote:
>>>> On 07/28/2014 12:55 PM, Digimer wrote:
>>>>> On 28/07/14 12:02 PM, Cole Robinson wrote:
>>>>>> On 07/28/2014 11:37 AM, Digimer wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>>      I've noticed that, for reasons I am not entirely sure of
>>>>>>> (though may exist
>>>>>>> and be valid), newly provisioned EL6 and EL7 VMs stay off after
>>>>>>> pressing
>>>>>>> "reboot" at the end of the OS install (--os-variant rhel*). I've
>>>>>>> seen this
>>>>>>> behaviour on RHEL/CentOS 6.x and various recent Fedoras. Note that
>>>>>>> when I
>>>>>>> install other OSes, the VM reboots properly.
>>>>>>>
>>>>>>>      Why would this be? Is this designed behaviour? Installing the
>>>>>>> same on
>>>>>>> bare-iron nodes reboots properly.
>>>>>>>
>>>>>>
>>>>>> The VM should be restarting... can you show an example command line
>>>>>> and full
>>>>>> virt-install --debug output? Make sure you aren't passing --noreboot
>>>>>> or --wait
>>>>>> timeout that is expiring.
>>>>>>
>>>>>> The way it's supposed to work is that the VM fully shuts down,
>>>>>> virt-install
>>>>>> changes the VM configuration to boot off the now installed disk, and
>>>>>> restarts
>>>>>> the VM. It does this by telling VM to shutdown rather than perform a
>>>>>> soft
>>>>>> reboot with <on_reboot>destroy</on_reboot> in the VM XML. It does
>>>>>> this for all
>>>>>> VM installs regardless of the OS.
>>>>>>
>>>>>> When the VM shuts down after install, virt-install should update the
>>>>>> config,
>>>>>> restart the VM, and exit. But clearly that's failing here
>>>>>>
>>>>>> - Cole
>>>>>
>>>>> Here is an example install which showed the problem. It is very
>>>>> similar to how
>>>>> I do all my EL6/EL7 installs (save for sometimes installing from
>>>>> PXE/http):
>>>>>
>>>>> virt-install --connect qemu:///system \
>>>>>     --name an-a03n01 \
>>>>>     --ram 2048 \
>>>>>     --arch x86_64 \
>>>>>     --vcpus 2 \
>>>>>     --cdrom /mnt/usb/VMs/files/CentOS-7.0-1406-x86_64-Everything.iso \
>>>>>     --os-variant rhel7 \
>>>>>     --network bridge=virbr0,model=virtio \
>>>>>     --network bridge=virbr0,model=virtio \
>>>>>     --network bridge=virbr0,model=virtio \
>>>>>     --network bridge=virbr0,model=virtio \
>>>>>     --network bridge=virbr0,model=virtio \
>>>>>     --network bridge=virbr0,model=virtio \
>>>>>     --disk path=/mnt/usb/VMs/images/an-a03n01.img,bus=virtio,size=40 \
>>>>>     --graphics vnc
>>>>>
>>>>
>>>> I just tried a centos 7 install from cdrom with a nearly identical
>>>> command
>>>> line using stock f20 host, and virt-install rebooted the guest
>>>> correctly at
>>>> the end of the VM install. So you'll need to provide the virt-install
>>>> --debug
>>>> output of a failing invocation so I can see what's going wrong
>>>>
>>>> Thanks,
>>>> Cole
>>>
>>> OK, I will try to get that to you later today or tomorrow. Thanks!
>>>
>>> digimer
>>
>> Hi,
>>
>>    Sorry for the lag, got inundated with work.
>>
>>    I ran a fresh install today on a CentOS 6.5 host, installing CentOS 6.5,
>> using '--debug' and, as expected, it did not reboot. I manually booted it
>> after about a minute of waiting.
>>
>> Provision script:
>> ======
>> lvremove -f /dev/c01n01_vg0/vm18-striker_0
>> lvcreate -L 35GiB -n vm18-striker_0 c01n01_vg0
>> virt-install --connect qemu:///system \
>>    --name vm18-striker \
>>    --ram 2048 \
>>    --arch x86_64 \
>>    --vcpus 2 \
>>    --cdrom '/shared/files/CentOS-6.5-x86_64-bin-DVD1.iso' \
>>    --os-variant rhel6 \
>>    --video cirrus \
>>    --network bridge=vbr2,model=virtio \
>>    --disk path=/dev/c01n01_vg0/vm18-striker_0,bus=virtio \
>>    --debug \
>>    --graphics vnc > /var/log/an-install_vm18-striker.log &
>> ======
>>
>> STDOUT
>> ======
>>    Configuration setting "activation/thin_check_executable" unknown.
>>    Configuration setting "activation/thin_check_options" unknown.
>>    Logical volume "vm18-striker_0" successfully removed
>>    Configuration setting "activation/thin_check_executable" unknown.
>>    Configuration setting "activation/thin_check_options" unknown.
>>    Logical volume "vm18-striker_0" created
>> an-c01n01:/shared/provision# Wed, 06 Aug 2014 21:38:04 DEBUG    Launched with
>> command line:
>> /usr/sbin/virt-install --connect qemu:///system --name vm18-striker --ram 2048
>> --arch x86_64 --vcpus 2 --cdrom /shared/files/CentOS-6.5-x86_64-bin-DVD1.iso
>> --os-variant rhel6 --video cirrus --network bridge=vbr2,model=virtio --disk
>> path=/dev/c01n01_vg0/vm18-striker_0,bus=virtio --debug --graphics vnc
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Requesting libvirt URI qemu:///system
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Received libvirt URI qemu:///system
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Requesting virt method 'default', hv type
>> 'default'.
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Received virt method 'hvm'
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Hypervisor name is 'kvm'
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Setting os type to 'linux' for variant 'rhel6'
>> Wed, 06 Aug 2014 21:38:04 DEBUG    DistroInstaller location is a local
>> file/path: /shared/files/CentOS-6.5-x86_64-bin-DVD1.iso
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Guest.has_install_phase: True
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Generated install XML:
>> <domain type='kvm'>
>>    <name>vm18-striker</name>
>>    <uuid>4ad074a8-a4bf-7ffe-4d8b-6c009771ce04</uuid>
>>    <memory>2097152</memory>
>>    <currentMemory>2097152</currentMemory>
>>    <vcpu>2</vcpu>
>>    <os>
>>      <type arch='x86_64'>hvm</type>
>>      <boot dev='cdrom'/>
>>      <boot dev='hd'/>
>>    </os>
>>    <features>
>>      <acpi/><apic/><pae/>
>>    </features>
>>    <clock offset="utc"/>
>>    <on_poweroff>destroy</on_poweroff>
>>    <on_reboot>destroy</on_reboot>
>>    <on_crash>destroy</on_crash>
>>    <devices>
>>      <emulator>/usr/libexec/qemu-kvm</emulator>
>>      <disk type='block' device='disk'>
>>        <driver name='qemu' cache='none' io='native'/>
>>        <source dev='/dev/c01n01_vg0/vm18-striker_0'/>
>>        <target dev='vda' bus='virtio'/>
>>      </disk>
>>      <disk type='file' device='cdrom'>
>>        <driver name='qemu'/>
>>        <source file='/shared/files/CentOS-6.5-x86_64-bin-DVD1.iso'/>
>>        <target dev='hdc' bus='ide'/>
>>        <readonly/>
>>      </disk>
>>      <interface type='bridge'>
>>        <source bridge='vbr2'/>
>>        <mac address='52:54:00:e2:40:5c'/>
>>        <model type='virtio'/>
>>      </interface>
>>      <input type='tablet' bus='usb'/>
>>      <graphics type='vnc' port='-1'/>
>>      <console type='pty'/>
>>      <video>
>>        <model type='cirrus'/>
>>      </video>
>>    </devices>
>> </domain>
>>
>> Wed, 06 Aug 2014 21:38:04 DEBUG    Generated boot XML:
>> <domain type='kvm'>
>>    <name>vm18-striker</name>
>>    <uuid>4ad074a8-a4bf-7ffe-4d8b-6c009771ce04</uuid>
>>    <memory>2097152</memory>
>>    <currentMemory>2097152</currentMemory>
>>    <vcpu>2</vcpu>
>>    <os>
>>      <type arch='x86_64'>hvm</type>
>>      <boot dev='hd'/>
>>    </os>
>>    <features>
>>      <acpi/><apic/><pae/>
>>    </features>
>>    <clock offset="utc"/>
>>    <on_poweroff>destroy</on_poweroff>
>>    <on_reboot>restart</on_reboot>
>>    <on_crash>restart</on_crash>
>>    <devices>
>>      <emulator>/usr/libexec/qemu-kvm</emulator>
>>      <disk type='block' device='disk'>
>>        <driver name='qemu' cache='none' io='native'/>
>>        <source dev='/dev/c01n01_vg0/vm18-striker_0'/>
>>        <target dev='vda' bus='virtio'/>
>>      </disk>
>>      <disk type='block' device='cdrom'>
>>        <target dev='hdc' bus='ide'/>
>>        <readonly/>
>>      </disk>
>>      <interface type='bridge'>
>>        <source bridge='vbr2'/>
>>        <mac address='52:54:00:e2:40:5c'/>
>>        <model type='virtio'/>
>>      </interface>
>>      <input type='tablet' bus='usb'/>
>>      <graphics type='vnc' port='-1'/>
>>      <console type='pty'/>
>>      <video>
>>        <model type='cirrus'/>
>>      </video>
>>    </devices>
>> </domain>
>>
>> Wed, 06 Aug 2014 21:38:05 DEBUG    Started guest, connecting to console if
>> requested
>> Wed, 06 Aug 2014 21:38:05 DEBUG    Launching virt-viewer for graphics type 'vnc'
>> Wed, 06 Aug 2014 21:38:05 DEBUG    Running: /usr/bin/virt-viewer --connect
>> qemu:///system --wait 5
>> Wed, 06 Aug 2014 21:38:05 DEBUG    XML fetched from libvirt object:
>> <domain type='kvm' id='5'>
>>    <name>vm18-striker</name>
>>    <uuid>4ad074a8-a4bf-7ffe-4d8b-6c009771ce04</uuid>
>>    <memory unit='KiB'>2097152</memory>
>>    <currentMemory unit='KiB'>2097152</currentMemory>
>>    <vcpu placement='static'>2</vcpu>
>>    <os>
>>      <type arch='x86_64' machine='rhel6.5.0'>hvm</type>
>>      <boot dev='cdrom'/>
>>      <boot dev='hd'/>
>>    </os>
>>    <features>
>>      <acpi/>
>>      <apic/>
>>      <pae/>
>>    </features>
>>    <clock offset='utc'/>
>>    <on_poweroff>destroy</on_poweroff>
>>    <on_reboot>destroy</on_reboot>
>>    <on_crash>destroy</on_crash>
>>    <devices>
>>      <emulator>/usr/libexec/qemu-kvm</emulator>
>>      <disk type='block' device='disk'>
>>        <driver name='qemu' type='raw' cache='none' io='native'/>
>>        <source dev='/dev/c01n01_vg0/vm18-striker_0'/>
>>        <target dev='vda' bus='virtio'/>
>>        <alias name='virtio-disk0'/>
>>        <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
>>      </disk>
>>      <disk type='file' device='cdrom'>
>>        <driver name='qemu' type='raw'/>
>>        <source file='/shared/files/CentOS-6.5-x86_64-bin-DVD1.iso'/>
>>        <target dev='hdc' bus='ide'/>
>>        <readonly/>
>>        <alias name='ide0-1-0'/>
>>        <address type='drive' controller='0' bus='1' target='0' unit='0'/>
>>      </disk>
>>      <controller type='usb' index='0'>
>>        <alias name='usb0'/>
>>        <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
>>      </controller>
>>      <controller type='ide' index='0'>
>>        <alias name='ide0'/>
>>        <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
>>      </controller>
>>      <interface type='bridge'>
>>        <mac address='52:54:00:e2:40:5c'/>
>>        <source bridge='vbr2'/>
>>        <target dev='vnet3'/>
>>        <model type='virtio'/>
>>        <alias name='net0'/>
>>        <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
>>      </interface>
>>      <serial type='pty'>
>>        <source path='/dev/pts/0'/>
>>        <target port='0'/>
>>        <alias name='serial0'/>
>>      </serial>
>>      <console type='pty' tty='/dev/pts/0'>
>>        <source path='/dev/pts/0'/>
>>        <target type='serial' port='0'/>
>>        <alias name='serial0'/>
>>      </console>
>>      <input type='tablet' bus='usb'>
>>        <alias name='input0'/>
>>      </input>
>>      <input type='mouse' bus='ps2'/>
>>      <graphics type='vnc' port='5903' autoport='yes' listen='127.0.0.1'>
>>        <listen type='address' address='127.0.0.1'/>
>>      </graphics>
>>      <video>
>>        <model type='cirrus' vram='9216' heads='1'/>
>>        <alias name='video0'/>
>>        <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
>>      </video>
>>      <memballoon model='virtio'>
>>        <alias name='balloon0'/>
>>        <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
>>      </memballoon>
>>    </devices>
>>    <seclabel type='none'/>
>> </domain>
>>
>> Cannot open display:
>> Run 'virt-viewer --help' to see a full list of available command line options
>> Wed, 06 Aug 2014 21:38:08 DEBUG    Domain state after install: 1
>> ======
>>
>> Contents of /var/log/an-install_vm18-striker.log
>> ======
>> Starting install...
>> Creating domain...                                       |    0 B 00:00
>> Domain installation still in progress. You can reconnect to
>> the console to complete the installation process.
>> ======
>>
>> Contents of /var/log/libvirt/qemu/vm18-striker.log
>> ======
>> 2014-08-07 01:35:36.912+0000: starting up
>> LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none
>> /usr/libexec/qemu-kvm -name vm18-striker -S -M rhel6.5.0 -enable-kvm -m 2048
>> -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid
>> 5bc740b0-b57c-df9d-f824-6281d6076a4a -nodefconfig -nodefaults -chardev
>> socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm18-striker.monitor,server,nowait
>> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-reboot
>> -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
>> file=/dev/c01n01_vg0/vm18-striker_0,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native
>> -device
>> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2
>> -drive
>> file=/shared/files/CentOS-6.5-x86_64-bin-DVD1.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw
>> -device
>> ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
>> -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=29 -device
>> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:5d:6d:4f,bus=pci.0,addr=0x3 -chardev
>> pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device
>> usb-tablet,id=input0 -vnc 0.0.0.0:3 -vga cirrus -device
>> virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
>> char device redirected to /dev/pts/0
>> qemu: terminating on signal 15 from pid 7182
>> 2014-08-07 01:36:45.703+0000: shutting down
>> 2014-08-07 01:38:04.719+0000: starting up
>> LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none
>> /usr/libexec/qemu-kvm -name vm18-striker -S -M rhel6.5.0 -enable-kvm -m 2048
>> -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid
>> 4ad074a8-a4bf-7ffe-4d8b-6c009771ce04 -nodefconfig -nodefaults -chardev
>> socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm18-striker.monitor,server,nowait
>> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-reboot
>> -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
>> file=/dev/c01n01_vg0/vm18-striker_0,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native
>> -device
>> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2
>> -drive
>> file=/shared/files/CentOS-6.5-x86_64-bin-DVD1.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw
>> -device
>> ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
>> -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=29 -device
>> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:e2:40:5c,bus=pci.0,addr=0x3 -chardev
>> pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device
>> usb-tablet,id=input0 -vnc 127.0.0.1:3 -vga cirrus -device
>> virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
>> char device redirected to /dev/pts/0
>> qemu: terminating on signal 15 from pid 7182
>> 2014-08-07 01:49:40.120+0000: shutting down
>> 2014-08-07 01:51:19.649+0000: starting up
>> LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none
>> /usr/libexec/qemu-kvm -name vm18-striker -S -M rhel6.5.0 -enable-kvm -m 2048
>> -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid
>> 4ad074a8-a4bf-7ffe-4d8b-6c009771ce04 -nodefconfig -nodefaults -chardev
>> socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm18-striker.monitor,server,nowait
>> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
>> -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
>> file=/dev/c01n01_vg0/vm18-striker_0,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native
>> -device
>> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
>> -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device
>> ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev
>> tap,fd=22,id=hostnet0,vhost=on,vhostfd=23 -device
>> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:e2:40:5c,bus=pci.0,addr=0x3 -chardev
>> pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device
>> usb-tablet,id=input0 -vnc 127.0.0.1:3 -vga cirrus -device
>> virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
>> char device redirected to /dev/pts/0
>> ======
>>
>> Screenshot showing the behaviour:
>>
>> http://i.imgur.com/kV0kfbA.png
>>
>> Let me know if there is anything else I can do to help. I can reproduce this
>> 100% of the time.
>>
>> Cheers
>>
>


-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without 
access to education?




More information about the virt-tools-list mailing list