
Hi, Zdenek Thank you for your comment. On Thu, 20 Jan 2011 12:48:46 +0100 Zdenek Styblik <stybla@turnovfree.net> wrote:
On 01/20/2011 09:34 AM, Minoru Usui wrote:
Hi, everyone
In an environment with multiple host machines, I want to select a suitable host automatically on which I run a VM depending on machine's load.
Libvirt has APIs to get host machine's information, but I think these APIs aren't enough for above purpose. So I suggest below changes. What do you think?
* virNodeGetInfo() This API can get "CPU frequency"(mhz member of virNodeInfo) from "cpu MHz" of /proc/cpuinfo. This value isn't constant, because it may be decrease by power saving feature.(cf. cpuspeed on RHEL)
This value is very useful for getting *present* cpu frequency, but I want to get Maximum CPU frequency, too. I want to add max_mhz member in struct virNodeInfo from /sys/device/system/cpu/cpuXX/cpufreq/cpuinfo_max_freq.
* virNodeGetFreeMemory() This API returns amount of free memory of the host machine's all node, but this value doesn't include host's cache/buffer memory. For above purpose, it would be more suitable to account cache/buffer as free memory, because most of cache/buffer memory are reclaimable. But I think virNodeGetFreeMemory()'s ABI should not change easily.
I want to add function virNodeGetCacheBufferMemory(). It returns amount of cache + buffer memory from /proc/meminfo.
* virSysinfoRead() This API is completely internal. But DMI type1 information(dmidecode -t1) is useful for above purpose, because it's one of the information which suppose to processing capacity about host machine.
I want to export virSysinfoRead() to user.
Hello,
this is a great news. I was wondering if libvirt has anything like load balancing(or HA). I'm not sure if this is aim of yours resp. of this RF(C|D).
Anyway, wouldn't it be better to count in total load, io-waits, idle etc. instead of just CPU freq?
I agree with memory as being key element, still I would choose by more just than these two. I mean, machine can have "low" CPU utilization, perhaps even "a lot" of free RAM, yet high io-waits. I wouldn't want to migrate anything there.
You are right. It's better to CPU utilization than CPU freq. I'll add new API which named virNodeGetCpuTime() about it. It returns cpu time of host machine from /proc/stat. How about this?
It might be as well as gibberish/rubbish from my side, or plain misunderstanding. I beg for forgiveness! :)
It is not necessary to mind it.
Regards, Zdenek
-- Zdenek Styblik Net/Linux admin OS TurnovFree.net email: stybla@turnovfree.net jabber: stybla@jabber.turnovfree.net
-- Minoru Usui <usui@mxm.nes.nec.co.jp>