溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎么解決后端使用ceph qem性能問題

發(fā)布時間:2021-12-06 14:24:25 來源:億速云 閱讀:154 作者:柒染 欄目:云計算

怎么解決后端使用ceph qem性能問題,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。


由于升級libvirt、qemu后沒有qemu-kvm模塊。nova配置文件配置為 virt-type=kvm將會報錯、配置為qemu則性能低。

本次測試環(huán)境配置:

horizon 的ip 192.168.10.71

其他組件ip 192.168.10.191


1、使用virt-type=qemu啟動的虛擬機(jī):

怎么解決后端使用ceph qem性能問題

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

怎么解決后端使用ceph qem性能問題




2、virt-type=kvm用openstack生成虛擬機(jī),報錯:

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


怎么解決后端使用ceph qem性能問題




3、關(guān)于qemu-system-x86_64、qemu-kvm、qemu-img

圖3.1

怎么解決后端使用ceph qem性能問題

查看上面兩個qemu-img對應(yīng)的版本及支持格式:



/usr/bin/qemu-img | grep -E  "version|Supported"

圖3.2

怎么解決后端使用ceph qem性能問題




/usr/local/qemu/bin/qemu-img | grep -E  "version|Supported"

圖3.3

怎么解決后端使用ceph qem性能問題




在回到上述錯誤:

圖3.4

怎么解決后端使用ceph qem性能問題


此處啟動用的qemu-kvm:


查找qemu-kvm:

圖3.5

怎么解決后端使用ceph qem性能問題


查看qemu-kvm版本:

圖3.6

怎么解決后端使用ceph qem性能問題


再找到對應(yīng)的0.12.1版本的qemu-img(圖3.2),發(fā)現(xiàn)不支持rbd(ceph后端使用需要rbd支持)。(注:圖3.3qemu-img支持rbd。)


通過上面分析總結(jié)一下:

/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的模塊,因此出現(xiàn)圖3.4錯誤。


 

解決辦法:

將圖3.4中啟動的qemu-kvm替換為新版version 1.6.1的/usr/bin/qemu-system-x86_64來啟動虛擬機(jī)。


 

操作步驟:

 mv /usr/libexec/qemu-kvm /usr/libexec/qemu-kvm.bak


再次生成虛擬機(jī):

怎么解決后端使用ceph qem性能問題


發(fā)現(xiàn)虛擬機(jī)生成成功。


再來看看底冊啟動參數(shù):

ps aux | grep qemu

怎么解決后端使用ceph qem性能問題


發(fā)現(xiàn)后面生成的虛擬機(jī),將nova.conf配置為virt-type=kvm之后。再將原生自帶的qemu-kvm移除掉則能正常生成虛擬機(jī)。且生成的虛擬機(jī)使用了kvm虛擬機(jī)(accel=kvm),提高了性能。


結(jié)論:

1、當(dāng)     nova.conf配置為virt-type=qemu時候,會使用qemu軟件特性模擬生成虛擬機(jī),一次性能降低。    

2、當(dāng)nova.conf配置為virt-type=kvm時候,首先回去查找qemu-kvm模塊。如果存在qemu-kvm模塊則直接使用此模塊啟動虛擬機(jī)。如果qemu-kvm模塊找不到,則會去尋找qemu-system-x86_64,找到則用qemu-system-x86_64啟動虛擬機(jī),并使用kvm虛擬機(jī)特性。及開啟--enable-kvm特性參數(shù)


 

注:kvm虛擬化模塊:

在老版本中有單獨的qemu-kvm模塊存在,結(jié)合qemu一起做虛擬機(jī)工作。     在后續(xù)新版本中,已經(jīng)將qemu-kvm模塊完全合并到qemu中去。因此當(dāng)需要使用kvm特性時候,只需要qemu-system-x86_64 啟動命令中增加參數(shù) --enable-kvm參數(shù)使能即可。


看完上述內(nèi)容,你們掌握怎么解決后端使用ceph qem性能問題的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI