How to use the command `qm import disk` (with examples)
- Linux
- December 25, 2023
The qm import disk
command is an alias of the original command qm disk import
. This command is used to import a disk image into a Proxmox VM.
Use case 1: Importing a disk image into a Proxmox VM
Code:
qm import disk <vmid> <storage> <filename> [--format raw|qcow2|vmdk] [--discard 0|1] [--backingstore 0|1] [--password]
Motivation: This use case is helpful when you want to import a disk image into a Proxmox virtual machine.
Explanation:
<vmid>
: The ID of the Proxmox VM where the disk image will be imported.<storage>
: The storage where the disk image will be stored.<filename>
: The name of the disk image file that will be imported.--format
: The format of the disk image. It can beraw
,qcow2
, orvmdk
. This argument is optional, and if not specified, the format will be determined automatically.--discard
: Enable or disable discard (TRIM) on the imported image. It can be0
or1
. This argument is optional.--backingstore
: Enable or disable backing store on the imported image. It can be0
or1
. This argument is optional.--password
: Ask for the password to encrypt the new disk image. This argument is optional.
Example output:
# qm import disk 100 local: 100-disk.qcow2
The above command imports the 100-disk.qcow2
disk image into the Proxmox VM with ID 100
and stores it in the local storage.
Use case 2: Viewing the documentation for the original command
Code:
tldr qm disk import
Motivation: This use case allows you to quickly view the documentation for the qm disk import
command to familiarize yourself with its usage.
Example output:
qm import disk
Import a disk image into a VM.
Note: This command is an alias of 'qm disk import'.
The output provides a brief description of the command and mentions that it is an alias of qm disk import
. This information can be useful when you want to learn more about the command and its usage.
Conclusion:
The qm import disk
command provides a convenient way to import a disk image into a Proxmox virtual machine. It offers various options to specify the format, enable or disable discard and backing store, and even encrypt the new disk image with a password. Additionally, you can refer to the documentation of the original command qm disk import
using the tldr
command to quickly understand its usage.