SmartArray P410のfirmwareをCentOS6でアップデートしてみた

Smart Array P410をRAIDカードだけ入手して、CentOS6.3のサーバにさしてみた。
認識はしたんだが、firmwareが古い。

また、おそらくマザーボードの問題で、P410からのブートは無理だったので、USBメモリにbootパーテーションを作って、そこから起動させる形でLinuxをインストールした。

インストール完了後、 hpacucliをインストールして、ステータスを確認してみる。

# hpacucli
HP Array Configuration Utility CLI 9.40.12.0
Detecting Controllers...Done.
Type "help" for a list of supported commands.
Type "exit" to close the console.

=>ctrl all show config detail

Smart Array P410 in Slot 6
   Bus Interface: PCI
   Slot: 6
   Serial Number: PACCRID??????RQ
   Cache Serial Number: PAAVPID??????KDX
   RAID 6 (ADG) Status: Disabled
   Controller Status: OK
   Hardware Revision: C
   Firmware Version: 3.00
   Rebuild Priority: Medium
   Expand Priority: Medium
   Surface Scan Delay: 3 secs
   Surface Scan Mode: Idle
   Queue Depth: Automatic
   Monitor and Performance Delay: 60  min
   Elevator Sort: Enabled
   Degraded Performance Optimization: Disabled
   Inconsistency Repair Policy: Disabled
   Wait for Cache Room: Disabled
   Surface Analysis Inconsistency Notification: Disabled
   Post Prompt Timeout: 15 secs
   Cache Board Present: True
   Cache Status: OK
   Cache Ratio: 25% Read / 75% Write
   Drive Write Cache: Disabled
   Total Cache Size: 512 MB
   Total Cache Memory Available: 400 MB
   No-Battery Write Cache: Enabled
   Cache Backup Power Source: Batteries
   Battery/Capacitor Count: 1
   Battery/Capacitor Status: Failed (Replace Batteries)
   SATA NCQ Supported: True
   Array: A
      Interface Type: SAS
      Unused Space: 0  MB
      Status: OK
      Array Type: Data
      Spare Type: dedicated

      Logical Drive: 1
         Size: 205.0 GB
         Fault Tolerance: 5
         Heads: 255
         Sectors Per Track: 32
         Cylinders: 52687
         Strip Size: 256 KB
         Full Stripe Size: 768 KB
         Status: OK
         Caching:  Enabled
         Parity Initialization Status: In Progress
         Parity Initialization Progress: 79.64% complete
         Unique Identifier: 600508B100103130333?????????????
         Disk Name: /dev/sda
         Mount Points: /boot 500 MB
         OS Status: LOCKED
         Logical Drive Label: A23B2853PACCRID???????????F
         Drive Type: Data

      physicaldrive 1I:0:3
         Port: 1I
         Box: 0
         Bay: 3
         Status: OK
         Drive Type: Data Drive
         Interface Type: SAS
         Size: 72 GB
         Rotational Speed: 10000
         Firmware Revision: 0603
         Serial Number: 0422???Y            3??????Y
         Model: SEAGATE ST973402SSUN72G
         PHY Count: 2
         PHY Transfer Rate: 3.0Gbps, Unknown

      physicaldrive 1I:0:4
         Port: 1I
         Box: 0
         Bay: 4
         Status: OK
         Drive Type: Data Drive
         Interface Type: SAS
         Size: 72 GB
         Rotational Speed: 10000
         Firmware Revision: 0603
         Serial Number: 0422???1            3??????1
         Model: SEAGATE ST973402SSUN72G
         PHY Count: 2
         PHY Transfer Rate: 3.0Gbps, Unknown

      physicaldrive 2I:0:5
         Port: 2I
         Box: 0
         Bay: 5
         Status: OK
         Drive Type: Data Drive
         Interface Type: SAS
         Size: 72 GB
         Rotational Speed: 10000
         Firmware Revision: 0603
         Serial Number: 0522???3            3??????3
         Model: SEAGATE ST973402SSUN72G
         PHY Count: 2
         PHY Transfer Rate: 3.0Gbps, Unknown

      physicaldrive 2I:0:6
         Port: 2I
         Box: 0
         Bay: 6
         Status: OK
         Drive Type: Data Drive
         Interface Type: SAS
         Size: 72 GB
         Rotational Speed: 10000
         Firmware Revision: 0603
         Serial Number: 0422???7            3??????7
         Model: SEAGATE ST973402SSUN72G
         PHY Count: 2
         PHY Transfer Rate: 3.0Gbps, Unknown

      physicaldrive 2I:0:7
         Port: 2I
         Box: 0
         Bay: 7
         Status: Predictive Failure
         Drive Type: Spare Drive
         Interface Type: SAS
         Size: 72 GB
         Rotational Speed: 10000
         Firmware Revision: 0603
         Serial Number: 4922???W            3??????W
         Model: SEAGATE ST973402SSUN72G
         PHY Count: 2
         PHY Transfer Rate: 3.0Gbps, Unknown


   SEP (Vendor ID PMCSIERA, Model  SRC 8x6G) 250
      Device Number: 250
      Firmware Version: RevC
      WWID: 500143800??????F
      Vendor ID: PMCSIERA
      Model:  SRC 8x6G

#

ディスクが1本死にかけてるとか、バッテリーモジュールが死んでるとか、RAID構築中とか、あるけれど、firmware はv3.0であることを確認。

バージョンアップしようとしたところ、エラーが・・・

# ./CP019316.scexe
./hpsetup: ./ccissflash: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
#

なんのファイルが足らないのか調べようとしたら、実行した後に展開される作業用ファイルを削除してしまってわからない。

CP019316.scexeはシェルスクリプトなので、ファイルを展開するだけのオプションがないか確認したところ「–unpack=出力先ディレクトリ」であることが判明。

# ./CP019316.scexe --unpack=/root/t
1115.bin
CP019316.xml
MIZ108.bin
Rom.bin
ccissflash
firmware.cfg
hpsetup
libcpqimgr.so
sandman.bin
# ls -l /root/t
合計 20908
-rwxr-xr-x 1 root root 1494272 11月 16 04:24 2011 1115.bin
-rw-rw-rw- 1 root root  743473 12月 14 02:25 2012 CP019316.xml
-rwxr-xr-x 1 root root 1461504  9月 18 02:36 2012 MIZ108.bin
-rwxr-xr-x 1 root root 4194304 11月 16 04:24 2011 Rom.bin
-rwxr-xr-x 1 root root 7159043  3月 27 14:10 2012 ccissflash
-rw-rw-rw- 1 root root     427 12月 14 02:20 2012 firmware.cfg
-rwxrwxrwx 1 root root     268 12月 14 02:20 2012 hpsetup
-rwxr-xr-x 1 root root 2148102  3月 27 14:11 2012 libcpqimgr.so
-rwxr-xr-x 1 root root 4194304 12月 12 09:31 2012 sandman.bin
# file *
1115.bin:       data
CP019316.xml:   XML  document text
MIZ108.bin:     data
Rom.bin:        data
ccissflash:     ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.3, not stripped
firmware.cfg:   ASCII text, with CRLF line terminators
hpsetup:        Bourne-Again shell script text executable
libcpqimgr.so:  ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
sandman.bin:    data
#

とりあえず、よくある compat-libstdc++-296あたりかな、と「yum install compat-libstdc++-296」を実行。

# yum install compat-libstdc++-296
<略>
Dependencies Resolved

================================================================================
 Package                  Arch       Version                  Repository   Size
================================================================================
Installing:
 compat-libstdc++-296     i686       2.96-144.el6             base         77 k
Installing for dependencies:
 glibc                    i686       2.12-1.80.el6_3.7        updates     4.3 M
 libgcc                   i686       4.4.6-4.el6              base        111 k
 nss-softokn-freebl       i686       3.12.9-11.el6            base        116 k
Updating for dependencies:
 glibc                    x86_64     2.12-1.80.el6_3.7        updates     3.8 M
 glibc-common             x86_64     2.12-1.80.el6_3.7        updates      14 M

Transaction Summary
================================================================================
Install       4 Package(s)
Upgrade       2 Package(s)

Total download size: 23 M
Is this ok [y/N]: y
<略>
# ./ccissflash
./ccissflash: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
#

まだエラーがでている。
というか、「compat-libstdc++-296」ではなかったようだ。

ぐぐったところ「“bad ELF interpreter” Error When Running Smart Array Controller Firmware Update Script」を発見。

「glibc-2.12-~.i686」と「libstdc++-4.4.6-~.i686」があれば良かったらしい。
先ほどの操作でglibc-2.12-~.i686はインストールされたので、libstdc++-4.4.6のみインストール。

# yum install libstdc++-4.4.6-4.el6.i686
<略>
Dependencies Resolved

================================================================================
 Package             Arch           Version                Repository      Size
================================================================================
Installing:
 libstdc++           i686           4.4.6-4.el6            base           299 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 299 k
Installed size: 908 k
Is this ok [y/N]: y
<略>
#  ./ccissflash

HP Enclosure ROM  Flash.
Flash Engine Version: 2.06.10
Copyright (c) 2006-2009 Hewlett-Packard Development Company L.P.

-i<romfile> is required
#

こんどは、問題なく動作できた。

改めてfirmwareのアップデートプログラムを実行

# ./CP019316.scexe

HP Enclosure ROM  Flash.
Flash Engine Version: 2.06.10
Copyright (c) 2006-2009 Hewlett-Packard Development Company L.P.

Device [P410]:  FW Ver [ Current:3.00 | Apply:6.00 ?]Flash this device? [NO, yes, quit] yes
Preparing to flash devices on the array controller...
Requesting flash - this could take up to 15 minutes...
The array flash operation succeeded.
Device [P410]:  FW Ver [ Current:3.00 | Apply:6.00 ?]Flash this device? [NO, yes, quit] yes
Preparing to flash devices on the array controller...
Requesting flash - this could take up to 15 minutes...
Flash complete.
The array flash operation succeeded.
#

アップデート後は再起動して、hpacucliにてバージョンを確認。

# hpacucli ctrl all show config detail

Smart Array P410 in Slot 6
   Bus Interface: PCI
   Slot: 6
   Serial Number: PACCRID??????RQ
   Cache Serial Number: PAAVPID??????KDX
   RAID 6 (ADG) Status: Disabled
   Controller Status: OK
   Hardware Revision: C
   Firmware Version: 6.00-2
   Rebuild Priority: Medium
   Expand Priority: Medium
<略>

v6.00-2になっていることを確認した。

CentOS6でカスタムインストールDVD作成

CentOS6.3ベースでひとまずある程度までパッケージ選択済みでインストールできるkickstartを書いた。
(「CentOS6ベースでカスタムLiveCDを作るという記事もあります)
具体的にはファイルサーバっぽい感じの設定を考えている。

しかし、実際にブートしてみるとパーテーション選択の次で、止まる。

Alt+F2でコンソールを切り替えてみると、以下のエラーが出力されていることがわかった。

ERROR: Error downloading treeinfo file: [Error 14] PYCURL ERROR 6 - "Couldn't resolve host 'cdrom:sr0'"

しかし、dfで見てみると「/mnt/source」にDVDはマウントされている状況。

ぐぐってみると答えを発見。
serverfault:「PyCURL couldn’t resolve “cdrom:sr0” during CentOS 6.2 kickstart installation

上記ページの要約
「repo –name=”CentOS” –baseurl=cdrom:sr0 –cost=100」ってなってるのを「repo –name=”CentOS” –baseurl=file:///mnt/source –cost=100」に変更しろ。

実際、その通りにしたところ、正常に動作した。

以下は、カスタムインストールDVDを作成するにあたり、実行したコマンドを順に書いていったもの。

 [/root]# mkdir mnt
[/root]# mount -o ro,loop CentOS-6.3-x86_64-bin-DVD1.iso mnt
[/root]# mkdir CentOS
[/root]# cd mnt
[/root/mnt]# tar cf - . |(cd ../CentOS;tar xpf -)
[/root]# cd ..
[/root]# cp anadonda-ks.cfg CentOS/isolinux/ks.cfg
[/root]# cp -r custom CentOS
[/root]# cd CentOS
[/root/CentOS]# cd isolinux
[/root/CentOS/isolinux]# vi isolinux.cfg
[/root/CentOS/isolinux]# cat isolinux.cfg
default vesamenu.c32
#prompt 1
timeout 600

display boot.msg

menu background splash.jpg
menu title Welcome to CentOS 6.3!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
  menu label ^Install or upgrade an existing system
  kernel vmlinuz
  append initrd=initrd.img
label vesa
  menu label Install system with ^basic video driver
  kernel vmlinuz
  append initrd=initrd.img xdriver=vesa nomodeset
label rescue
  menu label ^Rescue installed system
  kernel vmlinuz
  append initrd=initrd.img rescue
label local
  menu label Boot from ^local drive
  localboot 0xffff
label memtest86
  menu label ^Memory test
  kernel memtest
  append -
label nas
  menu label ^Install or upgrade a CentOS custom OS
  menu default
  kernel vmlinuz
  append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg
[/root/CentOS/isolinux]# cat ks.cfg
# Kickstart file automatically generated by anaconda.

#version=DEVEL
install
cdrom
text
lang en_US.UTF-8
keyboard jp106
network --onboot yes --device eth0 --bootproto dhcp --noipv6
network --onboot no --device eth1 --bootproto dhcp --noipv6
rootpw  --plaintext password
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc Asia/Tokyo
bootloader --location=mbr --driveorder=sda,sdb --append="crashkernel=auto"
firstboot --disabled
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work

#repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100
repo --name="CentOS"  --baseurl=file:///mnt/source --cost=100

%packages
@core
@server-policy
crypto-utils
perl-DBD-SQLite
perl-CGI
wget
parted
ypbind
yp-tools
xfsdump
xfsprogs
iscsi-initiator-utils
ntpdate
openssh-clients
screen
unzip
man
nfs-utils
samba
autofs
lm_sensors
dmidecode
i2c-tools
lm_sensors-sensord
%end
%post --nochroot
cd /mnt/stage2/custom
# Areca RAID setup
cp cli64 archttp64 archttpsrv.conf /mnt/sysimage/root/
chmod a+x /mnt/sysimage/root/cli64 /mnt/sysimage/root/archttp64
cp init.d-archttp /mnt/sysimage/etc/init.d/archttp
chmod a+x /mnt/sysimage/etc/init.d/archttp
cp logrotate.d-archttp /mnt/sysimage/etc/logrotate.d/archttp
chroot /mnt/sysimage /sbin/chkconfig --add archttp
chroot /mnt/sysimage /sbin/chkconfig archttp on

# system mod
chroot /mnt/sysimage /sbin/chkconfig iptables off
chroot /mnt/sysimage /sbin/chkconfig mcelogd off
chroot /mnt/sysimage /sbin/chkconfig autofs off
chroot /mnt/sysimage /sbin/chkconfig cups off
# nfs mod
mv /mnt/sysimage/etc/sysconfig/nfs /mnt/sysimage/etc/sysconfig/nfs.org
sed s/#RPCNFSDCOUNT=8/RPCNFSDCOUNT=32/ig /mnt/sysimage/etc/sysconfig/nfs.org > /mnt/sysimage/etc/sysconfig/nfs
chroot /mnt/sysimage /sbin/chkconfig nfs on
cat nfs.mod >> /mnt/sysimage/etc/sysctl.cfg

# lm_sensor
mv /mnt/sysimage/etc/sensors3.conf /mnt/sysimage/etc/sensors3.conf.org
cp sensors3.conf /mnt/sysimage/etc/sensors3.conf
mv /mnt/sysimage/etc/sysconfig/lm_sensors /mnt/sysimage/etc/sysconfig/lm_sensors.org
cp lm_sensors /mnt/sysimage/etc/sysconfig/lm_sensors
mv /mnt/sysimage/etc/sysconfig/sensord /mnt/sysimage/etc/sysconfig/sensord.org
cp sensord /mnt/sysimage/etc/sysconfig/sensord
chroot /mnt/sysimage /sbin/chkconfig lm_sensors on
chroot /mnt/sysimage /sbin/chkconfig sensord on

%end
[/root/CentOS/isolinux]# cd ..
[/root/CentOS]# cat custom/nfs.mod

## add for NFS server start
# increase TCP max buffer size
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
net.core.rmem_default = 65536
net.core.wmem_default = 65536
# increase Linux autotuning TCP buffer limits
# min, default, and max number of bytes to use
net.ipv4.tcp_rmem = 4096 33554432 33554432
net.ipv4.tcp_wmem = 4096 33554432 33554432
net.ipv4.tcp_mem= 33554432 33554432 33554432
net.ipv4.route.flush=1
net.core.netdev_max_backlog=1500
## add for NFS server end
[/root/CentOS]# cd Packages
[/root/CentOS/Packages]# cp /mnt/Packages/lm_sensors-sensord-3.1.1-10.el6.x86_64.rpm .
[/root/CentOS/Packages]# rm -f eclipse* 
[/root/CentOS/Packages]# cd ..
[/root/CentOS]# mkisofs -r -l -J -o ../Custom.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
[/root/CentOS]# 

MZK-WD300DHってもしかしてMiracastになるんだろうか?

PLANEX Directからメールが来た。

「残り僅か!ワンセグチューナー、Wi-Fiディスプレイシステム最終価格で販売中!」だそうな

Wi-Fiディスプレイシステムって、どんなんだろ?と見てみると、MZK-WD300DHというものだった。

ぶっちゃけ、あまし評判はよくないようだ。

ただ、なんかうたい文句的にはいまで言うMiracastっぽいけど、別のモノ、ということにはなっている。

PLANEXページからドライバをダウンロードしてみた。
3種類のドライバと、関連ソフトの詰め合わせだった。

「92_DU_Driver」は、Realtek RTL8192D USBドライバ(rtl8192du.sys)でバージョンは「1002.1.816.2011」(日付:2011/11/21 0:00)

「WiDi_Driver」は2種類。
「RTKVideo」PLANEX Wifi Display VGA Adapter(RtlvVga.sys)でバージョン「1005.2.622.2011」(日付:2011/11/21 0:00)
「RTKAudio」PLANEX Wifi Display Audio Adapter(RtlvSound.sys)でバージョン「1005.1.526.2011」(日付:2011/11/21 0:00)
どちらもinfファイル内には「Realtek Semiconductor Corporation」の文字。

この情報を持って、チップメーカであるRealTekのページを探すと、以下がでてきた。

RTL8192DU-VC
Single-Chip IEEE 802.11a/b/g/n 2T2R WLAN Controller with USB 2.0 Interface
(PCI Express対応だとRTL8192DE-VCになる)

そして、プレスリリース系として、以下が・・・

2012年9月19日:「Realtek Selected for the Wi-Fi CERTIFIED Miracast™ Test Bed
 Miracastのテスト環境にRealtekが選ばれました! RTL8192DE, RTD1185,RTL8192DUです!

2013年1月7日:「Realtek to Demonstrate Full Range of Connectivity and Multimedia Solutions during 2013 CES
 RealShare Smart Display(RTD1185 Digital Media Processor とRTL8192DU Wi-Fi moduleの組み合わせ)

もしかして!?と一瞬期待をしてみる。

RTL8192DU関連のソフトウェアは、RTL8192DU-VC用としていくつか提供されていた。
こちらの中身は、普通に無線LAN用ドライバだった。

よくよく確認してみれば「RTL8192DU」自体は、普通のWiFiアダプタとして使っている普通のチップでもあった。
ただ、Miracastで使えるだけの能力を持っている、というだけだった。

つまりは、「WiDi_Driver」の方が本命。

で・・・「WiDi_Driver」に相当するものをRealTekページで探してみたけど見付からない。

いろいろ探していると
Dishing Tech:「Realtek Wi-Fi Direct Programming Guide」という記事が見付かった。

「Wireless_tools_porting_guide.pdf」という資料を元に解説をしている。
入手元を調べたところ、RealtekのドライバページにあるUnix(Linux)用のファイルに含まれていた。
v4.0.0_4074.20120518からWiDiのサポートが入ったらしい。

この資料の中に、AndroidでWiFi Directに対応させるためのコードとかも含まれているようだ。

なので、もしかしたら、送信側はRTL8192DUを使っていれさえすれば対応できるかもしれない。

しかし、受信側は、改造できなさそうなので、対応は難しいような気がする・・・

えぇ・・・気がする、というところ。
もしかすると動くのかもしれませんが・・・
ダレカ、チャレンジしていませんか?

ECCエラー多発してるエラーが取れたのでメモ

CentOS6サーバに、2GBメモリが2枚刺さってる。
久々に起動したら、ECC関連のエラーメッセージを吐きまくってるのでメモ書き。

Feb  8 16:42:15 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:16 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:17 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:18 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:19 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:20 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:21 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:22 cent6server kernel: EDAC MC0: CE page 0x1e23, offset 0x980, grain 128, syndrome 0x64, row 0, channel 1, label "": i3000 CE
Feb  8 16:42:23 cent6server kernel: EDAC MC0: CE page 0xfb802, offset 0x200, grain 128, syndrome 0x64, row 1, channel 1, label "": i3000 CE
Feb  8 16:42:24 cent6server kernel: EDAC MC0: CE page 0xfab1b, offset 0xa00, grain 128, syndrome 0x64, row 1, channel 1, label "": i3000 CE
Feb  8 16:42:25 cent6server kernel: EDAC MC0: CE page 0xfb8ac, offset 0x780, grain 128, syndrome 0x64, row 1, channel 1, label "": i3000 CE

ちなみに、読み込まれているドライバは以下でした。

# lsmod|grep edac
i3000_edac              3471  0
edac_core              46581  3 i3000_edac
#

ちなみに「rmmod edac」を実行すると、エラーログを出力させなくすることもできます。
(もちろん、エラーがなくなるわけではない)

Proxmox上のOpenVZ仮想マシンをCLIでlive motion

Proxmox 2.xでは、共有ディスク無しでのホストサーバ移行(Live Motion/vMotion)みたいなことができる。
Web GUIでの方法はわかったが、CLIでのやり方についてのドキュメントが見つけにくく難航した。

使用するコマンド「pvectl」

ただし、このコマンドは、自サーバ上のみのコントロールを担当する。

「pvectl list」で、サーバ上にある仮想マシンリストを表示

root@pve1:~# pvectl list
Use of uninitialized value in printf at /usr/bin/pvectl line 46.
      VMID NAME                 STATUS     MEM(MB)    DISK(GB)
       101 server1.osakana.net  running    1024       8.00
       102 server2.osakana.net  running    1280       30.00
#

他にもサーバがある場合は以下の様な形で他サーバに対してssh経由でコマンドを発行して状態を取得する。

root@pve1:~# ssh root@pve2 pvectl list
Use of uninitialized value in printf at /usr/bin/pvectl line 46.
      VMID NAME                 STATUS     MEM(MB)    DISK(GB)
       103 server3.osakana.net  stopped    1024       10.00
       104 server4.osakana.net  stopped    1024       8.00
# 

移動させる時は「pvectl migrate VMID サーバ名 -online」

root@ns5:~# pvectl migrate 101 pve2 -online
Jan 31 15:56:51 starting migration of CT 101 to node 'pve2' (192.168.1.102)
Jan 31 15:56:51 container is running - using online migration
Jan 31 15:56:51 starting rsync phase 1
Jan 31 15:56:51 # /usr/bin/rsync -aHAX --delete --numeric-ids --sparse /var/lib/vz/private/101 root@192.168.1.102:/var/lib/vz/private
Jan 31 15:57:31 start live migration - suspending container
Jan 31 15:57:31 dump container state
Jan 31 15:57:32 copy dump file to target node
Jan 31 15:57:32 starting rsync (2nd pass)
Jan 31 15:57:32 # /usr/bin/rsync -aHAX --delete --numeric-ids /var/lib/vz/private/101 root@192.168.1.102:/var/lib/vz/private
Jan 31 15:57:35 dump 2nd level quota
Jan 31 15:57:35 copy 2nd level quota to target node
Jan 31 15:57:36 initialize container on remote node 'pve2'
Jan 31 15:57:36 initializing remote quota
Jan 31 15:57:37 turn on remote quota
Jan 31 15:57:38 load 2nd level quota
Jan 31 15:57:38 starting container on remote node 'pve2'
Jan 31 15:57:38 restore container state
Jan 31 15:57:39 removing container files on local node
Jan 31 15:57:40 start final cleanup
Jan 31 15:57:40 migration finished successfuly (duration 00:00:49)
root@pve1:~ #

で、うちの環境だと、CPUがpve1はIntel, pve2がAMDなので、移行後の起動に失敗する。
なので、別途、起動させる必要がある。

root@pve1:~# ssh root@pve2 pvectl start 101
Starting container ...
Container is mounted
Adding IP address(es): 192.168.1.201
Setting CPU units: 1000
Setting CPUs: 1
Container start in progress...
root@pve1:~#

これで、以下のような感じで移行が完了する。

root@pve1:~# pvectl list
Use of uninitialized value in printf at /usr/bin/pvectl line 46.
      VMID NAME                 STATUS     MEM(MB)    DISK(GB)
       102 server2.osakana.net  running    1280       30.00
root@pve1:~# ssh root@pve2 pvectl list
Use of uninitialized value in printf at /usr/bin/pvectl line 46.
      VMID NAME                 STATUS     MEM(MB)    DISK(GB)
       101 server1.osakana.net  running    1024       8.00
       103 server3.osakana.net  stopped    1024       10.00
       104 server4.osakana.net  stopped    1024       8.00
# 

さて、この処理を自動化すると・・・

#!/usr/bin/bash

SERVER=pve2
for vid in `pvectl list 2>&1 |grep running | awk '{ print $1 }'`
do
  echo === $vid ===
  echo pvectl migrate $vid $SERVER -online
  pvectl migrate $vid $SERVER -online
  ssh root@$SERVER pvectl list 2>&1 |grep  stop | grep $vid
  echo ssh root@$SERVER pvectl start $vid
  ssh root@$SERVER pvectl start $vid
done

ほんとは、移行後に起動しているか確認した上で、pvectl startを実行させるべきなんだろうけど、起動状態でpvectl startを実行しても影響がないので、無視している。