How to use the command 'qm disk move' (with examples)

How to use the command 'qm disk move' (with examples)

The ‘qm disk move’ command is used to move a virtual disk from one storage to another within the same Proxmox cluster. It is a useful command for managing the storage of virtual disks in a Proxmox environment.

Use case 1: Move a virtual disk

Code:

qm disk move vm_id destination index

Motivation: One common use case for the ‘qm disk move’ command is when you want to move a virtual disk from one storage to another within the same Proxmox cluster. This may be necessary to optimize storage utilization or to distribute the load on different storage devices.

Explanation:

  • ‘qm disk move’ is the command itself.
  • ‘vm_id’ is the ID of the virtual machine from which you want to move the disk.
  • ‘destination’ is the name of the storage where the disk should be moved to.
  • ‘index’ is the index or ID of the disk you want to move.

Example output:

# qm disk move 100 local-lvm 0
disk move 'local:vm-100-disk-0' -> 'local-lvm:vm-100-disk-0'

Use case 2: Delete the previous copy of the virtual disk

Code:

qm disk move -delete vm_id destination index

Motivation: In some cases, you may want to delete the previous copy of the virtual disk after moving it to a new storage within the Proxmox cluster. This can help to free up storage space and avoid duplication of data.

Explanation:

  • ‘qm disk move’ is the command itself.
  • ‘-delete’ is an optional argument that tells the command to delete the previous copy of the virtual disk.
  • ‘vm_id’ is the ID of the virtual machine from which you want to move the disk.
  • ‘destination’ is the name of the storage where the disk should be moved to.
  • ‘index’ is the index or ID of the disk you want to move.

Example output:

# qm disk move -delete 100 local-lvm 0
disk move 'local:vm-100-disk-0' -> 'local-lvm:vm-100-disk-0' (delete)

Conclusion:

The ‘qm disk move’ command is a versatile tool for managing virtual disk storage within a Proxmox cluster. It allows users to easily move virtual disks from one storage to another and optionally delete the previous copy of the disk. This can help optimize storage utilization and improve the overall performance of virtual machines.

Related Posts

How to use the command "input" (with examples)

How to use the command "input" (with examples)

The “input” command is used to send event codes or touchscreen gestures to an Android device.

Read More
AWS Glue CLI Examples (with examples)

AWS Glue CLI Examples (with examples)

List jobs aws glue list-jobs Motivation: The list-jobs command allows you to retrieve a list of jobs in your AWS Glue environment.

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

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

The chflags command in macOS is used to change the file or directory flags.

Read More