|
Configure exclusive block level access with iSCSI on Linux CentOS
iSCSI is used to give exclusive block level controlled disk to a server. The server’s operating system sees the remote disk as if it were local. To configure iSCSI on MS Windows, go to this page.
Add a disk do your account and allow your server to access it.
Using nscmd Command Line Tool:
- nscmd addDisk 250GB (note the diskId, diskIpAddress, and initiatorName)
- nscmd enableDiskService [diskId] iscsi
- nscmd grantDiskAccess [diskId] [diskIpAddress]
From the NewServers™ API:
- https://noc.newservers.com/api/addDisk?username=you&password=yourpass&size=250(note the id, disk-ip-address, and initiator-name)
- https://noc.newservers.com/api/enableDiskIscsi?username=you&password=yourpass&diskId=[id]&service=iscsi
- https://noc.newservers.com/api/grantDiskAccess?username=you&password=yourpass&diskId=[id]&address=[serverIpAddress](serverIpAddress is the ip of the server you wish to allow connection to the disk)
From your NOC account:
- Login
- Go to 'Storage' and click on 'Add Dedicated Disk' or 'Add SAN Volume'. Choose the size and click on 'Add now'.
- Under 'Active Disk List' click on the newly added disk. Note the Disk Ip Address, and Initiator Name. Set the IP address that will be allowed to access the disk using the drop down menu or enter it manually. Check 'Enable iSCSI'. Click 'Save'.
Setup disk on server Instructions (Centos 5.5):
- Install initiator utils.
yum install iscsi-initiator-utils
- Edit /etc/iscsi/iscsid.conf and uncomment the line "#isns.address = 192.168.0.1" by removing the # and set the ip address to the diskIpAddress. Save the changes.
isns.address = [diskIpAddress]
- Start iscsid and iscsi.
/etc/init.d/iscsid start
/etc/init.d/iscsi start
- Edit /etc/iscsi/initiatorname.iscsi and set the initiatorName of your disk.
InitiatorName=[initiatorName]
- Discover the devices.
iscsiadm -m discovery -t sendtargets -p [ipAddress]
- Restart iscsi service.
/etc/init.d/iscsi restart
- Check to see if the new device is present. If the server has just one physical disk (/dev/sda) then the first iscsi disk will be /dev/sdb. The following command will show the local and iscsi disks visible to the operating system.
fdisk -l
- Format the disk, create the directory and label for the disk.
mkfs.ext3 /dev/sdb
mkdir /mynewdisk
e2label /dev/sdb1 /mynewdisk
- Set your server to Mount the disk on bootup. Edit /etc/fstab and add the line below.
LABEL=/mynewdisk /mynewdisk ext3 defaults 0 0
- Mount the disk.
mount /mynewdisk
|