Virsh attach-disk: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 8: Line 8:


==Attaching a File-Based Storage Volume==
==Attaching a File-Based Storage Volume==
Shut down the guest before attaching the disk. Note that is also possible to add the device while the guest is running, see virsh man page for more details.


The command requires at minimum the file-based storage volume path, as shown by the [[virsh vol-list]] command, and the device name under which the disk is exposed to guest, typically "vdX", where X is "a", "b", etc.
The command requires at minimum the file-based storage volume path, as shown by the [[virsh vol-list]] command, and the device name under which the disk is exposed to guest, typically "vdX", where X is "a", "b", etc.


<pre>
<pre>
virsh attach-disk testvm-01 /main-storage-pool/test-volume vdb
virsh attach-disk testvm-01 /main-storage-pool/test-volume vdb --config
</pre>
</pre>



Revision as of 20:33, 28 June 2017

Internal

Overview

Examples

Attaching a File-Based Storage Volume

Shut down the guest before attaching the disk. Note that is also possible to add the device while the guest is running, see virsh man page for more details.

The command requires at minimum the file-based storage volume path, as shown by the virsh vol-list command, and the device name under which the disk is exposed to guest, typically "vdX", where X is "a", "b", etc.

virsh attach-disk testvm-01 /main-storage-pool/test-volume vdb --config

virsh will detect malformed device names and will error out if that is the case.

Options