apt dist-upgrade でエラーが出る場合
The following packages have unmet dependencies:
pve-firmware : Conflicts: firmware-linux-free but 3.4 is to be installed
E: Broken packagesfirmware-linux-free is not installed
apt autoremove
をしてから再度apt dist-upgrade
をするとよい。
ディスプレイの解像度を800x600以外も選べるようにする
- Default のままだとゲストOSからは 800x600 以外選べない。
- SPICE に変更することで変更可能になる。
proxy設定
Acquire::http::Proxy "http://192.168.0.9:8888";
bondingするには ifenslave
パッケージが必要。
- ネットに繋がずにdebian8 netinstのisoでインストールを完了するとifenslaveが含まれないので注意。
LXCでのエラー
- GNUSparseFile.xxxxx(数字)
というフォルダができ不完全なファイルになることを2回経験した。
そのため自分はlxcを使わずqemuを使うようにする。
kvmが起動しない場合
kvm: -vnc unix:/var/run/qemu-server/100.vnc,x509,password: Failed to start VNC server: The server certificate /etc/pve/local/pve-ssl.pem is not yet active
TASK ERROR: start failed: command '/usr/bin/kvm -id 100 -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/100.pid -daemonize -smbios 'type=1,uuid=2a96e9bf-f609-4d7a-89b7-e3909762a81d' -name test4 -smp '1,sockets=1,cores=1,maxcpus=1' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga cirrus -vnc unix:/var/run/qemu-server/100.vnc,x509,password -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 512 -k ja -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:a17fc34cf2f2' -drive 'if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/mnt/sdb1/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=100' -netdev 'type=user,id=net0,hostname=test4' -device 'virtio-net-pci,mac=8A:96:3C:CA:DE:D8,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1
rm /etc/pve/pve-root-ca.pem /etc/pve/priv/pve-root-ca.key
pvecm updatecerts -f
qm start 100
# 起動することを確認。
KVMのバックアップが時間がかかる場合
- DISKイメージがrawフォーマットだとバックアップに時間がかかる。qcow2に変換。
dd if=/dev/zero of=a.img bs=1M
sync;sync
rm -f a.img
poweroff
$ cd /var/lib/vz/images/188
$ sudo -s
% ls -lh
合計 29G
-rw-r----- 1 root root 60G 3月 5 06:12 vm-188-disk-1.raw
# rawをqcow2に変換
% qemu-img convert -O qcow2 vm-188-disk-1.raw vm-188-disk-1.qcow2
- virtio0: local:188/vm-188-disk-1.raw,size=60G
+ virtio0: local:188/vm-188-disk-1.qcow2,size=60G
ホスト名を数字にしてはいけない
-
66.my-network
というホスト名で進めていたらインストール最後でエラーになった。
XPをvirtioでインストール
-
vfdの取得 :
Latest virtio-win x86 floppy
- Machine :
i440fx
- SCSI Controller :
VirtIO SCSI
- ide0 を指定 (sataを指定するには、OSをインストールした後。)
- Intel ICH8M AHCI controller - 7.8.0.1012) のドライバを使う。nLiteも対応。
- Network Device :
VirtIO
- virtio-win.iso
sudo qm set <VMID> \
-args '-fda /var/lib/vz/template/iso/virtio-win-0.1.173_x86.vfd'
# もしくは以下を追記
args: -fda /var/lib/vz/template/iso/virtio-win-0.1.173_x86.vfd
- XPセットアップ中 viostor.sys, viostor.ini が無いと出て再起動するとブルースクリーンエラーになった。(virtio-win.iso の viostor\xp\ に含まれている?)
7をvirtio指定
- sataでインストール。通常インストール後、virtioのdiskを追加、ドライバをインストールしsataからvirtioに変更する。
- Windows Virtio Drivers - FedoraProject
他リンク
- proxmox4でzfsを使う時に注意する点 - Qiita
- proxmox - OpenVzからLXCに移行 - Qiita
- proxmox - CentOS7のsystemdでサービスを起動するときspawing: Permission deniedエラーの対処 - Qiita
Proxmox4.1でvirtualboxは動かない
systemctl status virtualbox
● virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox)
Active: failed (Result: exit-code) since Tue 2016-02-02 05:21:11 JST; 1min 25s ago
Process: 1441 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
CPU Units
- CPU questions | Proxmox Support Forum
- 初期値: 1024。大きい方が処理が優先される。(8〜500000の間)
backup,restore
KVMのBackupが時間かかるようになった場合
dd if=/dev/zero of=zero bs=1M; rm -f zero
ゼロ埋めをした後にバックアップを取れば早くなった。
backupを中断した場合ロックがかかる件
qm unlock `vmid`
リストア時のエラー
trying to aquire lock...TASK ERROR: can't lock file '/run/lock/lxc/pve-config-307.lock' - got timeout
ぎょっとするが2重起動をした場合上記エラーに遭遇。
落ち着いて、restore完了していることを確認。
KVMのdumpリストア
qmrestore vzdump-qemu-123.vma.lzo 123 -storage local
手動バックアップ
vzdump 100 -compress lzo -dumpdir /var/lib/vz/dump/
LXCにてsuspend vm
から先に進まない場合、WebUIからLXCコンテナを停止(stop)してから再度試してみるとよい。
LXCのdiskイメージマウント
cd /var/lib/vz/images/100/
mkdir a
mount -o loop,ro vm-100-disk-1.raw a
その他
proxmox4のlxcでnfsを使う
create another apparmor profile which includes the lxc-container-default file and has an
allow mount fstype=nfs
line, run apparmor_parser on it to load it if you don't want to restart, and specify an lxc.aa_profile line in the VM config with that profile.
Note that apparmor comes with a secondary profile to allow mounting in general (not just nfs) which you can use if you don't need to restrict it to NFS-only. (That would be lxc.aa_profile = lxc-container-default-with-mounting)
zfsが超遅い場合
zfs set sync=disabled rpool
nfsサーバでの権限
- nobody:nogroup に書き込み権限を与えること。
/mnt/storage1/nfs 192.168.33.3(rw,sync,no_subtree_check)
chown nobody:nogroup /mnt/storage1/nfs
sshfs
- サーバ側の設定が面倒なのでちょっとしたdumpの転送であればsshfsのほうが早い
インストール時に入力したメールアドレスの修正方法
- user:root@pam:1:0:::user1@myserver.com::
+ user:root@pam:1:0:::user2@myserver.com::
CentOS7テンプレート
- Proxmox4.1付属のCentOS7テンプレートはssh接続できなくなる現象に遭遇した。
-
Download/template/precreated - OpenVZ Virtuozzo Containers Wikiからダウンロードすると良い。
- /var/lib/vz/template/cache/ に保存
USBパススルー
# lsusb
Bus 002 Device 002: ID 0bda:817f Realtek Semiconductor Corp. RTL8188RU 802.11n WLAN Adapter
+ usb0: host=0bda:817f
kvmの自動restore
# !/bin/sh
set -eu
# user1
rsync -a --delete --bwlimit=4096 server1:/var/lib/vz/dump/ ~/rsync_server1/dump/
rsync -a --delete --bwlimit=4096 server2:/var/lib/vz/dump/ ~/rsync_server2/dump/
du -h ~/rsync_server[12]/dump/*lzo | sed -e 's@/home/user1/rsync_@@'
# !/bin/sh
DATE=$(date "+%m_%d")
# rootで実行すること
vzrestore() {
cd $1
DUMPFILE=$(find -name "vzdump-qemu-$3-*${DATE}-*.lzo")
# serverが停止中か確認
ISRUNNING=$(qm list | grep $2 | grep running)
if [ "$ISRUNNING" != "" ];then
echo "[quit] $2 is running!"
exit 1
fi
# restore
qmrestore ${DUMPFILE} $3 --force
# OS起動時の自動bootを無効化
sed -i -e 's@onboot: 1@onboot: 0@' /etc/pve/qemu-server/$3.conf
}
vzrestore /home/user1/rsync_pve1/dump server1.local 101
vzrestore /home/user1/rsync_pve2/dump server2.local 102