十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
怎么解决后端使用ceph qem性能问题,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
昌乐网站建设公司创新互联,昌乐网站设计制作,有大型网站制作公司丰富经验。已为昌乐上千余家提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的昌乐做网站的公司定做!
由于升级libvirt、qemu后没有qemu-kvm模块。nova配置文件配置为 virt-type=kvm将会报错、配置为qemu则性能低。
本次测试环境配置:
horizon 的ip 192.168.10.71 其他组件ip 192.168.10.191 |
1、使用virt-type=qemu启动的虚拟机:
root 24502 17.6 0.4 2530112 307192 ? Sl 21:51 1:23 /usr/bin/qemu-system-x86_64 -name instance-00000001 -S -machine pc-i440fx-1.6,accel=tcg,usb=off -m 512 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 8ee337e0-4808-49e7-9e66-45dc4a7b1f40 -smbios type=1,manufacturer=Red Hat Inc.,product=OpenStack Nova,version=2014.1.1-3.el6,serial=44454c4c-3600-1058-8033-b3c04f463232,uuid=8ee337e0-4808-49e7-9e66-45dc4a7b1f40 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/usr/local/libvirt/var/lib/libvirt/qemu/instance-00000001.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=rbd:liunova/8ee337e0-4808-49e7-9e66-45dc4a7b1f40_disk:id=admin:key=AQBlwSxU0HsWBxAAMfhhWANPIIDihk7JTFunKQ==:auth_supported=cephx\;none:mon_host=192.168.10.186\:6789\;192.168.10.187\:6789\;192.168.10.188\:6789\;192.168.10.189\:6789,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=18,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:99:7c:a0,bus=pci.0,addr=0x3 -chardev file,id=charserial0,path=/var/lib/nova/instances/8ee337e0-4808-49e7-9e66-45dc4a7b1f40/console.log -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charserial1 -device isa-serial,chardev=charserial1,id=serial1 -device usb-tablet,id=input0 -spice port=5900,addr=0.0.0.0,disable-ticketing,seamless-migration=on -k en-us -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 |
很明显看到上面使用的是/usr/bin/qemu-system-x86_64。
看看:/usr/bin/qemu-system-x86_64 --help
2、virt-type=kvm用openstack生成虚拟机,报错:
2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] Traceback (most recent call last): 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1305, in _build_instance 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] set_access_ip=set_access_ip) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 393, in decorated_function 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] return function(self, context, *args, **kwargs) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1717, in _spawn 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] LOG.exception(_('Instance failed to spawn'), instance=instance) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__ 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] six.reraise(self.type_, self.value, self.tb) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1714, in _spawn 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] block_device_info) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2265, in spawn 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] block_device_info) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3656, in _create_domain_and_network 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] power_on=power_on) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3559, in _create_domain 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] domain.XMLDesc(0)) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__ 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] six.reraise(self.type_, self.value, self.tb) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3554, in _create_domain 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] domain.createWithFlags(launch_flags) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 183, in doit 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] result = proxy_call(self._autowrap, f, *args, **kwargs) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 141, in proxy_call 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] rv = execute(f, *args, **kwargs) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 122, in execute 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] six.reraise(c, e, tb) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 80, in tworker 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] rv = meth(*args, **kwargs) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] File "/usr/lib64/python2.6/site-packages/libvirt.py", line 727, in createWithFlags 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self) 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee1tafd7f8] libvirtError: internal error: process exited while connecting to monitor: char device redirected to /dev/pts/4 2014-11-18 21:53:55.498 25214 TRACE nova.compute.manager [instance: 5b50ed5b-c3d9-40cd-889d-0aee14afd7f8] q%mu-kvm: -drive file=rbd:liunova/5b50ed5b-c3d9-40cd-889d-0aee14afd7f8_disk:id=admin:key=AQBlwSxU0HsWBxAAMfhhWANPIIDihk7JTFunKQ==:auth_supported=cephx\;none:mon_host=192.168.10.186\:6789\;192.168.10.187\:6789\;192.168.10.188\:6789\;192.168.10.189\:6789,if=none,id=drive-virtio-disk0,format=raw,cache=none%sA could not open disk image rbd:liunova/5b50ed5b-c3d9-40cd-889d-0aee14afd7f8_disk:id=admin:key=AQBlwSxU0HsWBxAAMfhhWANPIIDihk7JTFunKQ==:auth_supported=cephx\;none:mon_host=192.168.10.186\:6789\;192.168.10.187\:6789\;192.168.10.188\:6789\;192.168.10.189\:6789: No such file or directory |
3、关于qemu-system-x86_64、qemu-kvm、qemu-img
图3.1
查看上面两个qemu-img对应的版本及支持格式:
/usr/bin/qemu-img | grep -E "version|Supported" |
图3.2
/usr/local/qemu/bin/qemu-img | grep -E "version|Supported" |
图3.3
在回到上述错误:
图3.4
此处启动用的qemu-kvm:
查找qemu-kvm:
图3.5
查看qemu-kvm版本:
图3.6
再找到对应的0.12.1版本的qemu-img(图3.2),发现不支持rbd(ceph后端使用需要rbd支持)。(注:图3.3qemu-img支持rbd。)
通过上面分析总结一下:
/usr/bin/qemu-system-x86_64与/usr/local/qemu/bin/qemu-img是配套的。版本为:version 1.6.1(手动编译1.6.1 qemu的源码包之后版本)
/usr/libexec/qemu-kvm与/usr/bin/qemu-img是配套的。版本为:version 0.12.1(为升级前版本)
这样就可以解释图3.4的错误了,因为图3.4使用的是V0.12.1,而 V0.12.1的qemu-img没有编译支持rbd的模块,因此出现图3.4错误。
解决办法:
将图3.4中启动的qemu-kvm替换为新版version 1.6.1的/usr/bin/qemu-system-x86_64来启动虚拟机。
操作步骤:
mv /usr/libexec/qemu-kvm /usr/libexec/qemu-kvm.bak |
再次生成虚拟机:
发现虚拟机生成成功。
再来看看底册启动参数:
ps aux | grep qemu |
发现后面生成的虚拟机,将nova.conf配置为virt-type=kvm之后。再将原生自带的qemu-kvm移除掉则能正常生成虚拟机。且生成的虚拟机使用了kvm虚拟机(accel=kvm),提高了性能。
结论:
1、当 nova.conf配置为virt-type=qemu时候,会使用qemu软件特性模拟生成虚拟机,一次性能降低。 2、当nova.conf配置为virt-type=kvm时候,首先回去查找qemu-kvm模块。如果存在qemu-kvm模块则直接使用此模块启动虚拟机。如果qemu-kvm模块找不到,则会去寻找qemu-system-x86_64,找到则用qemu-system-x86_64启动虚拟机,并使用kvm虚拟机特性。及开启--enable-kvm特性参数 |
注:kvm虚拟化模块:
在老版本中有单独的qemu-kvm模块存在,结合qemu一起做虚拟机工作。 在后续新版本中,已经将qemu-kvm模块完全合并到qemu中去。因此当需要使用kvm特性时候,只需要qemu-system-x86_64 启动命令中增加参数 --enable-kvm参数使能即可。 |
看完上述内容,你们掌握怎么解决后端使用ceph qem性能问题的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注创新互联行业资讯频道,感谢各位的阅读!