Iscsi Target For Mac

For
  1. Kernsafe Iscsi Initiator
  2. Iscsi Target Virtual Machine
  3. Linux Iscsi Target Server
  4. Globalsan Iscsi Initiator
  5. Iscsi Target Mac Os X

Setting up an iSCSI Target on a Synology NAS

  • It is the beauty and downfall of iSCSI. This is a relatively new technology. The fact that the only real option for a Mac OS X initiator is the ATTO one shows how immature this technology is. Also, the target software is quite new as well, so it may be that the blame for the lockups with default settings can be shared by the target software.
  • Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
  • Requirements for setting up a host. These system and network requirements must be met before.

Part.2 Format iSCSI target on Windows Now that the iSCSI target has been successfully connected, the iSCSI target will be displayed as an Unallocated Disk on Windows. Next, you will need to make the disk online and format it before you can start using it as a local disk to store data.

Kernsafe Iscsi Initiator

This project was to enable me to migrate my test Virtual machines from their default location of /var/lib/libvirt/images to storage that was not local to the server. My server has limited physical storage capabilities compared with the 10 TBs of storage on the NAS. There are probably a few different ways I could have mounted a volume, however, I went with iSCSI because I was learning it as one of my RHCE objectives. Next is how the process of setting up an iSCSI Target on a Synology NAS.

Setting up the iSCSI Target with Synology

The first step is to get our Target configured. With the GUI interface, this process is quick and easy.

  • Login to your Synology NAS
  • Open Storage Manager
  • Choose iSCSI Target
  • Choose Create
  • You then will give your target a name. I left mine as Target-1.
  • Next is the IQN: The default comes up with iqn.2000.01.com.synology:….
  • I changed mine to match the naming standards, which is the current year and month, plus your domain (in reverse).
  • Mine ended up being iqn.2018.03.com.therootuser.den:SynologyNAS…

We then will continue by selecting Next, if you wish to use CHAP, fill in the appropriate information.

You have the option to create a new iSCSCI LUN or Map existing iSCSI LUNs. You can see the one I already created, but chances are you’ll not have one already, so pick create a new iSCSI LUN and then click Next to continue.

Our next option is to choose the LUN type. I went with iSCSI LUN (File-Level)

It shows that this type of iSCSI LUN provides the flexibility of dynamic capacity management with Thin Provisioning.

When you are happy with your choice, you can click on Next to continue.

Finally, we set up how we want the LUN to be configured, such as the LUN name, if it will be Thin Provisioned, which volume we are going to store it on within the NAS, and how large the LUN will be. I went with 500 GB for the example.

Once you are happy with everything you can hit next and you’ll see a summary of your choices, if all looks as it should you can press Apply and your iSCSI target will be configured and you can then move on to the next phase, of setting up the iSCSI connection on the RHEL server.

Setting up the iSCSI connection on a RHEL Server

We need to first ensure we have all the required packages. Do so with a yum command:

We need to discover our target, so we need to run the command:

Iscsi Target For Mac

The portal IP is the IP of your Synology NAS (or any server you are running your iSCSI Target on).

Next, we can issue the command:

Iscsi Target Virtual Machine

The iSCSI device should now be available. You can verify by typing lsscsi and then to see all disks:

We will need to put a file system on our device now, so run lsblk from the command line to see your devices. For my system the new device was on /dev/sdb. I went with XFS for my file system as I wasn’t going to have multiple systems trying to write to it at the same time.

The above command will give you the UUID number of the device which you can then use in fstab.

Add the UUID number with the options of :

The /SynologyNAS can be whatever you wish, just create it in a location on your file system as it will be the mount point of the iSCSI device. For instance, as I wanted my mount point to be called SynlogyNAS, I did a mkdir /SynlogyNAS to create the mount point folder.

When done, save fstab and then run:

Assuming no errors came up you are ready, you can verify with mount to show all mounted devices. If you see an error, go back and check your fstab file and correct the error.

So if all you wanted out of this is how to get iSCSI going, you are done. Throw some files on your new mount and have fun. I, however, had a purpose for this, which was to relocate my VMs. So the next step, moving and reconfiguring the KVM VMs on RHEL 7.4.

Migrating the VMs to iSCSI

I currently had 5 VMs that were local to the RHEL server that needed to be moved. So the first step is to power all the VMs down.

I then made a directory on the iSCSI mount, mkdir /images (this was within /SynologyNAS)

Then move your VMs over with:

Iscsi Target For MacIscsi target synology mac

Depending on the size of your VMs this is going to take a minute or so to complete.

Linux Iscsi Target Server

Now that they are moved over you’ll need to edit those configuration files of each of the servers, otherwise, they won’t start as they are pointing to the old location.

Run this command and it will open the editor and you can change the VM location from the old to the new. You’ll want to do this for each server. Once you are done you can issue the command:

From there close out KVM if it’s still running and then start it again from the command line

You can then start each of your VMs back up and they should load without issue. Our final step though is to change the storage default location for VMs with KVM so they will go to your new iSCSI device.

Changing default VM locations in KVM

Globalsan

Globalsan Iscsi Initiator

First, just open Connection Details within KVM, then go to Storage.

Iscsi Target Mac Os X

I selected default, hit the X to stop the pool, then selected to delete the pool completely.

Then hit the plus to create a new pool, call it default, choose dir: filesystem Directory and choose forward.

The next option will be the path of the pool, which for me was /SynologyNAS/images, then click on Finish.

From there I did a restarted the service one more time for good measure and attempted to create a new VM. The location of the VM showed it was going to the iSCSI device so I was pleased.

So nothing really too difficult here, just takes some time to get it all set up and working correctly.

If you have any questions or comments, please feel free to reach out to me.

Cheers,

Ivan Windon – RHCSA

iSCSI is a network storage protocol that allows sending and receiving of SCSI commands over a TCP/IP network. This allows you to leverage Ethernet, a low cost network medium to get SAN performance and network based storage. While you can use pretty much any Ethernet switch, I’d recommend that if you’re going to use iSCSI that you dedicate a switch to it, or use quality switches and build a dedicated VLAN for your iSCSI traffic.Recently, I’ve recently been seeing a lot of traffic about whether or not you can use iSCSI with Mac OS X. The answer, yes. As with Xsan, to get started with iSCSI you’ll need an initiator and a target. Studio Network Solutions (SNS) provides a software-based iSCSI initiator called globalSAN that can be downloaded and used free of charge from their site. Alternatively you can also look into the Atto Xtend SAN, which runs about $200 for 1 user with volumes discount slashing the prices to about $90 for 100 users. Software based initiators will use the CPU of your system and a built-in or third party standard Ethernet port, but you can also buy a dedicated card which will offload the processing power to the card, which in some cases will be required for various performance reasons. For the purpose of this article we’re going to use the SNS globalSAN software.For the purposes of this howto, we’re using the free version of software called Starwind from RocketDivision. However, we’ve also tested LeftHand, Isilon, OpenFiler, iSCSI Target (from Microsoft) and many others (including dozens of appliances) with the Mac. So for starters, fire up your iSCSI storage and share it out. Next, extract the installer as seen in the globalSAN installer screenshot.Next, launch the installer and click on the Continue button at the Welcome screen.At the Software License Agreement screen, read the licensing agreement and then click on the Continue button if you agree to the terms.At the uninstall screen, click on continue. If you later need to uninstall the software you would re-run this installer and click on the Uninstall button.At the Standard Install screen you can click on the Custom Install button to allow you to choose which packages within the metapackage to install. It is best to leave them all checked and then click on the Continue button.Provided everything installs properly you will next be at the Installation Completed Successfully screen. Here, click on Restart and then log back into the system when it comes back online.Once you are logged back in, open System Preferences and you’ll see the new System Preference for globalSAN iSCSI.If you click on the globalSAN System Preference you’ll be able to add your first portal. Each share will have a unique IP and be referenced as a portal. Click on the add icon (+) to add your first portal.At the dialog box, type in the IP address of your iSCSI target and the port number, which defaults to 3260 for a majority of the products you may use.If you require authentication to your target then click on the Advanced… button and enter the pertinent information (Kerberos is not yet supported as an authentication method but CHAP is).You can also click on the IPSec tab if you use IPSec for authentication on your targets.Click OK to add your portal and you will be taken back to the Portals tab of the globalSAN System Preference. Here you should see your portal listed. If you don’t, click on the Refresh button.Now that you have your portal populated, click on the Targets tab and you should see the storage listed. Click on it and then click on the Log On button to initiate your session into the storage. At this point, it will mount on the Desktop (provided you have already given it a file system) and you will be able to use it as you would any other storage. You can check the box for Peristent if you would like to have the volume always mounted on the system.If you click on the Sessions tab then you will be able to look at various statistics about your storage including the LUN identifier and disk name.If you don’t yet have a file system on the storage then you can go ahead and open Disk Utility and you will see the storage listed there, click on it, click on the Partition tab and you will then be able to give it a file system.So it’s pretty easy to use iSCSI with Mac OS X. We didn’t have to open Terminal or do anything crazy in the least. It just works and while it’s not going to be as fast as something like fiber channel, it also doesn’t come with the costly infrastructure requirements that fiber channel comes with. The LUNs can be accessed by multiple hosts provided that the file system supports that. However, HFS+ does not support iSCSI, nor do any of the current file systems for the Mac that we’ve tested other than acfs (Apple Clustered File System)/cvfs, the file system for Xsan.
Comments are closed.