How to Use the Command `qm config` (with examples)
The qm config
command is part of the Proxmox Virtual Environment (PVE) suite of tools, used specifically to manage and configure virtual machines (VMs). This command provides users the ability to query and manipulate VM configurations by displaying current settings, pending changes, or configurations stored in snapshots. It is a powerful tool for administrators who need to ensure that their VMs are set up correctly and to inspect configurations before applying any changes.
Use Case 1: Display the Virtual Machine Configuration
Code:
qm config vm_id
Motivation:
When managing a virtual environment, it’s important to have a clear view of the configuration for your virtual machines. By using this command, administrators can quickly check for any pending configuration changes that have been applied to a VM but have not yet taken effect. This is crucial for verifying that changes are correctly queued and for ensuring that the VM will behave as expected once the changes are applied.
Explanation:
qm
: This is the base command used for managing virtual machines in Proxmox.config
: The subcommand that specifies you want to display configuration details.vm_id
: This argument is the unique identifier for the specific virtual machine whose configuration you wish to examine.
Example Output:
balloon: 2048
bootdisk: scsi0
cores: 2
memory: 4096
name: example-vm
net0: virtio=00:11:22:33:44:55,bridge=vmbr0
scsi0: local-lvm:vm-100-disk-0,size=32G
Use Case 2: Display the Current Configuration Values Instead of Pending Values
Code:
qm config --current true vm_id
Motivation:
There may be instances where an administrator needs to confirm the existing configuration of a VM before making additional changes. This command is particularly useful when there are pending changes that might not reflect the current operational state of the VM. By checking the current configuration values, administrators can more accurately perform troubleshooting or ensure operational consistency before changes are committed.
Explanation:
qm
: The Proxmox command for managing virtual machines.config
: Indicates the desire to interact with the VM’s configuration.--current true
: This flag forces the command to display only the current configuration values of the VM, ignoring any pending changes that have been staged but not applied.vm_id
: The unique VM identifier for which you want to view the current configuration.
Example Output:
balloon: 2048
boot: order=scsi0
bootdisk: scsi0
cores: 4
memory: 4096
name: example-vm
net0: virtio=12:34:56:78:9A:BC,bridge=vmbr0,firewall=1
scsi0: local-lvm:vm-101-disk-0,size=50G
Use Case 3: Fetch the Configuration Values from a Given Snapshot
Code:
qm config --snapshot snapshot_name vm_id
Motivation:
Snapshots are a convenient way to capture the state of a virtual machine at a specific point in time. This capability is invaluable for testing environments, allowing administrators to revert changes or return to a known-good state. By retrieving the configuration from a snapshot, users can evaluate specific settings that were in effect at the time of the snapshot, providing context for debugging or re-establishing previous configurations.
Explanation:
qm
: The base command for managing virtual machines in Proxmox.config
: Refers to fetching configuration details.--snapshot snapshot_name
: Specifies that the configuration from a specific snapshot should be retrieved.snapshot_name
corresponds to the name or ID of the desired snapshot.vm_id
: The unique identifier for the virtual machine whose snapshot configuration you wish to view.
Example Output:
balloon: 1024
bootdisk: scsi0
cores: 2
memory: 2048
name: example-vm-snapshot
net0: e1000=C0:FF:EE:C0:FF:EE,bridge=vmbr1
scsi0: local-lvm:vm-102-disk-0,size=20G
Conclusion
Using the qm config
command provides a streamlined approach to managing and reviewing the configurations of virtual machines within the Proxmox Virtual Environment. Whether you need to see pending changes, the current configuration, or details from a past snapshot, this command delivers the necessary insights to maintain and troubleshoot your virtual infrastructures effectively.