提交 4775ca27 编写于 作者: J John Ferlan

docs: Remove unnecessary <auth> example for iscsi disk type='volume'

Alter the example to remove the <auth> from:

  <disk type='volume' device='disk'>
    <driver name='qemu' type='raw'/>
    <source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/>
    <auth username='myuser'>
      <secret type='iscsi' usage='libvirtiscsi'/>
    </auth>
    <target dev='vdb' bus='virtio'/>
  </disk>

and

  <disk type='volume' device='disk'>
    <driver name='qemu' type='raw'/>
    <source pool='iscsi-pool' volume='unit:0:0:2' mode='direct'/>
    <auth username='myuser'>
      <secret type='iscsi' usage='libvirtiscsi'/>
    </auth>
    <target dev='vdc' bus='virtio'/>
  </disk>

The reality is, it's not even used. For a <source pool> the authdef
from the storage source pool will supercede whatever is in the <disk>
definition during virStorageTranslateDiskSourcePool processing. In fact,
if the pool doesn't have/need authentication, then the authdef would
be removed anyway as the storage pool would be handling things.

The "proof" for this is in the adjustment to the test to add an
<auth> for a disk. The resulting .args file won't add what normally
would be added "myname:encodedpassword@" prior to the hostname in
the IQN (e.g. iscsi://myname:encodedpassword@iscsi.example.org:3260/...
上级 a823d0a6
...@@ -2385,17 +2385,11 @@ ...@@ -2385,17 +2385,11 @@
&lt;disk type='volume' device='disk'&gt; &lt;disk type='volume' device='disk'&gt;
&lt;driver name='qemu' type='raw'/&gt; &lt;driver name='qemu' type='raw'/&gt;
&lt;source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/&gt; &lt;source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/&gt;
&lt;auth username='myuser'&gt;
&lt;secret type='iscsi' usage='libvirtiscsi'/&gt;
&lt;/auth&gt;
&lt;target dev='vdb' bus='virtio'/&gt; &lt;target dev='vdb' bus='virtio'/&gt;
&lt;/disk&gt; &lt;/disk&gt;
&lt;disk type='volume' device='disk'&gt; &lt;disk type='volume' device='disk'&gt;
&lt;driver name='qemu' type='raw'/&gt; &lt;driver name='qemu' type='raw'/&gt;
&lt;source pool='iscsi-pool' volume='unit:0:0:2' mode='direct'/&gt; &lt;source pool='iscsi-pool' volume='unit:0:0:2' mode='direct'/&gt;
&lt;auth username='myuser'&gt;
&lt;secret type='iscsi' usage='libvirtiscsi'/&gt;
&lt;/auth&gt;
&lt;target dev='vdc' bus='virtio'/&gt; &lt;target dev='vdc' bus='virtio'/&gt;
&lt;/disk&gt; &lt;/disk&gt;
&lt;disk type='file' device='disk'&gt; &lt;disk type='file' device='disk'&gt;
......
...@@ -28,4 +28,7 @@ id=drive-ide0-0-2,readonly=on \ ...@@ -28,4 +28,7 @@ id=drive-ide0-0-2,readonly=on \
-device ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 \ -device ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 \
-drive file=/tmp/idedisk.img,format=raw,if=none,id=drive-ide0-0-3 \ -drive file=/tmp/idedisk.img,format=raw,if=none,id=drive-ide0-0-3 \
-device ide-drive,bus=ide.0,unit=3,drive=drive-ide0-0-3,id=ide0-0-3 \ -device ide-drive,bus=ide.0,unit=3,drive=drive-ide0-0-3,id=ide0-0-3 \
-drive file=iscsi://iscsi.example.com:3260/demo-target/3,if=none,media=cdrom,\
id=drive-ide0-0-4,readonly=on \
-device ide-drive,bus=ide.0,unit=4,drive=drive-ide0-0-4,id=ide0-0-4 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
...@@ -39,6 +39,19 @@ ...@@ -39,6 +39,19 @@
<target dev='hdc' bus='ide'/> <target dev='hdc' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='3'/> <address type='drive' controller='0' bus='0' target='0' unit='3'/>
</disk> </disk>
<disk type='volume' device='cdrom'>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
</auth>
<source pool='pool-iscsi' volume='unit:0:0:3' mode='direct'>
<seclabel model='selinux' relabel='yes'>
<label>system_u:system_r:public_content_t:s0</label>
</seclabel>
</source>
<target dev='hdd' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</disk>
<controller type='usb' index='0'/> <controller type='usb' index='0'/>
<controller type='ide' index='0'/> <controller type='ide' index='0'/>
<controller type='pci' index='0' model='pci-root'/> <controller type='pci' index='0' model='pci-root'/>
......
...@@ -39,6 +39,19 @@ ...@@ -39,6 +39,19 @@
<target dev='hdc' bus='ide'/> <target dev='hdc' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='3'/> <address type='drive' controller='0' bus='0' target='0' unit='3'/>
</disk> </disk>
<disk type='volume' device='cdrom'>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
</auth>
<source pool='pool-iscsi' volume='unit:0:0:3' mode='direct'>
<seclabel model='selinux' relabel='yes'>
<label>system_u:system_r:public_content_t:s0</label>
</seclabel>
</source>
<target dev='hdd' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</disk>
<controller type='usb' index='0'> <controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller> </controller>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册