qm-move-disk
Move a virtual machine disk image
TLDR
View documentation for the original command
SYNOPSIS
qm move-disk <vmid> <disk> <storage> [OPTIONS]
PARAMETERS
vmid
The ID of the virtual machine or container whose disk is to be moved.
disk
The identifier of the disk to move. This can be a device name (e.g., scsi0, ide0, virtio0) or the full disk path (e.g., vm-100-disk-0).
storage
The ID of the target storage to which the disk will be moved.
--delete <boolean>
If set to true, the original disk will be automatically deleted from its source storage after a successful move operation. Default is false.
--format <string>
Specifies the desired disk format for the new disk on the target storage (e.g., raw, qcow2, vmdk). If not specified, the original format is maintained if supported by the target storage, or a default is chosen.
--node <string>
Specifies the target node in a Proxmox cluster where the disk should be moved to. Useful when moving disks between nodes while staying on the same storage type (e.g., shared storage).
--sparse <boolean>
If set to true, enables sparse allocation for the new disk on the target storage, meaning only used blocks are allocated, which can save storage space. This is mainly applicable to qcow2 and raw formats. Default is false.
--target-disk <string>
Specifies a new disk ID for the moved disk on the target VM (e.g., scsi1 instead of scsi0). If not specified, the original disk ID is used.
--target-storage <string>
An alias for the main <storage> argument.
--skip-latest-backup <boolean>
If set to true, skips the check for the latest backup before moving the disk. Use with caution as this may bypass important data integrity checks.
DESCRIPTION
The qm-move-disk command is a subcommand of qm, the Proxmox VE (Virtual Environment) virtual machine management tool. It is designed to migrate virtual machine or container disks from one storage location to another within a Proxmox VE cluster or on a standalone node. This command is essential for optimizing storage utilization, improving VM performance by moving to faster storage, or consolidating disks. It handles the complete process of copying the disk data to the target storage, updating the VM's configuration to point to the new disk location, and optionally deleting the original disk. Additionally, qm-move-disk can perform disk format conversions during the migration, such as converting from raw to qcow2.
CAVEATS
- The virtual machine or container must be stopped for a clean and safe disk move operation, especially for attached disks that are actively in use (e.g., system disks). Moving a live attached disk can lead to data corruption or inconsistencies.
- Ensure the target storage has sufficient free space for the new disk.
- Disk format conversion and data copying can be a time-consuming process, depending on the disk size, network bandwidth, and I/O performance of the storage systems.
- Using the --delete option is irreversible. Always verify that the disk move was successful before deleting the original disk, especially if not using this option and performing manual cleanup.
OFFLINE OPERATION STRONGLY RECOMMENDED
For maximum data integrity and to prevent corruption, it is highly recommended to shut down the virtual machine or container before attempting to move its disks using qm-move-disk. This ensures that no data is being written to the disk during the migration process, guaranteeing a consistent copy.
SUPPORT FOR VARIOUS STORAGE TYPES
The qm-move-disk command is compatible with a wide range of Proxmox storage types, including but not limited to LVM, LVM-Thin, ZFS, directory-based storage, CephFS, NFS, and iSCSI. The specific features available, such as format conversion or sparse allocation, may depend on the capabilities of both the source and target storage systems.
HISTORY
qm-move-disk is a crucial subcommand within the Proxmox VE software suite, which has been under continuous development since its initial release in 2008. As Proxmox VE evolved to support diverse storage backends and advanced clustering features, the qm command and its disk management functionalities, including move-disk, have been steadily refined. This evolution addresses the growing need for dynamic and flexible storage reconfiguration, performance optimization, and robust data management in modern virtualized environments.