How to Use the Command 'qm list' (with examples)

How to Use the Command 'qm list' (with examples)

The qm list command is a versatile tool used in the Proxmox VE environment to manage and display virtual machines (VMs). Proxmox Virtual Environment is an open-source server management platform for your enterprise virtualization. The qm list command plays a crucial role in offering insights into the virtual machines running within your infrastructure, providing essential details such as VM ID, name, memory usage, boot disk size, and the current status of each virtual machine. This command serves as a fundamental aspect of managing your server environment efficiently and effectively.

Use case 1: List all virtual machines

Code:

qm list

Motivation: Administering a virtualized environment involves keeping track of various VMs running on physical servers. As administrators or users, understanding the virtual machines currently deployed, at a glance, is often necessary. The qm list command provides a quick summary of all the virtual machines, helping administrators catalog their infrastructure components, decide on resource allocations, and ensure their environment is operating as expected.

Explanation:

  • qm: This stands for “QEMU Manager,” the command-line interface of Proxmox used to administer virtual machines.
  • list: This argument tells the Proxmox VE environment to display a list of all virtual machines. Running qm list without any additional flags or settings results in a comprehensive list of VMs, showing each one’s ID, name, status, memory usage, and disk space used.

Example output:

VMID    NAME            STATUS     MEM(MB)    BOOTDISK(GB)
100     windows-server  running    4096       60
101     debian-vm       stopped    2048       20
102     ubuntu-vm       running    2048       30

In this output, each row provides a high-level summary of a virtual machine’s VMID, its name, whether it’s currently running or not, the memory allocated to it, and the size of the boot disk.

Use case 2: List all virtual machines with a full status about the ones which are currently running

Code:

qm list --full 1

Motivation: There are scenarios in server management where knowing which virtual machines are running becomes crucial. You might need to perform maintenance, patch live systems, or allocate additional resources. The qm list --full 1 command offers comprehensive detail specifically about the VMs that are currently running, without cluttering the display with information about VMs that are inactive, allowing for focused troubleshooting or resource management.

Explanation:

  • qm: Again stands for “QEMU Manager,” used as the interface to control VMs.
  • list: Requests the system to return a list of virtual machines.
  • --full: This flag, combined with a specified condition, modifies the detail level of the output.
  • 1: This denotes that only VMs with a specific status—in this case, running VMs—should be displayed with complete information. The focus here is on the VMs that are actively consuming resources and potentially impacting infrastructure performance.

Example output:

VMID    NAME            STATUS     MEM(MB)    BOOTDISK(GB)  PID
100     windows-server  running    4096       60            3456
102     ubuntu-vm       running    2048       30            4657

In this output, additional details about the running VMs appear, notably the “PID” or Process ID, which is essential for identifying and managing the processes related to each running virtual machine.

Conclusion:

The qm list command in Proxmox offers varied functionalities for efficiently managing and monitoring virtual machines. Whether you’re looking for a general overview of all VMs or need detailed information about active ones, qm list serves as a critical command for proactive virtual environment management. Understanding and leveraging these features can greatly enhance an administrator’s ability to maintain infrastructure stability and performance.

Related Posts

Mastering PM2 for Node.js Process Management (with examples)

Mastering PM2 for Node.js Process Management (with examples)

PM2 is a production-ready process manager for Node.js applications. It is designed to facilitate seamless application deployment and management, thereby ensuring smooth performance, robust monitoring, and efficient logging.

Read More
How to use the command 'open' (with examples)

How to use the command 'open' (with examples)

The open command in macOS is a versatile utility that allows users to open files, directories, and applications from the command line.

Read More
How to use the command 'lxc' (with examples)

How to use the command 'lxc' (with examples)

The lxc command is a powerful tool used to manage Linux containers via the LXD REST API.

Read More