We moved this page to our Documentation Portal. You can find the latest updates here. |
Issue
In some cases in more recent hardware you will notice that the sector sizes of the disks are changing from 512 bytes to 4096 bytes, if you are running with shared storage presented via iSCSI or OnApp Integrated Storage. The problem is mitigated, however, customers running local storage could run into a problem when booting VMs.
Environment
All HVs on CentOS 5,6,7
Resolution
A workaround for this is to create a local iSCSI target on the hypervisor and present the disk locally with a 512 byte sector size. You should perform the following steps on each hypervisor:
1. Create the local iSCSI target.
yum install scsi-target-utils
service tgtd start
chkconfig tgtd on
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>
service tgtd restart
Check if the target is live available with tgt-admin --show
2. Discover the iSCSI target locally.
iscsiadm -m discovery -t st -p127.0.0.1
iscsiadm -m node -l
Sessions are automatically logged in at boot.
3. Filter out the main block device, so LVM only sees the iSCSI connected block.
I've added a filter line into /etc/lvm/lvm.conf:
[root@CS4761 ~]# grep filter /etc/lvm/lvm.conf | grep -v "#"
filter = [ "r|/dev/sda|" ]
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
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
The iSCSI attached 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