-----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 at sandi:~# virsh pool-autostart equalog
Pool equalog marked as autostarted
root at 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 ?
My environement :
Debian Squeeze 64 bits
root at sandi:~# virsh -v
0.7.6
root at sandi:~# /usr/sbin/libvirtd --version
/usr/sbin/libvirtd (libvirt) 0.7.6
Thanks for your attention,
- --
Nicolas Greneche - RSSI et Sysadmin
Centre de Ressources Informatiques (CRI)
Doctorant au sein du projet SDS - www.sds-project.fr
Mail : nicolas.greneche_(at)_univ-orleans.fr
GPG : http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x5FEBD0EF
Universite d'Orleans Web : http://blog.garnett.fr
Batiment 3IA - 2e etage Tel : 02 38 49 25 26
6 rue Leonard de Vinci
BP 6102 45061 ORLEANS Cedex 2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkugsQsACgkQTx/Y+1/r0O90NACeMvgK2mA4EUaB+JzA7v6+xQxO
jNsAmwSIh428gtZRa2jVkekyYBTpVVJK
=ltP0
-----END PGP SIGNATURE-----
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 at sandi:~# virsh pool-autostart equalog > Pool equalog marked as autostarted > > root at 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