{"id":187,"date":"2012-11-15T05:00:25","date_gmt":"2012-11-15T05:00:25","guid":{"rendered":"https:\/\/www.nicktailor.com\/?p=187"},"modified":"2022-10-21T11:59:54","modified_gmt":"2022-10-21T11:59:54","slug":"187","status":"publish","type":"post","link":"https:\/\/nicktailor.com\/tech-blog\/187\/","title":{"rendered":"How to setup your own cloud SAN storage at home using FreeNAS and a VM"},"content":{"rendered":"<p><strong><span style=\"text-decoration: underline;\">How to setup your own Cloud SAN storage at home using FREENAS and a VM<\/span><\/strong><\/p>\n<p>So, I am writing this blog post for others who want to understand how SAN and NAS storage systems work. I had a colleague of mine suggest that I should setup my own NAS at home. \u00a0I decided that it was a great idea. This tutorial will teach you how to setup a NAS using virtual machines for the purposes of testing and learning.<\/p>\n<p>It will help you understand the fundamentals of what is involved in setting up a NAS and how they work. There are commercial applications such as NETAPP that provide far more complexity in terms of functionality, however the principles are pretty much the same, and relatively easy to pick up on variations should you need to learn them on the fly in a job.<\/p>\n<ul>\n<li>So one of the key benefits of setting up a NAS in VM is it allows you setup a sort of home based storage cloud solution<\/li>\n<li>You may add multiple USB storage devices where you will be able to create volumes of various file systems types, essentially giving you the cloud type solution.<\/li>\n<li>This will also allow various devices you have to mount the storage volumes<\/li>\n<li>At the moment VirtualBox allows up to 2 terabytes ,\u00a0 I\u2019m sure this will increase as future revisions come to pass.<\/li>\n<\/ul>\n<p><strong><span style=\"text-decoration: underline;\">Phase 1 <\/span><\/strong><\/p>\n<p><span style=\"text-decoration: underline;\">Create a new virtualbox VM for freeNAS<\/span><\/p>\n<ol>\n<li>Download\u00a0 freeNAS<br \/>\nhttps:\/\/www.nicktailor.com\/files\/ FreeNAS-8.3.0-RELEASE-x86.iso<\/li>\n<\/ol>\n<ol>\n<li>Create a new VM in virtual box with the following configurations<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"http:\/\/doc.freenas.org\/images\/7\/70\/Vbox1.png\" alt=\"Vbox1.png\" \/><img decoding=\"async\" src=\"http:\/\/doc.freenas.org\/images\/3\/3b\/Vbox2.png\" alt=\"Vbox2.png\" \/><\/p>\n<p>&nbsp;<\/p>\n<ol>\n<\/ol>\n<ol>\n<li>Ensure that you have over 10GB of HDspace and at least 512mb ram for you VM (otherwise your volume creations will fail)<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"http:\/\/doc.freenas.org\/images\/a\/a5\/Vbox3.png\" alt=\"Vbox3.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/doc.freenas.org\/images\/b\/b1\/Vbox5.png\" alt=\"Vbox5.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/doc.freenas.org\/images\/9\/99\/Vbox6.png\" alt=\"Vbox6.png\" \/><\/p>\n<p>&nbsp;<\/p>\n<ol>\n<\/ol>\n<ol>\n<li>Network Configuration<br \/>\ni.\u00a0\u00a0\u00a0\u00a0\u00a0 Nic 1 (NAT)<br \/>\nii.\u00a0\u00a0\u00a0\u00a0\u00a0 Nic 2 (Bridged Adapter, use wireless if its supported)<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"http:\/\/doc.freenas.org\/images\/f\/ff\/Vbox.png\" alt=\"Vbox.png\" \/><\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li>On the settings tab you should enable USB Controller, you will need to install an additional packages for Virtualbox to enable this feature as it doesn\u2019t come out of the box. The advantage of this is will allow you add multiple USB devices and use them as storage. Download and install the\u00a0<a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\" rel=\"nofollow\">Oracle VM VirtualBox Extension Pack<\/a>\u00a0that matches your version of VirtualBox. The extension pack enables USB support.<\/li>\n<li>Next you want to click on the Storage tab under the IDE controller there should be a EMPTY and a icon of a CD, on the far right of that you should see Attributes \u201cCD\/DVD Drive\u201d and the very far right of that a CD, click on that and find the FreeNAS iso you downloaded, click okay<\/li>\n<\/ol>\n<div><img decoding=\"async\" src=\"http:\/\/doc.freenas.org\/images\/8\/83\/Vbox9.png\" alt=\"Vbox9.png\" \/><\/div>\n<ol>\n<li>Now click the okay and go back to start the VM<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"text-decoration: underline;\">Phase 2 Configuring FreeNAS<\/span><\/strong><\/p>\n<ol>\n<li>Once freeNAS is installed you will get a configuration screen.\u00a0 The primary interface you should leave alone, as this most like dhcp\u2019d already.<\/li>\n<\/ol>\n<ul>\n<li>You should be be able to ping externally from the freeNAS VM, if you need to look at your network configuration.<\/li>\n<li>Typically the primary interface will use a\u00a0 non-routable address \u00a010.0.2.10 which is being NAT\u2019d externally<\/li>\n<\/ul>\n<ol>\n<li>So if your home network is like most people you\u2019re probably using a dhcp pool in \u00a0192.168.1.1-100 addresses. So you want to configure the second nic with within your home network pool (eg. 192.168.1.138\/255.255.255.0) address and a netmask.\n<ol>\n<li>\u00a0You will not need to set a default gateway, since the primary interface is already using a gateway<\/li>\n<li>Once you have done this go to the command prompt on your host machine, so this is no longer in the VM, its on the physical machine that runs Virtualbox and see if you can ping the address you just assigned in FreeNAS. If you can\u2019t ping the FreeNAS Ip you assigned try restarting the VM.<\/li>\n<li>Next you will want to ensure that your router of firewall allows port 80 on the ip address you assigned to freeNAS.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><span style=\"text-decoration: underline;\">\u00a0<\/span><\/p>\n<p><strong><span style=\"text-decoration: underline;\">Phase 3 setting up ISCSI SAN with freeNAS<\/span><\/strong><\/p>\n<p><em><strong>Note- any client Machine you want to connect to the iscsi SAN\/NAS must have a iscsi controller, so if you are using a VM ensure that you have added the iscsi controller under the settings of your vm.<\/strong><\/em><\/p>\n<ol>\n<li>So go to your browser and go to the webGUI<\/li>\n<\/ol>\n<p>Eg. <a href=\"http:\/\/192.168.1.138\/\">http:\/\/192.168.1.138<\/a><\/p>\n<ol>\n<li>Open a browser and login to FreeNAS 8.2.<\/li>\n<li>Navigate to\u00a0<strong>Storage &gt; Active Volumes<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_001.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_001\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_001.png\" alt=\"\" width=\"828\" height=\"456\" \/><\/a><\/li>\n<li>\u00a0Click\u00a0<strong>Volume Manager<\/strong>.<\/li>\n<li>Enter a\u00a0<strong>Volume Name<\/strong>, select\u00a0<strong>disk(s)<\/strong>, select\u00a0<strong>Filesystem type<\/strong>\u00a0(<a href=\"http:\/\/en.wikipedia.org\/wiki\/ZFS\">ZFS<\/a>\u00a0has some neat features), then click\u00a0<strong>Add Volume<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_002.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_002\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_002.png\" alt=\"\" width=\"388\" height=\"305\" \/><\/a><\/li>\n<li>Click the\u00a0<strong>Create ZFS Volume<\/strong>\u00a0button:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_003.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_003\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_003.png\" alt=\"\" width=\"603\" height=\"256\" \/><\/a><\/li>\n<li>Enter a\u00a0<strong>ZFS Volume Name<\/strong>, specify the\u00a0<strong>volume size<\/strong>, then click\u00a0<strong>Add ZFS Volume<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_004.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_004\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_004.png\" alt=\"\" width=\"413\" height=\"228\" \/><\/a><\/li>\n<li>Navigate to\u00a0<strong>Services &gt; Core<\/strong>, and turn on\u00a0<strong>iSCSI<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_005.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_005\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_005.png\" alt=\"\" width=\"484\" height=\"573\" \/><\/a><\/li>\n<li>Click the\u00a0<strong>wrench<\/strong>\u00a0icon next to iSCSI.<\/li>\n<li>Navigate to<strong>\u00a0iSCSI &gt; Portals<\/strong>, click\u00a0<strong>Add Portal<\/strong>. Select\u00a0<strong>0.0.0.0<\/strong>\u00a0as the IP Address (this means it will listen on all IPs). Click\u00a0<strong>OK<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_007.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_007\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_007.png\" alt=\"\" width=\"338\" height=\"265\" \/><\/a><\/li>\n<li>\u00a0Navigate to<strong>\u00a0iSCSI &gt; Initiators<\/strong>, click\u00a0<strong>Add\u00a0Initiator<\/strong>. Leave\u00a0<strong>ALL<\/strong>\u00a0in both fields to allow all client connections from any network:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_008.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_008\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_008.png\" alt=\"\" width=\"559\" height=\"267\" \/><\/a><\/li>\n<li>Navigate to<strong>\u00a0iSCSI &gt; Authorized Access<\/strong>, click\u00a0<strong>Add\u00a0iSCSI Authorized Access<\/strong>. Enter a\u00a0<strong>User<\/strong>\u00a0and<strong>Secret<\/strong>:<\/li>\n<\/ol>\n<p><strong><em>Note: If you dont want create a user for your home SAN, just because it makes life easier, then skip the user Access stuff and under the Target Global Configuration just select\u00a0<\/em><\/strong><\/p>\n<p><strong><em>Discovery Auth method :Auto<\/em><\/strong><\/p>\n<p><strong><em>Discovery Auth Group : None<\/em><\/strong><\/p>\n<ol>\n<li><a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_009.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_009\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_009.png\" alt=\"\" width=\"422\" height=\"367\" \/><\/a><\/li>\n<li>Navigate to<strong>\u00a0iSCSI &gt; Target<\/strong>, click<strong>\u00a0Add\u00a0Target<\/strong>. Enter a\u00a0<strong>Target Name<\/strong>\u00a0and\u00a0<strong>Alias<\/strong>. Select the<strong>Portal<\/strong>\u00a0and\u00a0<strong>Initiator<\/strong><strong>Group IDs<\/strong>, and\u00a0<strong>Authentication Group<\/strong>\u00a0number:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_010.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_010\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_010.png\" alt=\"\" width=\"453\" height=\"481\" \/><\/a><\/li>\n<li>Navigate to\u00a0<strong>iSCSI &gt; Device Extents<\/strong>, click\u00a0<strong>Add\u00a0Extent<\/strong>. Enter an\u00a0<strong>Extent Name<\/strong>\u00a0and select a<strong>Volume<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_011.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_011\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_011.png\" alt=\"\" width=\"338\" height=\"215\" \/><\/a><\/li>\n<li>Navigate to\u00a0<strong>iSCSI &gt; Associated Targets<\/strong>, click\u00a0<strong>Add\u00a0Extent to Target<\/strong>. Select a\u00a0<strong>Target<\/strong>\u00a0and<strong>Extent<\/strong>\u00a0to map together:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_012.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_012\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_012.png\" alt=\"\" width=\"298\" height=\"181\" \/><\/a><\/li>\n<li>Navigate to<strong>\u00a0iSCSI &gt; Target Global Configuration<\/strong>.\u00a0Customise your\u00a0<strong>Base Name<\/strong>, select\u00a0<strong>CHAP<\/strong>for\u00a0<strong>Discovery Auth Method<\/strong>\u00a0and select your\u00a0<strong>Discovery Auth Group<\/strong>. Leave other settings unless you know what you\u2019re doing. Scroll to bottom of page to\u00a0<strong>Save<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_013.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_013\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_013.png\" alt=\"\" width=\"559\" height=\"370\" \/><\/a><\/li>\n<li>All done. Now you need to connect to the<strong>\u00a0iSCSI SAN<\/strong>\u00a0using an\u00a0<strong>iSCSI Initiator<\/strong>.<\/li>\n<li>If you get any connection problems, try restarting the iSCSI service here:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_005.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_005\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_005.png\" alt=\"\" width=\"484\" height=\"573\" \/><\/a><\/li>\n<li>If you don\u2019t trust the GUI and want to confirm the service has definitely started, you can run<strong>service -e<\/strong>\u00a0at the shell prompt, and look for\u00a0<strong>istgt<\/strong>:<br \/>\n<a href=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_014.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Configuring_iSCSI_FreeNAS_8.2_014\" src=\"http:\/\/www.virtuallyimpossible.co.uk\/wp-content\/uploads\/2012\/07\/Configuring_iSCSI_FreeNAS_8.2_014.png\" alt=\"\" width=\"632\" height=\"415\" \/><\/a><\/li>\n<\/ol>\n<p>Cheers Hope this helped you understand how it all works email nick@nicktailor.com if you have questions<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to setup your own Cloud SAN storage at home using FREENAS and a VM So, I am writing this blog post for others who want to understand how SAN and NAS storage systems work. I had a colleague of mine suggest that I should setup my own NAS at home. \u00a0I decided that it was a great idea. This<a href=\"https:\/\/nicktailor.com\/tech-blog\/187\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,138,18],"tags":[],"class_list":["post-187","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-setup-your-san-using-freenas"],"_links":{"self":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=187"}],"version-history":[{"count":18,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/187\/revisions"}],"predecessor-version":[{"id":1620,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/187\/revisions\/1620"}],"wp:attachment":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}