PVE Reference Manual

From WikiMLT
Revision as of 10:48, 3 September 2022 by Spas (talk | contribs)

In this sec­tion are list­ed my lessons, notes and learn­ings about the in­stal­la­tion, set­up and the us­age of Prox­mox. most of the sec­tions are based on the Prox­moxVE Full Course, pro­vid­ed by YouTube chan­nel Learn­Lin­uxTV. The sec­tion is named af­ter Prox­mox but it con­strains much ref­er­ences and in­for­ma­tion for vir­tu­al­iza­tion in gen­er­al.

Get­ting Start­ed, In­stal­la­tion, Set­up and Doc­u­men­ta­tion

#Get­ting Start­ed, In­stal­la­tion, Set­up and Doc­u­men­ta­tion

#LXC vs LXD vs Prox­mox Con­tain­ers vs Dock­er

LXC vs LXD vs Prox­mox Con­tain­ers vs Dock­er – Prox­moxVE Wi­ki: FAQ

  • LXC is a user­space in­ter­face for the Lin­ux ker­nel con­tain­ment fea­tures. Through a pow­er­ful API and sim­ple tools, it lets Lin­ux users eas­i­ly cre­ate and man­age sys­tem con­tain­ers. LXC, as well as the for­mer Open­VZ, aims at sys­tem vir­tu­al­iza­tion. Thus, it al­lows you to run a com­plete OS in­side a con­tain­er, where you log in us­ing ssh, add users, run apache, etc…
  • LXD is built on top of LXC to pro­vide a new, bet­ter user ex­pe­ri­ence. Un­der the hood, LXD us­es LXC through li­blxc and its Go bind­ing to cre­ate and man­age the con­tain­ers. It’s ba­si­cal­ly an al­ter­na­tive to LXC’s tools and dis­tri­b­u­tion tem­plate sys­tem with the added fea­tures that come from be­ing con­trol­lable over the net­work.
  • Prox­mox Con­tain­ers are how we re­fer to con­tain­ers that are cre­at­ed and man­aged us­ing the Prox­mox Con­tain­er Toolk­it (pct). They al­so tar­get sys­tem vir­tu­al­iza­tion and use LXC as the ba­sis of the con­tain­er of­fer­ing. The Prox­mox Con­tain­er Toolk­it (pct) is tight­ly cou­pled with Prox­mox VE. This means that it is aware of clus­ter se­tups, and it can use the same net­work and stor­age re­sources as QE­MU vir­tu­al ma­chines (VMs). You can even use the Prox­mox VE fire­wall, cre­ate and re­store back­ups, or man­age con­tain­ers us­ing the HA frame­work. Every­thing can be con­trolled over the net­work us­ing the Prox­mox VE API.
  • Dock­er aims at run­ning a sin­gle ap­pli­ca­tion in an iso­lat­ed, self-con­tained en­vi­ron­ment. These are gen­er­al­ly re­ferred to as “Ap­pli­ca­tion Con­tain­ers”, rather than “Sys­tem Con­tain­ers”. You man­age a Dock­er in­stance from the host, us­ing the Dock­er En­gine com­mand line in­ter­face. It is not rec­om­mend­ed to run dock­er di­rect­ly on your Prox­mox VE host.
  • If you want to run ap­pli­ca­tion con­tain­ers, for ex­am­ple, Dock­er im­ages, it is best to run them in­side a Prox­mox Qe­mu VM.

Cre­at­ing Vir­tu­al Ma­chines and VM Tem­plates

Cre­at­ing Con­tain­ers and CT Tem­plates

In or­der to dis­able the au­to­mat­ic set­ting of the con­tain­er host­name we cam do the fol­low­ing in­side the Guest OS:

sudo touch /etc/.pve-ignore.hosts
sudo touch /etc/.pve-ignore.hostname

Clus­ter­ing

It is im­por­tant when you cre­ate PVE VM in­stance that is a part of a clus­ter to set pvecm ex­pect­ed 1 at the main node (the phys­i­cal PVE), oth­er­wise that node will not run cor­rect­ly while the VM is not start­ed… which will be not pos­si­ble, be­cause of the sta­tus: Clus­ter Not Ready – No Quo­rum?

Prox­mox Back­up Serv­er

LVM Main­te­nance

Delete LVM Snap­shots

Find all Snap­shots at­tached to VMS/LXC:

for v in $(qm list|egrep -v VMID|awk '{print $1}'); do \
    for s in $(qm listsnapshot $v|egrep -v current|awk '{print $2}'); do \
        echo qm delsnapshot $v $s; \
    done; \
done

When the snap­shot is not at­tached (i.e. the VM was re­moved): 1) list all log­i­cal vol­umes; 2) find whish snap­shot is not need­ed and 3) re­move it.

vgs # scan the volume groups
lvs # list logical volumes - analyse the output
lvremove /dev/<volume group>/<logical volume of the snapshot>

HDD Sleep