qm config (with examples)

qm config (with examples)

The qm config command in Proxmox VE is used to display the configuration of a virtual machine. It can also display the configuration with pending changes applied, or fetch the configuration values from a specific snapshot. In this article, we will explore examples of different use cases of the qm config command.

Displaying the virtual machine configuration

The basic usage of the qm config command is to display the configuration of a virtual machine. The command takes the virtual machine ID as an argument and outputs the configuration details. Here is an example:

qm config 100

In this example, we are displaying the configuration of the virtual machine with ID 100.

Motivation: Displaying the configuration of a virtual machine is useful for various administration and troubleshooting tasks. It provides important information such as the virtual hardware settings, network configurations, storage devices, and other parameters that define the behavior of the virtual machine. Explanation: The config sub-command is used to specify that we want to view the configuration. The vm_id argument is the ID of the virtual machine for which we want to display the configuration. Example output:

bootdisk: scsi0
cores: 4
memory: 4096
name: MyVM
net0: virtio=FE:A6:63:80:1B:32,bridge=vmbr0
onboot: 1
ostype: l26
scsi0: local:vm-100-disk-1,size=32G
smbios1: uuid=2c2dba1d-4bd4-4c0b-a226-3deedd63faee
sockets: 1

This output contains the configuration properties of the virtual machine with ID 100. Each line represents a configuration parameter and its corresponding value.

Displaying the current configuration values

By default, the qm config command displays the configuration with the pending changes applied. However, you can use the --current option to display the current configuration values instead. Here is an example:

qm config --current true 100

In this example, we are displaying the current configuration values for the virtual machine with ID 100.

Motivation: Sometimes, you may have made changes to the virtual machine configuration, but those changes are still pending. By using the --current option, you can view the current configuration values without the pending changes. This can be helpful for checking the current state of the virtual machine before committing the pending changes. Explanation: The --current option is used to specify that we want to display the current configuration values. The true argument is used to enable this option. The vm_id argument is the ID of the virtual machine for which we want to display the configuration. Example output:

bootdisk: scsi0
cores: 2
memory: 2048
name: MyVM
net0: virtio=FE:A6:63:B7:AB:56,bridge=vmbr0
onboot: 1
ostype: l26
scsi0: local:vm-100-disk-1,size=32G
smbios1: uuid=2c2dba1d-4bd4-4c0b-a226-3deedd63faee
sockets: 1

The output is similar to the previous example, but the values reflect the current configuration without any pending changes.

Fetching configuration from a snapshot

If you have snapshots of a virtual machine, you can use the qm config command to fetch the configuration values from a specific snapshot. This can be useful for comparing the current configuration with the configuration of a previous snapshot. Here is an example:

qm config --snapshot snapshot1 100

In this example, we are fetching the configuration values from the “snapshot1” snapshot of the virtual machine with ID 100.

Motivation: Snapshots allow you to save and restore the state of a virtual machine at a specific point in time. By fetching the configuration values from a particular snapshot, you can see the exact configuration of the virtual machine at that specific moment. This can be helpful for troubleshooting or reverting to a previous configuration. Explanation: The --snapshot option is used to specify that we want to fetch the configuration values from a snapshot. The snapshot_name argument is the name of the snapshot from which we want to fetch the configuration. The vm_id argument is the ID of the virtual machine for which we want to display the configuration. Example output:

bootdisk: ide2
cores: 2
memory: 1024
name: MyVM
net0: virtio=FE:A6:63:80:1B:32,bridge=vmbr0
onboot: 1
ostype: l26
scsi0: local:vm-100-disk-1,size=32G
smbios1: uuid=2c2dba1d-4bd4-4c0b-a226-3deedd63faee
sockets: 1

The output is similar to the previous examples, but it represents the configuration values from the “snapshot1” snapshot.

Conclusion:

In this article, we explored different use cases of the qm config command in Proxmox VE. We learned how to display the configuration of a virtual machine, display the current configuration values, and fetch the configuration from a snapshot. These examples showcase the flexibility and versatility of the qm config command, which can be utilized for various administrative tasks and troubleshooting scenarios in a Proxmox VE environment.

Related Posts

How to use the command 'git commit-tree' (with examples)

How to use the command 'git commit-tree' (with examples)

The ‘git commit-tree’ command is a low-level utility in Git that is used to create commit objects.

Read More
How to use the command 'iptables-save' (with examples)

How to use the command 'iptables-save' (with examples)

This article will illustrate the various use cases of the ‘iptables-save’ command.

Read More
Using the Chocolatey Package Manager (with examples)

Using the Chocolatey Package Manager (with examples)

Introduction Chocolatey is a popular package manager for Windows, allowing users to install, upgrade, and manage software packages easily from the command line.

Read More