Skip to content

Instantly share code, notes, and snippets.

@dragolabs
Last active November 28, 2024 23:07
Show Gist options
  • Select an option

  • Save dragolabs/f391bdda050480871ddd129aa6080ac2 to your computer and use it in GitHub Desktop.

Select an option

Save dragolabs/f391bdda050480871ddd129aa6080ac2 to your computer and use it in GitHub Desktop.
Useful proxmox commands

Create containter with external and internal nets

pct create 100 \
    local:vztmpl/ubuntu-16.04-standard_16.04-1_amd64.tar.gz \
    --cores 2 --cpuunits 1024 \
    --memory 4096 --swap 128 \
    --hostname ct100.example.com \
    --net0 name=eth0,ip=1.2.3.4/32,bridge=vmbr0,gw=1.2.3.0 \
    --net1 name=eth1,ip=192.168.0.2/32,bridge=vmbr1 \
    --rootfs local:24 \
    --onboot 1

Remove container. Be careful, it'll destroy ct without questions

pct destroy 100

View sum of memory allocated to VMs and CTs

grep -R memory /etc/pve/local | awk '{sum += $NF } END {print sum;}'

View sorted list of vmid

cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n
@einheit
Copy link

einheit commented Jul 16, 2023

lxc-ls --fancy
pveperf
qm list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment