 All right, let's dive into iSCSI. So first, what is iSCSI? So iSCSI is a block storage system and it works over network. So unlike maybe plugging a SAS or a SATA cable into the motherboard where you present a hard drive to the operating system, iSCSI works over the TCPIP network and it's pretty neat. So the way this initiates is you're gonna set this up and we're gonna use an example of Freenast as the backend, so that's the walkthrough we're gonna do here. And I've talked about it before of presenting it to a VM but I wanted to cover this video just the iSCSI protocol, how it works and how to set it up. So no matter what you're using to present it to whether a Windows server, a VMWare machine, or a Zen server, this initial setup works the same for all those scenarios. Now why would you even wanna use iSCSI? Why not just share files and share things like Samba across there? Well, there's some performance gains to be had from iSCSI plus whatever the operating system you're presenting it to may have different ways it wants to handle data. So when you present it as a block storage system, it can format it to whatever format it wants. For example, in Windows, it's gonna wanna use NTFS or if it's using presented to Linux, it's going to present it maybe as an EXT-4 or an EXT-3 file system in Linux. But the backend is still gonna have all the advantages of ZFS. And ZFS has a system referred to as ZVAL which handles block storage. This is how you set up the iSCSI and that's what we're gonna go through. So you get the benefits on the backend of the ZFS, the snapshots and the compression. And then the OS that is being presented to gets all the advantages of a really high performance provided you have the performance machine to provide the data stream there. Now a couple caveats here with iSCSI. If you're running a really old or slow processor, that may be great for holding lots of storage on FreeNAS and it will be great for your lab to do some testing, but you will have a lot of performance issues with iSCSI. iSCSI is processor intensive because you're taking the abstraction layer of a block device and presenting it over TCPIP to another device. That's processor intensive and memory intensive. So most FreeNAS forums right now here in 2018 recommend a minimum of 32 gigs of RAM to start getting performance out of it. And a modern processor, such as a multi-core Xeon dual processor board. So if you want the performance, do look into that. But to get started with it, you can have a lower end processor and get it going at a reasonably fast speed. So let's get started. I will leave links to the docs here. So there's plenty of documentation with a lot of more detail than I'll go into. I'm gonna go over the basics of how to get it set up, but it does have a lot of tweaking you can do and lots of setup you can do to, for example, set it up so it can handle 20 different, 30 different, even more machines connecting to it. You can create volume groups. You can have this thing handing out hard drives all over the place via iSCSI. We're gonna cover the basics to get it started, but you'll kind of get the gist of it from there, how you can fine tune and add more features as needed. So first thing we do is we go into our FreeNAS here. I have a brand new data set created called tank one. And we're not gonna add another data so we're gonna add a Zval to it. We're gonna call it iSCSI, the SCSI volume. What is the size of this Zval? I apologize because it's hard to zoom this in. The new interface does have a really small font for a couple of things like this, but this is where you can set up how big you want the Zval to be. And let's just make this one 250 eggs. Now there's a couple options. You can force the size, not really needed, but you can, the system restricts the Zval that brings the pool over 8% capacity. So to force set creation, don't recommend this, but you can over provision and oversize it a bit. And then it has a thin provisioning on set thin provisioning cost. This will fail if the pool is low on space. This allows you a thin provisioning doubt. I'm not really gonna worry about that right now. We're just gonna hit save and create it with mostly the default options here. So now we have the Zval called iSCSI and now we're gonna go set up the iSCSI part of it. This is where the data is going to land. Now by the way, because this is presented as a block storage, if you format this with NTFS when you're in Windows or even if you did a Linux file system, this is only handled as block storage. So there's not a way for free NAS to mount this as a share in Samba or anything like that. This is handled differently because it's a Zval block storage. Just wanna make sure that's clear because iSCSI is not a shared device. It's basically a way of creating a piece of this ZFS dataset and presenting it as a hard drive to another operating system. So we're gonna over here to iSCSI. Now there's two ways to get to it by the way. I went over here to services to make sure it was enabled and we can click here. It's also located here under sharing. So you just go over here to block iSCSI and we're gonna go ahead and start setting this up. So here's the first piece. Leave it alone, it's fine like this but you can do customizations. This is once again, there's plenty of help for each one of these that take you to the help pages to give you all the details but the base name and all of that is fine. Portal, we're gonna go ahead and create a portal and this is none none. What that means is we're gonna go ahead and leave wide open. We're gonna bind it to all the addresses which I have a couple IP addresses on here. So leave it at zero zero. We're gonna leave it at the default portal 3260. Don't really need to add a comment but this does support things like authentication and that we're gonna skip the authentication. Ideally when you're setting these up you want a SAN network separate either on a separate VLAN but sharing physical layer with your other network but that can create some bandwidth limitations. The ideal situation is maybe having a 10 gigabit link separate and actually this server does it has both a 10 gig link and a gigabit link and we're gonna go ahead and bind it to each and talk about the performance of that but you can set up a series of different ISCSI initiators and portal groups and on different ports. Once it's in, you can get really extensive with this. We're just doing the basics. Create an initiator, all all and that's a restriction. Now this comes down to another security. Ideally when you're building a SAN there should be a separate network. We're choosing all all but then you can get very specific for each group you do and each hard drive group you do only allowing certain IP address restrictions along with usernames and passwords. We're gonna skip the username and password part but that would be set up here. ISCSI doesn't have the most secure they use chat for the authentication. It's kind of a it's good but ideally this should be all locked down on a separate network. I didn't do a search but I'm sure there's plenty of people who have incidentally exposed all their ISCSI across the internet. I'm sure there's plenty of insecure ways to set it up. It would be more secure for setting this up but we're doing direct link because the 10 gigabit is on a separate network and if we were really thinking about security yes we would add this here but it's not necessary to get started with ISCSI. Targets, target name. Free NAS, target alias, not worried about it. Portal group, the group we created. Group ID, auth method none, authentic creation group none. Targets, heck plus, just call it test. One one these are just from the ones we chose before, hit save. Actually it does also need to start with a lowercase side note there. It did, it will let me save it but it actually spun there so a side note it does need to be lowercase. So we'll just call it SCSI. That's why I failed the first time it does have to be that way. Now we're gonna add the extents. Now this is where we actually add the Zvol. Extent name, SCSI one was our first one. It is a device so we'll pull down the devices. Now there's some debate about this. You can create a file path to the extent but you lose features when you do that. So you could have instead of a Zvol a data set and you create a file called the file.ext whatever you wanna call it and then that file can be pointed at. That's not the most ideal way to do it because some features don't work when you do it that way. I'm not gonna get into all the details but basically it limits down some of the features that are available inside of iSCSI that are performance based. So you ideally wanna set it up as a device. I don't have any good reasoning why you'd wanna set it up as a file but I'm sure some esoteric reasoner is out there that I can't think of right now. I always build minus devices. Now if you're initiating this to a Zen server Zen initiate your compact mode this is some enhanced features for Zen server. It does also have enhanced features built in for Windows and it has enhanced features built in for VMware built into this as well. And the Zen one is just an extra checkbox that you can check on this when you're doing it. Now that built almost everything. The last little piece we have to do is actually create the target. Target, SCSI, LUN 1, Extent. Now LUN 1 means hard drive logical unit ID 1. So pretty simple. And if we added more hard drives which we will shortly here this would be number two after that. The number three, the number four. And that's how you can use one SCSI group. And now you can kind of see how there's so many tiers down to this. So you could create a different group, a different portal and then have it a bunch of different associated extents and then a bunch of associated targets with those extents and group them out. And if you do very large scale enterprise storage you may have one very large storage pool built on maybe free NAS even and then it delegates out to lots of different virtual machines and different hypervisors, all the different hard drive allocations that go out there. For simplicity, we went with 111 all the way across to keep it really simple. But that's all we need you to get it started. Now let's see what it looks like in Windows. I'm gonna move this over. Let me just click on the ICSI initiator, say yes. Target 192.168.3. Oops, that 25. That's just the free NAS one that we had set up here. Login succeeded. Now you wanna click connect. I know done is actually what you connect. All right, volumes and devices, auto configure. Okay, now we're gonna go over here to disk management. And there it is. So when it presents inside of Windows here, so MBR GPT, so we're gonna go ahead and choose MBR. Then we're gonna go ahead, new simple volume. Make it S for SCSI, next. Perform quick format, yep, finish. And there it is. Now this is kinda cool because as I said, it presents it as a hard drive. So as far as Windows is concerned, this is a standard just like you manage any other hard drive on there. It just happens to be working over the ICSI protocol and it's gonna operate, well, unfortunately, only a gig of it because that's the connection I have between this virtual machine and that. But it is up and running and working. So let's talk a little bit about performance of it. Now, as I said, when you're doing this, and let's go ahead and just create a folder, new folder, whoops. Because this is an NTFS volume, all your NTFS permissions and everything are working. It's not like when you share it with a Samba share on, for you to ask, this is just a hard drive attached. And you may have noticed because the ability to create a simple volume, yes you could, even across multiple free NAS servers, ICSI target each of them back to one machine and even raid them across. You can also create redundancies because while you use network layer link redundancies to create redundant connections to these volumes. But let's talk about how the performance looks like. Now this is only gonna be a gig of it, so let me get some files. Okay, I have this folder copied over to this computer. So now it's local on this computer and I was gonna copy it over to the ICSI. So let's see what kinda transfer. Not bad, pretty fast. But let's look what's going on over here now. So this is our free NAS 3.25. This is showing how much processor use is just a gigabit copying over is using on here. So you can see this gets processor intensive really quick. Now this machine, just so you know, we'll go back to the beginning here. This is an old Opturon 6172. It does have 12 cores, doesn't score that high. This is a pretty old processor. But one of the things you notice is ICSI by comparative, if you looked at a Samba transfer, it would barely even have blipped it. Samba doesn't really take much because it's just handling some file and SMB. But ICSI because it's doing an interpretation, as I said, an extraction layer of controlling block storage. While you can get all these features and performance, it can be a disadvantage if you have a slow processor. But it is pretty slick that it connects copies. Here's all the files and everything that goes with there. And here's some junk files. I'll delete real quick. If I need to snapshot that, actually we'll go ahead and do this. So right here it is LTS Tufts Graphics. And let's go over here to FreeNAS again. Well, let's just go ahead and create a snapshot real quick here. Oh, just this fuzzy. Before, before RMRF save. So now we have a snapshot of that and we'll do kind of like I said here. So we're going to go ahead and RMRF it. All right. And so I don't feel like dealing with the windows errors that come with it. We're actually going to stop windows because we just nuked all the files on that extent. Then we're going to go over here and we're going to roll back to it. Continue with the rollback. Yes. Now I did this on purpose because it says, yes, take data sets busy and it won't let me do it. All you really have to do is go over here to services. It does protect you from doing this because there's a couple of different options. Now, because I have Ice-Cuzzy running, Ice-Cuzzy has an advantage of doing this. We could go here, go to the extents, choose device, all of your snapshots show up. So one of the advantages you have, let's say you had a regular recurring snapshots on a regular basis with FreeNAS, you can actually remount them as extents and then present them back over into Windows or whatever the device is to be able to get a file back without rolling it back. So it's kind of a nice feature because once you have all the regular snapshots, you're really protecting, you're actually snapshotting that entire hard drive all the time. And that hard drive can have an entire virtual machine running on it or in this case just a Windows extra hard drive in this Windows machine but this helps maintain data integrity on there also makes it very easy for you to roll back to it. And this is the reason a lot of people like with Windows Server 2016 or even any Windows Server, they use iSCSI as the backend with FreeNAS because it does all the data integrity protection and will handle all the snapshots and everything else but then none of the troubles. You have all the Windows NTFS permissions and everything's the way you're used to using it. It just looks like a hard drive that like any other hard drive in the Windows Server but you have all the ZFS data production going on in the backend and of course all this rollback protection. Now the way you, if you just wanted to do a rollback is pretty simple. Go here to services, stop iSCSI and then you just go and roll it back now. And of course once iSCSI stopped that's what it's busy and kind of warning you about when you're in the snapshots. So I'm gonna go here to snapshots and we'll go rollback. Instantly it rolled back that quick. As you know snapshots work very fast. I have an entire video on just the snapshot system and we fire up our virtual machine again and there it is with all the data back where it belongs. So completely restored back based on a snapshot. Pretty straightforward or pretty simple the way it works and that's one of the reasons that iSCSI is pretty popular solution for presenting that. As long as you have a fast enough processor to handle all the different iSCSI commits it's easy to do. Now let's talk about it real quick in Zen Server while we're here. So this demo XCPNG server I have set up is attached at 10 gigabit to here. So we're gonna get even more performance out of it in terms of connecting it to iSCSI. How do you attach it to iSCSI? Well it's actually really simple. So we're gonna go over here to FreeNAS. We're gonna go over to iSCSI, Extents, Edit. We're just gonna add this to add those extended features in there. And while we're here we're gonna go ahead and add one more. So we go over to pools, add ZVAL, SCSI2, just give it a hundred gigs, Save. There's our two of them. One's a hundred gig, one's 256 gig. Then I go back over to iSCSI, Extent, add one more, Save, and add one more target. Now this one we're gonna call LUN2. Now you could still have the first one presented to Windows and the second one presented to Zen Server. It really doesn't matter. Matter of fact you could have a multitude of hypervisors and create a different LUN ID for each one. Things you cannot do, as I mentioned, you cannot share one because this first one is still formatted as NTFS and Windows. This one's empty and blank, so we're gonna do whatever we want with it. But we could also, if we were to try to present two Windows machines appointed at the same one, it will not work properly. It may read someone's hacked around with it and found ways to kind of sort of make it work, but it's not the way it was meant to be used. Just gonna throw that out there. All right, so now we have our two different extents created. We're gonna go ahead and add a storage option here. Storage name, SCSI1, storage type, iSCSI. Now just so you know, and we'll jump into networking real quick, so we're clear on how it's hooked up. Interfaces, this is the iSCSI. 10 gig link between them. That's why I named it creatively 10 gig. So this is 192.168.10.10. So paste that in there. And for reasons unknown, it doesn't default the port in there, but the default port is 3260. You do have to type it in and it scans it, select the IQN. So anything is finding is a screen is this one free NAS, but if there are more of them on there it would, then it's going to read and select the LUN. So we can select the LUN1 or LUN2. And now we've added the storage. Crete. All right, and let's go ahead and add the other storage. Add storage, SCSI2, select LUN2, Crete. And now we have more than one storage option on here. Now I already have a VM on the local storage. If you look at the disk, this is actually on the local storage of this machine. We're going to head and copy it over to, we'll call it Debian on SCSI, select the storage repository. It really doesn't matter which one I select, but I'll go ahead and choose this one, hit okay. And now it's going to create a duplicate copy of this virtual machine over onto SCSI. All right, so we have our Debian on SCSI all set up. Let's go ahead and fire it up. As you can see right here, it's on the SCSI1 disk. It'll boot up reasonably fast, but as it boots, the next thing we're going to see over here, actually make sure this is our always, here we go. I don't like, if you haven't used net data, if you go into settings, there's always you're on focus. This just means you refresh even when I'm not looking at it so it doesn't play catch up when I change another tab. So here we have our Debian system up and running and booted relatively quick. Let's get the IP address of it, 3.69. And let's run a quick test. This is just the Foronix test suite. One, one, three. Nope, don't care about saving results. Now while it's doing this in the background, we're going to watch the CPU load come right up. So it goes from, yeah, booting's no big deal, boots up relatively fast, but once you start doing some type of real intensive disk testing, it just goes crazy. So it looks like we're getting a right performance of around 343 megs a second. Now the read performance gets very skewed at 3.5 gigabits per second because when you're doing a bunch of small reads, ZFS caches it. So there's certainly some advantages because the underlying OS, and I showed these speed results on purpose to kind of give you an idea. When you have a bunch of little reads like that, ZFS goes, I know how to cache that. So when you go down here and look at ZFS and net data, you'll start seeing a lot of ZFS reads that were done here and all this green is all the cache hits. So it does, this is some of the advantages of presenting it this way. So even as ZFS is dealing with however the VM formatted this and provisioned it out for other virtualization, you're still getting all those benefits of the ZFS arc and the caching algorithms that ZFS has. And of course, snapshotting and everything is still applies because this is all presented over ISCSI, so it's still reasonably fast even though this is I think like an eight-year-old or seven-year-old processor that's in here. So that pretty much covers it. One last little side note I will cover is we're gonna take and make a couple fast clones on the SCSI to the SCSI. So there's another clone and another clone. Let's go ahead and even maybe boot up a couple of these clones. So over here to VMs, clone, clone, clone. So we'll go ahead and start this clone up and we'll fire up the main one too. And when we look at the storage, so it's a 249 gig and then here are each of these Debian clones. So each one's taking up 16 gigs, 16 gigs, 16 gigs and they're running on there. And of course then we have things going on like if we wanted to snapshot any of these so we can take these VMs and we'll create a snapshot of this VM, then we'll go over to the console, we'll log in, make sure it's up and running. Maybe we'll run some data on it real quick here. We'll go into it and we'll just create some random one gig data. So do some writing back and forth through it. And there's SCSI taken off going, hey, you're dumping a bunch of data this drive. And the reason I'm doing all this is to show you and let's go ahead and refresh this. And we'll go back over here to the pools and we can see that we've used not a lot of data. So this is part of the advantage you get with ZFS being behind the scenes. So despite having all these cloned Debian, some will show none so you can see all of them on here and the storage system thinking as far as the way it's presented to it that it has all this 75 gigs worth of used storage because FreeNAS is at the back end of it, you only are using this little bit of data because all these clones happen to be the same. So when you were cloning operating systems like this, ZFS is able to compress them actually 2.87X compression ratio here. Let me refresh it again, see if it's done creating data. Yeah, so there's all this compression going on, once again, behind the scenes ZFS handling it because it doesn't matter what the file system is, if it sees lots of repeating in the blocks of those files, it goes, I can compress those, I can make those more efficient. And by doing that, despite it being this much data used and this many VMs, it only ends up showing up as in your FreeNAS dataset, quite a bit less data. So this is, like I said, another advantage of having the ZFS handle everything at the back end level and having the front end be presented as ISCSI to the VM. So you get all those ZFS advantages and all that compression caching, especially for all these common reads, which is what gives us those crazy high read numbers when you're doing a bunch of little file reads and repetitious things inside of any VMs where FreeNAS is handling it from the back end. So hopefully this is enough to get you started in ISCSI. Yes, it supports a ton of things I didn't talk about, the protocol is extensive, it supports multipath, it supports redundancies and failovers and all kinds of extensive things for building a really high performance sand, but for getting started in your home lab or just kind of getting started learning how FreeNAS and ISCSI works, this is a great way to get going on it and then kind of expand your knowledge out from there. All right, thanks. Thanks for watching. If you liked this video, go ahead and click the thumbs up. Leave us some feedback below to let us know any details which you like and didn't like as well because we love hearing the feedback or if you just want to say thanks, leave a comment. If you wanted to be notified of new videos as they come out, go ahead and subscribe and the bell icon that lets YouTube know that you're interested in notifications. Hopefully they send them as we've learned with you too. Anyways, if you want to contract us for consulting services, you go ahead and hit LawrenceSystems.com and you can reach out to us for all the projects that we can do and help you. We work with a lot of small businesses, IT companies, even some large companies and you can farm different workout to us or just hire us as a consultant to help design your network. Also, if you want to help the channel in other ways, we have a Patreon, we have affiliate links, you'll find them in the description, you'll also find recommendations to other affiliate links and things you can sign up for on LawrenceSystems.com. Once again, thanks for watching and I'll see you in the next video.