Proxmox VE 4.x 中文初階學習手冊

1. 導讀 Proxmox VE

1. 安裝 Proxmox VE

2. 開始建立虛擬機

4. VirtualBox、VMWare 移轉至 proxmox

5. 增加硬碟

7. 虛擬機的移機 備援 重建 還原

8. DATACenter -叢集管理功能-管理全部主機

9. ZFS

 

Proxmox VE 4.x 中文初階學習手冊

1-1 前言 --- 企業級產品 買不起 還好有社群資源 支援 企業級的技術

企業級產品
 買不起
還好有社群資源
支援
企業級的技術

  1. 把塵封了8年的 RS162-E2 1U 主機 拆箱,安裝了 proxmox 系統。
    但這一台的效率仍然停留在 8年前,非常的 Lohas, 決定把它再裝回箱子,原箱封存。

     
  2. 後來改採 電腦教室服役滿四年所汰換下來的學生機(宏碁Acer Veriton M265),
    做為 proxmox 虛擬主機。

     
  3. 緣由:
    1. 原來參加了 VMware 的研習,回來後本來要安裝,但卻因 VMware 抓不到網卡(沒有多餘的經費買貴蔘蔘的網卡),所以才想辦法找免費又平民、效率又好的虛擬機作業系統。
    2. 同學在新北市擔任縣網管,看起來這套系統不錯用。就按照同學親自示範的影片安裝了 proxmox.
    3. 重要的是,proxmox 是以 Debian 作為基本的 OS,再加上 Proxmox VE 的 pve 套件所製作完成的 iso。也就是說,除了 proxmox 基本的 https://ip:8006 操作以外,還可以利用原Debian (Linux) 以 ssh 登入操作,可以說與原本的 Linux 操作轉換容易。

Proxmox VE 4.x 中文初階學習手冊

1-2 建議閱讀參考資料

Proxmox 教學  (FB  Proxmox VE 伺服器虛擬化管理)

Proxmox 安裝使用  (新北E學園)

安裝Proxmox VE 3.2 / Install Proxmox VE 3.2  (布丁布丁吃什麼?)

企業虛擬化平台的另類選擇 - Proxmox Virtual Environment 實戰 (自由軟體鑄造場)

Proxmox VE 4.x 中文初階學習手冊

1-3 各家虛擬軟體比較

本篇 Proxmox VE 是適合 一般使用者參考學習,若您是公司行號使用像 10GBe以上,或是像 Mellanox NIC/Infiniband Card,sr-iov 的 VF卡的朋友們,也就是超過 10GBe 以上的需求以及預算的話, 可以略過這個教學。

另外,Ceph , HA  的部份這裡也沒有。因為,這裡能使用得到的設備都是陽春型的。

Proxmox VE 4.x 中文初階學習手冊

1-3-1 Proxmox VE 和 VMWare 比較

http://www.slideshare.net/ChrisHsiang/pve-41-vs-vsphere-60

Proxmox VE 4.x 中文初階學習手冊

1-3-2 圖表

圖片來源:https://www.facebook.com/photo.php?fbid=10207963025304028&set=p.10207963025304028&type=3&theater

Proxmox VE 4.x 中文初階學習手冊

1-4 新版

PVE 只能算是管理 KVM/LXC 的工具以及圖形界面

如何善用

才是

有效率

開始

Proxmox VE 4.x 中文初階學習手冊

1-4-1 4.2 版新增功能

  1. PVE 這次在 lxc 真的下了很大的功夫, 以及它已經使用 ubuntu 16.04 的 kernel 為主, 是一個非常好的消息.
  2. PVE 4.2 installer 是支援 UEFI Shell 的安裝模式
  3. 很多主板如果要使用 NVMe SSD 開機, 那麼它的 boot 模式必須要使用 UEFI only, 必須要 disable legacy boot
  4. PVE 4.2 安裝 CD 多了 boot rescue 模式, 但是實際有沒有效就不知道了

This video highlights the new features in Proxmox VE 4.2:
- Debian Jessie 8.4 and long-term 4.4 Linux kernel
- Linux Containers (LXC)

Proxmox VE 4.x 中文初階學習手冊

1-5 攜碼跳槽前的準備(從 VirtualBox,VMWare,ESXi 轉換前的準備)

  1. 虛擬機的原始設定
    如果您打算把原來在 VMware 或是 VirtualBox 虛擬機 移至 proxmox 虛擬主機上 使用的話,
    請先記下每一個虛擬硬碟( .vmdk -> VMware ,   .vdi --> VirtualBox )
    最初設定的大小設定值


     
  2. 要記錄的地方有兩項,如上圖,
    1. 虛擬硬碟的介面(SATA/IDE),和 虛擬硬碟的容量(15G),
      這在 Proxmox VE 要手動建立,
      而 VirtualBox 會自動檢測虛擬硬碟的容量,但同樣的,介面選錯(如 原來建立的 IDE 虛擬硬碟,接在 SATA 介面,會無法開啟虛擬機或無法讀取).
      也就是說,SATA 的虛擬硬碟移至 proxmox 時也要選擇 SATA,IDE 的虛擬硬碟移至 proxmox 時也要選擇 IDE.
    2. 如果不是使用轉換的方式,那麼,建議使用 Virtio 介面,將會有較佳的執行效率。
       
  3. proxmox 的虛擬硬碟數量限制:
    IDE :4部(0-3)
    SATA:6部(0-5)    ---> VirtualBox 支援30個硬碟裝置 (0-29)
    VIRTRO:16部(0-15)   ---> 執行效率較佳。
    SCSI:4部(0-3)  ---> 沒試過。

Proxmox VE 4.x 中文初階學習手冊

2. 安裝 Proxmox VE

安裝前的準備:

  如果是要從 VirtualBox、VMWare ESXi、VMWare player 將虛擬機轉換至 Proxmox VE ,
請直接跳至 第4章 VirtualBox、VMWare 移轉至 proxmox

  本章主要是介紹 Proxmox VE 伺服主機的安裝、流灠器登入操作、管理、及 Proxmox VE 主機系統更新、安全設定。

Proxmox VE 4.x 中文初階學習手冊

2-1 開始安裝 Proxmox VE

準備一台主機,主機上要安裝的硬碟裡若有任何資料,請先備份,

一旦開始安裝 Proxmox VE 後,Proxmox VE 會使用整顆硬碟,並予以格式化。

Proxmox VE 4.x 中文初階學習手冊

2-1-1 proxmox 實體機的建議

  1. 實體機的 記憶機 建議 4GB
    (其實 2G 也可以跑的,尤其是跑 LXC 更省記憶體,2G 跑 4-6個LXC 絕對沒問題。當然如果有 8G 甚且 16G 以上更好,現在用的主機最多只支援到 4G),程式執行的速度應該會比較好。
  2. 虛擬硬碟的格式 建議使用 qcow2 (這是 Proxmox VE 原生的格式)
    所以在接下來的示範如何把 虛擬硬碟的檔案格式 轉成 .qcow2
  3. 在電腦上以VirtualBox架設Proxmox VE來測試的話,
    在這種情況下,一般來說是不能啟動KVM的。
    這時候得要在「Options」中關閉「KVM hardware virtualization」選項,然後就能順利開啟。
    當然,這種情況下只能測試用,不能運作實際的作業系統。因為,會很慢,但我實際在 Ubuntu 的改寫版本 ACFS 下以 Virtualbox 5.02 安裝 proxmox 4.0b1 可以安裝,但執行時卻無法執行,proxmox 告知找不到實體的CPU所以拒絕執行。若把「KVM hardware virtualization」選項應該就可以執行,但相對的卻是以全模擬的方式來跑,效率可想而知,這時已是笑能了。
    什麼叫做全模擬的方式?原來虛擬機系統可以利用 CPU 提供的 Intel VT (Virtualization Technology)或AMD V(CPU是否支援虛擬化指令集) 、VT-d(目的是為了讓虛擬機可以對IO裝置直接進行存取(passthrough),例如PCI裝置、USB裝置等等)技術等,讓虛擬系統將虛擬機所執行的指令直接交給 CPU 來執行,而不需要經過虛擬系統的「轉換程式」,這樣的好處是執行效率接近實體機的速度, CPU Loading 的損失非常少(LXC)或較少(KVM), 而硬體不支援這些虛擬化技術或是以虛擬系統中以巢狀安裝虛擬系統的話,就有兩層虛擬系統,這時就無法將虛擬機的執行指令直接交給 CPU 等硬體直接執行,因為多了一層虛擬系統,這時就必需將硬體功能關能,採用「全模擬」的方式來執行虛擬機,因為是透過程式執行的方式來轉換執行,所以,效率相對地非常慢。

Proxmox VE 4.x 中文初階學習手冊

2-2 開始在 實體機上 安裝 Proxmox VE

同學寫的實體機安裝 proxmox 過程

安裝proxmox ve
http://viewcamerafan.blogspot.tw/2011/11/blog-post.html

當初接觸  proxmox ve 時,就是從這裡開始的。

 

也可以參考這一篇
企業虛擬化平台的另類選擇 - Proxmox Virtual Environment 實戰

http://www.openfoundry.org/tw/enterprise-application/9341-proxmox-virtual-environment

裡面也有很詳盡的解說

Proxmox VE 4.x 中文初階學習手冊

2-2-1 下載 proxmox 5.0 版的 .iso 檔

這一篇是我的同學寫的, 直接看完,是不是很簡單呢?

  <---同學寫的實體機安裝 proxmox 過程



下載 proxmox 5.0 版的 .iso 檔

請到 Proxmox 下載 Proxmox VE 5.0 版 的下載頁面 下載  Proxmox VE 5.0  iso  
下載檔案 
proxmox-ve_5.0-af4267bf-4.iso 
或是就近由 TANet 下載 proxmox 的 iso檔 以下示範圖片為 pve5.0

Proxmox VE 4.x 中文初階學習手冊

2-2-2 開始安裝 Proxmox VE

安裝

  1. 安裝的部份非常簡單,放入光碟一步一步照著畫面(有中文)操作就可以安裝完成。
  2. 安裝完之後,變可以透過 https://[IP]:8006 進入主機的 web 管理介面。

    現在就開始在實體機 上 安裝 Proxmox VE 了。

Proxmox VE 4.x 中文初階學習手冊

2-2-2-1 BIOS 設定

安裝 Proxmox VE
進入安裝GUI 整個畫面 解析度 都不對 安裝不下去
可能解法

要把 bios 設定成 legacy bios不能用 uefi  (4.2版已開始支援 UEFI

https://forum.proxmox.com/threads/proxmox-3-4-install-resolution-issue.22346/

https://www.facebook.com/groups/135606248244/permalink/10154063517343245/

-----------------------------------------------------------------------------------------------------------------------------------------

所以,先確認電腦主機的 BIOS 設定是否為傳統的 Legacy ,而不是 新的 UEFI

4.2版已開始支援 UEFI

Proxmox VE 4.x 中文初階學習手冊

2-2-2-2 安裝方式1:以光碟開機安裝

 

  1. 把 Proxmox VE 5.1 的 iso 檔     proxmox-ve_5.1-722cc488-1.iso
    燒錄成光碟,放入光碟機中,並以光碟開機。

 

Proxmox VE 4.x 中文初階學習手冊

2-2-2-3 安裝方式2:以隨身碟方式安裝

  1. 如果在 Linux 底下,直接以
    dd   if=proxmox-ve_5.1-722cc488-1.iso   of=/dev/sdx     (x是隨身碟的代號)
    查詢隨身碟的代號︰
    ls -alF /dev/sd*

    這個指令,會直接將  pve 的 iso 檔寫到隨身碟裡,接下來,再把要安裝 proxmox VE 的主機,以隨身碟開機執行安裝。
    注意︰這個指令會把 隨身碟 裡全部的資料完全覆蓋清除,
       執行前請先確認隨身碟中沒有重要資料,或先將資料備份至其他地方。
  2. 在 Windows 系統下,可以使用 easy2boot 在隨身碟上安裝 grub4dos 多重iso開機,
    再把 proxmox VE 的 ISO 放置於隨身碟 _ISO/LINUX 目錄裡,
    再以隨身碟於 要安裝 proxmox VE 的主機上 開機,
    開機後會出現選單,選擇 Linux 目錄,再選擇 proxmox VE 的 ISO 檔,
    接下來會以 proxmox VE ISO 開機,安裝 proxmox VE.
    ---> 強力推薦使用,只要把 ISO 檔放在相對應的目錄下,就可以直接使用,不需再重新使用USB 製作軟體製作 USO ISO開機碟。
    第1次製作時需 Windows OS 來製作,完成後可再 Linux 下掛載讀寫 NTFS / FAT 檔案格式。
    1. 可能問題1:
      以 USB 開機或是以 easy2boot 載入 Proxmox VE 後,直接跳到文字畫面 # ,並提示按 Ctrl + D 重新開機:
      像是在 bootstrap 階段 usb 的驅動程式尚未載入,所以看不到 root volume,
      可以在 boot 的參數後面加上 rootdelay=15 試試看; 這個 delay 或許可以讓 usb driver 有機會載入
      (圖片來源為  https://www.facebook.com/groups/pve.tw/?ref=bookmarks
      https://www.facebook.com/photo.php?fbid=10154194842164464&set=gm.594569454044953&type=3)

       
    2. 可能問題2:
      https://www.facebook.com/groups/pve.tw/permalink/586700871498478/?hc_location=ufi
      要清空 USB 裡面所有的資料, 建議使用 gparted live cd 啟動, 在 shell 執行 wipefs -a /dev/sdX
      再重新 安裝 Proxmox VE 到 USB 隨身碟。
      wipefs -a 連 partition table 的模式以及 super block 全部清空空

Proxmox VE 4.x 中文初階學習手冊

2-2-2-4 安裝方式3:直接將系統安裝在 USB 隨身碟上以隨身碟當開機碟

注意:這是把 Proxmox VE 以光碟開機,並將 Proxmox VE 系統安裝在 隨身碟上(建議使用主機上的 usb3.0 並搭配 usb3.0的隨身碟較佳,使用usb2.0在開機的過程會比較久),且已經完成,以後開機就以 隨身碟開機

把/boot/grub/grub.cfg的內容加上 rootdelay=20,再重開測試就可以正常開機
(以usb 開機時系統載入的速度較快,而因為尚未載入usb driver ,導致找不到 usb隨身碟上的 rpool 分割區而無法正常開機,加入這個指令是先延遲20秒的時間讓系統先載入 usb driver 後再載入 開機系統)

可以參考     製作以 USB 隨身碟開機的步驟   裡的說明來操作

其它的方式:

http://l.facebook.com/l.php?u=http%3A%2F%2Fc-nergy.be%2Fblog%2F%3Fp%3D1159&h=_AQGAQviS

https://www.facebook.com/groups/pve.tw/permalink/586700871498478/?hc_location=ufi

Proxmox VE 4.x 中文初階學習手冊

2-2-2-5 版權宣告

 

Proxmox VE 4.x 中文初階學習手冊

2-2-2-6 安裝提示訊息-硬碟格式化

  1. Proxmox VE 對硬碟的支援有
    ext3,ext4(這是預設的格式),xfs,zfs(RAID0,RAID1,RAID10,RAIDZ-1,RAIDZ-2,RAIDZ-3)​
    圖中示範的只有單一顆 20G 的硬碟

    注意的是在安裝的過程之中,
    將會自動清除目標磁碟中的所有資料與分割區。

     
  2. 硬碟格式選項:
    1. Proxmox VE 預設硬碟格式: ext4
      這是Proxmox VE預設( proxmox 會採用 lvm 為底,再以 ext4 格式化)選項,若要採用 ext4 檔案格式則直接按 Next 進到下一步。
      如果想手動變更安裝開機碟分割區容量大小,則請參閱 1-3章節的說明

       
    2. 強烈建議使用非預設格式的 zfs(RAID0)或 zfs(RAID1)
      有強大的snapshot時間點快照功能
      系統即將安裝的目標硬碟(例如:/dev/sda)。必須





      1. ZFS(RAID0)硬碟格式(強列建議)
        優點:可以幾乎完全利用到整顆硬碟的容量,也能使用 snapshot 時間點快照功能,連開機磁區也能做快照,在萬一系統崩潰時(硬碟正常情況下)能立即roolback回復到可開機狀態。
      2. ZFS ,它的安裝介面已做的很友善了,直接就用滑鼠點一點,就可讓你選擇要建raid1 or raid0 還可讓你挑有哪幾個硬碟要不要加入....進階選項頁面裡,預設ashift=12 已幫你設定好,讓你決定是否要compress(壓縮)和 checksum。系統裝完之後,更不用擔心,它會不會象LVM一樣 root 分區給的空間極小,還得要用LVM指令去調整 root 分區劃大一點給它。這問題都不用擔心,因為它是共用的,不用象LVM一樣,還得用指令去調整root分區,真是比LVM方便許多。選zfs就對了。話說,使用 zfs 當系統碟,還能有快照回復的功能。(本段引用處)
      3. 開機硬碟選擇 zfs(RAID0)-單顆硬碟開機/zfs(RAID1)-兩顆硬碟做mirror鏡像開機

----------------------------------------------------------------------------------------------------------------------------------------

Proxmox VE 4.x 中文初階學習手冊

2-2-2-7 時區與鍵盤設定

Proxmox VE 4.x 中文初階學習手冊

2-2-2-8 管理員密碼與 Email 設定

  1. 輸入系統預設的管理員帳戶密碼以及 Email 地址
    (帳號預設為 root , 這裡輸入的密碼為 root  的 密碼)
    如此一來後續在完成安裝之後,才能夠以預設的管理員密碼來登入
    並且對於平日的運行維護,一旦有重要的系統事件發生時,就能夠主動以 Email 來通知管理員。點選 [Next] 繼續。

Proxmox VE 4.x 中文初階學習手冊

2-2-2-9 網路設定

  1. 分別設定此主機的完整網域名稱 (FQDN)、IP 位址、子網路遮罩 (Netmask)、閘道位址 (Gateway)、DNS 伺服器位址。
    其中 DNS 伺服器位址,一般都是輸入內部的 DNS 伺服器位址,以利於後續與其它系統的連線整合時,才能夠彼此透過 FQDN 的位址連線方式來進行通訊。提升網路連線的安全與簡化網路的管理。
    點選 [Next] 繼續。
    (Proxmox VE 的伺服主機裡的服務,有很多部份都會使用次 hostname,所以,完整的主機名稱務必要設定正確)

     

 

 

 

Proxmox VE 4.x 中文初階學習手冊

2-2-2-10 複製系統與程式檔案

  1. 接下來將會進入開始複製系統與程式檔案的進度頁面,過程之中可以看到頁面中,
    還會出現對於 Proxmox VE 這套系統的關鍵功能介紹。
    其中最重要的就是它同時提供了兩種虛擬化技術,分別是 ContainerKVM
    Container (容器 proxmox 稱為 LXC)下所運行的 Linux 系統之效能表現,
    相較於實體伺服器僅只減少大約 1% 至 3% 左右,但執行效能比 KVM 要高很多。




    若在第1張圖片時出現無法分割硬碟的錯誤,請以 gparted live 開機,或以其它 Linux 掛載後,找到這一顆硬碟的代號,
    再將這一顆硬碟整個完全清空即可。
    # wipefs -a /dev/sdX
    X
    為這一顆硬碟的代號

     
  2. 如圖所示則是已成功完成安裝的顯示頁面,點選 [Reboot] 來立即重新啟動。


     
  3. Reboot 前,請將光碟機中的光碟取出(或將 USB 拔出),避免重開機時又由光碟/USB開機。

Proxmox VE 4.x 中文初階學習手冊

2-2-2-11 安裝完成第1次開機

  1. 重新啟動系統之後將可以看到 Proxmox VE 的啟動選單,
    如圖 所示在上方位置可以看到目前使用的 GNU GRUB 版本。
    在選項部分正常狀況下只要選擇第一個啟動項目即可。
    至於其它選項則是主要用於復原模式的啟動以及記憶體的測試時使用。
    若是按下 c 按鍵將可以進入命令模式的操作。




     
  2. 開機中



     
  3. 開機完成,進入文字介面。

Proxmox VE 4.x 中文初階學習手冊

2-2-3 管理

Proxmox VE 的管理分為兩大類

  1. 文字介面的管理:以 CLI (命令列) 的操作為主
  2. 以 Web 介面的 Web 主控台 方式
    1. 支援電腦網頁管理
    2. 支援手機直接使用 Android/iOS 的 browser 連線到 https://yourpve.com:8006/?mobile=1#
      這樣子可以直接操作控制所有的 vm/lxc
      詳見:https://pve.proxmox.com/wiki/Proxmox_VE_API
      (很多 app 裡面只是 HTML5 在跑!只不過 proxmox 支援 rest/json)

Proxmox VE 4.x 中文初階學習手冊

2-2-3-1 文字介面的管理-1.本機登入

  1. 直接在 Proxmox VE  4.0b1 實體主機 上登入(通常很少會到主機面前登入)

Proxmox VE 4.x 中文初階學習手冊

2-2-3-2 文字介面的管理-2.遠端登入

安裝伺服器,就是希望能在每一台電腦都能方便的遠端登入,遠端操控。

Proxmox VE 4.x 中文初階學習手冊

2-2-3-3 Web 主控台方式登入-Firefox

  1. 預設 Proxmox VE 的網站連接埠為 8006,成功連線時將會出現登入驗證視窗
    https://192.168.1.10:8006

     
  2. 因 Proxmox VE 採加密連線,所以 Firefox 出現提示。



     
  3. 新增例外網站



     
  4. 將 proxmox VE 的 ip 192.168.1.10 加入信任網站



     
  5. 在此可以選擇驗證的方式 (Realm) 有 Linux PAM stanard authentication 與 Proxmox VE authentication Server,預設狀態下皆是採用前者,如果想要更安全的集中控管方式,未來則可以考慮架設一台 Proxmox VE 專屬的帳戶驗證伺服器。
    介面語言部份由於目前
    提供 [簡體中文] ,因此建議您選擇預設的 [English] 即可。
    完成預設管理員帳戶以及密碼的輸入之後,點選 [Login]。




     
  6. 原廠支援訂閱提示     (教育單位使用就不用訂閱)
    登入時可能會出現如下圖所示的,可以點選其中的 www.proxmox.com 超連結,來查看一下官方對於額外技術支援所提供的服務項目。
    PROXMOX 官方訂閱方案的介紹網站時,可以發現企業除了可以享用免費的 Proxmox VE 虛擬化平台之外,還可以根據實際部署規模的需要,來選擇四種不同等級的服務訂閱,分別是社群 (COMMUNITY)、基本 (BASIC)、標準 (STANDARD) 以及白金級 (PREMIUM)。其中社群的服務等級僅提供官方網站討論區中的支援服務,以及提供企業程式庫與相關軟體更新的權限,儘管如此相信已經可以滿足台灣許多中小企業的需要。至於白金級的服務則是提供了不限點數的技術支援,並且加贈客戶專屬的入口網站存取服務。(企業付費訂閱--->PROXMOX 官方提供支援服務)




     
  7. 登入完成,進入 Web 主控台

Proxmox VE 4.x 中文初階學習手冊

2-2-3-4 Web 主控台方式登入-Chrome

 

  1. 因為 Proxmox VE 連線採加密方式,所以,Chrome 出現私人連線提示:



     


  2.  
  3. 輸入預設帳號 root 及 密碼 登入 Proxmox VE


     
  4. 原廠支援訂閱提示 (適用 企業 需要技術支援)



     
  5. 登入完成,進入 WEB 介面主控台

Proxmox VE 4.x 中文初階學習手冊

2-2-4 第1次更新套件(debian update)

剛安裝完成 Proxmox VE 4.0b1 後,務必要立即做系統的安全性更新。

  1. 變更 ipv4和ipv6 的優先順序為 ipv4 優先
    某些更新站台或政府網站會同時回應 ipv4和ipv6,但ipv6卻無法正常回應,
    這時在預設以 ipv6 為優先的情況下會造成連不上或系統無回應.
    而遇到ipv6無回應的情況下會等待約21秒的時間才會切換回 ipv4,而造成等待的困擾.

    先修改 /etc/gai.conf
    pico /etc/gai.conf

    找到
    #precedence ::ffff:0:0/96  100
    這一行,將前面的 # 刪除並存檔(立即生效)
    precedence ::ffff:0:0/96  100


     
  2. 更新 套件資料庫
    # apt-get  update
  3. 下載並安裝、更新套件
    # apt-get dist-upgrade -y --force-yes



     
  4. 更新完成 (第1次需要更新的套件較多,需要一段時間才能完成)

Proxmox VE 4.x 中文初階學習手冊

2-2-4-1 無購買企業支援授權

pico /etc/apt/sources.list.d/pve-enterprise.list

為了防止訪問Proxmox的錯誤消息VE企業資源庫(如果您有沒有認購鍵),可以禁用此回購註釋掉下面一行:

#deb https://enterprise.proxmox.com/debian wheezy pve-enterprise

這樣,在執行 apt-get update 時,就不會出現沒有認購授權的錯誤訊息。


ps:這只是 Proxmox VE 原廠希望企業用戶能購買「維護合約」,提供原廠的有價維護。

Proxmox VE 4.x 中文初階學習手冊

2-2-4-2 Proxmox 的 enterprise support

企業、公司如果需要實際的支援度的話,可以購買 enterprise support,可以獲得立即解決問題的支援,避免因不明的操作等因素而造成損失,提昇企業、公司的競爭力。

轉貼:https://www.facebook.com/groups/575444189290813/permalink/586016381566927/
作者:向聖夫

Proxmox 的 enterprise support 是真的很棒. 如果有企業擔心使用 proxmox 但是支援度不夠的話, 真的可以購買他們提供的服務, 同時這個也是 proxmox 唯一的收入來源, 好的開源軟體還是需要大家實際行動的支持
.
https://shop.maurer-it.com/cart.php?gid=5 雖然目前我還沒有購買任何的 subscription, 但是近期內我一定會購買. 下面是 proxmox support 的回覆以及為使用者(我)解決問題. 他們回覆的速度真的在 24小時之內.

 

 

Jason Cheng 我們有協助客戶做 Proxmox Mail Gateway,服務回覆訊息的速度很快!
 
向聖夫 我 覺得有很多 IT Manager/CTO 如果能得到原廠/原開發者的支援服務, 晚上一定睡得更好. 我大概是其中一個. 這次我是幫 proxmox 發現了一個 nvme & grub 的 bug, 他們免費幫我做的 support (有遠端 ipmi 進到我的服務器來看情況解決問題) 他們兩位工程師大概花了 2個小時的時間. 對於這種支援, 我真的是除了感激以外, 還是感激 (然後馬上拿錢包買服務了)
<---- 我也是會撞牆需要原廠開發者來協助的人 (功力還是不夠)

Proxmox VE 4.x 中文初階學習手冊

2-2-4-3 套件功能的更新(Proxmox update)

適用 Proxmox VE 4.x 版
# pico /etc/apt/sources.list

加入以行的套件庫,這樣,隨時可以將 Proxmox VE 更新至最新、修正過的套件版本
# 由proxmox.com提供#PVE PVE-無認購庫,不推薦用於正式運作  ---> 這個一定要加入
# --->  這個要加入,在 update 時會更新新的套件
deb http://download.proxmox.com/debian jessie pve-no-subscription

------------------------------------------------------------------------------------------------------------------------

適用 Proxmox VE 5.x 版
# pico /etc/apt/sources.list

加入以行的套件庫,這樣,隨時可以將 Proxmox VE 更新至最新、修正過的套件版本
# 由proxmox.com提供#PVE PVE-無認購庫,不推薦用於正式運作  ---> 這個一定要加入
# --->  這個要加入,在 update 時會更新新的套件

deb http://download.proxmox.com/debian stretch pve-no-subscription

# --->  這一行是測試版的套件版本,請自行考慮加入

# deb http://download.proxmox.com/debian/pve stretch pvetest

------------------------------------------------------------------------------------------------------------------------

再執行更新
~# apt-get update
~# apt-get dist-upgrade -y --force-yes

------------------------------------------------------------------------------------------------------------------------
套件說明

pve-no-subscription
  安裝完後,將具有原廠已測試通過但未正式釋放出來的套件
pvetest

  這是測試版搶先使用版,自行考慮是否使用

 

 

4.x ---> 5.x 參考下列連結由 4.4 升級至 5.x

https://pve.proxmox.com/wiki/Package_Repositories#_proxmox_ve_no_subscription_repository

 

--------------------------------------------------------------------------------------------------------------

適用 Proxmox VE 6.x 版

  1. pico /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
    # security updates
    deb http://security.debian.org buster/updates main contrib
    deb http://download.proxmox.com/debian buster pve-no-subscription
    deb http://download.proxmox.com/debian/pve buster pvetest
  2. pico /etc/apt/sources.list.d/pve-enterprise.list
    把這一行前面加上 #  註解掉

    # deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise

Proxmox VE 4.x 中文初階學習手冊

2-2-4-4 安裝其它套件

  1. 在實體機額外加裝硬碟當 nfs 用, 或某些目錄要 share 給 VM 用。
    ~# apt-get install nfs-kernel-server
  2. 有需要的話,亦可再安裝 autofs (讓虛擬機掛載用)
    ~# apt-get install autofs
  3. 如果需要掛載 cifs (samba) 的話,請安裝 cifs-utils (讓虛擬機掛載用)
    ~# apt-get install cifs-utils
  4. 安裝主機遠端喚醒套件,(主機平時關機,需要時以遠端直接喚醒主機)
    ~# apt-get install wakeonlan

     
  5. 安裝 硬碟 檢測工具
    ~# apt-get install smartmontools

     
  6. 安裝 linux 效能測試工具 - sysbench ( 參閱 ) Debian 10 沒有此套件
    ~# apt-get install sysbench

     
  7. 安裝 linux 工具
    ~# apt-get install htop iftop iotop

Proxmox VE 4.x 中文初階學習手冊

2-2-4-5 4.x ---> 5.x 升級版本

4.x ---> 5.x 參考下列連結由 4.4 升級至 5.x

https://pve.proxmox.com/wiki/Package_Repositories#_proxmox_ve_no_subscription_repository

 

# wget http://download.proxmox.com/debian/proxmox-ve-release-5.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg

 

修改套件來源
將 /etc/apt/sources.list 檔的內容變更為如下
# pico /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

# 這一行是測試版本,不建議使用在正式產品運作上
deb http://download.proxmox.com/debian/pve stretch pvetest

更新套件庫資料

# apt-get update

更新套件

# apt-get dist-upgrade


更新完成後 Proxmox VE 已經升級到 5.x 版
但 OS debian 並未升級至 9.x 版

 

Proxmox VE 4.x 中文初階學習手冊

2-2-4-6 5.x ---> 6.x 升級版本

https://pve.proxmox.com/wiki/Upgrade_from_5.x_to_6.0?fbclid=IwAR1GZTrZj3m2csz4FdU5wljSO6g6S3FkDkcjzLI5hLSuhxaz_m8O89B-y6E

 

就地升級

就地升級是使用apt完成的。需要熟悉apt才能繼續此升級機制。

 

前提條件

 

分步行動

需要在群集中每個Proxmox VE節點的命令行上執行以下操作(通過控制台或ssh;最好通過控制台,以避免ssh連接中斷)。切記:在繼續操作之前,請確保已創建所有VM和CT的有效備份。

連續使用pve5to6清單腳本

最新的Proxmox VE 5.4軟件包中包含一個名為pve5to6的小型清單程序該程序將在升級過程之前,之中和之後提供有關潛在問題的提示和警告。可以通過執行以下命令來調用它:

 pve5to6

該腳本僅檢查和報告內容。默認情況下,不對系統進行任何更改,因此不會自動修復所有問題。請記住,Proxmox VE可以進行大量自定義,因此該腳本可能無法識別特定設置的所有可能問題!

建議在每次嘗試解決問題後重新運行腳本。這樣可以確保所採取的措施實際上可以修正相應的警告。

群集:始終先升級到Corosync 3

使用Corosync 3,在線格式已更改。現在它與Corosync 2.x不兼容,因為它用kronosnet切換了基礎多播UDP堆棧。由Proxmox VE 5.2版或更高版本生成的配置文件已經與新的Corosync 3.x兼容(至少足以處理升級而沒有任何問題)。

重要說明:升級之前,無論選擇哪種方式升級到Corosync 3,都必須先停止所有HA管理服務。停止所有HA服務可確保在升級過程中不會出現任何群集節點。這也意味著在Corosync升級的短時間內將沒有任何可用的HA功能。

首先,請確保清單腳本報告的所有與Corosync不相關的警告均已修復或確定為良性/錯誤否定。接下來,在每個節點上停止本地資源管理器“ pve-ha-lrm”。僅在它們停止之後,還要在每個節點上停止集群資源管理器“ pve-ha-crm”。通過在每個節點上運行以下命令來使用GUI(節點->服務)或CLI:

systemctl stop pve-ha-lrm

僅對所有節點完成上述操作之後,才在每個節點上運行以下命令:

systemctl stop pve-ha-crm

然後添加Proxmox Corosync 3 Stretch存儲庫:

echo "deb http://download.proxmox.com/debian/corosync-3/ stretch main" > /etc/apt/sources.list.d/corosync3.list

並運行

apt update

然後再次確保只更新或重新安裝corosync,kronosnet及其庫:

apt list --upgradeable
Listing... Done
corosync/stable 3.0.2-pve2~bpo9 amd64 [upgradable from: 2.4.4-pve1]
libcmap4/stable 3.0.2-pve2~bpo9 amd64 [upgradable from: 2.4.4-pve1]
libcorosync-common4/stable 3.0.2-pve2~bpo9 amd64 [upgradable from: 2.4.4-pve1]
libcpg4/stable 3.0.2-pve2~bpo9 amd64 [upgradable from: 2.4.4-pve1]
libqb0/stable 1.0.5-1~bpo9+2 amd64 [upgradable from: 1.0.3-1~bpo9]
libquorum5/stable 3.0.2-pve2~bpo9 amd64 [upgradable from: 2.4.4-pve1]
libvotequorum8/stable 3.0.2-pve2~bpo9 amd64 [upgradable from: 2.4.4-pve1]

有兩種方法可以繼續進行Corosync升級:

注意:在升級期間,通常不允許對任何VM / CT或群集進行更改!

在所有節點上預下載到corosync-3的升級,例如,使用:

apt dist-upgrade --download-only

然後在所有節點上運行實際的升級:

 apt dist-upgrade

在此過程中的任何時候,都可以使用以下命令驗證節點上群集仲裁的本地視圖:

pvecm status

在所有節點上完成 Corosync 3.x的更新後,請在所有節點上重新啟動本地資源管理器和群集資源管理器:

 systemctl start pve-ha-lrm
 systemctl start pve-ha-crm

移動重要的虛擬機和容器

如果在升級過程中任何VM和CT需要保持運行,請從當前升級的節點上遷移它們。將VM或CT從Proxmox VE的較舊版本遷移到較新版本將始終有效。從較新的Proxmox VE版本到較舊版本的遷移可能會起作用,但通常不支持。在計劃群集升級時,請記住這一點。

更新已配置的APT存儲庫

首先,確保系統使用最新的Proxmox VE 5.4軟件包運行:

apt update
apt dist-upgrade

將所有Debian存儲庫條目更新為Buster。

sed -i 's/stretch/buster/g' /etc/apt/sources.list

禁用所有Proxmox VE 5.x存儲庫。這包括pve-enterprise存儲庫,pve-no-subscription存儲庫和pvetest存儲庫。

為此,在/etc/apt/sources.list.d/pve-enterprise.list和/etc/apt/sources.list文件中添加#符號以註釋掉這些存儲庫。請參閱Package_Repositories

添加Proxmox VE 6軟件包系統信息庫

echo "deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise" > /etc/apt/sources.list.d/pve-enterprise.list

有關無訂閱存儲庫,請參閱軟件包存儲庫可能是這樣的:

sed -i -e 's/stretch/buster/g' /etc/apt/sources.list.d/pve-install-repo.list

(僅限Ceph)用proxmox.com ceph存儲庫替換ceph.com存儲庫

echo "deb http://download.proxmox.com/debian/ceph-luminous buster main" > /etc/apt/sources.list.d/ceph.list

如果有反向端口行,請將其刪除-當前,尚未使用安裝的反向端口存儲庫中的軟件包測試升級。

更新存儲庫數據:

apt update

將系統升級到Debian Buster和Proxmox VE 6.0

根據系統性能,此操作將花費一些時間-最多60分鐘或更長時間。在具有SSD存儲的高性能服務器上,可以在5分鐘內完成dist升級。

從此步驟開始,獲取初始的升級軟件包:

 apt dist-upgrade

在上述步驟中,可能會要求您批准一些替換配置文件的新軟件包。它們與Proxmox VE升級無關,因此您可以選擇要執行的操作。

重新啟動系統以使用新的PVE內核

Proxmox VE升級後

對於集群

rm /etc/apt/sources.list.d/corosync3.list

對於超融合Ceph

現在,您應該在文章Ceph Luminous to Nautilus之後將Ceph集群升級到Nautilus版本

清單問題

proxmox-ve軟件包太舊

檢查已配置的軟件包存儲庫條目(請參閱Package_Repositories)並運行

apt update

其次是

apt dist-upgrade

升級到PVE 6.x 之前獲取最新的PVE 5.x軟件包

已安裝corosync 2.x,需要在群集範圍內升級到3.x!

請先參閱升級到corosync 3部分

已知的升級問題

一般

作為基於Debian的發行版,Proxmox VE受大多數影響Debian的問題和更改的影響。因此,請務必閱讀針對升級的特定問題

特別是提高了OpenSSL的默認版本和安全級別(通常由pve5to6工具檢查)和使用環境變量進行su的語義更改

未設置“ root”密碼

根帳戶必須設置密碼(您要記住)。否則,將在升級過程中卸載sudo軟件包,因此,如果未設置密碼,則您將無法以root用戶身份再次登錄。如果您使用的是Proxmox VE或Debian官方安裝程序,並且在安裝後沒有刪除,則可以。

GlusterFS

至少當前版本的Gluster(6.5-1,可從gluster.org獲得)與我們的軟件包有衝突。升級必須通過選件完成

-o Dpkg::Options::="--force-overwrite"

如果已安裝此版本。將來的版本也可能如此。

故障排除

確保Buster的存儲庫配置正確。

如果發生網絡故障,並且已經部分升級,請嘗試使用

apt -f install

請參閱從Grub失敗中恢復

 

原因:在升級過程中 /root/.ssh/config 檔案未更新

 

# pico ~/.ssh/config
將內容置換為
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com

 

 

Proxmox VE 4.x 中文初階學習手冊

2-2-5 Proxmox VE 的安全性

Proxmox VE 4.x 中文初階學習手冊

2-2-5-1 proxmox ve 使用者權限管理功能

 

https://pve.proxmox.com/wiki/User_Management

 


Cookies help us deliver our services. By using our services, you agree to our use of cookies. More information

 


User Management


Contents

    Users
    Authentication Realms
    Two factor authentication
    Permission Management
    Command Line Tool
    Real World Examples

Proxmox VE supports multiple authentication sources, e.g. Linux PAM, an integrated Proxmox VE authentication server, LDAP, Microsoft Active Directory.

By using the role based user- and permission management for all objects (VMs, storages, nodes, etc.) granular access can be defined.
Users

Proxmox VE stores user attributes in /etc/pve/user.cfg. Passwords are not stored here, users are instead associated with authentication realms described below. Therefore a user is internally often identified by its name and realm in the form <userid>@<realm>.

Each user entry in this file contains the following information:

    First name

    Last name

    E-mail address

    Group memberships

    An optional Expiration date

    A comment or note about this user

    Whether this user is enabled or disabled

    Optional two factor authentication keys

System administrator

The system’s root user can always log in via the Linux PAM realm and is an unconfined administrator. This user cannot be deleted, but attributes can still be changed and system mails will be sent to the email address assigned to this user.
Groups

Each user can be member of several groups. Groups are the preferred way to organize access permissions. You should always grant permission to groups instead of using individual users. That way you will get a much shorter access control list which is easier to handle.
Authentication Realms

As Proxmox VE users are just counterparts for users existing on some external realm, the realms have to be configured in /etc/pve/domains.cfg. The following realms (authentication methods) are available:

Linux PAM standard authentication

    In this case a system user has to exist (e.g. created via the adduser command) on all nodes the user is allowed to login, and the user authenticates with their usual system password.

    useradd heinz
    passwd heinz
    groupadd watchman
    usermod -a -G watchman heinz

Proxmox VE authentication server

    This is a unix like password store (/etc/pve/priv/shadow.cfg). Password are encrypted using the SHA-256 hash method. This is the most convenient method for small (or even medium) installations where users do not need access to anything outside of Proxmox VE. In this case users are fully managed by Proxmox VE and are able to change their own passwords via the GUI.
LDAP

    It is possible to authenticate users via an LDAP server (e.g. openldap). The server and an optional fallback server can be configured and the connection can be encrypted via SSL.

    Users are searched under a Base Domain Name (base_dn), with the user name found in the attribute specified in the User Attribute Name (user_attr) field.

    For instance, if a user is represented via the following ldif dataset:

    # user1 of People at ldap-test.com
    dn: uid=user1,ou=People,dc=ldap-test,dc=com
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    uid: user1
    cn: Test User 1
    sn: Testers
    description: This is the first test user.

    The Base Domain Name would be ou=People,dc=ldap-test,dc=com and the user attribute would be uid.

    If Proxmox VE needs to authenticate (bind) to the ldap server before being able to query and authenticate users, a bind domain name can be configured via the bind_dn property in /etc/pve/domains.cfg. Its password then has to be stored in /etc/pve/priv/ldap/<realmname>.pw (e.g. /etc/pve/priv/ldap/my-ldap.pw). This file should contain a single line containing the raw password.
Microsoft Active Directory

    A server and authentication domain need to be specified. Like with ldap an optional fallback server, optional port, and SSL encryption can be configured.

Two factor authentication

Each realm can optionally be secured additionally by two factor authentication. This can be done by selecting one of the available methods via the TFA dropdown box when adding or editing an Authentication Realm. When a realm has TFA enabled it becomes a requirement and only users with configured TFA will be able to login.

Currently there are two methods available:

Time based OATH (TOTP)

    This uses the standard HMAC-SHA1 algorithm where the current time is hashed with the user’s configured key. The time step and password length parameters are configured.

    A user can have multiple keys configured (separated by spaces), and the keys can be specified in Base32 (RFC3548) or hexadecimal notation.

    Proxmox VE provides a key generation tool (oathkeygen) which prints out a random key in Base32 notation which can be used directly with various OTP tools, such as the oathtool command line tool, the Google authenticator or FreeOTP Android apps.
YubiKey OTP

    For authenticating via a YubiKey a Yubico API ID, API KEY and validation server URL must be configured, and users must have a YubiKey available. In order to get the key ID from a YubiKey, you can trigger the YubiKey once after connecting it to USB and copy the first 12 characters of the typed password into the user’s Key IDs field.

    Please refer to the YubiKey OTP documentation for how to use the YubiCloud or host your own verification server.

Permission Management

In order for a user to perform an action (such as listing, modifying or deleting a parts of a VM configuration), the user needs to have the appropriate permissions.

Proxmox VE uses a role and path based permission management system. An entry in the permissions table allows a user or group to take on a specific role when accessing an object or path. This means an such an access rule can be represented as a triple of (path, user, role) or (path, group, role), with the role containing a set of allowed actions, and the path representing the target of these actions.
Roles

A role is simply a list of privileges. Proxmox VE comes with a number of predefined roles which satisfies most needs.

    Administrator: 擁有所有特權

    NoAccess: 沒有特權 (used to forbid access)

    PVEAdmin: can do most things, but miss rights to modify system settings (Sys.PowerMgmt, Sys.Modify, Realm.Allocate).

    PVEAuditor: read only access

    PVEDatastoreAdmin: create and allocate backup space and templates

    PVEDatastoreUser: allocate backup space and view storage

    PVEPoolAdmin: allocate pools

    PVESysAdmin: User ACLs, audit, system console and system logs

    PVETemplateUser: view and clone templates

    PVEUserAdmin: user administration

    PVEVMAdmin: 完全管理 VM

    PVEVMUser: view, backup, config CDROM, VM console, VM power management

You can see the whole set of predefined roles on the GUI.

Adding new roles can be done via both GUI and the command line, like this:

pveum roleadd PVE_Power-only -privs "VM.PowerMgmt VM.Console"
pveum roleadd Sys_Power-only -privs "Sys.PowerMgmt Sys.Console"

Privileges

A privilege is the right to perform a specific action. To simplify management, lists of privileges are grouped into roles, which can then be used in the permission table. Note that privileges cannot directly be assigned to users and paths without being part of a role.

We currently use the following privileges:

Node / System related privileges

        Permissions.Modify: modify access permissions

        Sys.PowerMgmt: Node power management (start, stop, reset, shutdown, …)

        Sys.Console: console access to Node

        Sys.Syslog: view Syslog

        Sys.Audit: view node status/config, Corosync cluster config and HA config

        Sys.Modify: create/remove/modify node network parameters

        Group.Allocate: create/remove/modify groups

        Pool.Allocate: create/remove/modify a pool

        Realm.Allocate: create/remove/modify authentication realms

        Realm.AllocateUser: assign user to a realm

        User.Modify: create/remove/modify user access and details.

Virtual machine related privileges

        VM.Allocate: create/remove new VM to server inventory

        VM.Migrate: migrate VM to alternate server on cluster

        VM.PowerMgmt: power management (start, stop, reset, shutdown, …)

        VM.Console: console access to VM

        VM.Monitor: access to VM monitor (kvm)

        VM.Backup: backup/restore VMs

        VM.Audit: view VM config

        VM.Clone: clone/copy a VM

        VM.Config.Disk: add/modify/delete Disks

        VM.Config.CDROM: eject/change CDROM

        VM.Config.CPU: modify CPU settings

        VM.Config.Memory: modify Memory settings

        VM.Config.Network: add/modify/delete Network devices

        VM.Config.HWType: modify emulated HW type

        VM.Config.Options: modify any other VM configuration

        VM.Snapshot: create/remove VM snapshots

Storage related privileges

        Datastore.Allocate: create/remove/modify a data store, delete volumes

        Datastore.AllocateSpace: allocate space on a datastore

        Datastore.AllocateTemplate: allocate/upload templates and iso images

        Datastore.Audit: view/browse a datastore

Objects and Paths

Access permissions are assigned to objects, such as a virtual machines, storages or pools of resources. We use file system like paths to address these objects. These paths form a natural tree, and permissions of higher levels (shorter path) can optionally be propagated down within this hierarchy.

Paths can be templated. When an API call requires permissions on a templated path, the path may contain references to parameters of the API call. These references are specified in curly braces. Some parameters are implicitly taken from the API call’s URI. For instance the permission path /nodes/{node} when calling /nodes/mynode/status requires permissions on /nodes/mynode, while the path {path} in a PUT request to /access/acl refers to the method’s path parameter.

Some examples are:

    /nodes/{node}: Access to Proxmox VE server machines

    /vms: Covers all VMs

    /vms/{vmid}: Access to specific VMs

    /storage/{storeid}: Access to a storages

    /pool/{poolname}: Access to VMs part of a pool

    /access/groups: Group administration

    /access/realms/{realmid}: Administrative access to realms

Inheritance

As mentioned earlier, object paths form a file system like tree, and permissions can be inherited down that tree (the propagate flag is set by default). We use the following inheritance rules:

    Permissions for individual users always replace group permissions.

    Permissions for groups apply when the user is member of that group.

    Permissions replace the ones inherited from an upper level.

Pools

Pools can be used to group a set of virtual machines and data stores. You can then simply set permissions on pools (/pool/{poolid}), which are inherited to all pool members. This is a great way simplify access control.
What permission do I need?

The required API permissions are documented for each individual method, and can be found at http://pve.proxmox.com/pve-docs/api-viewer/

The permissions are specified as a list which can be interpreted as a tree of logic and access-check functions:

["and", <subtests>...] and ["or", <subtests>...]

    Each(and) or any(or) further element in the current list has to be true.
["perm", <path>, [ <privileges>... ], <options>...]

    The path is a templated parameter (see Objects and Paths). All (or , if the any option is used, any) of the listed privileges must be allowed on the specified path. If a require-param option is specified, then its specified parameter is required even if the API call’s schema otherwise lists it as being optional.
["userid-group", [ <privileges>... ], <options>...]

    The caller must have any of the listed privileges on /access/groups. In addition there are two possible checks depending on whether the groups_param option is set:

        groups_param is set: The API call has a non-optional groups parameter and the caller must have any of the listed privileges on all of the listed groups.

        groups_param is not set: The user passed via the userid parameter must exist and be part of a group on which the caller has any of the listed privileges (via the /access/groups/<group> path).

["userid-param", "self"]

    The value provided for the API call’s userid parameter must refer to the user performing the action. (Usually in conjunction with or, to allow users to perform an action on themselves even if they don’t have elevated privileges.)
["userid-param", "Realm.AllocateUser"]

    The user needs Realm.AllocateUser access to /access/realm/<realm>, with <realm> referring to the realm of the user passed via the userid parameter. Note that the user does not need to exist in order to be associated with a realm, since user IDs are passed in the form of <username>@<realm>.
["perm-modify", <path>]

    The path is a templated parameter (see Objects and Paths). The user needs either the Permissions.Modify privilege, or, depending on the path, the following privileges as a possible substitute:

        /storage/...: additionally requires 'Datastore.Allocate`

        /vms/...: additionally requires 'VM.Allocate`

        /pool/...: additionally requires 'Pool.Allocate`

        If the path is empty, Permission.Modify on /access is required.

Command Line Tool

Most users will simply use the GUI to manage users. But there is also a full featured command line tool called pveum (short for “Proxmox VE User Manager”). Please note that all Proxmox VE command line tools are wrappers around the API, so you can also access those function through the REST API.

Here are some simple usage examples. To show help type:

pveum

or (to show detailed help about a specific command)

pveum help useradd

Create a new user:

pveum useradd testuser@pve -comment "Just a test"

Set or Change the password (not all realms support that):

pveum passwd testuser@pve

Disable a user:

pveum usermod testuser@pve -enable 0

Create a new group:

pveum groupadd testgroup

Create a new role:

pveum roleadd PVE_Power-only -privs "VM.PowerMgmt VM.Console"

Real World Examples
Administrator Group

One of the most wanted features was the ability to define a group of users with full administrator rights (without using the root account).

Define the group:

pveum groupadd admin -comment "System Administrators"

Then add the permission:

pveum aclmod / -group admin -role Administrator

You can finally add users to the new admin group:

pveum usermod testuser@pve -group admin

Auditors

You can give read only access to users by assigning the PVEAuditor role to users or groups.

Example1: Allow user joe@pve to see everything

pveum aclmod / -user joe@pve -role PVEAuditor

Example1: Allow user joe@pve to see all virtual machines

pveum aclmod /vms -user joe@pve -role PVEAuditor

Delegate User Management

If you want to delegate user management to user joe@pve you can do that with:

pveum aclmod /access -user joe@pve -role PVEUserAdmin

User joe@pve can now add and remove users, change passwords and other user attributes. This is a very powerful role, and you most likely want to limit that to selected realms and groups. The following example allows joe@pve to modify users within realm pve if they are members of group customers:

pveum aclmod /access/realm/pve -user joe@pve -role PVEUserAdmin
pveum aclmod /access/groups/customers -user joe@pve -role PVEUserAdmin

Note    The user is able to add other users, but only if they are members of group customers and within realm pve.
Pools

An enterprise is usually structured into several smaller departments, and it is common that you want to assign resources to them and delegate management tasks. A pool is simply a set of virtual machines and data stores. You can create pools on the GUI. After that you can add resources to the pool (VMs, Storage).

You can also assign permissions to the pool. Those permissions are inherited to all pool members.

Lets assume you have a software development department, so we first create a group

pveum groupadd developers -comment "Our software developers"

Now we create a new user which is a member of that group

pveum useradd developer1@pve -group developers -password

Note    The -password parameter will prompt you for a password

I assume we already created a pool called “dev-pool” on the GUI. So we can now assign permission to that pool:

pveum aclmod /pool/dev-pool/ -group developers -role PVEAdmin

Our software developers can now administrate the resources assigned to that pool.


Categories:

    Reference Documentation
    HOWTO


Navigation menu

    Log in


    Page
    Discussion

    Read
    View source
    View history

Search

    Proxmox VE Wiki
    Downloads
    Installation
    Get support
    Recent changes

Sites

    proxmox.com
    Support forum
    Bugtracker
    Source code
    FAQ

Tools

    What links here
    Related changes
    Special pages
    Printable version
    Permanent link
    Page information
    Cite this page

    This page was last edited on 16 May 2018, at 11:07.

    Privacy policy
    About Proxmox VE
    Disclaimers

    Powered by MediaWiki


 

Proxmox VE 4.x 中文初階學習手冊

2-2-5-2

  

https://pve.proxmox.com/wiki/User_Management

 

 

 

 
 

 

Authentication Realms

Linux PAM standard authentication

In this case a system user has to exist (e.g. created via the adduser command) on all nodes the user is allowed to login, and the user authenticates with their usual system password.

Proxmox VE authentication server

This is a unix like password store (/etc/pve/priv/shadow.cfg). Password are encrypted using the SHA-256 hash method. This is the most convenient method for small (or even medium) installations where users do not need access to anything outside of Proxmox VE. In this case users are fully managed by Proxmox VE and are able to change their own passwords via the GUI.

LDAP

It is possible to authenticate users via an LDAP server (e.g. openldap). The server and an optional fallback server can be configured and the connection can be encrypted via SSL.

Users are searched under a Base Domain Name (base_dn), with the user name found in the attribute specified in the User Attribute Name (user_attr) field.

The Base Domain Name would be ou=People,dc=ldap-test,dc=com and the user attribute would be uid.

Microsoft Active Directory

A server and authentication domain need to be specified. Like with ldap an optional fallback server, optional port, and SSL encryption can be configured.

Permission Management

Proxmox VE uses a role and path based permission management system. An entry in the permissions table allows a user or group to take on a specific role when accessing an object or path. This means an such an access rule can be represented as a triple of (path, user, role) or (path, group, role), with the role containing a set of allowed actions, and the path representing the target of these actions.

Roles

Privileges

Node / System related privileges
Virtual machine related privileges
Storage related privileges

Objects and Paths

Pools

Pools can be used to group a set of virtual machines and data stores. You can then simply set permissions on pools (/pool/{poolid}), which are inherited to all pool members. This is a great way simplify access control.

What permission do I need?

["and", <subtests>...] and ["or", <subtests>...]

Each(and) or any(or) further element in the current list has to be true.

["perm", <path>, [ <privileges>... ], <options>...]

The path is a templated parameter (see Objects and Paths). All (or , if the any option is used, any) of the listed privileges must be allowed on the specified path. If a require-param option is specified, then its specified parameter is required even if the API call’s schema otherwise lists it as being optional.

["userid-group", [ <privileges>... ], <options>...]

The caller must have any of the listed privileges on /access/groups. In addition there are two possible checks depending on whether the groups_param option is set:

  • groups_param is set: The API call has a non-optional groups parameter and the caller must have any of the listed privileges on all of the listed groups.

  • groups_param is not set: The user passed via the userid parameter must exist and be part of a group on which the caller has any of the listed privileges (via the /access/groups/<group> path).

["userid-param", "self"]

The value provided for the API call’s userid parameter must refer to the user performing the action. (Usually in conjunction with or, to allow users to perform an action on themselves even if they don’t have elevated privileges.)

["userid-param", "Realm.AllocateUser"]

The user needs Realm.AllocateUser access to /access/realm/<realm>, with <realm> referring to the realm of the user passed via the userid parameter. Note that the user does not need to exist in order to be associated with a realm, since user IDs are passed in the form of <username>@<realm>.

["perm-modify", <path>]

The path is a templated parameter (see Objects and Paths). The user needs either the Permissions.Modify privilege, or, depending on the path, the following privileges as a possible substitute:

Real World Examples

Delegate User Management

User joe@pve can now add and remove users, change passwords and other user attributes. This is a very powerful role, and you most likely want to limit that to selected realms and groups. The following example allows joe@pve to modify users within realm pve if they are members of group customers: