Proxmox
https://www.proxmox.com/images/proxmox/Proxmox_logo_standard_hex_400px.png
Proxmox VE - Virtualization Management Platform
Proxmox VE is a complete, open-source server management platform for enterprise virtualization. It tightly integrates the KVM hypervisor and Linux Containers (LXC), software-defined storage and networking functionality, on a single platform. With the integrated web-based user interface you can manage VMs and containers, high availability for clusters, or the integrated disaster recovery tools with ease.
The enterprise-class features and a 100% software-based focus make Proxmox VE the perfect choice to virtualize your IT infrastructure, optimize existing resources, and increase efficiencies with minimal expense. You can easily virtualize even the most demanding of Linux and Windows application workloads, and dynamically scale computing and storage as your needs grow, ensuring that your data center adjusts for future growth.
Ready to build an open and future-proof data center with Proxmox VE?
Bootstrap
iso をダウロードして USB を作成する
code: (bash)
# ISOをダウンロード
wget https://enterprise.proxmox.com/iso/proxmox-ve_9.0-1.iso
# 差し込まれたUSBのデバイスを確認
diskutil list
# USBをExFAT形式でフォーマットする
diskutil eraseDisk ExFAT PVE /dev/disk7
# アンマウントする
diskutil unmountDisk /dev/disk7
# USBメモリにisoを書き込む
sudo dd if=/Users/$USER/Downloads/proxmox-ve_9.0-1.iso of=/dev/disk7 bs=1m status=progress
# アンマウントする
diskutil unmountDisk /dev/disk7
pve をインストールする。以下の設定をして再起動が始まる
Filesystem
Password
Email
DNS
...
ssh 公開鍵設定
code: (bash)
export SSH_PUBKEY="<proxmoxのssh公開鍵の内容>"
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no root@pve "echo ${SSH_PUBKEY} >> /root/.ssh/authorized_keys
proxmox terraform provider を利用するためのセットアップ
terraform でアクセスできるユーザーを追加する
Docs overview | bpg/proxmox | Terraform | Terraform Registry
Proxmox のバージョンごとに role が異なるので都度確認する
払い出した API Token は terraform にて利用する
tfc-agent を起動する
環境変数もこちらに設定する
(Optional) cloud-init テンプレート作成
terraform で cloud-init から VM を作成するため、テンプレートを手動で作成する
bpg/proxmox なら terraform リソースで管理できる
code: (bash)
# Download Base VM cloudimg
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
# Create Base VM
qm create 9000 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci
# Confiture Base VM
qm set 9000 --name ubuntu-22.04
qm set 9000 --scsi0 local-lvm:0,import-from=/root/jammy-server-cloudimg-amd64.img
qm set 9000 --ide2 local-lvm:cloudinit
qm set 9000 --boot order=scsi0
qm set 9000 --serial0 socket --vga serial0
# Template Base VM
qm template 9000
Configurations
データセンター
SDN: Software-Defined Network
_ ノード増えた時に試してみる
メトリックサーバー
x InfluxDB(クレデンシャルがあるので、terraformで管理したくない部分)
(物理ホスト名)
local(ストレージ)
ストレージ
x 編集より、import を有効にする
proxmox_virtual_environment_download_file で import が利用するため
システム
ネットワーク
必要な VLAN を作成
ホストネットワークでブリッジ
Proxmox 内部のみ
証明書
手動で mkcert を追加
terraform の管理対象外の
デフォルトの http ポート 8006 を変更するには力技が必要
nginx proxy or iptables で無理やり
サブスクリプション通知の無効化
code: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
success: function (response, opts) {
let res = response.result;
if (
false && // add
res === null ||
res === undefined ||
!res ||
res.data.status.toLowerCase() !== 'active'
)
systemctl restart pveproxy
Reference
Proxmox Virtual Environment で仮想化環境構築 - Fenrir Engineers
Proxmox VE6.3のインストールと、やっておくと良い初期設定