-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dave Allan wrote:
On 03/17/2010 06:38 AM, Nicolas Greneche wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Former user of Xen and newbie in kvm/qemu/libvirt stuff, I give it a try
> on my network ;-)
>
> I need to run a VM with iSCSI target attached.
>
> I did it this way :
>
> 1) Creation of iscsi pool (equa.xml) :
>
> <pool type="iscsi">
> <name>equalog</name>
> <source>
> <host name="10.10.0.1"/>
> <device
>
path="iqn.2001-05.com.equallogic:0-8a0906-4992c7f05-39c000000114b8fc-vglog"/>
>
> </source>
> <target>
> <path>/dev/disk/by-path</path>
> </target>
> </pool>
>
> This pool start smoothly (when open-iscsi started), no problems. An
> entry is created in /dev/disk/by-path/ related to iscsi target.
>
> 2) I flagged it autostart :
>
> root@sandi:~# virsh pool-autostart equalog
> Pool equalog marked as autostarted
>
> root@sandi:~# virsh pool-list
> Name State Autostart
> - -----------------------------------------
> equalog active yes
>
> 3) In my guest VM, I have following section :
>
> <disk type='block' device='disk'>
> <driver name='qemu'/>
> <source
>
dev='/dev/disk/by-path/ip-10.10.0.1:3260-iscsi-iqn.2001-05.com.equallogic:0-8a0906-4992c7f05-39c000000114b8fc-vglog-lun-0'/>
>
> <target dev='vdc' bus='virtio'/>
> <alias name='virtio2'/>
> <address type='pci' domain='0x0000' bus='0x00'
slot='0x06'
> function='0x0'/>
> </disk>
>
> When I start VM, iscsi target is availaible.
>
> The snag is that when I reboot the host, the pool is not automatically
> started (making it impossible to autostart VM relying on this iscsi
> volume).
>
> I verified that open-iscsi is started first. Startup script is localised
> in /etc/rcS.d which is prior to /etc/rc2.d (my default runlevel).
> Libvirtd is started in rc2.d and not mentionned in rcS.d.
>
> My questions are :
> - - Is this the correct way to attach iscsi volume to a guest ?
> - - Did I missed something to have iscsi pool autostart working at boot
> time ?
You're doing everything right, so it's odd that the pool isn't
autostarting. Does the pool autostart properly if you restart libvirtd
when the system is fully booted?
Dave
Yes it works with a libvirtd reboot on a fully booted system. I
submitted a bug to the maintainer of the libvirt-bin Debian package.
It's very odd because libvirtd starts very late in booting process.
root@sandi:~# ls /etc/rc2.d --format=single-column
README
S01qemu-kvm
S14portmap
S15nfs-common
S17rsyslog
S17sudo
S18acpid
S18atd
S18cron
S18dbus
S18exim4
S18postfix
S18ssh
S20bootlogs
S20libvirt-bin
S21rc.local
S21rmnologin
S21stop-bootlogd
Nicolas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iEYEARECAAYFAkug+UMACgkQTx/Y+1/r0O/OvACgiojSVOovS773cWAM3sKPh4xF
AScAn0eBYiAY1KZKsoD2gFt4CpskpMie
=QoDT
-----END PGP SIGNATURE-----