Tuesday, May 18, 2010

add a physical block device to virtualized guest in KVM or XEN

1. Physically attach the hard disk device to the host. Configure the host if the drive is not accessible by default.
2. Configure the device with multipath and persistence on the host if required.
3. Use the virsh attach command. Replace: myguest with your guest's name, /dev/hdb1 with the device to add, and hdc with the location for the device on the guest. The hdc must be an unused device name.

# virsh attach-disk myguest /dev/hdb1 hdc --driver tap --mode readonly

4. The guest now has a new hard disk device called /dev/hdb on Linux. This device may require formatting.

No comments:

Post a Comment