顯示具有 XENserver 標籤的文章。 顯示所有文章
顯示具有 XENserver 標籤的文章。 顯示所有文章

2013年2月5日 星期二

Xenserver 6 free version VM autostart

參考這個討論
http://forums.citrix.com/thread.jspa?threadID=300865

http://www.raido.be/knowledge-center/blog/detail/xenserver-6-auto-start-vms

  1. 先手動把需要Xenserver 開機後自動帶起來的VM,加上 autostart 這個 tag
  2. 然後想辦法在開機後執行下列 shell scrip ,看是要把這段script放到 /etc/rc.local   還是其他開機後會自動執行的 Shellscript 隨意。



# AutoStart VM's that are tagged with autostart tag
# Script created by Raido Consultants - http://www.raido.be

TAG="autostart" # helper function
function xe_param()
{
PARAM=$1
while read DATA; do
LINE=$(echo $DATA | egrep "$PARAM")
if [ $? -eq 0 ]; then
echo "$LINE" | awk 'BEGIN{FS=": "}{print $2}'
fi
done
} # Get all VMs
sleep 20
VMS=$(xe vm-list is-control-domain=false | xe_param uuid) for VM in $VMS; do
echo "Raido AutoStart Script : Checking VM $VM"
VM_TAGS="$(xe vm-param-get uuid=$VM param-name=tags)" if [[ $VM_TAGS == *$TAG* ]]
then
echo "starting VM $VM"
sleep 20
xe vm-start uuid=$VM
fi done




2012年9月17日 星期一

A brief guide to fixing the "The VDI is not available" problem.


今天又一個Xenserver guest OS 當掉,強迫關閉 guest 之後,出現 The VDI is not available
問題,查到這個參考來源,證實可用。紀錄之

參考來源:
http://stuffpeopleaskme.blogspot.tw/2011/12/brief-guide-to-fixing-vdi-is-not_21.html

updated 2013/10/29
another document from support.citrix.com
http://support.citrix.com/article/CTX138234
原理基本上一樣,都是先把原本的 vdi 忘掉,然後重新掃描,再次找到vdi,重新指定給VM guest

A brief guide to fixing the "The VDI is not available" problem.

media_1324414599696.png
There are three problems that usually cause this message.
1. The DVD drive has a VDI in it, and that VDI is not available.
2. The XenServer platform erroneously (or otherwise) believes a VDI (Virtual Disk Image - a hard disk) configured for your VM is in use.
3. The VM has some kind of corruption. - this is not covered here.

Identify the VM with the problem.

media_1324414599864.png

Check the DVD drive is empty and select properties for the hard disk

media_1324414600236.png
Please take a written note of the Storage Repository (in my case "TurboBoost SSD Storage Array" and the disk size (in my case 59.8GB) if you don't already know these details.

Check the VDI has an identifiable name

media_1324414600775.png

Identify the UUID for the VDI

media_1324414601192.png

Tell XenServer to forget the VDI

media_1324414601741.png

The disk isn't in the Storage Repository anymore

media_1324414602272.png

Scanning will find the VDI

media_1324414602992.png

Rename the VDI again so you can identify it

media_1324414603654.png

Attached the renamed VDI to the VM

media_1324414604471.png

Turn on the VM

media_1324414605073.png

The VM will now start

media_1324414605706.png

2012年1月11日 星期三

Xenserver 無法關閉的 guest

Xenserver 遇到頑強無法關閉的guest怎麼辦?

今天安裝了 Debian 6.03 xfce+lxde 在一台 Xenserver 5.6上。安裝完之後發生很多靈異現象,最後Squeeze (Debian 6的代號,玩具總動員裡面那隻綠色三眼外星人)變成了無法關閉、殺死的三眼外星殭屍...

從Xencenter GUI上面強迫關機,外星殭屍不鳥,繼續頑強抵抗。

SSH進入 Xenserver,用 xsconsole去shutdown,開了好幾槍這隻VM還是殭屍狀態,百毒不侵,不能關閉。

從console 下指令硬砍: xe vm-shutdown vm=Squeeze force=true
失敗。

xe-toolstack-restart  ... 從這行指令開始都已經是xenserver的危險動作了,小朋友不要學,叔叔有練過。但還是失敗。

xe task-lis 加上 xe task-cancel uuid=你他媽的外星殭屍id  ...  刪除了pending task之後 xe vm-shutdown,但Squeeze還是白爛的running....

xe vm-reset-powerstate vm=Squeeze --force ,嘿嘿,沒用,外星小綠綠笑得更開心了。不過這邊有個好玩的Error訊息:

The operation could not be performed because a domain still exists for the specified VM.
vm: 你他媽的外星殭屍id (Squeeze)
domid: 29

有眉目了。

拜了Google大神,以及對照上述錯誤訊息,用

/opt/xensource/debug/destroy_domain -domid {domid}


這最終兵器,總算關閉了這隻頑強的綠色小外星殭屍。

至於Squeeze變成殭屍之前的靈異現象,以後有機會再說吧。現在我只想把這VM從我的Xenserver中永遠移除,淨化這隻殭屍之後,以後再也不去碰 Squeeze。至少在Xenserver 環境。

至少....在我下次手癢之前。

update:
2013-02-05

Xenserver VM暴力關閉法

  1. 由xencenter控制界面中,找出要強制關閉的vm uuid
  2. 再開啟putty / ssh ,連線到 xenserver root@xenserver ,此為 Xenserver 的 dom0 XenServercontrol domain
  3. cd /opt/xensource/debug
  4. list_domains | grep <強制關閉的vm uuid> 這個指令會顯示vm所在 domid
  5. 再下指令暴力摧毀dom: /opt/xensource/debug/destroy_domain -domid {domid} 
  6. 離開xencenter再重新開啟xencenter,連上vm host,先前關閉不了的vm 應該就已經關閉,可以重開了。




2011年4月22日 星期五

Xenserver授權:一年一次的約定


問:XenServer 免費版的授權方式是怎樣的?
答:XenServer 免費版使用者可繼續下載副檔名為 .XSLIC 格式的授權檔案,在資源池中的每台主機上使用。和此前的版本一樣,採用免費的 XenServer EULA,使用者必須手動更新連絡人和使用資訊。在一年使用期限屆滿時或之前,管理員必須登入和更新資訊,以獲得新一年的免費授權檔案。

好濫漫啊,跟七夕一樣一年見面一次喔。

2010年12月18日 星期六

xenserver rescan fiber channel HBA target / LUN list

ssh or use xsconsole command interface,

use following command  to rescan Fiber Channel HBA target / LUN ( in my case, we use Qlogic fiber card for Xenserver 5.6)

echo "- - -" > /sys/class/scsi_host/host1/scan

where host1 will depend on which HBA channel used.