差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
tech:pvetips [2023/04/16 09:09] – [移除 cluster 內的一個 node] jonathantech:pvetips [2025/04/11 15:28] (目前版本) – [Proxmox VE(PVE) 安裝相關紀錄] jonathan
行 1: 行 1:
 ====== Proxmox VE(PVE) 安裝相關紀錄 ====== ====== Proxmox VE(PVE) 安裝相關紀錄 ======
 +  * 版本資訊(Roadmap) - https://pve.proxmox.com/wiki/Roadmap
 ===== 更改 Package Repositories ===== ===== 更改 Package Repositories =====
   * [[https://pve.proxmox.com/wiki/Package_Repositories]]    * [[https://pve.proxmox.com/wiki/Package_Repositories]] 
   * 參考網址 - https://nevertired.nctu.me/2019/11/09/proxmox-ve-%E6%9B%B4%E6%96%B0/   * 參考網址 - https://nevertired.nctu.me/2019/11/09/proxmox-ve-%E6%9B%B4%E6%96%B0/
  
-{{tabinclude>tech/pvetips/pve7, tech/pvetips/pve6, tech/pvetips/pve5}}+{{tabinclude>tech/pvetips/pve8, tech/pvetips/pve7, tech/pvetips/pve6, tech/pvetips/pve5}}
  
 ==== 執行命令列更新 ==== ==== 執行命令列更新 ====
行 12: 行 13:
 </cli> </cli>
  
-==== 讓 PVE 6 安裝 CentOS7 的 CT 移轉至 PVE 7 的妥協做法 ==== 
-  * [[https://www.ichiayi.com/tech/pve6_and_pve7#%E8%AE%93_pve_6_%E5%85%A7%E7%9A%84_centos7_%E7%9A%84_ct_%E7%A7%BB%E8%BD%89%E8%87%B3_pve_7_%E7%9A%84%E5%A6%A5%E5%8D%94%E5%81%9A%E6%B3%95| 在 PVE 7 的主機 kernel option 加上 systemd.unified_cgroup_hierarchy=0 來改變使用之前 CGroup 版本]] 
 ===== PVE 主機安裝 snmpd ===== ===== PVE 主機安裝 snmpd =====
   * 安裝與設定程序<cli>   * 安裝與設定程序<cli>
行 42: 行 41:
 #  use tls #  use tls
 smtp_use_tls=yes smtp_use_tls=yes
 +
 +# MailU Setting
 +#relayhost = [mail.mailu.com]:465
 +#smtp_tls_security_level = encrypt
 +#smtp_tls_wrappermode = yes
 +
 # use sasl when authenticating to foreign SMTP servers # use sasl when authenticating to foreign SMTP servers
 smtp_sasl_auth_enable = yes smtp_sasl_auth_enable = yes
行 54: 行 59:
   - 編輯 /etc/postfix/sasl_passwd <file>   - 編輯 /etc/postfix/sasl_passwd <file>
 [smtp.gmail.com]:587  username:password [smtp.gmail.com]:587  username:password
 +#[mail.mailu.com]:465  username:password
 </file> </file>
   - 更改檔案權限 <cli>   - 更改檔案權限 <cli>
 +newaliases
 postmap /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd
 cd /etc/postfix cd /etc/postfix
行 82: 行 89:
 rm -rf /etc/pve/nodes/pve01 rm -rf /etc/pve/nodes/pve01
 </cli> </cli>
-    * 將 pve cluster 服務重新啟動<cli>+    * 進入每個 node 將 pve cluster 服務重新啟動<cli>
 systemctl restart corosync systemctl restart corosync
 systemctl restart pve-cluster systemctl restart pve-cluster
行 419: 行 426:
   * 參考網址 :    * 參考網址 : 
     * https://forum.proxmox.com/threads/proxmox-backup-wont-stop.23219/      * https://forum.proxmox.com/threads/proxmox-backup-wont-stop.23219/ 
 +<note tip> 
 +**對備份到共用目錄 exp. NFS 無法中斷的處理方式** 
 +  * 參考 - https://forum.proxmox.com/threads/cannot-kill-vzdump-process.55038/ 
 +  * 先確認 vzdump 程式是否 stat 出現 'D'(已經是 uninterruptible sleep 狀態) Exp. <cli> 
 +root@PVE-13:~# ps ax | grep vzdump 
 +2991321 ?        Ds     0:01 task UPID:PVE-13:002DA4D9:064C84B2:6598045A:vzdump::root@pam: 
 +3158042 pts/0    S+     0:00 grep vzdump 
 +</cli>如果 stat 有出現 D 的狀態, 原則上需要重開機才能砍掉 
 +  * 如果不想重開機, 可以試看看強制卸載該 node 的共用目錄後, 再中斷 vzdump 的 Workaround 方式, Exp. <cli> 
 +root@PVE-13:/# cd /mnt/pve 
 +root@PVE-13:/mnt/pve# ls 
 +omv-nfs  NFS-13 
 +root@PVE-13:/mnt/pve# umount -f /mnt/pve/NFS-13 
 +umount.nfs4: /mnt/pve/NFS-13: device is busy 
 +root@PVE-13:/mnt/pve# umount -f -l /mnt/pve/NFS-13 && vzdump --stop 
 +root@PVE-13:/mnt/pve# ps -ef | grep vzdump 
 +root     3158849 3019745  0 06:26 pts/0    00:00:00 grep vzdump 
 +</cli> 
 +</note>
 ===== 設定自動 Snapshot 的方式 ===== ===== 設定自動 Snapshot 的方式 =====
 <note warning> <note warning>
行 646: 行 671:
 rc-update add qemu-guest-agent rc-update add qemu-guest-agent
 rc-service qemu-guest-agent restart rc-service qemu-guest-agent restart
 +</cli>
 +    * Freebsd <cli>
 +pkg install qemu-guest-agent
 +sysrc qemu_guest_agent_enable="YES"
 +service qemu-guest-agent start
 </cli> </cli>
     * Windows VM      * Windows VM 
行 658: 行 688:
      
   * 參考網址 - https://pve.proxmox.com/wiki/Qemu-guest-agent   * 參考網址 - https://pve.proxmox.com/wiki/Qemu-guest-agent
 +
 +===== 解決 VM 時間無法和 Host 同步問題 =====
 +  * 主要發生在 Alpine VM 內的系統時間無法和 PVE 主機時間相同的議題
 +  * 解決方案 : 在 vmid.conf 內加入 args: -rtc clock=vm,base=utc 來解決 Exp. /etc/pve/qemu-server/111.conf <file>
 +agent: 1
 +args: -rtc clock=vm,base=utc
 +boot: order=scsi0;ide2;net0
 +cores: 2
 +cpu: x86-64-v2-AES
 +ide2: none,media=cdrom
 +memory: 2048
 +meta: creation-qemu=8.1.2,ctime=1702131932
 +name: pve-rproxy-internet
 +net0: virtio=BC:24:11:8F:41:CE,bridge=vmbr0,firewall=1
 +numa: 0
 +onboot: 1
 +ostype: l26
 +scsi0: ssd-zfs:vm-111-disk-0,iothread=1,size=32G
 +scsihw: virtio-scsi-single
 +smbios1: uuid=595b1cc9-fbf0-4c16-a580-401bee86ac25
 +sockets: 1
 +tags: service
 +vmgenid: 58a2ec03-e357-4aa9-8567-9e58ec447890
 +</file>
  
 ===== CT 忘記 root 密碼重設方式 ===== ===== CT 忘記 root 密碼重設方式 =====
行 689: 行 743:
     * 新增完成後就點下 Order Certificate Now 就會自動進行申請 SSL 憑證與佈署到 PVE 的自動程序, 如果都沒問題就可完成 \\ {{:tech:nuc_-_proxmox_virtual_environment_-_google_chrome_2020_7_11_下午_10_18_52.png}}     * 新增完成後就點下 Order Certificate Now 就會自動進行申請 SSL 憑證與佈署到 PVE 的自動程序, 如果都沒問題就可完成 \\ {{:tech:nuc_-_proxmox_virtual_environment_-_google_chrome_2020_7_11_下午_10_18_52.png}}
     * 接著在瀏覽器網只用 domain name 就不會出現憑證警告訊息 \\ {{:tech:2020071101.png?500}}      * 接著在瀏覽器網只用 domain name 就不會出現憑證警告訊息 \\ {{:tech:2020071101.png?500}} 
 +
 +===== VM 寫入效能調整議題 =====
 +  * 參考 - https://pve.proxmox.com/wiki/Performance_Tweaks
 +  * 原則上 Disk Cache 使用預設 none 模式即可(Host Page Cache:disabled, Disk Write Cache:enabled)  \\ {{:tech:20231018-0557.png|}}
 +  * 也可調整為 writeback 模式後(Host Page Cache:enabled, Disk Write Cache:enabled), 進入 VM 內使用 wget -qO- bench.sh | bash 進行效能測試來比對調整後的結果 \\ {{:tech:20231018-0605.png|}}
 +
 +===== Move Disk 出現 timeout 議題 =====
 +  * 參考 - https://forum.proxmox.com/threads/how-do-you-move-large-disk.117633/
 +  * 當 VM Hard Disk 透過 Disk Action -> Move Storage 到 NFS 的 Storage Exp. pvs-253-nfs 結果等 60 秒出現 timed out 類似以下的訊息<cli>
 +create full clone of drive scsi0 (zfs-raid:vm-106-disk-0)
 +Formatting '/mnt/pve/pbs-253-nfs/images/106/vm-106-disk-0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=metadata compression_type=zlib size=536870912000 lazy_refcounts=off refcount_bits=16
 +TASK ERROR: storage migration failed: unable to create image: 'storage-pbs-253-nfs'-locked command timed out - aborting
 +</cli> 
 +  * 主要的原因就是 pve-253-nfs 這 Storage 速度太慢, 無法在 60 秒內建立出 500G 的磁碟空間(preallocation).. 所以可以設定對這 storage 不要 preallocation, 作法如下<cli>
 +pvesm set pbs-253-nfs --preallocation off
 +</cli>這樣針對 pbs-253-nfs 這 storage 就不會在搬移前進行 preallocation.
 +
 +===== 讓 PVE 6 安裝 CentOS7 的 CT 移轉至 PVE 7 的妥協做法 =====
 +  * [[https://www.ichiayi.com/tech/pve6_and_pve7#%E8%AE%93_pve_6_%E5%85%A7%E7%9A%84_centos7_%E7%9A%84_ct_%E7%A7%BB%E8%BD%89%E8%87%B3_pve_7_%E7%9A%84%E5%A6%A5%E5%8D%94%E5%81%9A%E6%B3%95| 在 PVE 7 的主機 kernel option 加上 systemd.unified_cgroup_hierarchy=0 來改變使用之前 CGroup 版本]]
 +
 +===== 清除舊版 kernel 的做法 ======
 +  * 參考 - https://forum.proxmox.com/threads/proper-way-to-remove-old-kernels-from-pve-8-0-4-which-are-safe-to-remove.131644/
 +  * 雖然每次升級後透過 apt autoremove 會自動移除掉不需要的舊版 kernel 但仍然會殘留一些不需要的 kernel 版本在系統內.. Exp. pve-kernel-5.4: 6.4-12 .. 
 +  * 所以可透過 [[https://tteck.github.io/Proxmox/|tteck]] 提供的 Proxmox VE Kernel Clean 工具將 kernel 5.x 全部清除 <cli>
 +bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/kernel-clean.sh)"
 +</cli>
 +
 +==== PVE ISO 安裝無法啟動 XWindow 的解決方式 ====
 +  * 參考 - https://forum.proxmox.com/threads/generic-solution-when-install-gets-framebuffer-mode-fails.111577/
 +  * 對於比較新的硬體可能 ISO 內還未支援 X driver, 所以會出現中斷在以下的訊息, 無法進入 GUI 安裝畫面<cli>
 +Starting the installer GUI - see tty2 (CTRL-ALT-F2) for any errors...
 +</cli>按下 (CRTL-ALT-F2) 出現以下類似的錯誤訊息<cli>
 +:
 +(EE)
 +Fatal server error:
 +(EE) Cannot run in framebuffer mode. Please spacify busIDs 
 +(EE)
 +:
 +</cli>
 +  * 切回 Console 畫面編輯 X Driver config file
 +    * 先以 lspci | grep -i vga 來確認 vga pci 編號<cli>
 +root@TN1-PVE-103:~# lspci | grep -i vga
 +00:02.0 VGA compatible controller: Intel Corporation Device a780 (rev 04)
 +</cli>
 +    * 編輯 config 檔案 Exp. /usr/share/X11/xorg.conf.d/my-vga.conf <file>
 +Section "Device"
 +    Identifier "Card0"
 +    Driver "fbdev"
 +    BusID "pci0:00:02:0:"
 +EndSection
 +</file>
 +  * 重啟 XWindows <cli>
 +xinit -- -dpi 96 >/dev/tty2 2>&1
 +</cli>
 +
 ===== 相關頁面 ===== ===== 相關頁面 =====
 {{topic>pve}} {{topic>pve}}
  
 {{tag>pve tips cloudos 虛擬化 opensource}} {{tag>pve tips cloudos 虛擬化 opensource}}
  • tech/pvetips.1681607371.txt.gz
  • 上一次變更: 2023/04/16 09:09
  • jonathan