Post

Proxmox CLI

This is to be a list of various CLI commands or scenarios for either automation or if for some reason the GUI is unavailable or unresponsive.

Config

Configs are stored in /etc/pve, while direct editing of these files is not recommended or supported the information in these files can be useful in an emergency situation or when the GUI is unavilable / unresponsive.

  • In cluster setups this is a fuse mount-point managed by the corosync process.
  • Loss of quorum can make this mount point read-only.

Config layout

  • VMs config:
    • /etc/pve/nodes//.conf
  • Done

Cluster

Core

Storage

VMs

VM is locked

Problem: can’t lock file ‘/var/lock/qemu-server/lock-.conf’ – got timeout or `VM is locked (backup|snapshot|clone|etc)`

Solution 1: qm unlock <VMID>

Solution 2: rm /var/lock/qemu-server/lock-<VMID>.conf

Containers

LXC

Directory mapping:

Directly mapping a directory from the host into a LXC container (similar to a docker bind-mount). While not great from a cluster it is useful

https://pve.proxmox.com/wiki/Linux_Container#_bind_mount_points https://forum.proxmox.com/threads/mount-host-directory-into-lxc-container.66555/

1
2
3
4
5
6
7
8
# Add the following to /etc/pve/lxc/<container_id>.conf
# Requires a reboot to activate
mp0: /mnt/nas0/,mp=/nas0

or

# Does not require a reboot, is immediate.
pct set 102 -mp0 /mnt/nas0/,mp=/nas0/

Networking

Storage

Commands

Proxmox - Official

CommandDescription
proxmox-offline-mirror 
proxmox-backup-client 
proxmox-file-restore 
pve-firewall 
pve-ha-crm 
pve-ha-lrm 
pveam 
pvebanner 
pvecmProxmox cluster management
pveceph 
pvedaemon 
pvefw-logger 
pvenode 
pvereport 
pveperfProxmox VE Benchmark
pvescheduler 
pveshCLI version of the API
pvesmProxmox storage management
pvesrStorage Replication
pveum 
pveupdate 
pveupgrade 
pveversion 
qmVM management

External

CommandDescription
pct 
qmrestoreRestore qemu server backups
qm remote-migrate and pct remote-migrateMigrate a VM to a different cluster
nfsstat -m 
NFS connection netstat | grep :nfs or ss -a | grep nfs 
  

Services

ServicesDescription
corosyncSyncronizes files in /etc/pve
pve-guests 
pvebanner 
pvernetcommit 
This post is licensed under CC BY 4.0 by the author.