最近工作上要使用 GENI (http://www.geni.net/)環境
其中 omni / gcf (GENI Control Framework) 是很好的文字界面的 client 軟體
上一篇文章是安裝在 Mac 環境, 這一篇是安裝在 openSUSE 環境
OS: openSUSE 13.2
安裝參考
Download omni ( GCF )
解壓縮
> tar zxvf gcf-2.9.tar.gz
觀察檔案
> ls -l
總計 688
drwxr-xr-x 12 max users 4096 5月 21 03:38 gcf-2.9
-rw-r--r-- 1 max users 697721 10月 2 01:42 gcf-2.9.tar.gz
我是把 gcf 搬到家目錄
> mv gcf-2.9 ~
切換到家目錄
> cd ~
建立 symbolic link 方便日後升級
> ln -s gcf-2.9/ gcf
將omni 加入 $PATH 變數
> vi ~/.bashrc
加入以下, 注意 /home/max/gcf 是我的安裝路徑, 要改成自己的安裝路徑
# set PATH so it includes geni software if it exists
if [ -d "/home/max/gcf/src" ] ; then
PATH="/home/max/gcf/src:/home/max/gcf/examples:$PATH"
export PYTHONPATH="/home/max/gcf/src:$PYTHONPATH"
fi
alias omni='omni.py'
alias omni-configure='omni-configure.py'
alias readyToLogin='readyToLogin.py'
alias clear-passphrases='clear-passphrases.py'
alias stitcher='stitcher.py'
alias remote-execute='remote-execute.py'
alias addMemberToSliceAndSlivers='addMemberToSliceAndSlivers.py'
讓設定值在目前的終端機生效
> source ~/.bashrc
安裝相關套件
> sudo zypper install python-M2Crypto python-dateutil python-pyOpenSSL xmlsec1 xmlsec1-devel xmlsec1-openssl-devel libxmlsec1-openssl1
正在載入套件庫資料...
讀取已安裝的套件...
正在解決套件相依性...
The following 20 NEW packages are going to be installed:
glibc-devel libgcrypt-devel libgpg-error-devel libopenssl-devel libxml2-devel libxmlsec1-1 libxmlsec1-openssl1 libxslt-devel linux-glibc-devel ncurses-devel python-dateutil python-M2Crypto
python-pyOpenSSL readline-devel tack xmlsec1 xmlsec1-devel xmlsec1-openssl-devel xz-devel zlib-devel
20 新套件將被安裝.
Overall download size: 7.1 MiB. Already cached: 0 B 完成操作後,將增加 42.8 MiB 的使用。
要繼續嗎? [y/n/? shows all options] (y):
到 GENI portal 下載 omni data
登入到 GENI 點選右上角的 自己名字, 然後點選 Profile
點選 Configure omni
點選 Generate an SSL certificate
會另開一個視窗來到 GENI Certificate Management 畫面
點選 Generate Combined Certificate and Key File
下載憑證還有 Key
點選 Download Your Portal Generated Certificate and Private Key
回到 Configure omni 畫面
點選 Download your omni data
在下載頁面
點選 Download your omni data
系統會下載一個 omni.bundle , 預設要求把它存到 ~/Downloads/omni.bundle
但是由於是中文環境, 所以只有 ~/下載 目錄
設定 omni
> omni-configure
Creating omni_config: /home/max/.gcf/omni_config
Portal bundle not in a default location:
~/Downloads/omni.bundle
~/Downloads/omni-bundle.zip
Make sure you place the bundle downloaded from the portal
in one of the above locations, or use the '-z' option to
specify a custom location.
所以我把 omni.bundle 放在自己家目錄了, 來試試看 -z 選項
> omni-configure -z /home/max/omni.bundle
Creating omni_config: /home/max/.gcf/omni_config
Using portal bundle: /home/max/omni.bundle
SSL certificate stored at:
/home/max/.ssl/geni_cert_portal.pem
Private SSH key stored at:
/home/max/.ssh/geni_key_portal
Public SSH key stored at:
/home/max/.ssh/geni_key_portal.pub
Script will create an extra public key file, based on the private key of the SSL cert:
/home/max/.ssl/geni_cert_portal.pem
Private SSH key from your SSL cert stored at:
/home/max/.ssh/geni_cert_portal_key
Public SSH key from your SSL cert stored at:
/home/max/.ssh/geni_cert_portal_key.pub
Wrote omni configuration file at:
/home/max/.gcf/omni_config
================================================================================
Omni is now configured!
To test your configuration, run:
omni -a gpo-ig getversion
測試一下
> omni -a gpo-ig getversion
應該可以取得資訊
跟 Mac 的差別, date 指令支援較好, 所以 renew 比較方便
例如要 renew 14 天後
> omni renewslice maxlab `date --date="now 14 days" +%Y%m%d`
這樣之後排入 crontab 就方便了
目前常用的指令
maxlab 是 slice 名稱
建立 slice
> omni createslice maxlab2
建立 sliver ( resource )
omni createsliver maxlab -a utah-ig https://dl.dropboxusercontent.com/u/12787647/iCAIR/GENI/1_Ubuntu1404.rspec
刪除 sliver
omni deletesliver maxlab -a utah-ig
將 slice 期限延到 14 天後
omni renewslice maxlab `date --date="now 14 days" +%Y%m%d`
將 sliver 期限延到 14 天後
omni renewsliver maxlab `date --date="now 14 days" +%Y%m%d` -a utah-ig
另外由於 VM 也不是所有人都用, 所以就改了設定檔, 預設不加入其他 slice member
> vi ~/.gcf/omni_config
將 userslicemembers 改為 False
useslicemembers = False
#useslicemembers = True
沒有留言:
張貼留言