Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Useful Proxmox Commands & Links

Backup File Names

Newer versions of vzdump encode the guest type and the backup time into the filename, for example

vzdump-lxc-105-2009_10_09-11_04_43.tar

That way it is possible to store several backup in the same directory. The parameter maxfiles can be used to specify the maximum number of backups to keep.

Restore

The resulting archive files can be restored with the following programs.

pct restore

Container restore utility

qmrestore
QemuServer restore utility

Examples

Simply dump guest 777 – no snapshot, just archive the guest private area and configuration files to the default dump directory (usually /var/lib/vz/dump/).

# vzdump 777

Use rsync and suspend/resume to create a snapshot (minimal downtime).

# vzdump 777 --mode suspend

Backup all guest systems and send notification mails to root and admin.

# vzdump --all --mode suspend --mailto root --mailto admin

Use snapshot mode (no downtime) and non-default dump directory.

# vzdump 777 --dumpdir /mnt/backup --mode snapshot

Backup more than one guest (selectively)

# vzdump 101 102 103 --mailto root

Backup all guests excluding 101 and 102

# vzdump --mode suspend --exclude 101,102

Restore a container to a new CT 600

# pct restore 600 /mnt/backup/vzdump-lxc-777.tar

Restore a QemuServer VM to VM 601

# qmrestore /mnt/backup/vzdump-qemu-888.vma 601

Clone an existing container 101 to a new container 300 with a 4GB root file system, using pipes

# vzdump 101 --stdout | pct restore --rootfs 4 300 -

Command to list the running VPSs in a node

# vzlist

Command to list running and stopped VPSs in an node. This command lists all (running and stopped) the VPSs in a node.

# vzlist -a

To start a VPS

# vzctl start CTID

To stop or shutdown a VPS

# vzctl stop CTID

To view the status of a VPS

# vzctl status CTID

To restart a VPS

# vzctl restart CTID

To enter a VPS

# vzctl enter CTID

Delete a container

# vzctl destroy CTID

Suspending a container

# vzctl suspend CTID

Set hostname for a Server

# vzctl set CTID --hostname New_hostname --save

Add new IP to VPS

# vzctl set CTID --ipadd xx.xx.xx.xx --save

Delete IP from VPS

# vzctl set CTID --ipdel xx.xx.xx.xx --save

Reset root password of a VPS

# vzctl set CTID --userpasswd root:new_password --save

To add NameServer IPs to VPS

# vzctl set CTID --nameserver xx.xx.xx.xx --save

Executes commands for a container from node

# vzctl exec CTID command

Example:

# vzctl exec 110 df -h
# vzctl exec 101 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/simfs 130G 89G 27G 78% /
none 8.0G 4.0K 8.0G 1% /dev
none 8.0G 0 8.0G 0% /dev/shm

To check the resource usages

# vzcalc -v CTID

Example:

# vzcalc -v 110
# vzcalc -v 101
Resource Current(%) Promised(%) Max(%)
Low Mem 1.53 182706895112.42 182706895112.42
Total RAM 33.79 n/a n/a
Mem + Swap 1.73 38695649865149.61 n/a
Alloc. Mem 2.95 38695649865149.61 38695649865149.61
Num. Proc 0.05 n/a 2395786836523892.00
——————————————–
Memory 33.79 38695649865149.61 2395786836523892.00

Restoring from a template

#pct restore 103 vzdump-lxc-103-2016_03_15-06_09_03.tar.lzo --storage system_lvms

If PCT Doesn’t work, use LXC commands to control containers

Reboot the container

lxc-stop -n containerNameHere -r

To reboot the container called myhttpd, enter:

lxc-stop -n myhttpd -r

Shut down and kill the container (hard kill)

The syntax is:

lxc-stop -n containerNameHere -k

OR

lxc-stop -n containerNameHere --kill

To forcefully kill and shut down the container called myhttpd, enter:

lxc-stop -n myhttpd -k

To wait TIMEOUT (say 180) seconds before hard-stopping the container, enter:

lxc-stop -n myhttpd -k -t 180

OR

lxc-stop -n myhttpd -k --timeout 180

Clean shutdown (recommended)

The following syntax only request a clean shutdown, do not kill the container tasks if the clean shutdown fail:

lxc-stop -n containerNameHere --nokill
lxc-stop -n myhttpd --nokill

A note about timeouts: To avoid waiting up to 60 seconds and simply perform the requestion action (reboot, shutdown, or hard kill) and exit, pass the -W option:
## hard kill ##

lxc-stop -W -n containerNameHere -k

## reboot ##

lxc-stop -W -n containerNameHere -r

To list only running containers, enter:

lxc-ls --fancy --running

To list only stopped containers, enter:

lxc-ls --fancy --stopped

To list both stopped and running containers on the system, enter:

lxc-ls –fancy

Import Disk

qm importdisk <vmid> yourimage.qcow2 namestoragepool

Example:

qm importdisk 101 fileserver.qcow2 local-lvm

LINKS

Cluster control

https://pve.proxmox.com/pve-docs/pvecm.1.html

Cluster Manager

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

CEPH

https://pve.proxmox.com/wiki/Manage_Ceph_Services_on_Proxmox_VE_Nodes#_footnote_8

Resize Disk

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

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes