← 返回命令列表

Linux command

qm-unlink 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Unlink a disk from a virtual machine

qm unlink [vmid] --idlist [unused0]

Unlink a disk and force-remove it from the config

qm unlink [vmid] --idlist [scsi0] --force

Unlink multiple disks at once

qm unlink [vmid] --idlist [scsi0;scsi1]

说明

qm unlink is an alias for qm disk unlink that removes a disk from a virtual machine's configuration without deleting the underlying storage volume. The disk becomes unused but remains available in the storage for reattachment to the same or another VM. This is useful for safely detaching disks before moving them between VMs or when cleaning up a VM configuration without losing data.

参数

--idlist _string_
A semicolon-separated list of disk IDs to unlink (e.g., `unused0`, `scsi0`, `virtio1`).
--force _boolean_
Force removal. Allows removing disks that are still referenced in the VM config even if they are not marked as unused. Default: `0`.

FAQ

What is the qm-unlink command used for?

qm unlink is an alias for qm disk unlink that removes a disk from a virtual machine's configuration without deleting the underlying storage volume. The disk becomes unused but remains available in the storage for reattachment to the same or another VM. This is useful for safely detaching disks before moving them between VMs or when cleaning up a VM configuration without losing data.

How do I run a basic qm-unlink example?

Run `qm unlink [vmid] --idlist [unused0]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --idlist _string_ do in qm-unlink?

A semicolon-separated list of disk IDs to unlink (e.g., `unused0`, `scsi0`, `virtio1`).