v0.6.0 MIT PRERELEASE預覽版

jt-pve-storage-qnap

Proxmox VE uses a QNAP NAS over iSCSI directly as its VM storage back end. 讓 Proxmox VE 透過 iSCSI,直接把 QNAP NAS 當成 VM 儲存後端。

Every Proxmox VE VM disk maps to one thin LUN on the QNAP NAS. So creating, removing, resizing, cloning, snapshotting and rolling back a VM all drive the NAS's own LUN features, instead of carving one large shared LUN up with LVM on the PVE side. No extra LVM storage layer, and no LUNs to manage by hand. 每一顆 Proxmox VE VM 磁碟,直接對應 QNAP NAS 上的一個 thin LUN。因此 VM 的建立、刪除、擴充、Clone、Snapshot 與 Rollback,都可以直接操作 NAS 原生的 LUN 能力,而不是先建立一個大型共用 LUN,再交給 PVE 用 LVM 切割。沒有額外的 LVM 儲存層,也不需要手動管理 LUN。

QTS & QuTS hero · PVE 9 · Shared Storage · Live Migration · Snapshot / Rollback · Instant Clone · Multipath 支援 QTS 與 QuTS hero、PVE 9、Shared Storage、Live Migration、Snapshot / Rollback、Instant Clone 與 Multipath。

NOT YET TESTED ON HARDWARE尚未實機測試
No part of this plugin has ever run against a real QNAP NAS. It is written from the API documentation alone. It compiles, passes 207 unit tests and has been driven against a simulated NAS, and none of that proves it works on your NAS. Do not put production data on it. Run it against a spare NAS, or a pool you are willing to lose, and read what is still unanswered first. 這個 plugin 還沒有在任何實體 QNAP NAS 上執行過。它完全是依照 API 文件寫成的。它可以編譯,通過 207 個單元測試,也對模擬的 NAS 跑過完整的操作流程,但這些都不能證明它在你的 NAS 上能正常運作。請不要放正式資料。請用一台備用 NAS、或一個可以捨棄的儲存集區來測試,並先確認還有哪些項目尚未驗證。

Read this first請先讀這個

This has not been run against a QNAP NAS yet.這個版本尚未在實體 QNAP NAS 上執行過。
Every 0.x release is a prerelease. Nothing array-facing has been answered by a NAS yet, and every open item is listed in TESTING.md in the order it should be settled. Do not put data you care about on this yet. 0.x 全部都是預覽版本。所有與 NAS 溝通的部分,都還沒有任何一台 NAS 回應過。所有待驗證項目都依處理順序列在 TESTING_zh-TW.md。請先不要把重要資料放上來。

The related projects in this family reached stability by measuring an array and writing down what it actually did, rather than by trusting a document. This one is at the start of that process, and saying so is the point of this section. 相關專案是靠實際量測儲存設備、把實際行為記錄下來才穩定的,不是靠文件。這個專案才剛開始這個過程,這一節說明目前的實際狀況。

What that means concretely具體來說

The three that would change the design會影響設計的三項

  1. Does the NAS's LUNNAA equal the kernel's /sys/block/<sd>/device/wwid? Every device in this plugin is identified by comparing them.NAS 回報的 LUNNAA 是否等於核心的 /sys/block/<sd>/device/wwid?這個 plugin 靠比對這兩者來辨識每一個裝置。
  2. What does a QNAP LUN report as its SCSI vendor string? If it is not QNAP, the multipath drop-in does not apply and the LUN falls back to defaults that include no_path_retry queue.QNAP LUN 的 SCSI vendor 字串是什麼?如果不是 QNAP,multipath 設定就不會生效,LUN 會落回包含 no_path_retry queue 的預設值。
  3. Does authLogin.cgi accept a POST? Every call this plugin makes is a POST, so that no credential travels in a URL.authLogin.cgi 是否接受 POST?這個 plugin 的每一個呼叫都是 POST,憑證不會出現在 URL 裡。

Which Proxmox VE operations work支援的 Proxmox VE 操作

Implemented and unit-tested, not yet driven on hardware, for virtual machines and for containers. The rows that are not a plain yes say why. 已實作並通過單元測試,但尚未在實機上執行過,虛擬機與容器都一樣。不是單純「支援」的那幾列,都寫出原因。

A container's disk is the same object as a virtual machine's: one thin LUN, one multipath device. The difference is what sits on top. Proxmox VE puts a filesystem on a container's LUN and mounts it on the host, where a VM's disk is handed to the guest whole. That is why two rows below differ, and only two. 容器的磁碟和虛擬機的磁碟是同一種東西:一個 thin LUN、一個 multipath 裝置。差別在上層。Proxmox VE 會在容器的 LUN 上建立檔案系統並掛接在主機上,而虛擬機的磁碟是整顆交給 guest。所以下表只有兩列不同。

Operation操作 VM虛擬機 Container容器
Create and remove a disk建立、移除磁碟
A container needs rootdir in the storage's content types: --content images,rootdir.容器需要在 storage 的內容類型裡包含 rootdir:--content images,rootdir。
yes yes
Thin provisioning精簡配置
Every disk is a thin LUN, so it occupies what has been written rather than what it was created as. Because that can overcommit the pool, qnap-min-free refuses to allocate once the pool's free space falls below it.每一顆磁碟都是 thin LUN,佔用的是已經寫入的量,不是建立時的大小。因為這樣可能超額配置儲存集區,所以剩餘空間低於 qnap-min-free 時會拒絕配置。
yes yes
Resize (grow)擴充容量
Rounded up to a whole GiB, see below. For a container Proxmox VE grows the filesystem on top afterwards; for a VM the guest does that itself.會進位到整數 GiB,見下一節。容器由 Proxmox VE 接著擴充上層的檔案系統,虛擬機則由 guest 自行處理。
yes yes
Shrink a disk縮小磁碟
Refused, loudly, for both. Shrinking a LUN under a filesystem destroys data, and PVE writes the requested size into the configuration whatever a plugin returns, so a silent no-op would leave it claiming a size the NAS does not have.兩者都明確拒絕。在檔案系統底下縮小 LUN 會損毀資料。而且不論 plugin 回傳什麼,PVE 都會把要求的大小寫入設定,所以如果 plugin 不做任何事也不回報錯誤,設定裡的容量就會與 NAS 上的實際容量不符。
no no
Snapshot, delete snapshot, roll back快照、刪除快照、倒回
Per LUN, not per volume: the rollback call is made with by_lun=1, so it does not take every other LUN on the same storage volume with it.以 LUN 為單位,不是以磁碟區為單位:倒回的呼叫帶有 by_lun=1,所以不會連同一個磁碟區上的其他 LUN 一起倒回。
The plugin answers volume_snapshot_needs_fsfreeze yes, so PVE freezes a running container's mount points before the NAS takes the snapshot. A container's root is mounted on the host, unlike a VM's disk.plugin 的 volume_snapshot_needs_fsfreeze 回答「是」,所以 PVE 會在 NAS 建立快照之前,先凍結執行中容器的掛接點。容器的根目錄是掛接在主機上的,這一點和虛擬機的磁碟不同。
yes yes
Template and linked clone範本與連結複製
Instant on QuTS hero. On QTS the same call copies, so a linked clone is as slow and as large as a full one.在 QuTS hero 上是即時的。在 QTS 上同一個呼叫是真的複製,所以連結複製跟完整複製一樣慢、一樣大。
yes yes
Full clone, pvesm export / import, move to another storage完整複製、pvesm export / import、搬移到其他 storage yes yes
Migration between nodes節點間遷移
The storage is shared, so nothing moves. The destination node attaches the same LUN.這是共用 storage,所以資料不需要搬動。目的節點掛上的是同一個 LUN。
yes yes
LIVE migration, with the guest running線上遷移(guest 不停機)
Proxmox VE does not live-migrate a running container at all, on any storage. A container migrates with a restart, and on this storage that restart moves no data.Proxmox VE 在任何 storage 上都不支援執行中容器的線上遷移。容器遷移需要重新啟動,而在這個 storage 上,重新啟動時不需要搬動任何資料。
yes n/a
Multipath across several NAS data ports跨多個 NAS 資料埠的多重路徑 yes yes
CHAP and mutual CHAPCHAP 與雙向 CHAP yes yes
Read a snapshot as a device直接把快照當裝置讀取
Not possible. Roll back to it, or clone it into a disk of its own. The plugin declines the capability up front rather than starting an operation and failing partway.無法做到。請倒回到該快照,或把它複製成一顆獨立的磁碟。plugin 會在一開始就表明不支援,不會做到一半才失敗。
no no

Three things about QTS that shape what this can do影響使用方式的三件事

They are worth knowing before you build a cluster around them. 在圍繞它們規劃叢集之前,值得先知道。

1. Disks are allocated in whole GiB一、磁碟以整數 GiB 配置

A LUN's capacity is a whole number of GiB, with no finer step. Proxmox VE allocates in KiB, so every size is rounded up, and volume_size_info reports what the NAS actually has rather than what PVE asked for. A volume that reports less than the configuration claims is one QEMU refuses to start. LUN 的容量是整數 GiB,沒有更細的刻度。Proxmox VE 是以 KiB 配置,所以每個容量都會無條件進位,而且 volume_size_info 回報的是 NAS 上實際的大小,不是 PVE 要求的大小。回報值小於設定值的磁碟區,QEMU 會拒絕啟動。

A resize says so out loud rather than leaving you to notice: 調整容量時會明講,而不是讓你自己發現:

storage 'qnap1': QTS allocates in whole GiB, so 'pve-qnap1-vm-100-disk-0'
is now 12884901888 bytes rather than the 11811160064 requested.

2. CHAP is the access control二、存取控制靠 CHAP

This plugin does not set up per-host access lists on the target. It configures CHAP on the target's default policy and nothing narrower; restricting a LUN to named hosts is something you do yourself in the QNAP web interface. 這個 plugin 不會在 target 上設定針對個別主機的存取清單。它只在 target 的預設原則上設定 CHAP,不做更細的限制。要把 LUN 限制給特定主機,請自行在 QNAP 網頁介面裡設定。

So set CHAP unless the NAS is on a storage-only network. The plugin warns when you add a storage without it, and it refuses a username with no secret. An empty CHAP secret is access control that reports itself as on and protects nothing. 所以除非這台 NAS 位於儲存專用的網路,否則請設定 CHAP。新增 storage 時如果沒有設定,plugin 會提出警告。只有帳號沒有密碼的設定會被拒絕,因為空的 CHAP 密碼看起來已經啟用,實際上沒有任何保護。

3. A linked clone copies on QTS and does not on QuTS hero三、連結複製在 QTS 上會真的複製資料,在 QuTS hero 上不會

Every clone is made from a snapshot. The plugin detects which firmware it is talking to and uses the right form. 所有複製都是從快照建立的。plugin 會偵測連接的是哪一種韌體,並使用對應的方式。

QTS (LVM) QuTS hero (ZFS)
Snapshot / rollback快照 / 倒回✓✓
Linked clone (qm clone)連結複製(qm clone)works, but copies可用,但是真的複製instant即時
Deploying from templates at scale大量從範本部署slow慢fast快

If you are choosing hardware for a Proxmox VE cluster and expect to deploy from templates, this is the deciding factor. One consequence to know about on QuTS hero: an instant clone keeps the snapshot it was made from as its backing store, so the plugin leaves a snapshot on a template, and deleting a template while linked clones still exist fails with a message that quotes what the NAS answered. 如果正在選購硬體,而且預期會大量從範本部署,這一點是決定性的差異。在 QuTS hero 上還有一件事需要知道:即時複製會以來源快照作為自己的基礎,所以 plugin 會在範本上保留一個快照。還有連結複製存在時,刪除範本會失敗,訊息裡會引用 NAS 的回應。

Which QNAP operating systems are supported支援的 QNAP 作業系統

Deliberately specific about the difference between supported, expected to work and not supported, because two of those are promises and one is not. 這裡把「支援」、「應可運作」與「不支援」分開說明,因為前後兩個是確定的答案,中間那個不是。

The hard requirement: Storage Manager V2硬性需求:Storage Manager V2

QNAP has two generations of Storage Manager and they are different sets of CGI calls, not two versions of one API. This plugin implements V2 only, and the firmware says which it has, so a firmware that is too old is refused at pvesm add, with its version in the message, instead of adding cleanly and then listing nothing. QNAP 有兩代 Storage Manager,兩者是兩套不同的 CGI 呼叫,不是同一套 API 的兩個版本。這個 plugin 只實作 V2。韌體會回報自己是哪一種,所以太舊的韌體會在 pvesm add 時被拒絕,訊息裡會寫出版本,不會先新增成功,之後才列不出任何東西。

<storage_v2> <is_zfs> What it is代表什麼 This plugin這個 plugin
absent, or 0不存在,或 0any任何值Legacy Storage Manager舊版 Storage Managerrefused拒絕
10Storage Manager V2 on LVM (QTS)LVM 上的 Storage Manager V2(QTS)supported支援
11ZFS (QuTS hero)ZFS(QuTS hero)supported, instant clones支援,且有即時複製

The matrix支援對照表

Operating system作業系統 Version版本 Status狀態 Notes說明
QTS5.1.x supported支援 The firmware generation this plugin is written for這個 plugin 撰寫時所針對的韌體版本
QTS5.2.x expected應可運作 Same API family; not verified同一套 API;未驗證
QTS4.5.1 to 5.0.x4.5.1 至 5.0.x expected應可運作 The first release with storage_v2; not verifiedstorage_v2 的起始版本;未驗證
QTS4.5.0 and older4.5.0 以下 not supported不支援 Legacy Storage Manager. Refused at pvesm add.舊版 Storage Manager。pvesm add 會直接拒絕。
QuTS heroh5.1.x supported支援 ZFS. Instant clones, so a linked clone is instant.ZFS。有即時複製,所以連結複製是瞬間完成的。
QuTS heroh5.2.x expected應可運作 Not verified未驗證
QuTS heroh4.5.x to h5.0.xh4.5.x 至 h5.0.x expected應可運作 Not verified未驗證
QuTScloudany任何版本 not supported不支援 A cloud image with no local storage pools of this shape雲端映像,沒有這種形式的本機儲存集區
QNE Network OSany任何版本 not supported不支援 A different product; it has no Storage Manager不同的產品線;沒有 Storage Manager

"Expected to work" means nothing in what this plugin uses is known to differ. It does not mean anyone has run it. Treat it as you would any untested combination. 「應可運作」的意思是:這個 plugin 用到的部分沒有已知的差異。這不代表有人實際執行過,請當成任何未經測試的組合來看待。

Model requirements, which are not the same as firmware機型需求,這和韌體版本是兩回事

The real ceiling is the LUN count真正的上限是 LUN 數量

One VM disk is one LUN, and a NAS has a maximum number of them. QNAP publishes 128 for QTS and 256 for QuTS hero on its product pages, and 255 for LUNs and targets combined in its user guides. The figure is the same on a two-bay model as on a twelve-bay one. A VM with a system disk and a data disk spends two, so plan on roughly 64 such VMs per NAS on QTS. The plugin reads the ceiling from the NAS rather than assuming, warns as it approaches, and refuses an allocation at the limit with a message that says free space will not help. 一顆虛擬機磁碟就是一個 LUN,而每台 NAS 能有的 LUN 數量有上限。QNAP 在產品頁公布的是 QTS 128、QuTS hero 256,在使用手冊公布的是 LUN 與 target 合計 255。兩顆硬碟的機型和十二顆硬碟的機型,數字都一樣。一台有系統磁碟與資料磁碟的虛擬機會用掉兩個,所以在 QTS 上,一台 NAS 大約可以規劃 64 台這樣的虛擬機。plugin 會向 NAS 讀取上限,不自行假設。接近上限時提出警告,到達上限時拒絕配置,並且說明增加空間沒有幫助。

storage 'qnap1': the NAS already holds 256 LUNs, which is this model's
maximum (256). Free space is not the problem and adding capacity will not
help. Delete LUNs, or use a second NAS. The count includes LUNs this
storage does not own, such as Virtual Machine Manager disks.
This is the number to check before you plan a cluster, and Proxmox VE has no way to express it. pvesm status goes on showing terabytes free on a NAS that cannot create another disk. pve-qnap-api-probe prints it. 規劃叢集之前請先確認這個數字,因為 Proxmox VE 沒有辦法顯示它。一台已經無法再建立磁碟的 NAS,pvesm status 仍然會顯示還有好幾 TB 的空間。pve-qnap-api-probe 會印出這個數字。
Every published limit, with sources 每一個公布的上限與來源

Requirements系統需求

Proxmox VE9.x, on every node. 8.x is expected to work and has never been tested9.x,叢集中的每個節點都要安裝。8.x 預期可以運作,但從未測試過
QNAP firmwareQNAP 韌體QTS 4.5.1+ or any QuTS hero, see aboveQTS 4.5.1 以上,或任何 QuTS hero,見上表
On the NASNAS 上the iSCSI target service on, and a storage pooliSCSI target 服務必須啟用,並且要有儲存集區
Account帳號an administrator, without 2-step verification管理員,且未啟用兩步驟驗證
On each node每個節點open-iscsi, multipath-tools

The NAS account, and where the password livesNAS 帳號,以及密碼放在哪裡

It has to be an administrator必須是管理員帳號

The CGIs this plugin calls are administrator-only in QTS. A standard user, or one with delegated permissions on a shared folder, gets a session that logs in perfectly well and then has every one of those calls refused. Use a second administrator account created for this purpose rather than admin: it can be disabled without locking anyone out, and the NAS's own logs then show which actions were Proxmox VE's. 這個 plugin 呼叫的 CGI 在 QTS 裡只有管理員可以使用。一般使用者,或只有共用資料夾授權的使用者,可以正常登入,但每一個呼叫都會被拒絕。請另外建立一個專用的管理員帳號,不要使用 admin:需要時可以停用它而不影響其他人,而且從 NAS 自己的記錄就能分辨哪些動作是 Proxmox VE 執行的。

Two-factor authentication must be off for this account. This plugin logs in with a username and a password only; it does not implement 2-step verification. That is a reason to give this account its own long password and leave 2FA on for the human accounts. 這個帳號必須停用兩步驟驗證。這個 plugin 只用帳號與密碼登入,沒有實作兩步驟驗證。所以這個帳號應該有一組專屬的長密碼,而由人員使用的帳號請繼續啟用兩步驟驗證。

Not in storage.cfg密碼不會寫進 storage.cfg

/etc/pve/storage.cfg is root:www-data 0640, and PVE returns any property it does not know is a secret from GET /storage/<id> to any user holding Datastore.Audit. A read-only auditor would have been handed an administrator credential for your NAS. The plugin declares its three secrets as sensitive, so PVE strips them from the configuration, and they are written to /etc/pve/priv/storage/<storeid>.qnap: root only, and replicated to every node. /etc/pve/storage.cfg 的權限是 root:www-data 0640,而且 PVE 不知道是機密的欄位,會透過 GET /storage/<id> 回傳給任何具有 Datastore.Audit 權限的使用者。只有唯讀稽核權限的人,就會拿到 NAS 的管理員憑證。這個 plugin 把三個欄位宣告為機密,PVE 就會把它們從設定檔移除,改寫入 /etc/pve/priv/storage/<storeid>.qnap:只有 root 能讀取,並且會同步到每個節點。

A wrong password locks the node out, once密碼錯誤只會鎖一次

QTS blocks a source address after a few failed logins. Proxmox VE polls every storage every ten seconds on every node, so a wrong password would reach that threshold in well under a minute. The symptom afterwards is a refused connection, which looks like a dead NAS rather than a bad credential. The plugin therefore latches a refused credential: one failed attempt, recorded under /run/, and no retry until the storage configuration changes. Any pvesm set clears it. QTS 會在數次登入失敗之後封鎖來源位址。Proxmox VE 的每個節點每十秒都會輪詢每個 storage,所以密碼錯誤時,不到一分鐘就會達到門檻。之後的症狀是連線被拒絕,看起來像 NAS 故障,而不像密碼錯誤。所以 plugin 會記住被拒絕的憑證:只嘗試一次,記錄在 /run/ 底下,在 storage 的設定改變之前不再重試。執行任何一次 pvesm set 就會解除。

Installing安裝

On every node of the cluster: 在叢集的每一個節點上執行:

# on each node: the two packages PVE does not install for you
apt update
apt install -y open-iscsi multipath-tools

cd /tmp
# no version in the filename: this URL always gives you the newest release
wget -O jt-pve-storage-qnap_all.deb \
  https://github.com/jasoncheng7115/jt-pve-storage-qnap/releases/latest/download/jt-pve-storage-qnap_all.deb
apt install -y ./jt-pve-storage-qnap_all.deb
systemctl restart pvedaemon pveproxy pvestatd

dpkg -l jt-pve-storage-qnap | awk '/^ii/{print $3}'    # check what you got

Keep the -O. Without it, wget does not overwrite a file that is already there and saves the download under another name. apt then installs the old file left in /tmp from last time. 請保留 -O。少了它,wget 不會覆寫已經存在的檔案,而是存成另一個檔名。接著 apt 安裝的就是上次留在 /tmp 的舊檔。

Every node in the cluster, including the one you browse from, and keep them on the same version. A storage operation runs on the node that owns the guest, and a node without the plugin makes the storage invisible in the web interface rather than reporting an error. 叢集中的每個節點都要安裝,包含用來開啟網頁介面的那一台,而且版本要一致。storage 的操作是在擁有該 guest 的節點上執行的。沒有安裝 plugin 的節點不會回報錯誤,而是讓這個 storage 從網頁介面上消失。

apt install ./file.deb, not dpkg -i: the latter does not resolve dependencies and leaves the package unconfigured on a node without multipath-tools. 請用 apt install ./檔案.deb,不要用 dpkg -i:後者不會處理相依套件,在沒有 multipath-tools 的節點上會留下一個未設定完成的套件。

Adding the storage新增 Storage

Every precondition is checked here (the firmware generation, the iSCSI service, the pool, the account), so a configuration that cannot work is refused now rather than at the first allocation. 所有前置條件都在這一步檢查(韌體版本、iSCSI 服務、儲存集區、帳號),所以無法運作的設定會在這時被拒絕,不會等到第一次配置磁碟才發現。

pvesm add qnapsan qnap1 \
    --qnap-portal 192.0.2.10 \
    --qnap-username pve \
    --qnap-password '<password>' \
    --qnap-pool 1 \
    --qnap-chap-username pve \
    --qnap-chap-password '<secret>' \
    --qnap-ssl-verify 0 \
    --content images

Then use it like any other storage: qm create --scsi0 qnap1:32, snapshots, rollback, templates, linked clones, live migration. 之後的用法和其他 storage 相同:qm create --scsi0 qnap1:32、快照、倒回、範本、連結複製、線上遷移。

The discovery tool探索工具

Run this before you add anything. It is read only (every call it makes is a query or the login itself), so it is safe against a production NAS, and it is the first thing to run when a storage will not add or a device will not appear. 請在新增任何東西之前先執行它。它是唯讀的(每個呼叫不是查詢就是登入),所以對正式環境的 NAS 是安全的。storage 無法新增,或裝置沒有出現時,也請先執行它。

pve-qnap-api-probe --host 192.0.2.10 --user admin --insecure --node

It prints the model, the firmware, whether it is QTS or QuTS hero, the LUN and target ceilings, the storage pools with their free space, and, with --node, what this node has installed and which sessions it holds. The password is read from the terminal rather than taken as an argument, so it stays out of the shell history and out of ps. 它會印出機型、韌體、是 QTS 還是 QuTS hero、LUN 與 target 的數量上限、各儲存集區與剩餘空間。加上 --node 還會印出這個節點安裝了哪些工具、有哪些工作階段。密碼是從終端機讀取,不是當成參數傳入,所以不會留在 shell 的歷史記錄裡,也不會出現在 ps 中。

The cleanup tool清理工具

Proxmox VE never tells the source node that a shared volume is no longer needed there. So a node a VM was migrated away from keeps a multipath map for a LUN it no longer uses, and if the VM was later destroyed elsewhere, for a LUN that no longer exists. 共用的磁碟在某個節點上不再需要時,Proxmox VE 不會通知該節點。所以虛擬機遷離之後,來源節點會留著一個已經用不到的 multipath map。如果那台虛擬機之後在別的節點被刪除,留下的就是一個指向已不存在 LUN 的 map。

pve-qnap-reap --all             # report only
pve-qnap-reap --all --remove    # act

It never touches a device that is in use, and it refuses rather than guessing when it cannot tell. 它不會動到正在使用中的裝置,無法確認狀態時會拒絕動作,不會猜測。

When something goes wrong故障處理

The storage will not addstorage 無法新增

A second node cannot log in to the target第二個節點無法登入 target

QTS's clustered-access flag is what admits more than one initiator, and targetInfo does not return it, so there is nothing for the plugin to compare against on the activation path. It is written when the target is created and re-applied on every pvesm set. If a node is refused, run: QTS 的叢集存取設定決定了能不能讓多個 initiator 同時連線,而 targetInfo 不會回傳它,所以 plugin 在啟用磁碟的過程中沒有東西可以比對。plugin 會在建立 target 時寫入,並在每次 pvesm set 時重新套用。如果有節點被拒絕,請執行:

pvesm set qnap1

A device does not appear on a node節點上出不來裝置

Options設定選項

Option選項 Default預設值
qnap-portalnone無management address; a comma-separated list is tried in order管理位址;可用逗號分隔多個,依序嘗試
qnap-port443QTS's HTTP admin port is usually 8080QTS 的 HTTP 管理埠通常是 8080
qnap-schemehttpshttp puts the password on the wire in clear用 http 會讓密碼以明文在網路上傳輸
qnap-usernamenone無must be an administrator必須是管理員
qnap-passwordnone無kept in /etc/pve/priv, never in storage.cfg存放於 /etc/pve/priv,不會寫進 storage.cfg
qnap-poolnone無the pool number Storage & Snapshots shows「儲存與快照總管」顯示的儲存集區編號
qnap-target-modesharedor per-volume, which costs a target per disk或 per-volume,每顆磁碟各佔用一個 target
qnap-chap-username / -passwordnone無the access control this plugin relies on這個 plugin 所依賴的存取控制
qnap-mutual-chap-username / -passwordnone無authenticates the NAS to the node讓 NAS 對節點驗證自己
qnap-ssl-verify0QTS ships a self-signed certificateQTS 出廠是自簽憑證
qnap-data-portalsmanagement address管理位址iSCSI data addresses, comma-separatediSCSI 資料位址,逗號分隔
qnap-min-free10refuse to allocate below this many GiB free in the pool儲存集區剩餘空間低於這個 GiB 數就拒絕配置
qnap-no-path-retry18multipath; a number, never queuemultipath 用;一定是數字,絕不用 queue
qnap-sector-size512or 4096; some guests will not boot from 4Kn或 4096。部分 guest 作業系統無法從 4Kn 開機
qnap-thin1a thick LUN reserves its whole capacity at creation厚配置的 LUN 建立時就佔滿整個容量
qnap-status-timeout5seconds, for the health path秒,健康檢查用

How to help this project如何協助這個專案

What this project needs is not code. It is a QNAP NAS that somebody is willing to run it against, because none of it has met one. 這個專案缺的不是程式,而是一台可以拿來測試的 QNAP NAS,因為它還沒有在任何一台上執行過。

Open an issue on GitHub到 GitHub 開一個 issue

Before you send code送程式碼之前

The set of QNAP API calls this plugin makes is fixed. t/07-api-scope.t lists every one and fails when the source makes a call that is not on the list. A change that needs a new call is welcome as an issue first; do not add it to the list to make the test pass. 這個 plugin 呼叫的 QNAP API 是固定的一組。t/07-api-scope.t 列出了每一個,原始碼只要多出一個不在清單上的呼叫,測試就會失敗。需要新增呼叫的修改,請先開 issue,不要為了讓測試通過而直接把它加進清單。

Licence, and what this project is not授權,以及這個專案不是什麼

MIT. The licence covers this plugin's own code. It does not extend to QNAP's API documentation, software, firmware or trademarks, none of which are part of the repository. MIT。授權範圍是這個 plugin 自己的程式碼,不包含 QNAP 的 API 文件、軟體、韌體或商標。這些都不在 repository 裡。

This is an independent project. It is not developed, certified, endorsed or maintained by QNAP Systems, Inc., and QNAP gives no warranty for it. QNAP, QTS and QuTS hero are trademarks of QNAP Systems, Inc. 這是獨立專案,不是由威聯通科技(QNAP Systems, Inc.)開發、認證、背書或維護,QNAP 也不為它提供任何保證。QNAP、QTS 與 QuTS hero 為 QNAP Systems, Inc. 的商標。