# Proxmox VE

# 疑難雜症



# LXC Container Permission denied 備份失敗

**<span style="color: rgb(35, 111, 161);">錯誤訊息 : </span>**LXC Container 備份時出現下列錯誤訊息，備份失敗

INFO: create storage snapshot 'vzdump'  
INFO: creating vzdump archive '/mnt/pve/xxxxxx/dump/vzdump-lxc-401-2024\_06\_08-00\_19\_50.tar.zst'  
INFO: tar: /mnt/pve/xxxxxx/dump/vzdump-lxc-401-2024\_06\_08-00\_19\_50.tmp: **<span style="color: rgb(224, 62, 45);">Cannot open: Permission denied</span>**  
INFO: tar: Error is not recoverable: exiting now

  
<span style="color: rgb(35, 111, 161);">**問題成因 :**</span>

只有在 <span style="color: rgb(35, 111, 161);">非特權容器 (Unpriviledged container)</span> 才會發生，如果是 <span style="color: rgb(35, 111, 161);">特權容器 (Priviledged container)</span> 則可以順利備份。這兩種模式在 vzdump 程式備份時使用的身份不一樣，前者會使用大於 100000 的 UID，而後者直接用 root 執行。

**<span style="color: rgb(35, 111, 161);">解決方式 : </span>**<span style="color: rgb(0, 0, 0);">修改 pve /etc/vzdump.conf</span>

```
mkdir /temp && mkdir /temp/vzdump
vim /etc/vzdump.conf
```

**<span style="color: rgb(35, 111, 161);">  
</span>**

\# vzdump default settings

<span style="color: rgb(224, 62, 45);">**tmpdir: /temp/vzdump**</span>  
\#dumpdir: DIR  
\#storage: STORAGE\_ID  
\#mode: snapshot|suspend|stop  
\#bwlimit: KBPS  
\#performance: \[max-workers=N\]\[,pbs-entries-max=N\]  
\#ionice: PRI  
\#lockwait: MINUTES  
\#stopwait: MINUTES  
\#stdexcludes: BOOLEAN  
\#mailto: ADDRESSLIST  
\#prune-backups: keep-INTERVAL=N\[,...\]  
\#script: FILENAME  
\#exclude-path: PATHLIST  
\#pigz: N  
\#notes-template: {{guestname}}

存檔後即可  
  
<span style="color: rgb(35, 111, 161);">**資料來源 :** </span>

**節省工具箱 Jason Tools** [<span style="color: rgb(0, 0, 0);">http://blog.jason.tools/2021/07/proxmox-ve-vzdump-lxc-fail.html</span>](http://blog.jason.tools/2021/07/proxmox-ve-vzdump-lxc-fail.html)

# Storage 相關



# Ceph指令

##### <span style="color: rgb(35, 111, 161);">**\#建立Crush Rule**</span>

  
ceph osd crush rule create-replicated rule-nvme default host nvme  
ceph osd crush rule create-replicated rule-hdd default host hdd  
ceph osd crush rule rm replicated\_rule

#####  

##### <span style="color: rgb(35, 111, 161);">**為HDD Pool建立SSD快取**</span>

  
ceph osd tier add Ceph\_Pool Cache  
ceph osd tier cache-mode Cache writeback  
ceph osd tier set-overlay Ceph\_Pool Cache  
ceph osd pool set Cache hit\_set\_type bloom  
\#ceph osd pool set Cache hit\_set\_count 12  
\#ceph osd pool set Cache hit\_set\_period 14400

ceph osd pool set Cache target\_max\_bytes xxxxxx  
ceph osd pool set Cache target\_max\_objects xxxxxx  
ceph osd pool set Cache min\_read\_recency\_for\_promote 2  
ceph osd pool set Cache min\_write\_recency\_for\_promote 2

ceph osd pool set Cache cache\_target\_dirty\_ratio 0.4  
ceph osd pool set Cache cache\_target\_dirty\_high\_ratio 0.6  
ceph osd pool set Cache cache\_target\_full\_ratio 0.8  
ceph osd pool set Cache cache\_min\_flush\_age 600  
ceph osd pool set Cache cache\_min\_evict\_age 1800

##### <span style="color: rgb(35, 111, 161);">**\#remove Cache Pool**</span>

  
ceph osd tier cache-mode Cache readproxy  
radow -p Cache ls  
radow -p Cache cache-flush-evict-all  
ceph osd tire remove-overlay Ceph\_Pool  
ceph osd tire remove Ceph\_Pool Cache  
ceph delete Cache Cache --yes-i-really-really-mean-it

##### <span style="color: rgb(35, 111, 161);">**\#移除以前是Ceph LVM的Disk Lable**</span>

  
ceph-volume lvm zap /dev/sdX --destroy

##### <span style="color: rgb(35, 111, 161);">**\#確認Ceph 狀態**</span>

  
ceph -s

ceph osd pool stats

#####   
<span style="color: rgb(35, 111, 161);">**\#關閉ceph cluster準備**</span>

  
ceph osd set noout  
ceph osd set nobackfill  
ceph osd set norecover

##### <span style="color: rgb(35, 111, 161);">**\#ceph cluster開機後執行**</span>

  
ceph osd unset noout  
ceph osd unset nobackfill  
ceph osd unset norecover

# ZFS指令

# 設定ZFS使用SSD做Cache與Log

zpool add ZFS\_Pool cache &lt;&lt; /dev/xxxx &gt;&gt;

zpool add ZFS\_Pool log &lt;&lt; /dev/xxxx &gt;&gt;

# 顯示ZFS相關資訊

zfs list

[![image.png](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/scaled-1680-/ty4image.png)](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/ty4image.png)

zpool list

[![image.png](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/scaled-1680-/XJfimage.png)](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/XJfimage.png)

zpool status

[![image.png](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/scaled-1680-/G9uimage.png)](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/G9uimage.png)

# GuestOS相關



# Guest OS安裝Qemu Guest Agent

## <span style="color: rgb(35, 111, 161);">**各版本OS安裝Qemu Guest Agent的方式**</span>

# Windows 2012以後

最新的VirtIO ISO中有 Qemu-GA可以安裝

[https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso)

# Windows 2008 R2 / 7

最後能安裝的版本為 100.0  
[https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-100.0.0.0-3.el7ev/](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-100.0.0.0-3.el7ev/)

<span style="color: rgb(224, 62, 45);">**注意 !!** </span>只要安裝了比100更新的版本會造成安裝錯誤，並無法再安裝任何版本的Qemu-GA，請勿必注意 !!

# Windows 2003(含) 以前

無任何Qemu-GA可以安裝

# CentOS/Redhat/Rocky

dnf install qemu-guest-agent -y  
systemctl enable qemu-guest-agent  
systemctl start qemu-guest-agent

# Ubuntu / Debian

apt update &amp;&amp; apt -y install qemu-guest-agent  
systemctl enable qemu-guest-agent  
systemctl start qemu-guest-agent