file:///C:/DOCUME~1/aaron/LOCALS~1/Temp/msohtml1/01/clip_image002.gif

電腦

eth0

eth1

網路設備

Nova-CC

10.10.10.1/24

192.168.104.11/24

Hub1(nova內部溝通)

Nova-1

10.10.10.2/24

192.168.104.12/24

Hub2(必須連至外部)

file:///C:/DOCUME~1/aaron/LOCALS~1/Temp/msohtml1/01/clip_image005.gif

file:///C:/DOCUME~1/aaron/LOCALS~1/Temp/msohtml1/01/clip_image007.jpg

file:///C:/DOCUME~1/aaron/LOCALS~1/Temp/msohtml1/01/clip_image009.jpg


1 nova nova 1029 2011-08-06 03:11 cacert.pem-rw


1 nova nova 2503 2011-08-06 03:11 cert.pem-rw-r--r-- 1 nova nova 5786 2011-08-06 03:11 novacreds.zip-rw


1 nova nova 981 2011-08-06 03:11 novarc-rw


1 nova nova 887 2011-08-06 03:11 pk.pemsource /home/nova/creds/novarcsudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry Since the script you are attempting to invoke has been converted to anUpstart job, you may also use the stop(8) and then start(8) utilities,e.g. stop libvirt-bin ; start libvirt-bin. The restart(8) utility is also available.libvirt-bin stop/waitinglibvirt-bin start/running, process 23598nova-network start/running, process 23620nova-compute start/running, process 23648nova-api start/running, process 23663nova-objectstore start/running, process 23674nova-scheduler start/running, process 23699nova-volume start/running, process 23708glance-api start/running, process 23715glance-registry start/running, process 23732root@nova-cc:~# euca-describe-availability-zones verboseAVAILABILITYZONE nova availableAVAILABILITYZONE |- nova-ccAVAILABILITYZONE | |- nova-compute enabled :-) 2011-08-06 08:15:15AVAILABILITYZONE | |- nova-scheduler enabled :-) 2011-08-06 08:15:13AVAILABILITYZONE | |- nova-network enabled :-) 2011-08-06 08:15:13AVAILABILITYZONE | |- nova-volume enabled :-) 2011-08-06 08:15:13 Nova Dashboard 安裝sudo apt-get install -y bzr sudo easy_install virtualenv Searching for virtualenvReading http://pypi.python.org/simple/virtualenv/Reading http://virtualenv.openplans.orgReading http://www.virtualenv.orgBest match: virtualenv 1.6.4Downloading http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.6.4.tar.gz#md5=1072b66d53c24e019a8f1304ac9d9fc5Processing virtualenv-1.6.4.tar.gzRunning virtualenv-1.6.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qWaoju/virtualenv-1.6.4/egg-dist-tmp-yFJeF5warning: no previously-included files matching '*.*' found under directory 'docs/_templates'Adding virtualenv 1.6.4 to easy-install.pth fileInstalling virtualenv script to /usr/local/bin Installed /usr/local/lib/python2.7/dist-packages/virtualenv-1.6.4-py2.7.eggProcessing dependencies for virtualenvFinished processing dependencies for virtualenv sudo bzr init-repo . Shared repository with trees (format: 2a)Location: shared repository: .sudo bzr branch lp:openstack-dashboard -r 46 /opt/osdb file:///C:/DOCUME~1/aaron/LOCALS~1/Temp/msohtml1/01/clip_image011.jpg cd /opt/osdb sudo sh run_tests.sh file:///C:/DOCUME~1/aaron/LOCALS~1/Temp/msohtml1/01/clip_image013.jpg


routing source 改成這個節的的內部網路IP --sql_connection=mysql://root:nova@192.168.104.11/nova ###外部ip 需要mysql帳號:密碼--glance_host=10.10.10.1 ###內部ip--image_service=nova.image.glance.GlanceImageService--iscsi_ip_prefix=10.10.10. 這樣就完成一個node 非常的簡單 安裝過程大部分較困難的地方為 nova 控制中心 因為我們這裡採用All in one方式,簡化了許多各個元件溝通與透過兩張網卡方式減少許多繁瑣的地方方便玩成實際測試環境的過程,不過若真正要真正達成以此營運的目的建議還是最好把nova-network nova-volume nova-objectstore nova-scheduler nova-compute nova-glance 各自分開,當某一個元件失效不至於造成全系統不能運作 手動制作linux image先建立一個5G大小的img aaron@nova-cc:/home/nova$ sudo kvm-img create -f raw ubuntu1104ser.img 5G Formatting 'ubuntu1104ser.img', fmt=raw size=5368709120下載或者若有光碟機也可以利用作ISO檔wget http://releases.ubuntu.com/natty/ubuntu-11.04-server-amd64.iso製作光碟 sudo dd if=/dev/cdrom of=/home/nova/ubuntu-11.04-server-amd64.isoroot@nova-cc:/home/nova# sudo kvm -m 512 -cdrom ubuntu-11.04-server-amd64.iso -drive file=ubuntu1104ser.img,if=scsi,index=0 -boot d -net nic -net user -vnc :0 這個時候Terminal會停住我們要利用VNC 連到安裝的介面需要安裝 sudo apt-get install xvnc4viewer接著我們另開一個Terminal輸入vncviewer IP:1接著就可以安裝了安裝的過程需要注意在分割區工作時的把 5GB 空間全部分割為 ext4 根目錄/ ,一個就好也不用建立 swap 若有警告則不予理會安裝好重新開機接著我們必須用vncviewersudo kvm -hda ubuntu1104ser.img -vnc :0再進入一次調整一下這個OS 的相關設定sudo apt-get update; sudo apt-get upgrade;sudo apt-get install openssh-server cloud-init如果做的是Centos or Fedora yum update yum install openssh-server chkconfig sshd on安裝完成無誤後輸入 sudo rm - rf / etc/udev/rules.d/70-persistent-net.rules 目的在於砍掉當時對eth0的設定讓每次使用的時產生新的該VM網路卡的rule安裝完後 關機 shutdown -h nowsudo losetup -f ubuntu1104ser.imgsudo losetup -a 你可以看到這樣的結果/dev/loop [0801]:16908388 ($filepath) 接著我們找出起始的sector root@nova-cc:/home/nova# sudo fdisk -cul /dev/loop0Disk /dev/loop1: 5368 MB, 5368709120 bytes 149 heads, 8 sectors/track, 8796 cylinders, total 10485760 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00048055 Device Boot Start End Blocks Id System /dev/loop1p0 * 2048 10483711 5240832 83 Linux 上面最後一行顯示sector 是從2048开始的,單一sector是512bytes , 2048 x 512 = 1048576 這個數字要記接著我們要要複製 loop0 先Unmount loop0 sudo losetup -f -o 1048576 server.imgsudo losetup -d /dev/loop0sudo losetup -a 可以看到底下這行/dev/loop0: [0801]:550044 (/home/nova/ubuntutemplate.img), offset 1048576sudo dd if=/dev/loop0 of=ubuntu1104server_template.img10483712+0 records in 10483712+0 records out 5367660544 bytes (5.4 GB) copied, 133.322 s, 40.3 MB/s複製之後先卸載 loop0 sudo losetup -d /dev/loop0再來我們先mountsudo mount -o loop serverfinal.img /mnt將最底下的這行註解掉#UUID=548c16fd-889a-4248-bc45-e75c9802d69a / ext4 errors=remount-ro $改成 LABEL=uec-rootfs /ext4 defaults 0 0 sudo cp /mnt/boot/vmlinuz-2.6.38-7-server /home/nova

Wiki: Aaron Huang (last edited 2011-08-23 16:25:20 by Aaron Huang)