差異處

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

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
tech:pvetips [2021/01/17 14:05] – 命令改用 cli jonathantech:pvetips [2024/04/13 23:46] (目前版本) – [Move Disk 出現 timeout 議題] jonathan
行 4: 行 4:
   * 參考網址 - 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/
  
-==== PVE 5 ===== +{{tabinclude>tech/pvetips/pve8tech/pvetips/pve7, tech/pvetips/pve6, tech/pvetips/pve5}}
-    - <code h /etc/apt/sources.list> +
-deb http://ftp.debian.org/debian stretch main contrib +
- +
-# PVE pve-no-subscription repository provided by proxmox.com, +
-# NOT recommended for production use +
-deb http://download.proxmox.com/debian/pve stretch pve-no-subscription +
- +
-# security updates +
-deb http://security.debian.org stretch/updates main contrib +
-</code> +
-    - <code h /etc/apt/sources.list.d/pve-enterprise.list> +
-#deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise +
-</code> +
- +
-==== PVE 6 ==== +
-    - <code h /etc/apt/sources.list> +
-deb http://ftp.tw.debian.org/debian buster main contrib +
- +
-deb http://ftp.tw.debian.org/debian buster-updates main contrib +
- +
-deb http://download.proxmox.com/debian/pve buster pve-no-subscription +
- +
-# security updates +
-deb http://security.debian.org buster/updates main contrib +
-</code> +
-    - <code h /etc/apt/sources.list.d/pve-enterprise.list> +
-#deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise +
-</code>+
  
 ==== 執行命令列更新 ==== ==== 執行命令列更新 ====
   * <cli>   * <cli>
-apt-get update+apt update
 apt upgrade apt upgrade
 </cli> </cli>
-===== 移除 Cluster 的方式 ===== + 
-  * [[https://pve.proxmox.com/wiki/Cluster_Manager]] <cli> +===== PVE 主機安裝 snmpd ===== 
-pvecm nodes +  * 安裝與設定程序<cli> 
-systemctl stop pve-cluster +apt install snmpd -y 
-systemctl stop corosync +cd /etc/snmp/ 
-pmxcfs -l +mv snmpd.conf snmpd.conf.org 
-rm /etc/pve/corosync.conf +vi snmpd.conf 
-rm -rf /etc/corosync/* +
-killall pmxcfs +依照實際需要編輯 
-systemctl start pve-cluster+
 +service snmpd restart 
 +systemctl enable snmpd
 </cli> </cli>
 +  * 參考網址 : https://www.svennd.be/how-to-install-snmp-service-on-proxmox/
 +
 +===== 如有使用 ZFS 可限制使用記憶體大小 =====
 +  * 參考 - https://www.ichiayi.com/tech/zfs#%E9%99%90%E5%88%B6_zfs_%E4%BD%BF%E7%94%A8%E5%A4%9A%E5%B0%91_ram_%E7%95%B6_cache_%E6%96%B9%E5%BC%8F
 +
 +===== PVE 主機設定 Postfix 由 GMail 寄發信件方式 =====
 +  * 假設預計 Relay 的 SMTP Server - smtp.gmail.com:587 (STARTTLS) 認證帳號:username 密碼:password
 +  - 安裝相關套件 <cli>
 +apt install libsasl2-modules -y
 +</cli>
 +  - 編輯 /etc/postfix/main.cf <file>
 +:
 +# GMail Setting
 +relayhost = [smtp.gmail.com]:587
 +#  use tls
 +smtp_use_tls=yes
 +# use sasl when authenticating to foreign SMTP servers
 +smtp_sasl_auth_enable = yes
 +# path to password map file
 +smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
 +# list of CAs to trust when verifying server certificate
 +smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
 +# eliminates default security options which are imcompatible with gmail
 +smtp_sasl_security_options = noanonymous
 +smtp_always_send_ehlo = yes
 +</file>
 +  - 編輯 /etc/postfix/sasl_passwd <file>
 +[smtp.gmail.com]:587  username:password
 +</file>
 +  - 更改檔案權限 <cli>
 +newaliases
 +postmap /etc/postfix/sasl_passwd
 +cd /etc/postfix
 +chown postfix /etc/postfix/sasl_passwd*
 +</cli>
 +  - 讓 postfix 新設定生效 <cli>
 +/etc/init.d/postfix reload
 +</cli>
 +
 +  * 參考網址 : http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html
 +
 +<note>
 +  * 如果 Google 的帳號有設定二階段認證, 密碼的部份就必須到 Google 帳號產生應用程式密碼 
 +  * 參考 - https://support.google.com/mail/?p=InvalidSecondFactor
 +  * ++看建立應用程式密碼畫面|{{:tech:2019110801.png}} \\ {{:tech:2019110802.png}}++
 +</note>
  
 ===== 移除 cluster 內的一個 node ===== ===== 移除 cluster 內的一個 node =====
-  * [[http://www.gienginali.idv.tw/modules/tad_book3/html.php?tbdsn=500| Exp. pve01 方式]] <cli>+  * 參考網址 - https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_remove_a_cluster_node 
 +  * [[http://www.gienginali.idv.tw/modules/tad_book3/html.php?tbdsn=500| Exp. pve01 移除方式]]  
 +    * 先進入 cluster 內其中一台 (不能是 pve01) 
 +    * 執行以下的語法將 pve01 刪除<cli>
 pvecm nodes pvecm nodes
 pvecm delnode pve01 pvecm delnode pve01
 pvecm status pvecm status
 rm -rf /etc/pve/nodes/pve01 rm -rf /etc/pve/nodes/pve01
 +</cli>
 +    * 進入每個 node 將 pve cluster 服務重新啟動<cli>
 +systemctl restart corosync
 +systemctl restart pve-cluster
 </cli> </cli>
  
   * <WRAP important>   * <WRAP important>
-  * 為了避免之後設定相同 IP 或 hostname 無法順利加入 Cluster 需要行以下程序: +  * 設定相同 IP 或 hostname 加入 Cluster 後, 因為之前的 ssh fingerprint / authorized_keys 在各節點都還有殘存, 所以需要在新增的節點上執行以下命令<cli>pvecm updatecerts</cli> 
-    * 每個 Node 都要清除已經移除 node 的 ssh fingerprint authorized_keys Exp. hostname : pve01<cli> +  * 可以直接編輯 /etc/pve/priv 內的 known_hosts 與 authorized_keys 將已經不在 cluster 內的 node ip 紀錄移除 
-ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R "pve01" +  * 再至所有 cluster 內 node 的 /root/.ssh/ 內 known_hosts 將已經不在 cluster 內的 node ip 紀錄移
-ssh-keygen -f "/root/.ssh/known_hosts" -R "pve01" +
-cd .ssh +
-grep pve01 * +
-cd /etc/pve/priv +
-grep pve01 * +
-</cli> 如果有出現哪個檔案還殘存這資訊, 透過 vi 編輯刪該行即可+
 </WRAP> </WRAP>
  
行 94: 行 115:
 </cli> </cli>
   * 參考網址 - http://blog.pulipuli.info/2014/08/proxmox-ve-fix-proxmox-ve-cluster-not.html   * 參考網址 - http://blog.pulipuli.info/2014/08/proxmox-ve-fix-proxmox-ve-cluster-not.html
 +
 +
 +===== 移除 Cluster 的方式 =====
 +  * [[https://pve.proxmox.com/wiki/Cluster_Manager]] <cli>
 +pvecm nodes
 +systemctl stop pve-cluster
 +systemctl stop corosync
 +pmxcfs -l
 +rm /etc/pve/corosync.conf
 +rm -rf /etc/corosync/*
 +killall pmxcfs
 +systemctl start pve-cluster
 +</cli>
 +
  
 ===== 更改 hostname 方式 ===== ===== 更改 hostname 方式 =====
   * 參考 - https://pvecli.xuan2host.com/proxmox-host-name-change/   * 參考 - https://pvecli.xuan2host.com/proxmox-host-name-change/
- 
  
 ===== 更改主機 IP 方式 ===== ===== 更改主機 IP 方式 =====
行 241: 行 275:
   * 解決方式 - 連入遷移主機可以看到目標主機是離線狀態(實際上並沒有離線), 所以要重新啟動 pve-cluster corosync 服務<cli>   * 解決方式 - 連入遷移主機可以看到目標主機是離線狀態(實際上並沒有離線), 所以要重新啟動 pve-cluster corosync 服務<cli>
 systemctl restart pve-cluster corosync systemctl restart pve-cluster corosync
 +</cli>
 +
 +===== migration 出現 volume 'xxx' already exists 問題 =====
 +  * 主要問題是 vm/ct 的硬碟檔名已出現在遷移目標的主機內, 所以出現這樣的訊息.. 可能之前遷移過程失敗沒有正確移除, 或是之前所建立的 vm/ct 移除時的硬碟沒有移除所造成硬碟檔名重複
 +  * 解決方式 - 連入遷移主機將檔案移除即可, 如果是 zfs 可以使用 zfs destroy 方式移除, Exp. local-zfs/subvol-109-disk-1 是出現重複的硬碟<cli>
 +root@aac:~# zfs list
 +NAME                          USED  AVAIL     REFER  MOUNTPOINT
 +local-zfs                    9.60G   889G      128K  /local-zfs
 +local-zfs/subvol-103-disk-0   522M  7.49G      522M  /local-zfs/subvol-103-disk-0
 +:
 +local-zfs/subvol-109-disk-1  2.99G  5.01G     2.99G  /local-zfs/subvol-109-disk-1
 +:
 +local-zfs/subvol-131-disk-0  2.31G  13.7G     2.31G  /local-zfs/subvol-131-disk-0
 +rpool                        1.32G   227G      104K  /rpool
 +rpool/ROOT                   1.32G   227G       96K  /rpool/ROOT
 +rpool/ROOT/pve-1             1.32G   227G     1.32G  /
 +rpool/data                     96K   227G       96K  /rpool/data
 +root@aac:~# zfs destroy -r local-zfs/subvol-109-disk-1
 </cli> </cli>
  
行 258: 行 310:
 Warning: Permanently added 'pve-45' (ECDSA) to the list of known hosts. Warning: Permanently added 'pve-45' (ECDSA) to the list of known hosts.
 </cli> </cli>
 +<WRAP center round tip 60%>
 +  * 如果是因為之前有移除與新增設定相同 IP 或 hostname 的節點, 因為之前的 ssh fingerprint / authorized_keys 在各節點都還有殘存, 所以需要在新增的節點上執行以下命令<cli>pvecm updatecerts</cli>
 +</WRAP>
 +
  
 ===== online migration 使用本機硬碟的 VM ===== ===== online migration 使用本機硬碟的 VM =====
行 268: 行 324:
   * 會出現先將 VM Disk 複製過去目標節點, 之後會將記憶體資料同步過去目標節點, 才完成切換, 所以 VM Disk 如果愈大, 遷移時間就會愈久   * 會出現先將 VM Disk 複製過去目標節點, 之後會將記憶體資料同步過去目標節點, 才完成切換, 所以 VM Disk 如果愈大, 遷移時間就會愈久
   * 參考網址 : https://blog.jason.tools/2018/12/pve-local-disk-migration.html   * 參考網址 : https://blog.jason.tools/2018/12/pve-local-disk-migration.html
 +
 +===== migration 使用第二張網卡的設定方式 =====
 +  * 因為 migration 過程可能會需要使用大量頻寬, 所以指定走另外一個網卡介面應該會比較合適
 +  * 參考 - http://blog.jason.tools/2019/01/pve-migrate-network.html
 +  * Exp. 第二張網卡網路的 Subnet 是 192.168.100.0/24 , 所以直接修改<cli>vi /etc/pve/datacenter.cfg</cli><file>
 +:
 +migration: secure,network=192.168.100.0/24
 +</file>
  
 ===== 設定使用 iSCSI 的 LVM Storage 方式 ===== ===== 設定使用 iSCSI 的 LVM Storage 方式 =====
行 287: 行 351:
 </cli> </cli>
     - 如果有其他 PVE Node 每一台都執行以上兩個步驟     - 如果有其他 PVE Node 每一台都執行以上兩個步驟
 +<note>
 +如果 iscsi 的連線要移除, 語法如下<cli>
 +iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:freenas -p 192.168.11.246 -o delete
 +</cli>
 +</note>
   * 將 iSCSI 的 Volume 建立成為 LVM partition   * 將 iSCSI 的 Volume 建立成為 LVM partition
     - 執行後可以使用 fdisk -l 看到 PVE Node 多出來一個 Disk Exp. /dev/sdg <code>     - 執行後可以使用 fdisk -l 看到 PVE Node 多出來一個 Disk Exp. /dev/sdg <code>
行 330: 行 399:
     * https://pve.proxmox.com/wiki/Storage     * https://pve.proxmox.com/wiki/Storage
  
 +===== CT(lxc) 設定掛載 CIFS 網路磁碟方式 =====
 +  - 這問題主要是預設建立 CT 會是 UnPrivilegied 模式, 所以建立時必須要將 UnPrivilegied 打勾拿掉  {{:tech:2021052401.png?600|}}
 +  - 建立之後還要將 Features 的 CIFS 打勾 {{:tech:2021052402.png?600|}} 
 +  - 這樣就可以將 cifs 掛載上去 Exp. <cli>cat /etc/fstab
 +# UNCONFIGURED FSTAB FOR BASE SYSTEM
 +//10.20.0.131/data/template/iso/ /omv-iso cifs username=isouser,password=xxxx,rw,users,dir_mode=0777,file_mode=0777 0 0
 +</cli>
 +  * 參考網址 :
 +    * https://forum.proxmox.com/threads/vm-and-lxc-mount-cifs-problem-solved.64157
 ===== 中斷 Backup 的處理方式 =====  ===== 中斷 Backup 的處理方式 ===== 
   * 正常只要透過 UI 的 Tasks->點開正在 Backup 的項目->Stop 即可中斷   * 正常只要透過 UI 的 Tasks->點開正在 Backup 的項目->Stop 即可中斷
行 340: 行 418:
   * 參考網址 :    * 參考網址 : 
     * 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>
行 381: 行 477:
   * 參考網址 :   * 參考網址 :
     * https://forum.proxmox.com/threads/task-error-vm-is-locked-snapshot.24012/     * https://forum.proxmox.com/threads/task-error-vm-is-locked-snapshot.24012/
 +
 +===== CT 啟動失敗出現 run_buffer: 321 Script exited with status 2 的解決方式 ===== 
 +  * 更新 PVE 系統重開後, 發現部分 CT 無法正常啟動, 出現<cli>
 +run_buffer: 321 Script exited with status 2
 +lxc_init: 847 Failed to run lxc.hook.pre-start for container "1xx"
 +__lxc_start: 2008 Failed to initialize container "1xx"
 +TASK ERROR: startup for container '1xx' failed
 +</cli>
 +  * 只要在 PVE 主機內安裝 binutils 即可解決這問題<cli>
 +apt install binutils 
 +</cli>
 +
 +  * 參考網址 :
 +    * https://forum.proxmox.com/threads/proxmox-lxc-start-issue-after-apt-upgrade.118117/
  
 ===== Replication 異常解決方式 ===== ===== Replication 異常解決方式 =====
行 537: 行 647:
     * CentOS VM <cli>     * CentOS VM <cli>
 yum install qemu-guest-agent yum install qemu-guest-agent
 +systemctl start qemu-guest-agent
 </cli> </cli>
-    * Debian VM <cli>+    * Debian / Ubuntu VM <cli>
 apt install qemu-guest-agent apt install qemu-guest-agent
 +systemctl start qemu-guest-agent
 </cli> </cli>
 +    * Alpine VM <cli>
 +apk add qemu-guest-agent
 +</cli> 修改 /etc/conf.d/qemu-guest-agent 設定 GA_PATH="/dev/vport2p1"<file>
 +:
 +# Specifies the device path for the communications back to QEMU on the host
 +# Default: /dev/virtio-ports/org.qemu.guest_agent.0
 +GA_PATH="/dev/vport2p1"
 +</file><cli>
 +rc-update add qemu-guest-agent
 +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>
 +    * Windows VM 
 +      - 先下載 [[https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso |virtio-win.iso]] 掛上 Windows 的 VM CD-ROM
 +      - 進入光碟路徑內找到 **virtio-win-gt-x64** 與 **guest-agent/qemu-ga-x86_64** 進行安裝 
 +      - 重新啟動 Windows VM
   * PVE 端設定 VM -> Option -> Qemu Agent -> [v]Enabled   * PVE 端設定 VM -> Option -> Qemu Agent -> [v]Enabled
   * {{:tech:2019031101.png}}   * {{:tech:2019031101.png}}
行 549: 行 681:
   * 參考網址 - https://pve.proxmox.com/wiki/Qemu-guest-agent   * 參考網址 - https://pve.proxmox.com/wiki/Qemu-guest-agent
  
-===== CT(Centos7) 忘記 root 密碼重設方式 =====+===== CT 忘記 root 密碼重設方式 ===== 
 +  * 參考網址 - https://pve.proxmox.com/wiki/Root_Password_Reset 
 +  * 執行方式 <cli> 
 +pct enter <VEID> 
 +passwd  
 +<new password> 
 +exit 
 +</cli> 
 +++++之前 (Centos7) 處理方式| 
   * 參考網址 - https://www.thegeekdiary.com/how-to-change-password-of-an-lxc-container-user-account/   * 參考網址 - https://www.thegeekdiary.com/how-to-change-password-of-an-lxc-container-user-account/
   * 執行方式 :   * 執行方式 :
行 556: 行 696:
     - 輸入 password root 重設 root 密碼     - 輸入 password root 重設 root 密碼
     * 參考以下實際操作畫面 {{:tech:2019121301.png}}     * 參考以下實際操作畫面 {{:tech:2019121301.png}}
-===== PVE 主機安裝 snmpd ===== +++++
-  * 安裝與設定程序<cli> +
-apt-get install snmpd +
-cd /etc/snmp/ +
-mv snmpd.conf snmpd.conf.org +
-vi snmpd.conf +
-+
-依照實際需要編輯 +
-+
-service snmpd restart +
-systemctl enable snmpd +
-</cli> +
-  * 參考網址 : https://www.svennd.be/how-to-install-snmp-service-on-proxmox/ +
- +
-===== PVE 主機設定 Postfix 由 GMail 寄發信件方式 ===== +
-  * 假設預計 Relay 的 SMTP Server - smtp.gmail.com:587 (STARTTLS) 認證帳號:username 密碼:password +
-  - 安裝相關套件 <cli> +
-apt-get install libsasl2-modules +
-</cli> +
-  - 編輯 /etc/postfix/main.cf <file> +
-+
-# GMail Setting +
-relayhost = [smtp.gmail.com]:587 +
-#  use tls +
-smtp_use_tls=yes +
-# use sasl when authenticating to foreign SMTP servers +
-smtp_sasl_auth_enable = yes +
-# path to password map file +
-smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd +
-# list of CAs to trust when verifying server certificate +
-smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt +
-# eliminates default security options which are imcompatible with gmail +
-smtp_sasl_security_options = noanonymous +
-smtp_always_send_ehlo = yes +
-</file> +
-  - 編輯 /etc/postfix/sasl_passwd <file> +
-[smtp.gmail.com]:587  username:password +
-</file> +
-  - 更改檔案權限 <cli> +
-postmap /etc/postfix/sasl_passwd +
-cd /etc/postfix +
-chown postfix /etc/postfix/sasl_passwd* +
-</cli> +
-  - 讓 postfix 新設定生效 <cli> +
-/etc/init.d/postfix reload +
-</cli> +
- +
-  * 參考網址 : http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html +
- +
-<note> +
-  * 如果 Google 的帳號有設定二階段認證, 密碼的部份就必須到 Google 帳號產生應用程式密碼  +
-  * 參考 - https://support.google.com/mail/?p=InvalidSecondFactor +
-  * ++看建立應用程式密碼畫面|{{:tech:2019110801.png}} \\ {{:tech:2019110802.png}}++ +
-</note>+
 ===== 設定 VM 的開機與關機順序 ===== ===== 設定 VM 的開機與關機順序 =====
   * PVE Web UI -> 選定 VM -> Options -> Start/Shutdown order -> Edit    * PVE Web UI -> 選定 VM -> Options -> Start/Shutdown order -> Edit 
行 624: 行 711:
     * 新增完成後就點下 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 cloudos 虛擬化 opensource}}+{{tag>pve tips cloudos 虛擬化 opensource}}
  • tech/pvetips.1610863506.txt.gz
  • 上一次變更: 2021/01/17 14:05
  • jonathan