Use FOG with FreeNAS

How to: Use FOG (1.1.2) with FreeNAS (Storage node - 9.1.1)
There are probably several solutions i think, but i propose you a simple solution that works with me.
 * I have often seen people want to use Fog Server with a Storage Node FreeNAS. At my office, it works so i describe you step by step how to do.

I* consider that your FreeNAS is ok for the installation and NIC.

Pre-Configuration

 * IP Addresses (These are not required but set as example)
 * Fog Server: 192.168.56.102
 * FreeNAS: 192.168.56.240

FOG Server

 * 1) Storage Management
 * 2) *Add the Storage node.
 * 3) *Storage Node Name: FNAS
 * 4) *IP Address: 192.168.56.240
 * 5) *Is Master Node: As you want.
 * 6) *Group: As you want.
 * 7) *Image Path: /mnt/Volume1/data/images
 * 8) *User/Pass: Free/Free (Not very secure ;) )
 * 9) Image Management
 * 10) *For your image, choose the storage group witch contains the new storage node.

FreeNAS

 * 1) Add Volume1
 * 2) *Storage -> ZFS Volume Manager:
 * 3) *Volume Name: Volume1
 * 4) *Volume layout: All the disk (in my case)
 * 5) Create the path
 * 6) *Clic on Volume1 -> Create ZFS Dataset:
 * 7) *Dataset Name: data
 * 8) *Compression level: inherit
 * 9) *Enable atime: inherit
 * 10) *ZFS Deduplication: inherit
 * 11) *Clic on data -> Create ZFS Dataset:
 * 12) *Dataset Name: images
 * 13) *Compression level: inherit
 * 14) *Enable atime: inherit
 * 15) *ZFS Deduplication: inherit
 * 16) *Clic on images -> Create ZFS Dataset:
 * 17) *Dataset Name: dev
 * 18) *Compression level: inherit
 * 19) *Enable atime: inherit
 * 20) *ZFS Deduplication: inherit
 * 21) *FreeNAS DirectoryStructure.png
 * 22) Create .mntcheck
 * 23) *On the folder "/images" and "/dev", create the file ".mntcheck"
 * 24) *CMD: touch .mntcheck
 * 25) Create new user
 * 26) *Account -> Users -> Add User
 * 27) *Username: Free
 * 28) *Primary Group ID: Free
 * 29) *Home Directory: /mnt/Volume1/data/images
 * 30) *Home Directory Mode: 777
 * 31) *FreeNAS User.png
 * 32) Permission for the path
 * 33) *Storage -> clic on data/images -> Change Permissions
 * 34) *User: Free
 * 35) *group: Free
 * 36) *Mode: 777
 * 37) *Type of ACL: Unix
 * 38) *Set Permission recursively: YES
 * 39) *Verification: cmd: ls -laR /mnt/Volume1/data/images
 * 40) NFS
 * 41) *Don't edit "/etc/exports". In my case, when i restart the service, the file faded. I had to WEBGui.
 * 42) *On the left.
 * 43) *Sharing -> Inux (NFS) Shares -> Add Unix (NFS) Share.
 * 44) *Comment:...
 * 45) *Authorized networks: 192.168.56.0/24
 * 46) *All directories: OK
 * 47) *Maproot User: Free
 * 48) *Maproot Group: Free
 * 49) *Path: /mnt/Volume1/data/images
 * 50) *OK.
 * 51) *FreeNAS NFS.png
 * 52) *Idem for the folder "/dev"
 * 53) *FreeNAS dev.png
 * 54) *Verification:
 * 55) *cmd: cat /etc/exports
 * 56) *FreeNAS Exports.png
 * 57) FTP (I don't know if it's really necessary)
 * 58) *Services -> FTP -> Advenced Mode
 * 59) *Path: /mnt/Volume1/data/images
 * 60) *File Permission: 666
 * 61) *Directory Permission: 777
 * 1) *File Permission: 666
 * 2) *Directory Permission: 777

Capturing Image

 * Now: you can capture your client
 * Problem, you may also get an error message at the end: FOGFTP: failed to rename file.
 * http://www.fogproject.org/wiki/index.php/Images_Directory_Permissions


 * Method 1 doesn't works with me, so i use method 2. *
 * FreeNAS FTP Will Not Rename And Move.png
 * CMD: cp -a /mnt/Volume1/data/image/dev/@MAC /mnt/Volume1/data/images/NameOfYourImage
 * cp -a to keep the same permission.


 * That's it.

Notes:

 * This tutorial was created using content from this thread: How to: Use FOG (1.1.2) with FreeNAS (Storage node - 9.1.1)


 * * Further investigation into the "FOGFTP: failed to rename file". This is most likely a permissions issue that needs to be corrected. (FOG Dev Team)