以下主要為安裝部署過程中遇到的一些問題,因為openstack版本問題,帶來的組件差異導致不同的版本安裝的方法也完全不一樣。經過測試,目前已可成 功部署Essex和Grizzly兩個版本,其中間還有個版本是Folsom,這個版本沒有部署成功,也沒有花太多時間去研究,因為Folsom版本中使 用的quantum組件還不成熟,對於網絡連通性還有很多問題,網上也很少有成功的案例,大多數人使用的還是folsom+nova-network模 式。
到了Grizzly版本,quantum組件才比較穩定,可以正常使用,自己也花了很多時間研究,現在已可以成功部署多節點環境。以下是部署過程中遇到的 一些問題,包括Essex和Grizzly兩個版本。國內網上關於這方面的資料很少,很多資料也都是國外網站上看到的。而且很多情況下日志錯誤信息相同, 但導致錯誤的原因卻不盡相同,這時候就需要仔細分析其中的原理,才能准確定位。遇到錯誤並不可怕,我們可以通過對錯誤的排查加深對系統的理解,這樣也是好 事。
關於安裝部署,網上有一些自動化的部署工具,如devstack和onestack,一鍵式部署。如果你是初學者,並不建議你使用這些工具,很明顯,這樣 你學不到任何東西,不會有任何收獲。如果沒有問題可以暫時恭喜你一下,一旦中間環節出現錯誤信息,你可能一頭霧水,根本不知道是哪里錯了,加之后期的維護 也是相當困難的。你可能需要花更多的時間去排查故障。因為你根本不了解中間經過了哪些環節,需要做哪些配置!這些工具大多數是為了快速部署開發環境所用, 正真生產環境還需要我們一步一步來操作。這樣有問題也可快速定位排查錯誤。
本文僅是針對部署過程中的一些錯誤信息進行總結梳理,並給予解決辦法,這些情況是在我的環境里遇到的,並成功解決的,可能會因為環境的不同而有所差異,僅供參考。
1、檢查服務是否正常
- root@control:~# nova-manage service list
- Binary Host Zone Status State Updated_At
- nova-cert control internal enabled :-) 2013-04-26 02:29:44
- nova-conductor control internal enabled :-) 2013-04-26 02:29:42
- nova-consoleauth control internal enabled :-) 2013-04-26 02:29:44
- nova-scheduler control internal enabled :-) 2013-04-26 02:29:47
- nova-compute node-01 nova enabled :-) 2013-04-26 02:29:46
- nova-compute node-02 nova enabled :-) 2013-04-26 02:29:46
- nova-compute node-03 nova enabled :-) 2013-04-26 02:29:42
- python2.7/dist-packages/nova/virt/libvirt/connection.py”, line 338, in _connect
- 2013-03-0917:05:42 TRACE nova return libvirt.openAuth(uri, auth, 0)
- 2013-03-09 17:05:42 TRACE nova File “/usr/lib/python2.7/dist-packages/libvirt.py”, line 102, in openAuth
- 2013-03-09 17:05:42 TRACE nova if ret is None:raise libvirtError(‘virConnectOpenAuth() failed’)
- 2013-03-09 17:05:42 TRACE nova libvirtError: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: No such file or directory
- 2013-03-09 22:05:41.909+0000: 12466: info : libvirt version: 0.9.8
- 2013-03-09 22:05:41.909+0000: 12466: error : virNetServerMDNSStart:460 : internal error Failed to create mDNS client: Daemon not running
- Error:
- Failed to add image. Got error:
The request returned 500 Internal Server Error
- OS_AUTH_KEY=”openstack”
- OS_AUTH_URL=”http://localhost:5000/v2.0/”
- OS_PASSWORD=”openstack”
- OS_TENANT_NAME=”admin”
- OS_USERNAME=”admin”
- Nova instance not found
- Local file storage of the image files.
- Error:
- 2013-03-09 17:58:08 TRACE nova raise exception.InstanceNotFound(instance_id=instance_name)
- 2013-03-09 17:58:08 TRACE nova InstanceNotFound: Instance instance-00000002 could not be found.
- 2013-03-09 17:58:08 TRACE nova
- $mysql –u root –p
- DROP DATABASE nova;
- Recreate the DB:
- CREATE DATABASE nova; (strip formatting if you copy and paste any of this)
- GRANT ALL PRIVILEGES ON nova.* TO ‘novadbadmin’@'%’ IDENTIFIED BY ‘<password>’;
- Quit
- Resync DB
- #!/bin/bash
- mysql -uroot -pmysql << _ESXU_
- use nova;
- DELETE a FROM nova.security_group_instance_association
- AS a INNER JOIN nova.instances AS b
- ON a.instance_uuid=b.id where b.uuid='$1';
- DELETE FROM nova.instance_info_caches WHERE instance_uuid='$1';
- DELETE FROM nova.instances WHERE uuid='$1';
- _ESXU_
- Error
- root@openstack-dev-r910:/home/brent/openstack# ./keystone_data.sh
- No handlers could be found for logger “keystoneclient.client”
- Unable to authorize user
- No handlers could be found for logger “keystoneclient.client”
- Unable to authorize user
- No handlers could be found for logger “keystoneclient.client”
- Unable to authorize user
- 2012-07-24 14:33:08 TRACE nova.rpc.amqp ProcessExecutionError: Unexpected error while running command.
- 2012-07-24 14:33:08 TRACE nova.rpc.amqp Command: sudo nova-rootwrap iscsiadm -m node -T iqn.2010-10.org.openstack:volume-00000011 -p 192.168.0.23:3260 –rescan
- 2012-07-24 14:33:08 TRACE nova.rpc.amqp Exit code: 255
- 2012-07-24 14:33:08 TRACE nova.rpc.amqp Stdout: ”
- 2012-07-24 14:33:08 TRACE nova.rpc.amqp Stderr: ‘iscsiadm: No portal found.\n’
- Authorization Failed: Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. Command 'openssl' returned non-zero exit status 3", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
Authorization Failed: Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. Command 'openssl' returned non-zero exit status 3", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
2677 2013-03-04 12:40:58 ERROR [keystone.common.cms] Signing error: Error opening signer certificate /etc/keystone/ssl/certs/signing_cert.pem2678 139803495638688:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('/etc/keystone/ssl/certs/signing_cert.pem','r')2679 139803495638688:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:2680 unable to load certificate2682 2013-03-04 12:40:58 ERROR [root] Command 'openssl' returned non-zero exit status 32683 Traceback (most recent call last):2684 File "/usr/lib/python2.7/dist-packages/keystone/common/wsgi.py", line 231, in __call__2685 result = method(context, **params)2686 File "/usr/lib/python2.7/dist-packages/keystone/token/controllers.py", line 118, in authenticate2687 CONF.signing.keyfile)2688 File "/usr/lib/python2.7/dist-packages/keystone/common/cms.py", line 140, in cms_sign_token2689 output = cms_sign_text(text, signing_cert_file_name, signing_key_file_name)2690 File "/usr/lib/python2.7/dist-packages/keystone/common/cms.py", line 135, in cms_sign_text2691 raise subprocess.CalledProcessError(retcode, "openssl")2692 CalledProcessError: Command 'openssl' returned non-zero exit status 3
token_format = UUID
- kvm -m 512 -boot d –drive
-
- ile=win2003server.img,cache=writeback,if=virtio,boot=on -fda virtio-win-1.1.16.vfd -cdrom w
- kvm -m 1024 –drive file=win2003server.img,if=virtio,
- boot=on -cdrom virtio-win-0.1-30.iso -net nic,model=virtio -net user -boot c -nographic -vnc 8
這 里需要注意的地方是if=virtio,boot=on –fda virtio-win-1.1.16.vfd和引導系統時使用的virtio-win-0.1-30.iso 這兩個驅動分別是硬盤和網卡驅動。如果不加載這兩個驅動安裝時會發現找不到硬盤,並且用制作好的鏡像生成實例也會發現網卡找不到驅動,所以在這里安裝鏡像 生成后需要重新引導鏡像安裝更新網卡驅動為virtio。
11、刪除僵屍volume
如果cinder服務不正常,我們在創建volume時會產生一些僵屍 volume,如果在horizon中無法刪除的話,我們需要到服務器上去手動刪除,命令:lvremove /dev/nova-volumes/volume-000002注意這里一定要寫完整的路徑,不然無法刪除,如果刪除提示:“Can't remove open logical volume“ 可嘗試將相關服務stop掉,再嘗試刪除。刪除完還需到數據庫cinder的volumes表里清除相關記錄。