Sun, 16 Mar 2014

Attaching a new disk to a running VM

Just for my own memory (attaching 400G to vm named git0):

pool-define-as hdd --type dir --target /mnt/libvirt
pool-start hdd
pool-autostart hdd
vol-create-as hdd gitdisk 400G
attach-disk git0 /mnt/libvirt/gitdisk vdb --persistent --driver qemu --subdriver qcow2

The driver and subdriver options are essential. Otherwise the disk is attached as raw disk and the guest will only see several kilobytes (kb) of disk not the full 400G.

posted at 23:00 | path: /vm | permanent link to this entry

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.