On Tue, Aug 12, 2008 at 10:25:34PM +1200, james wrote: > > On 11/08/2008, at 8:42 PM, Daniel P. Berrange wrote: > >Configuring SCSI disks with VMs in libvirt is no different to > >configuring > >any other kind of block based storage. The general description is > >here: > > > > http://libvirt.org/formatdomain.html#elementsDisks > > > >Specifically though you'd want a disk section looking like > > > > <disk type='block'> > > <source file='/dev/sdf1'/> > > <target dev='sda' bus='scsi'/> > > </disk> > > > >NB, there is no restriction on mapping to the target bus -ie a SCSI > >disk in > >the host can be mapped to a IDE disk in the guest, and vica-verca. > >Also > >note that the 'dev' attribute on the target isn't a guarenteed > >device name > >in the guest - it is merely used for ordering of devices when > >spawning QEMU. > > > >Now, the main fun you'll have is actually outside of libvirt - > >namely that > >on Linux SCSI disk names are not guarenteed stable across reboots. So > >rather than using /dev/sdf1 you may want to consider one of the udev > >created > >stable paths under the directories /dev/disk/by-{id,path,uuid}, or > >if you are > >using a multipath enabled SAN, then a name under /dev/multipath/XXXX > > > >Regards, > >Daniel > > To be clear I have not tried to use block devices but 5 image files as > I am experimenting. I have tried to create VMs using raw image files > under libvirt via the nice Virtual Machine Manager 0.5.3 and through > hand crafted xml files. Neither method will register the images as > scsi disks, it fails with an error. Getting the same disk images to be > regarded as scsi disks via the kvm command line is fine or if I fall > back to ide and limit. The ide test proves that the rest of the xml > file is correct. > > Trying to define a domain using virsh using a disk section defined as: > > <disk type='file' device='disk'> > <source file='/home/someuser/scsi-test/scsi-disk1.img'/> > <target dev='sda' bus='scsi'/> > </disk> > > fails with this error: > libvir: QEMU error : Invalid harddisk device name: sda
Oh, that means the version of libvirt you are using is too old - it predates us adding support for the -drive argument, which is required in order to use SCSI disks. THis was added in libvirt 0.4.3 Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
