作者 主題: 關於 OpenStack 安裝好後,運行實例發生錯誤的問題。  (閱讀 5163 次)

0 會員 與 1 訪客 正在閱讀本文。

zzxx80135

  • 可愛的小學生
  • *
  • 文章數: 2
    • 檢視個人資料
HI~大家好!

第一次來這PO文不知道該PO哪版,若不恰當的話我再另PO!

小弟有個很困擾的問題想提問,是關於OpenStack 安裝好後,SSH卻連不上已運行的實例問題,已經卡了我一星期啦!!由於時間真的好緊迫,只好上來請求大家的幫助了!!!  Orz

先簡單說一下我的系統架構: 

我有兩台電腦,一台 Server1,一台 Server2。

設定架構如下:









Server1 作為主要節點,假設對外IP eth0 : 100.100.100.10 ,對內IP eth1: 192.168.3.1
,安裝所有 Nova 元件、Glance、MySql 等等。
(但我沒安裝 Swift,想請問沒安裝的話會影響系統運行嗎?因為我看很多教學都沒裝一樣可以用,也就沒裝了。 )

Server2 作為計算節點,假設對外IP eth0 : 100.100.100.11 ,對內IP eth1: 192.168.3.2
只安裝 nova-compute。

爬了很多篇網路上的教學,一路上解決了很多卡點,終於,如今輸入指令:

# euca-describe-availability-zones verbose

AVAILABILITYZONE        nova    available
AVAILABILITYZONE        |- server1
AVAILABILITYZONE        | |- nova-scheduler     enabled :-) 2012-04-26 15:11:53
AVAILABILITYZONE        | |- nova-volume        enabled :-) 2012-04-26 15:11:53
AVAILABILITYZONE        | |- nova-compute       enabled :-) 2012-04-26 15:11:45
AVAILABILITYZONE        | |- nova-network       enabled :-) 2012-04-26 15:11:53
AVAILABILITYZONE        |- server2
AVAILABILITYZONE        | |- nova-compute       enabled :-) 2012-04-26 15:11:49

成功了阿!!!  Q_____Q

接著開始上傳 images 到網路上。

我是先下載此處  http://smoser.brickies.net/ubuntu/ttylinux-uec/  ,裏頭的 ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz 這個檔,作為我第一個測試。

上傳 images 成功後,檢查看看,輸入指令:

# euca-describe-images

IMAGE   aki-00000003    ttylinux/ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz.manifest.xml               available       public          i386    kernel
IMAGE   ari-00000004    ttylinux/ttylinux-uec-amd64-12.1_2.6.35-22_1-initrd.manifest.xml                available       public          i386    ramdisk
IMAGE   ami-00000005    ttylinux/ttylinux-uec-amd64-12.1_2.6.35-22_1.img.manifest.xml           available       public          i386    machine aki-

00000003ari-00000004


很好!進去了!

接著輸入指令,創建虛擬機:

# euca-run-instances -k mykey -t m1.tiny ami-00000005

RESERVATION     r-0tpi08wm      proj    default
INSTANCE        i-00000010      ami-00000005                    scheduling      mykey (proj, None)      0               m1.tiny 2012-04-26T15:21:58Z    unknown

zone


接著列出所有實例狀態:

# euca-describe-instances

RESERVATION     r-0tpi08wm      proj    default
INSTANCE        i-00000010      ami-00000005    192.168.4.3     192.168.4.3     running mykey (proj, server1)   0               m1.tiny 2012-04-

26T15:21:58Znova



很好!狀態也處在 running 了!

再確定一下KVM:

# virsh list

 Id 名稱               狀態
----------------------------------
   6 instance-00000010    執行中


YES!那麼現在便來透過 SSH連線虛擬機吧!

輸入指令:

# ssh -i mykey.priv user@192.168.4.3

卻出現

Warning: Identity file mykey.priv not accessible: No such file or directory.
ssh: connect to host 192.168.4.3 port 22: No route to host

接著把 user 改成 root試看看,輸入指令:

# ssh -i mykey.priv root@192.168.4.3

Warning: Identity file mykey.priv not accessible: No such file or directory.
ssh: connect to host 192.168.4.3 port 22: No route to host


一樣結果阿!! 

再輸入指令:

# euca-get-console-output i-00000010

i-00000010
2012-04-26T15:46:50Z


也非網路上正常顯示的訊息......

已經卡在這很久了......(崩潰)

先整理一下我的問題:

1. 為什麼我的SSH連不上去呢?看訊息很像是它根本沒有被啟動阿!但問題在哪裡呢?

2. 我主要是按照此網頁 http://cssoss.wordpress.com/ 的教學PDF檔做的,但我沒有安裝 Swift ,這樣是否會有影響呢?

3. 我的Server1 是有支援 KVM的功能,但Server2 是沒有的,想請問這樣會有影響嗎?想說應該不會,但還是不放心所以問一下。





以上問題,還請知道答案 的朋友幫我看看,無限感激!!!

以下是我的  /var/log/nova/nova-compute.log 顯示的內容:


2012-04-26 23:21:59,323 DEBUG nova.rpc [-] 已接收 {u'_context_request_id': u'Q679F-1Y3-043VAF6184', u'_context_read_deleted': False, u'args': {u'instance_id': 16, u'injected_files': None, u'availability_zone': None}, u'_context_is_admin': True, u'_context_timestamp': u'2012-04-26T15:21:58Z', u'_context_user': u'novaadmin', u'method': u'run_instance', u'_context_project': u'proj', u'_context_remote_address': u'120.105.80.242'} from (pid=2259) _receive /usr/lib/pymodules/python2.7/nova/rpc.py:167
2012-04-26 23:21:59,323 DEBUG nova.rpc [-] unpacked context: {'timestamp': u'2012-04-26T15:21:58Z', 'remote_address': u'120.105.80.242', 'project': u'proj', 'is_admin': True, 'user': u'novaadmin', 'request_id': u'Q679F-1Y3-043VAF6184', 'read_deleted': False} from (pid=2259) _unpack_context /usr/lib/pymodules/python2.7/nova/rpc.py:331
2012-04-26 23:21:59,370 AUDIT nova.compute.manager [Q679F-1Y3-043VAF6184 novaadmin proj] 虚拟机 16 :启动
2012-04-26 23:21:59,461 DEBUG nova.rpc [-] Making asynchronous call on network.server1 ... from (pid=2259) call /usr/lib/pymodules/python2.7/nova/rpc.py:350
2012-04-26 23:21:59,462 DEBUG nova.rpc [-] 消息ID(MSG_ID)是 393293bca4eb488f8f4382cdf337e71c from (pid=2259) call /usr/lib/pymodules/python2.7/nova/rpc.py:353
2012-04-26 23:21:59,972 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:ip link show dev vlan100 from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:21:59,979 DEBUG nova.utils [-] Attempting to grab semaphore "ensure_bridge" for method "ensure_bridge"... from (pid=2259) inner /usr/lib/pymodules/python2.7/nova/utils.py:594
2012-04-26 23:21:59,979 DEBUG nova.utils [-] Attempting to grab file lock "ensure_bridge" for method "ensure_bridge"... from (pid=2259) inner /usr/lib/pymodules/python2.7/nova/utils.py:599
2012-04-26 23:21:59,979 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:ip link show dev br100 from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:21:59,985 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo route -n from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,001 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo ip addr show dev vlan100 scope global from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,017 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo brctl addif br100 vlan100 from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,032 DEBUG nova.utils [-] 运行结果为 1 from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:166
2012-04-26 23:22:00,080 DEBUG nova.virt.libvirt_conn [-] instance instance-00000010: starting toXML method from (pid=2259) to_xml /usr/lib/pymodules/python2.7/nova/virt/libvirt_conn.py:996
2012-04-26 23:22:00,123 DEBUG nova.virt.libvirt_conn [-] instance instance-00000010: finished toXML method from (pid=2259) to_xml /usr/lib/pymodules/python2.7/nova/virt/libvirt_conn.py:1041
2012-04-26 23:22:00,174 INFO nova [-] called setup_basic_filtering in nwfilter
2012-04-26 23:22:00,174 INFO nova [-] ensuring static filters
2012-04-26 23:22:00,204 INFO nova [-] <nova.db.sqlalchemy.models.SecurityGroupIngressRule object at 0xabc598c>
2012-04-26 23:22:00,204 INFO nova [-] <nova.db.sqlalchemy.models.SecurityGroupIngressRule object at 0xabc5c0c>
2012-04-26 23:22:00,208 DEBUG nova.utils [-] Attempting to grab semaphore "iptables" for method "apply"... from (pid=2259) inner /usr/lib/pymodules/python2.7/nova/utils.py:594
2012-04-26 23:22:00,208 DEBUG nova.utils [-] Attempting to grab file lock "iptables" for method "apply"... from (pid=2259) inner /usr/lib/pymodules/python2.7/nova/utils.py:599
2012-04-26 23:22:00,213 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo iptables-save -t filter from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,227 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo iptables-restore from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,241 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo iptables-save -t nat from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,258 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo iptables-restore from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,293 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:mkdir -p /var/lib/nova/instances/instance-00000010/ from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,299 INFO nova.virt.libvirt_conn [-] instance instance-00000010: Creating image
2012-04-26 23:22:00,347 DEBUG nova.utils [-] Attempting to grab semaphore "00000003" for method "call_if_not_exists"... from (pid=2259) inner /usr/lib/pymodules/python2.7/nova/utils.py:594
2012-04-26 23:22:00,348 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:cp /var/lib/nova/instances/_base/00000003 /var/lib/nova/instances/instance-00000010/kernel from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,404 DEBUG nova.utils [-] Attempting to grab semaphore "00000004" for method "call_if_not_exists"... from (pid=2259) inner /usr/lib/pymodules/python2.7/nova/utils.py:594
2012-04-26 23:22:00,405 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:cp /var/lib/nova/instances/_base/00000004 /var/lib/nova/instances/instance-00000010/ramdisk from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,479 DEBUG nova.utils [-] Attempting to grab semaphore "00000005_sm" for method "call_if_not_exists"... from (pid=2259) inner /usr/lib/pymodules/python2.7/nova/utils.py:594
2012-04-26 23:22:00,479 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:qemu-img create -f qcow2 -o cluster_size=2M,backing_file=/var/lib/nova/instances/_base/00000005_sm /var/lib/nova/instances/instance-00000010/disk from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:00,638 INFO nova.virt.libvirt_conn [-] instance instance-00000010: injecting key into image 5
2012-04-26 23:22:00,647 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo qemu-nbd -c /dev/nbd15 /var/lib/nova/instances/instance-00000010/disk from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:01,689 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo tune2fs -c 0 -i 0 /dev/nbd15 from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:02,275 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo mount /dev/nbd15 /tmp/tmpgyPunH from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:02,315 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo mkdir -p /tmp/tmpgyPunH/root/.ssh from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:02,334 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo chown root /tmp/tmpgyPunH/root/.ssh from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:02,350 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo chmod 700 /tmp/tmpgyPunH/root/.ssh from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:02,365 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo tee -a /tmp/tmpgyPunH/root/.ssh/authorized_keys from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:02,412 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo umount /dev/nbd15 from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:03,010 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:rmdir /tmp/tmpgyPunH from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:03,016 DEBUG nova.utils [-] 正在运行(在子进程中)运行命令:sudo qemu-nbd -d /dev/nbd15 from (pid=2259) execute /usr/lib/pymodules/python2.7/nova/utils.py:150
2012-04-26 23:22:04,121 DEBUG nova.virt.libvirt_conn [-] instance instance-00000010: is running from (pid=2259) spawn /usr/lib/pymodules/python2.7/nova/virt/libvirt_conn.py:618
2012-04-26 23:22:04,296 DEBUG nova.virt.libvirt_conn [-] instance instance-00000010: booted from (pid=2259) _wait_for_boot /usr/lib/pymodules/python2.7/nova/virt/libvirt_conn.py:634



/etc/nova/nova.conf 內容:

--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--lock_path=/var/lock/nova
--verbose

--s3_host=100.100.100.10
--rabbit_host=100.100.100.10
--cc_host=100.100.100.10
--nova_url=http://100.100.100.10:8774/v1.1/
--fixed_range=192.168.0.0/16
--network_size=8
--routing_source_ip=100.100.100.10
--sql_connection=mysql://novadbadmin:novasecret@100.100.100.10/nova
--glance_api_servers=192.168.3.2:9292
#--glance_api_servers=192.168.3.1:9292
--image_service=nova.image.glance.GlanceImageService
--iscsi_ip_prefix=192.168.
--vlan_interface=virbr0
--public_interface=eth0




如果有需要提供什麼訊息才能知道問題的話,請不要客氣,直接在底下留言給我,我看到便會馬上回覆你!!

感恩!因為真的很急!謝謝大家!! (鞠躬、鞠躬、再鞠躬)


« 上次編輯: 2012-04-27 00:26 由 zzxx80135 »