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

  1. Prepare(Install) Fedora 26 Virual Machine
  2. Prepare mingw64 envionment
    yum install mingw64-pixman mingw64-glib2  mingw64-gmp mingw64-SDL mingw64-pkg-config
    yum install mingw64-winpthreads-static
  3. Download VSS SDK
    http://www.microsoft.com/en-us/download/details.aspx?id=23490
    from QEMU source

    ./qemu/scripts/extract-vsssdk-headers setup.exe
  4. 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
    
  5. Copy qemu-ga-x86_64.msi to Windows VM and install it.
  6. 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)

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