[virt-tools-list] qestion about --os-variant of virt-install

Jianlin Liu jialiu at redhat.com
Mon Jan 18 05:15:03 UTC 2010


Hi Cole,

Thanks for your reply.


Maybe my comments is not clear, so I update it as following:

Environment:
# rpm -qa|grep virt
libvirt-cim-0.5.5-2.1.el5_4
libvirt-python-0.6.3-30.el5
virt-viewer-0.0.2-3.el5
python-virtinst-0.400.3-7.el5
virt-manager-0.6.1-12.el5
libvirt-0.6.3-30.el5

# uname -a
Linux dhcp-66-70-45.nay.redhat.com 2.6.18-174.el5 #1 SMP Mon Nov 16 22:54:31 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

# rpm -qa|grep kvm
etherboot-roms-kvm-5.4.4-10.el5
kvm-83-140.el5
kvm-qemu-img-83-132.el5
etherboot-zroms-kvm-5.4.4-10.el5
kmod-kvm-83-140.el5
kvm-tools-83-132.el5

# lsmod|grep kvm
kvm_intel              86664  0 
kvm                   223648  2 ksm,kvm_intel

Steps:
1. Running virt-install with "--os-variant=virtio26" option:
# virt-install -n xx -r 512 --os-variant=virtio26 -f /var/lib/libvirt/images/FV.img --import --force --debug
Sun, 17 Jan 2010 22:07:50 DEBUG    Requesting libvirt URI default
Sun, 17 Jan 2010 22:07:50 DEBUG    Received libvirt URI 'qemu:///system'
Sun, 17 Jan 2010 22:07:50 DEBUG    Requesting virt method 'default'
Sun, 17 Jan 2010 22:07:50 DEBUG    Received virt method 'hvm'
Sun, 17 Jan 2010 22:07:50 DEBUG    Hypervisor name is 'qemu'
Sun, 17 Jan 2010 22:07:50 DEBUG    Setting size for existing storage to '7.8125'
Sun, 17 Jan 2010 22:07:50 DEBUG    Detected storage as type 'file'
Sun, 17 Jan 2010 22:07:50 DEBUG    Setting size for existing storage to '7.8125'
Sun, 17 Jan 2010 22:07:50 DEBUG    Detected storage as type 'file'
Sun, 17 Jan 2010 22:07:50 DEBUG    Setting size for existing storage to '7.8125'
Sun, 17 Jan 2010 22:07:50 DEBUG    Detected storage as type 'file'
Sun, 17 Jan 2010 22:07:50 DEBUG    Forcing return value of True to prompt '%s'
Sun, 17 Jan 2010 22:07:50 DEBUG    DISPLAY is set: graphics defaulting to VNC.
Sun, 17 Jan 2010 22:07:50 DEBUG    Setting os type to 'linux' for variant 'virtio26'


Starting install...
Sun, 17 Jan 2010 22:07:50 DEBUG    Saving XML boot config:
<domain type='qemu'>
  <name>xx</name>
  <currentMemory>524288</currentMemory>
  <memory>524288</memory>
  <uuid>94d27945-4208-07b0-fdcd-38e4808464fa</uuid>
  <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>
  <vcpu>1</vcpu>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <console type='pty'/>
    <disk type='file' device='disk'>
      <driver name='qemu' cache='none'/>
      <source file='/var/lib/libvirt/images/FV.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='network'>
      <source network='default'/>
      <mac address='54:52:00:14:42:c2'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' keymap='en-us'/>
  </devices>
</domain>

Guest installation complete... restarting guest.
Sun, 17 Jan 2010 22:07:51 DEBUG    Restarted guest, looking to see if it is running
Sun, 17 Jan 2010 22:07:51 DEBUG    Launching console callback

2. check domain config xml file.
# virsh dumpxml xx
<domain type='qemu' id='2'>
  <name>xx</name>
  <uuid>94d27945-4208-07b0-fdcd-38e4808464fa</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>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='file' device='disk'>
      <driver name='qemu' cache='none'/>
      <source file='/var/lib/libvirt/images/FV.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='network'>
      <mac address='54:52:00:14:42:c2'/>
      <source network='default'/>
      <target dev='vnet0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/5'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/5'>
      <source path='/dev/pts/5'/>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' keymap='en-us'/>
  </devices>
</domain>


Actual Result:
No such lines (e.g. <model type='virtio'/>  and <target dev='vda' bus='virtio'/>) is seen in domain config xml file.
It seem like that the "--os-variant=virtio26" option does not take any effect at all.

As my understand, if user select "--os-variant=virtio26" option, the lines ( <model type='virtio'/>  and <target dev='vda' bus='virtio'/>) should be saved into domain config xml file automatically. 
I am not sure whether my understand is right.

Thanks

Johnny



----- Original Message -----
From: "Cole Robinson" <crobinso at redhat.com>
To: "Jianlin Liu" <jialiu at redhat.com>
Cc: virt-tools-list at redhat.com
Sent: Friday, January 15, 2010 10:41:32 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
Subject: Re: [virt-tools-list] qestion about --os-variant of virt-install

On 01/15/2010 06:08 AM, Jianlin Liu wrote:
> Hi,
> 
> I have a qestion about --os-variant option of virt-install,need your help.
> 
> I know that virtio support will be enabled via virt-install --os-variant [rhel5.4 | virtio26].
> 
> But I am not sure whether the virtio support will be saved into my guest config file.
> 
> Just like that:
>     <disk type='file' device='disk'>
>       <source file='/var/lib/libvirt/images/demo1.img'/>
>       <target dev='vda' bus='virtio'/>    ----> block device virtio support is enabled
>     </disk>
> 
>     <interface type='bridge'>
>       <mac address='00:16:36:14:b2:ad'/>
>       <source bridge='virbr0'/>
>       <target dev='vnet0'/>
>       <model type='virtio'/>               ----> NIC device virtio support is enabled
>     </interface>
> 
> I notice that the above virtio line is not saved into my guest xml config file if run command - "virt-install -n xx -r 512  --os-variant  virtio26 -f /var/lib/libvirt/images/xx.img --import".
> 
> Does it is expected behavior or it is a bug.
> 

What virtinst and libvirt version are you using? If you run virtinst with
--debug, it will show the generated XML, so you can make sure virtinst is
actually building it correctly. If your libvirt version is too old, it might
not recognize the virtio options and ignore them.

Also, make sure you are actually installing a KVM guest, otherwise virtio
won't be added.

- Cole




More information about the virt-tools-list mailing list