Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:lxc [2024/04/10 19:19] – created nonewiki:lxc [2024/11/02 16:32] (current) 5.152.82.90
Line 1: Line 1:
 =====Commnads===== =====Commnads=====
-**Get config** +**Config** 
-<code>pct config <id></code+<code> 
-**Set cpu core count** +pct config <id> 
-<code>pct set <id> --cores 4</code> +pct set <id> --cores 4 --memory 2048 
-**Set memory size** +pct resize <id> rootfs 32G 
-<code>pct set <id> --memory 2048</code> +</code>
-**Set disk size** +
-<code>pct resize <id> rootfs 32G</code>+
  
 +**Images**
 +<code>
 +pveam available
 +pveam download local image.tar.gz
 +pveam list local
 +</code>
 +
 +=====LXC Kernel Logs=====
 +<code bash>
 +apt install -y ulogd2
 +
 +cp /etc/ulogd.conf /etc/ulogd.conf.ORIG
 +cat<<EOF>/etc/ulogd.conf
 +[global]
 +logfile="syslog"
 +loglevel=3
 +stack=log1:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,print1:PRINTPKT,iptables:LOGEMU
 +[log1]
 +group=1
 +[iptables]
 +file="/var/log/iptables.log"
 +sync=1
 +EOF
 +
 +systemctl restart ulogd
 +rm -rf /var/log/ulog
 +</code>
 +=====Memory Usage=====
 +<code bash>
 +total=0
 +for i in $(pct list|grep running|awk '{print $1}'); do
 +  pct status $i --verbose|yq -r '.|"\(.vmid)"+" "+"\(.maxmem|tonumber/1048576|round)"+"M"+" "+"\(.mem|tonumber/1048576|round)"+"M"'
 +  total=$((total+$(pct status $i --verbose|yq -r '.|"\(.maxmem|tonumber/1048576|round)"')))
 +done
 +echo ${total}M
 +</code>
 =====Fix issue with Zabbix===== =====Fix issue with Zabbix=====
 <code file lxcfs.service> <code file lxcfs.service>
Navigation
Print/export
QR Code
QR Code wiki:lxc (generated for current page)