Proxmox VE 5.1

2017/10/25 [proxmox ve 5.1 リリース](https://www.proxmox.com/en/news/press-releases/proxmox-ve-5-1)

* Debian 9.2 ベースになった。
* kernel 4.10から4.13に変更。
* 内部バージョンは5.0.32 から 5.1.35に変更

* https://www.proxmox.com/en/downloads
    * [リポジトリ](http://download.proxmox.com/debian/pve/dists/stretch/pvetest/binary-amd64/?C=M;O=D)


## proxomx5をdebian9にインストール

* http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/
* [Install Proxmox VE on Debian Stretch - Proxmox VE](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Stretch)
* [Jessie(8.6)にPromox4.3をインストール、NAT設定 - Qiita](http://qiita.com/tukiyo3/items/71e3222b817e1188bc40)
        * [複数DISK搭載している端末にdebian 9インストール後boot失敗(initramfs)する時 - Qiita](http://qiita.com/tukiyo3/items/5bc94fc76023710aa972)

### OSインストール後

```bash:bridge設定に必要
apt install -y sudo ifenslave bridge-utils
```

### ネットワーク設定

* [round-robin に誤認識された bond0 を active-backup に修正する - Qiita](https://qiita.com/tukiyo3/items/9dea89fe32b94b215437)

```rb:/etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
    address 192.168.100.70
    netmask 255.255.255.0
    gateway 192.168.100.1
    dns-nameservers 8.8.8.8 8.8.4.4
    bridge_ports eth0
    bridge_stp off
```

* グラフィカルデスクトップ環境の場合、付随している`network-manager`が邪魔をして上記設定が有効にならない。その場合は`dpkg --purge netwok-manager`する。

### /etc/hosts (必須！)

```diff:/etc/hosts
- 127.0.1.1	proxmox5.local
+ 192.168.100.70	proxmox5.local
```

### install packages

```bash:rootで実施
echo "deb http://download.proxmox.com/debian stretch pve-no-subscription" > /etc/apt/sources.list.d/pve-enterprise.list
wget http://download.proxmox.com/debian/proxmox-ve-release-5.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg

apt update && apt dist-upgrade -y
apt install -y proxmox-ve ntp postfix ksm-control-daemon open-iscsi \
 mdadm logwatch sshfs vim screen tig
```

## nfs-server

```rb:server
apt install -y nfs-kernel-server
echo "/var/lib/vz/dump 192.168.100.70(rw,insecure,no_subtree_check,no_root_squash)" >> /etc/exports
exportfs -rav
chmod 777 /var/lib/vz/dump
```

```rb:client
apt install -y nfs-common
mount -t nfs 192.168.100.64:/var/lib/vz/dump /var/lib/vz/dump

umount -f /var/lib/vz/dump
## どうしてもumount出来ない場合
umount -f -l /var/lib/vz/dump
```

## cpu設定

* [How many CPU-sockets (or sockets) do I have? - Knowledgebase - Maurer IT Systemloesungen KG](https://shop.maurer-it.com/knowledgebase.php?action=displayarticle&id=11)

```
cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
```

----

## gpgエラーの場合

```sh
$ sudo apt update
Ign:1 http://ftp.jp.debian.org/debian stretch InRelease                                                             
Get:2 http://ftp.jp.debian.org/debian stretch-updates InRelease [91.0 kB]                                           
Hit:3 http://security.debian.org/debian-security stretch/updates InRelease                                    
Hit:4 http://ftp.jp.debian.org/debian stretch Release                                                   
Hit:6 https://download.docker.com/linux/debian stretch InRelease                                        
Get:7 http://download.proxmox.com/debian stretch InRelease [3,052 B]                                                 
Err:7 http://download.proxmox.com/debian stretch InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0D9A1950E2EF0603
Fetched 91.0 kB in 1min 29s (1,013 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
105 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.proxmox.com/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0D9A1950E2EF0603
W: Failed to fetch http://download.proxmox.com/debian/dists/stretch/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0D9A1950E2EF0603
W: Some index files failed to download. They have been ignored, or old ones used instead.
```

```sh
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0D9A1950E2EF0603
Executing: /tmp/apt-key-gpghome.KrlpOkasCA/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0D9A1950E2EF0603
gpg: key 0D9A1950E2EF0603: public key "Proxmox Virtual Environment 5.x Release Key <proxmox-release@proxmox.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
```