Mauricio Tavares
2012-Jul-10 11:18 UTC
[libvirt-users] Adding a second lv as vm drive: how to set the pci part
Let's say I have a vm, vm1, which has a lv as its hard drive: <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none' io='native'/> <source file='/dev/mapper/kvmtest_vm1_rootvg'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> I could add pickles as a second drive as follows: <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none' io='native'/> <source file='/dev/mapper/kvmtest_pickles'/> <target dev='vdb' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> but I am trying to understand the pci address entry. Must drive be on a different slot?
Eric Blake
2012-Jul-10 13:00 UTC
[libvirt-users] Adding a second lv as vm drive: how to set the pci part
On 07/10/2012 05:18 AM, Mauricio Tavares wrote:> Let's say I have a vm, vm1, which has a lv as its hard drive: > > <disk type='file' device='disk'> > <driver name='qemu' type='raw' cache='none' io='native'/> > <source file='/dev/mapper/kvmtest_vm1_rootvg'/> > <target dev='vda' bus='virtio'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x04' > function='0x0'/> > </disk> > > I could add pickles as a second drive as follows: > > <disk type='file' device='disk'> > <driver name='qemu' type='raw' cache='none' io='native'/> > <source file='/dev/mapper/kvmtest_pickles'/> > <target dev='vdb' bus='virtio'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x06' > function='0x0'/> > </disk> > > but I am trying to understand the pci address entry. Must drive be on > a different slot?The easiest way to do this is to omit the <address> line entirely when adding the drive, and let libvirt auto-generate the next available address on your behalf. The <address> element exists to say what libvirt chose, so that future migration of the domain (including if you upgrade to newer qemu with different allocation patterns, which has happened in the past) will still preserve the allocation pattern that you used at the time you originally added the disk. But unless you specifically care where the guest sees the disk, then letting libvirt auto-allocate is good enough. -- Eric Blake eblake at redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 620 bytes Desc: OpenPGP digital signature URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120710/8e53ac7f/attachment.sig>
Possibly Parallel Threads
- ssh 6.6.1, PubkeyAcceptedKeyTypes
- Snapshot without volumes temporarily
- Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: 26.
- Re: Detach disk from VM - virsh (working) vs. PHP (not working)
- Re: Memory corruption when testing nbdkit python plugin with nbd-tester-client?