[libvirt-users] Windows Server 2008 - KVM

Dominique Ramaekers dominique.ramaekers at cometal.be
Sat May 21 11:47:11 UTC 2016


The guest fs is created in the qcow when you installed the guest. So your qcow is a complete disk including MBR, filesystem tables, journaling,….

dd is a classic linux command: please read ‘man dd’ (to be less polite, RTFM: don’t use commands until you have at least read the man page…)

quick usage: dd if=image.raw of=/dev/lv-group/volume bs=4M
The logical volume can be seen as a real disk-partition… Like this your guest is (almost) directly reading and writing to the host disk. That’s why this setup is so fast.

Make sure the logical volume is at least equal size as the raw image!!! If it is not, the volume will be corrupted. I always work in bytes and not in Gb to prevent mistakenly switching gigabytes and gibibytes…
It’s not a problem if the logical volume is larger then the raw (not good practise but like this you’re on the safe side until you’re really familiar with lvm…)

the command dd will write the content of the raw, byte for byte, to the logical volume. So, it’s like mirroring the volume offline…

Change the guest disk(s) to use the logical volume (I do this with virt-manager: remove the volume without erasing the image, and recreate using the logical volume)

Then rename the qcow to qcow.old or something, so you’re sure you’re using the logical volume and not by accident still the qcow

I know it’s a hand full but once you’re familiar with it, you can do really cool stuff with lvm…


Van: Thiago Oliveira [mailto:cpv.thiago at gmail.com]
Verzonden: vrijdag 20 mei 2016 16:37
Aan: Dominique Ramaekers
CC: libvirt-users at redhat.com
Onderwerp: Re: [libvirt-users] Windows Server 2008 - KVM

Hi Dominique,

You’ll have to convert the qcow to raw, create a LVM-volume (don’t create a file system on the volume), and dd the raw tot he LVM volume…

Convert the qcow to raw, Ok
Create a LVM-Volume, OK
Don´t create a file system on the volume ?? Is not clear why...
DD the raw to the LVM? How ? I don´t understand this point....

Thanks a lot!







2016-05-20 10:23 GMT-03:00 Dominique Ramaekers <dominique.ramaekers at cometal.be<mailto:dominique.ramaekers at cometal.be>>:


Van: Thiago Oliveira [mailto:cpv.thiago at gmail.com<mailto:cpv.thiago at gmail.com>]
Verzonden: vrijdag 20 mei 2016 15:07
Aan: Dominique Ramaekers
CC: libvirt-users at redhat.com<mailto:libvirt-users at redhat.com>
Onderwerp: Re: [libvirt-users] Windows Server 2008 - KVM

Hi there!

Although the guest has 2GB memory, the windows guest was adjusted to support this.

I guess that the LVM is the best choice! I will save all images to other disk and re-build the partition with LVM. Do you recomend to use ext4 or zfs ?
You’ll have to convert the qcow to raw, create a LVM-volume (don’t create a file system on the volume), and dd the raw tot he LVM volume…

- About the apparmor, I have my doubts, I will try to disable and see what will happen!
- About the tablet input device, I removed! Some forums say that consuming idle cpu time. I know… Never could have verivied this…
- About the guest agent, I have installed, but the first service can´t start!
The error says: A timeout was reached (30000 milliseconds) while waiting for the QEMU Guest Agent service to connect.
You’ll have to include the qemu-ga directives in the xml, that should do the trick:
<channel type='unix'>
      <source mode='bind'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
    </channel>

[Imagem inline 1]

I´m using the virtio-win-0.1.117.iso, but I don´t know if this is updated.

Thanks for your reply and your help!

Thiago Oliveira







2016-05-20 8:31 GMT-03:00 Dominique Ramaekers <dominique.ramaekers at cometal.be<mailto:dominique.ramaekers at cometal.be>>:
Please check virtual memory usage in the guest. 2Gb memory is very low. I think your Windows guest is ‘swapping’ constantly. This combined with the less performant qcow format… Reading and writing to qcow takes up host cpu…

I don’t go under 3,5Gb for Windows Guests…

Tip: Take the time to learn LVM. Changing from an image file to LVM really pays off. I have a virtual host with RAID10 local storage. Changing to LVM gave me more than 25% performance boost.

For the rest, it seems ok.

Less important:
I have disabled apparmor security. This was done while using an older version of virsh and I had trouble with apparmor. I don’t know if apparmor has big performance influence.

Wasn’t there a tablet input device? Did you delete this device? I think it’s better to leave it. It has something to do with mouse usage in virt-viewer or vnc…

Install the guest agent on the guest and insert the needed XML-directives. It gives you more possibilities managing your guest like a backup with external snapshots.



Van: Thiago Oliveira [mailto:cpv.thiago at gmail.com<mailto:cpv.thiago at gmail.com>]
Verzonden: vrijdag 20 mei 2016 13:07
Aan: Dominique Ramaekers
CC: libvirt-users at redhat.com<mailto:libvirt-users at redhat.com>
Onderwerp: Re: [libvirt-users] Windows Server 2008 - KVM

Hi there!

Sure......see below.

# virsh version
Compiled against library: libvirt 1.3.1
Using library: libvirt 1.3.1
Using API: QEMU 1.3.1
Running hypervisor: QEMU 2.5.0

# uname -a
Linux 4.4.0-22-generic #40-Ubuntu 16


<domain type='kvm' id='8'>
  <name>W2k8</name>
  <uuid>a148a0b7-eefb-9a5b-8e83-8efaf19f9899</uuid>
  <description>None</description>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='1'/>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' io='native'/>
      <source file='/mnt/VM_SAS/w2k8.img'/>
      <backingStore/>
      <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='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/VM_SAS/second_HD.raw'/>
      <backingStore/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='hda' bus='ide' tray='open'/>
      <readonly/>
      <alias name='ide0-1-1'/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='usb' index='0'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:c3:c9:f3'/>
      <source network='network_win' bridge='virbr0'/>
      <target dev='vnet1'/>
      <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/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' 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='dynamic' model='apparmor' relabel='yes'>
    <label>libvirt-a148a0b7-eefb-9a5b-8e83-8efaf19f9899</label>
    <imagelabel>libvirt-a148a0b7-eefb-9a5b-8e83-8efaf19f9899</imagelabel>
  </seclabel>
</domain>






2016-05-20 3:57 GMT-03:00 Dominique Ramaekers <dominique.ramaekers at cometal.be<mailto:dominique.ramaekers at cometal.be>>:


Van: libvirt-users-bounces at redhat.com<mailto:libvirt-users-bounces at redhat.com> [mailto:libvirt-users-bounces at redhat.com<mailto:libvirt-users-bounces at redhat.com>] Namens Thiago Oliveira
Verzonden: vrijdag 20 mei 2016 4:09
Aan: libvirt-users at redhat.com<mailto:libvirt-users at redhat.com>
Onderwerp: [libvirt-users] Windows Server 2008 - KVM

Hi folks!

When I start the Windows Server 2008 guest, the host cpu grown up the utilization and the host load average too. Are there some tips to use Windows Server with libvirt?

Thanks,
Thiago


Could you send the XML and the result of ‘virsh version’?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20160521/bcd076e1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 11954 bytes
Desc: image001.png
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20160521/bcd076e1/attachment.png>


More information about the libvirt-users mailing list