From Fedora Project Wiki

< FWN‎ | Beats

No edit summary
Line 14: Line 14:
[http://www.redhat.com/mailman/listinfo/fedora-virt fedora-virt list].
[http://www.redhat.com/mailman/listinfo/fedora-virt fedora-virt list].


==== KVM and Paravirtualization ====
==== KSM Tuning ====
The Linux Kernel-based Virtual Machine is a form of hardware assisted
[[IzikEidus|Izik Eidus]]
virtualization<ref>http://en.wikipedia.org/wiki/Hardware-assisted_virtualization</ref>
<ref>http://www.redhat.com/archives/fedora-virt/2009-October/msg00110.html</ref>
as opposed to software-only or paravirtualization. This means the underlying
hardware must have CPU features like Intel-VT or AMD-V. While common in the
last few years, there are still many servers in operation which lack these extensions.


[[GiovanniTirloni|Giovanni Tirloni]]
" by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know
asked<ref>http://www.redhat.com/archives/fedora-virt/2009-October/msg00090.html</ref>
about the state of paravirtualization support in KVM, and  
asked about a set of KVM patches<ref>http://people.redhat.com/mingo/kvm-paravirt-patches/</ref>.


[[DorLaor|Dor Laor]]
that much more memory can be saved...
answered<ref>http://www.redhat.com/archives/fedora-virt/2009-October/msg00092.html</ref>
there is no plan to support non-VT hardware with KVM. While Xen is not
supported on Fedora, it is still a paravirtualization for such hardware option under Redhat 5.  


<references />


==== Installing Virtio Drivers in Windows XP Setup ====
Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?
[[RichardHughes|Richard Hughes]]
posted<ref>http://www.redhat.com/archives/fedora-virt/2009-October/msg00101.html</ref>
the following directions for installing VirtIO drivers<ref>http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers</ref> during Windows XP setup.


* create a 1.44Mb image file
And if we set it to disabled by default, cant we set the initialized values
* mount it by loopback
into more realistic value? (like 1/4 of the memory in the mainline kernels? )
* format it with vfat
"
* copy the {{filename|Install/Xp/x86/viostor.sys}}, {{filename|Install/Xp/x86/wnet.inf}}, and the txtsetup.oem file below to the root of the mounted image
 
* umount the loop device
[[MarkMcLoughlin|Mark McLoughlin]]
* attach the floppy image as a floppy storage element in the VM's details pane
<ref>http://www.redhat.com/archives/fedora-virt/2009-October/msg00112.html</ref>
* boot the VM
 
* remember to press F6 when booting the windows xp setup and select the VirtoIO device.
"ksm is disabled by default currently"
 
"Here's the logic we have in the init script<ref>http://gitorious.org/ksm-control-scripts/ksm-control-scripts</ref>:


File {{filename|txtsetup.oem}}:
<pre>
<pre>
[Disks]
  # unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory.
d1 = "Viostor SCSI driver disk",\disk1.tag,\
  default_max_kernel_pages () {
      local total pagesize
      total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo`
      pagesize=`getconf PAGESIZE`
      echo $[total * 1024 / pagesize / 2]
  }
</pre>


[Defaults]
[[JustinForbes|Justin Forbes]]
SCSI = viostor
<ref>http://www.redhat.com/archives/fedora-virt/2009-October/msg00115.html</ref>


[SCSI]
"There are actually 2 init scripts.  One to turn on ksm, and one for tuning.
viostor = "Viostor SCSI Controller"
The actual ksm init script simply makes sure ksm is turned on in the kernel
and sets max_kernel_pages to half of system memory.  The ksmtuned script is
a bit more involved."


[Files.SCSI.viostor]
[[MarkMcLoughlin|Mark McLoughlin]]
driver = d1,viostor.sys,viostor
<ref>http://www.redhat.com/archives/fedora-virt/2009-October/msg00119.html</ref>
inf = d1,wnet.inf
"For Fedora 13, it'll be off by default in the kernel and the recommended
way of switching it on is with 'chkconfig ksm on'


[HardwareIds.scsi.viostor]
For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just
id = "PCI\VEN_1AF4&DEV_1001","viostor"
changes max pages and the only way of disabling it is by manually
</pre>
writing zero to {{filename|/sys/kernel/mm/ksm/run}}"
 
"We'll probably end up with this behaviour in F12 updates at some point
anyway when 2.6.32 is pulled in"


Richard added "I'm still unable to install XP using ide, scsi or virtio drivers
[[JustinForbes|Justin Forbes]]
as it gives the message "Setup was unable to format the partition. The
"The limit to half of total memory is because ksm pages are unswappable at
disk maybe damaged." -- any ideas welcome."
this time. To be fixed in a future kernel."


<references />
<references />

Revision as of 21:39, 1 November 2009


Virtualization

In this section, we cover discussion of Fedora virtualization technologies on the @fedora-virt and @virt-tools lists..

Contributing Writer: Dale Bewley

Fedora Virtualization List

This section contains the discussion happening on the fedora-virt list.

KSM Tuning

Izik Eidus [1]

" by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know

that much more memory can be saved...


Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?

And if we set it to disabled by default, cant we set the initialized values into more realistic value? (like 1/4 of the memory in the mainline kernels? ) "

Mark McLoughlin [2]

"ksm is disabled by default currently"

"Here's the logic we have in the init script[3]:

  # unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory.
  default_max_kernel_pages () {
      local total pagesize
      total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo`
      pagesize=`getconf PAGESIZE`
      echo $[total * 1024 / pagesize / 2]
  }

Justin Forbes [4]

"There are actually 2 init scripts. One to turn on ksm, and one for tuning. The actual ksm init script simply makes sure ksm is turned on in the kernel and sets max_kernel_pages to half of system memory. The ksmtuned script is a bit more involved."

Mark McLoughlin [5] "For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'

For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run"

"We'll probably end up with this behaviour in F12 updates at some point anyway when 2.6.32 is pulled in"

Justin Forbes "The limit to half of total memory is because ksm pages are unswappable at this time. To be fixed in a future kernel."

Virtualization Tools List

This section contains the discussion happening on the virt-tools-list list.

libosinfo Revisited

Arjun Roy revived[1] discussion of a library to track details of OS distributions for use by tools such as Package-x-generic-16.pngpython-virtinst and virt-inspector. LibOSinfo was first proposed[2] by Cole Robinson.

Other Sources

Using Kernel Samepage Merging with KVM

An upcoming feature of Fedora 12 is KSM[1]. "Kernel SamePage Merging is a recent linux kernel feature which combines identical memory pages from multiple processes into one copy on write memory region." Haydn Solomon described[2] how KSM and KVM work together.