RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1188463 - When define/create two iscsi pools (one with IPv4 and the other with IPv6) libvirt doesn't check if their ipv4 and ipv6 addresses pointing to the same target.
Summary: When define/create two iscsi pools (one with IPv4 and the other with IPv6) l...
Keywords:
Status: CLOSED DUPLICATE of bug 1171984
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-03 00:40 UTC by yisun
Modified: 2015-05-12 20:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-12 20:25:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yisun 2015-02-03 00:40:31 UTC
Description:
When define/create two iscsi pools (one with IPv4 and the other with IPv6) libvirt doesn't check if their ipv4 and ipv6 addresses pointing to the same target. 


Version-Release number of selected component (if applicable):
kernel-3.10.0-227.el7.x86_64
libvirt-1.2.8-16.el7.x86_64
qemu-kvm-rhev-2.1.2-23.el7.x86_64



How reproducible:
100%
steps:1
1. Prepare two hosts
    host A is iscsi target with IPv4 = 10.66.4.203
    host B is iscsi client with IPv4 = 10.66.4.206
 
2. On host A:
    2.1. Setup ipv6
#ifconfig eth0 inet6 add 3ffe::103/64        <== change eth0 to your working nic
     
    2.2 create image
#qemu-img create /home/disk1.img 10G
     
    2.3 modify iscsi target config file
#cat /etc/tgt/targets.conf
....
      <target lento.work.com:iscsi_enc>
           backing-store /home/disk1.img
      </target>
....
    
    2.4 restart tgt service
#service tgtd restart

3. On host B:
    3.1 setup ipv6
#ifconfig eth0 inet6 add 3ffe::104/64        <== change eth0 to your working nic
     
    3.2 Discover iscsi targets on host A
 # iscsiadm -t sendtargets -m discovery -p 10.66.4.203
         10.66.4.203:3260,1 lento.work.com:iscsi_enc
    
    3.3 prepare two pool xml files, one with host A's ipv4, the other with ipv6
#cat iscsi_pool_ipv4.xml
        <pool type='iscsi'>
          <name>iscsipool_ipv4</name>
          <uuid>b0eaf2c1-c239-1234-ba98-8ddf19f81234</uuid>
          <capacity unit='bytes'>4294967296</capacity>
          <allocation unit='bytes'>4294967296</allocation>
          <available unit='bytes'>0</available>
          <source>
            <host name='10.66.4.203' port='3260'/>
            <device path='lento.work.com:iscsi_enc'/>
          </source>
          <target>
            <path>/dev/disk/by-path</path>
            <permissions>
              <mode>0755</mode>
              <owner>0</owner>
              <group>0</group>
            </permissions>
          </target>
        </pool>
#cat iscsi_pool_ipv6.xml
        <pool type='iscsi'>
          <name>iscsipool_ipv6</name>
          <uuid>b0edf2c1-c239-4294-ba98-855f19f8bdd1</uuid>
          <capacity unit='bytes'>4294967296</capacity>
          <allocation unit='bytes'>4294967296</allocation>
          <available unit='bytes'>0</available>
          <source>
            <host name='3ffe::103' port='3260'/>
            <device path='lento.work.com:iscsi_enc'/>
          </source>
          <target>
            <path>/dev/disk/by-path</path>
            <permissions>
              <mode>0755</mode>
              <owner>0</owner>
              <group>0</group>
            </permissions>
          </target>
        </pool>

    3.4 Create pools from these xml files. 
# virsh pool-create iscsi_pool_ipv4.xml
Pool iscsipool_ipv4 created from iscsi_pool_ipv4.xml
# virsh pool-create iscsi_pool_ipv6.xml
Pool iscsdipool_ipv6 created from iscsi_pool_ipv6.xml
  
    3.5 Pools created successfully
# virsh pool-list
 Name                 State      Autostart
-------------------------------------------
 iscsipool_ipv6      active     no        
 iscsipool_ipv4       active     no 
 
    3.6 Check the pools vol-list info, they all have the same volume.
# virsh vol-list iscsipool_ipv6
 Name                 Path                                    
------------------------------------------------------------------------------
 unit:0:0:1           /dev/disk/by-path/ip-10.66.4.203:3260-iscsi-lento.work.com:iscsi_enc-lun-1

# virsh vol-list iscsipool_ipv4
 Name                 Path                                    
------------------------------------------------------------------------------
 unit:0:0:1           /dev/disk/by-path/ip-10.66.4.203:3260-iscsi-lento.work.com:iscsi_enc-lun-1

    3.7 Destroy these two pools
# virsh pool-destroy iscsipool_ipv4
Pool iscsipool_ipv4 destroyed

# virsh pool-destroy iscsipool_ipv6
error: Failed to destroy pool iscsdipool_ipv6
error: internal error: Child process (iscsiadm --mode node --portal '[3ffe::103]:3260,1' --targetname lento.work.com:iscsi_enc --logout) unexpected exit status 21: 2015-02-02 09:55:51.497+0000: 7101: debug : virFileClose:99 : Closed fd 26
2015-02-02 09:55:51.497+0000: 7101: debug : virFileClose:99 : Closed fd 28
2015-02-02 09:55:51.497+0000: 7101: debug : virFileClose:99 : Closed fd 23
iscsiadm: No matching sessions found


Expected Result:
The second pool creation/definition should be forbidden. 


Actually Result:
Both pools could be created/defined. This causes only one pool could be destroyed, to destroy the second pool will be failed. Workaround  is manually  "#iscsiadm --mode node --portal '[3ffe::103]:3260,1' --targetname lento.work.com:iscsi_enc --login", then the pool-destroy will take effect.


Additional Info:
According to bug https://bugzilla.redhat.com/show_bug.cgi?id=817219 It's not allowed to define two pools with one iscsi target. So we may need to check if the IPv4 and IPv6 pointing to the same host and forbid the second binding.

Comment 1 John Ferlan 2015-05-12 20:25:22 UTC

*** This bug has been marked as a duplicate of bug 1171984 ***


Note You need to log in before you can comment on or make changes to this bug.