Author: flight
開源免費圖示相關網站
awk one liner example
rbd list volumes|awk '{printf("rbd feature enable volumes/%s journaling\n",$1)}'
Ceph增加rbd
- ssh登入要使用rbd的主機(/etc/ceph目錄下需事先準備好相關keying)
- 在rbd這個pool下建立test2(容量100G),另因為CentOS7 3.10 Kernel不支援部分Ceph功能,需disable相關參數
rbd create --size 102400 rbd/test2 rbd feature disable test2 exclusive-lock object-map fast-diff deep-flatten rbd map test2 #執行完畢後會顯示device編號 mkfs.xfs /dev/rbd1 mkdir /test2 mount /dev/rbd1 /test2
- 刪除rbd
umount /test2 rbd unmap test2 rbd rm test2
Build(Customize) Windows QEMU Guest Agent
參考資料:
https://wiki.qemu.org/Hosts/W32
http://www.cnblogs.com/silvermagic/p/7666143.html
- Prepare(Install) Fedora 26 Virual Machine
- Prepare mingw64 envionment
yum install mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config yum install mingw64-winpthreads-static
- Download VSS SDK
http://www.microsoft.com/en-us/download/details.aspx?id=23490
from QEMU source./qemu/scripts/extract-vsssdk-headers setup.exe
- Download and build from QEMU source
git clone https://github.com/qemu/qemu cd qemu git submodule update --init dtc ./configure --enable-guest-agent --cross-prefix=x86_64-w64-mingw32- --with-vss-sdk=/root/vss make msi -j
- Copy qemu-ga-x86_64.msi to Windows VM and install it.
- Test query VM IP from KVM Host.
virsh list (Get VM Name or ID) qemu-agent-command <Name or Id> '{"execute":"guest-info"}' qemu-agent-command <Name or Id> '{"execute":"guest-network-get-interfaces"}'
Download: qemu-ga-x86_64(v2.10.50)
使用powershell下firewall policy
參考:https://technet.microsoft.com/zh-tw/library/jj554908(v=wps.630).aspx
New-NetFirewallRule -DisplayName "test" -direction Inbound -Protocol tcp -RemoteAddress 192.168.99.254 -RemotePort any -LocalAddress any -LocalPort 3389
XenServer 6.x/7.x 更新patch script
#!/bin/bash PATCH=( XS70E002 XS70E003 XS70E004 XS70E006 XS70E007 XS70E008 XS70E009 XS70E010 XS70E011 XS70E012 XS70E013 XS70E014 XS70E015 XS70E016 XS70E017 XS70E019 XS70E020 XS70E021 XS70E022 XS70E023 ) for i in ${PATCH[@]};do PATCH_UUID=`xe patch-upload file-name=$i.xsupdate` echo $PATCH_UUID xe patch-pool-apply uuid=$PATCH_UUID done
CentOS 7 調整text console解析度
環境
XenServer 7.0下面的CentOS7虛擬機
- 編輯/etc/default/grub,加入video=640×480
-
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet video=640x480" GRUB_DISABLE_RECOVERY="true"
- grub2-mkconfig -o /boot/grub2/grub.
cfg - reboot
參考
- https://www.centos.org/forums/viewtopic.php?t=48413
Bananian OS從SD改安裝到SSD
- 環境
- BPI-R1
- ezlink 64G SATA SSD
- 大部分步驟和參考資料相同
- apt-get install u-boot-tools (此步驟建議先執行)
- 新版本bananian需用下面指令更換boot disk
mount /dev/mmcblk0p1 /boot find /boot -type f -name boot.cmd -exec sed -i 's/mmcblk0p2/sda1' {} \; cd /boot mv boot.scr boot.scr.old mkimage -C none -A arm -T script -d boot.cmd boot.scr
- 注意事項
- 安裝完成後仍需要SD才可啟動(應該是硬體限制)
- 參考資料
- http://tech.argyropoulos.info/moving-bananian-to-sata-hdd/
將VM從XenServer批次搬移到另一台XenServer
環境
兩台XenServer需在同一個pool
#!/bin/bash if [ $# -eq 0 ]; then echo "Usage: $0 <Host UUID(SRC)> <Host UUID(Dest)>" else SRC_HOST=$1 DST_HOST=$2 VM=$(xe vm-list resident-on=$SRC_HOST is-control-domain=false params=uuid|grep uuid|awk '{print $5}') for i in ${VM[@]};do echo -n "xenmotion: $i ...." xe vm-migrate uuid=$i host=$DST_HOST --live #echo "xe vm-migrate uuid=$i host=$DST_HOST --live" echo "Done" done fi