Installation guide

iSCSI-based storage pools
231
<device path='iqn.2010-05.com.example.server1:trial1'/>
The device element path attribute must contain the IQN for the iSCSI server.
With a text editor, create an XML file for the iSCSI storage pool. This example uses a XML
definition named trial1.xml.
<pool type='iscsi'>
<name>trial1</name>
<uuid>afcc5367-6770-e151-bcb3-847bc36c5e28</uuid>
<source>
<host name='server1.example.com'/>
<device path='iqn.2010-05.com.example.server1:trial1'/>
</source>
<target>
<path>/dev/disk/by-path</path>
</target>
</pool>
Use the pool-define command to define the storage pool but not start it.
# virsh pool-define trial1.xml
Pool trial1 defined
2. Alternative step: Use pool-define-as to define the pool from the command line
Storage pool definitions can be created with the virsh command line tool. Creating storage pools
with virsh is useful for systems administrators using scripts to create multiple storage pools.
The virsh pool-define-as command has several parameters which are accepted in the
following format:
virsh pool-define-as name type source-host source-path source-dev source-name target
The type, iscsi, defines this pool as an iSCSI based storage pool. The name parameter must
be unique and sets the name for the storage pool. The source-host and source-path
parameters are the hostname and iSCSI IQN respectively. The source-dev and source-name
parameters are not required for iSCSI-based pools, use a - character to leave the field blank. The
target parameter defines the location for mounting the iSCSI device on the host.
The example below creates the same iSCSI-based storage pool as the previous step.
# virsh pool-define-as trial1 iscsi server1.example.com
iqn.2010-05.com.example.server1:trial1 - - /dev/disk/by-path
Pool trial1 defined
3. Verify the storage pool is listed
Verify the storage pool object is created correctly and the state reports as inactive.
# virsh pool-list --all
Name State Autostart
-----------------------------------------
default active yes
trial1 inactive no