> On July 10, 2013, 6:50 a.m., Wei Zhou wrote: > > plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java, > > line 956 > > <https://reviews.apache.org/r/12360/diff/2/?file=319577#file319577line956> > > > > It is mentioned in http://libvirt.org/formatdomain.html that "Since > > 0.9.10, an optional mode attribute may be used to make it easier to > > configure a guest CPU to be as close to host CPU as possible". Hence, I > > think it is better to compare _libvirtVersion here. This feature supports > > from libvirt 0.9.10.
i will do the version check in LibvirtComputingResource.java. - Jijun ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/12360/#review22949 ----------------------------------------------------------- On July 10, 2013, 3 a.m., Jijun Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/12360/ > ----------------------------------------------------------- > > (Updated July 10, 2013, 3 a.m.) > > > Review request for cloudstack, edison su, soren, and Wei Zhou. > > > Repository: cloudstack-git > > > Description > ------- > > Add cpu model for kvm guest.Now all the kvm guest's cpu model is 'QEMU > Virtual CPU version xxx'. This will affect the activation of Windows OS and > low performance. I add three mode for user to indicate the guest cpu model. > some ideas come from openstack and libvirt. > user can uncomment guest.cpu.mode and guest.cpu.model in agent.properties to > enable this feature.it is disabled by default. > some details as follows: > custom - user custom the CPU model which specified by guest.cpu.model. > host-model - identify the named CPU model which most closely matches the > host, and then request additional CPU flags to complete the match. This > should give close to maximum functionality/performance, which maintaining > good reliability/compatibility if the guest is migrated to another host with > slightly different host CPUs. > host-passthrough - tell KVM to passthrough the host CPU with no > modifications. The difference to host-model, instead of just matching feature > flags, every last detail of the host CPU is matched. This gives absolutely > best performance,and can be important to some apps which check low level CPU > details, but it comes at a cost wrt migration. The guest can only be migrated > to an exactly matching host CPU. > > > Diffs > ----- > > agent/conf/agent.properties 60030ae > > plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java > 914017c > > plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java > 5120870 > > plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java > 2c0ff8d > > Diff: https://reviews.apache.org/r/12360/diff/ > > > Testing > ------- > > 1.set guest.cpu.mode=custom,guest.cpu.model=Nehalem in agent.properties,you > can get more guest.cpu.model by execute virsh capabilities .create a new vm > instance or reboot your vm instance,the guest's cpu model will change as > guest.cpu.model specified. > 2.set guest.cpu.mode=host-model,create a new vm instance or reboot your vm > instance the guest's cpu model will be a closely cpu model as your hypervisor. > 3.set guest.cpu.mode=host-passthrough,create a new vm instance or reboot your > vm instance,the guest's cpu model should be the cpu model as your hypervisor. > > > Thanks, > > Jijun Liu > >