Issue


In some cases, in more recent hardware, you may have noticed that the sector size of a disk is changing from 512 bytes to 4096 bytes when running with shared storage presented via iSCSI or OnApp Integrated Storage. The issue has been mitigated, however, customers running local storage could face some issues when booting virtual servers.

Environment


All compute resources on CentOS 5, 6, 7 


Resolution


As a workaround, create a local iSCSI target on the compute resource and present the disk locally with a 512-byte sector size. Perform the following steps on each compute resource:

  1. Create a local iSCSI target:

    yum install scsi-target-utils
    service tgtd start
    chkconfig tgtd on
    CODE
  2. Add config to cat /etc/tgt/targets.conf:

    <target iqn.2015-06.com.example.local:target1>
    backing-store /dev/sdX
    initiator-address 127.0.0.1
    </target>
    CODE
    service tgtd restart
    CODE
  3. Check if the target is available with tgt-admin --show.

  4. Discover the iSCSI target locally:

    iscsiadm -m discovery -t st -p127.0.0.1
    iscsiadm -m node -l
    CODE

    Sessions are automatically logged in when booting.


  5. Filter out the main block device, so that LVM only sees the iSCSI connected block. For example, add a filter line into /etc/lvm/lvm.conf:

    [root@CS4761 ~]# grep filter /etc/lvm/lvm.conf | grep -v "#"
     filter = [ "r|/dev/sda|" ]
    CODE

    If you've already created the LVM physical device and volume group, it should now be visible only on the iSCSI attached block device:

    [root@CS4761 ~]# pvscan
    PV /dev/sdc VG onapp-rzyaaqlqlcsmal lvm2 [10.91 TiB / 10.90 TiB free]
    Total: 1 [10.91 TiB] / in use: 1 [10.91 TiB] / in no VG: 0 [0 ]
    
    [root@CS4761 ~]# iscsiadm -m session -P3 | grep Attached
    Attached SCSI devices:
    Attached scsi disk sdc State: running
    CODE

    The real block device:

    [root@CS4761 ~]# fdisk -l /dev/sda
    
    Disk /dev/sda: 12000.0 GB, 11999968755712 bytes, 2929679872 sectors
    Units = sectors of 1 * 4096 = 4096 bytes
    Sector size (logical/physical): 4096 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    CODE

    The attached iSCSI block device:

    [root@CS4761 ~]# fdisk -l /dev/sdc
    
    Disk /dev/sdc: 12000.0 GB, 11999968755712 bytes, 23437438976 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    CODE