Skip to main content

How to create Storage array for iscsi disk on a linux machine

 Use Case:

I have to create a KVM cluster using GFS Datastore.


#Create a Ubuntu Linux to act as storage server array:

# Make sure the system have enough resources(Storage,MEM&CPU)

#Install TargetCLI tool:  

     apt install targetcli-fb -y

#Create LUN:

 mkdir -p /iscsi_disks

 fallocate -l 600G /iscsi_disks/disk01.img

 targetcli 

     /backstores/fileio create disk01 /iscsi_disks/disk01.img 600G

     /iscsi create iqn.2025-01.com.example:storage1

     /iscsi/iqn.2025-01.com.example:storage1/tpg1/luns create /backstores/fileio/disk01

     /iscsi/iqn.2025-01.com.example:storage1/tpg1/acls create iqn.2025-01.com.example:client1

     /iscsi/iqn.2025-01.com.example:storage1/tpg1/acls create iqn.2025-01.com.example:client2

    /iscsi/iqn.2025-01.com.example:storage1/tpg1/acls create iqn.2025-01.com.example:client3


#Allow all network to access this LUN:

    cd /iscsi/iqn.2025-01.com.example:storage1/tpg1/portals

    create 0.0.0.0

#enable target service:

    systemctl enable --now target


#on host1:

    echo "InitiatorName=iqn.2025-01.com.example:client1" | sudo tee /etc/iscsi/initiatorname.iscsi

    systemctl restart open-iscsi

#on host2:

    echo "InitiatorName=iqn.2025-01.com.example:client2" | sudo tee /etc/iscsi/initiatorname.iscsi

    systemctl restart open-iscsi

#on host 3:

    echo "InitiatorName=iqn.2025-01.com.example:client3" | sudo tee /etc/iscsi/initiatorname.iscsi

    systemctl restart open-iscsi


#scan target lun on each hosts:

    iscsiadm -m discovery -t sendtargets -p <Storage_IP>

  #login from each hosts

   iscsiadm -m node -p <storage_IP> --login

    #verify new lun:

     lsblk

#To make the iscsi login permanent after reboots: on all hosts:

iscsiadm -m node -T iqn.2025-01.com.example:storage1 -p <Storage_IP>--op update -n node.startup -v automatic

Comments

Popular posts from this blog

How to Open KVM oVirt Virtual machine console from windows

  To open virtual machine console from ovirt manager (KVM) 1. Download and Install ovirt-viewer from the below link:     https://virt-manager.org/download 2.From browser open ovirt engine and login to administrator portal 3.Right click the virtual machine and choose "Console" 4.Console file be getting created on your windows->downloads 5.Right click the file ->Properties and change the file "Opens With:" as a new program and browse till c:\program files->ovirt-viewer-> "Remote-Viewer" type 5.Now double click on the "Console.vv" file will open the console:

Deploy OVF fails Issues detected with selected template. Details: VALUE_ILLEGAL: No supported hardware versions among [virtualbox-2.2]; supported: [vmx-04, vmx-07, vmx-08, vmx-09, vmx-10, vmx-11, vmx-12, vmx-13, vmx-14, vmx-15, vmx-16, vmx-17, vmx-18, vmx-19].

 Error: While deploy using OVF file ,getting error as : Issues detected with selected template. Details: - -1:-1:VALUE_ILLEGAL: No supported hardware versions among [virtualbox-2.2]; supported: [vmx-04, vmx-07, vmx-08, vmx-09, vmx-10, vmx-11, vmx-12, vmx-13, vmx-14, vmx-15, vmx-16, vmx-17, vmx-18, vmx-19]. Solution: Open .OVF file and edit       <Info>Virtual hardware requirements for a virtual machine</Info>       <System>         <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>         <vssd:InstanceID>0</vssd:InstanceID>         <vssd:VirtualSystemIdentifier>zabbix_appliance-6.2.7</vssd:VirtualSystemIdentifier>         <vssd:VirtualSystemType> virtualbox-2.2 </vssd:VirtualSystemType>       </System> to  vmx-19       <Info>Virtual hardware requireme...

HPE Morpheus UI loading hangs

  Error: After Morpheus installation, the UI hangs, saying loading. Solution: edit /etc/morpheus/morpheus.rb file and mark below parameter as "false" ui['morpheus_hub_enabled'] = false   Then run the below command to reconfigure: morpheus-ctl stop morpheus-ui morpheus-ctl reconfigure morpheus-ctl start morpheus-ui