Setting up a Windows 2012 server as a FOG Storage Node


  • Moderator

    Under Construction

    NOTE: Support for using a Windows 2012 server as a storage node was added in FOG 1.4.1 and later builds

    In a previous tutorial I created an outline of what was required to configure a windows server as a FOG Storage Node. At the time I was just “testing” to see if it was even possible. With the outcome successful I concluded it was possible to do. After many months away from the tutorial, reviewing it now its a bit of a convoluted mess mainly because of the way the forums place newer content at the beginning and older content at the tail. With this in mind I’ve consolidated the steps into a single post. If you want to understand the logic behind these steps, you can read the original document here: https://forums.fogproject.org/topic/6941/windows-server-as-fog-storage-node-proof-of-concept-blog

    From elevated rigts powershell prompt

    Import-Module ServerManager
    Add-WindowsFeature FS-NFS-Service
    

    Reboot the server to complete the feature addition. If you don’t reboot you will get an error on the next ps command.

    Import-Module NFS
    
    $WinSNode = "<win_storage_node_ip>"
    
    mkdir c:\share
    mkdir c:\share\images
    mkdir c:\share\images\postdownloadscripts
    mkdir c:\share\images\dev
    mkdir c:\share\images\dev\postinitscripts
    
    mkdir c:\share\tftpboot
    mkdir c:\share\snapins
    mkdir c:\share\snapins\ssl
    
    New-NfsShare –Name "images" –Path c:\share\images –Authentication sys -AllowRootAccess $True -EnableUnmappedAccess $True –Permission Readwrite
    
    Enable-NetFirewallRule -DisplayGroup “Server for NFS” -Verbose
    
    net localgroup fog_users /add
    net user fog_user "mi5ty_cl0ud" /add /EXPIRES:NEVER /PASSWORDCHG:NO /active:YES /Y
    net localgroup fog_users fog_user /add
    icacls c:\share /grant "fog_users:M"
    
    Install-WindowsFeature Web-FTP-Server,Web-FTP-Service,Web-FTP-Ext -IncludeManagementTools
    New-WebFtpSite -Name "FOGFtpSite" -Port 21 -PhysicalPath "c:\share" -IPAddress $WinSNode 
    
    Set-ItemProperty "IIS:\Sites\FOGFtpSite" -Name ftpServer.security.ssl.controlChannelPolicy -Value 0
    Set-ItemProperty "IIS:\Sites\FOGFtpSite" -Name ftpServer.security.ssl.dataChannelPolicy -Value 0
    Set-ItemProperty "IIS:\Sites\FOGFtpSite" -Name ftpServer.security.authentication.basicAuthentication.enabled -Value $true
    Set-ItemProperty "IIS:\Sites\FOGFtpSite" -Name ftpserver.userisolation.mode -Value 4
    Add-WebConfiguration "/system.ftpServer/security/authorization" -value @{accessType="Allow";roles="fog_users";permissions="Read,Write";users=""} -PSPath IIS:\ -location "FOGFtpSite"
    Restart-WebItem "IIS:\Sites\FOGFtpSite"
    
    New-Item "IIS:\Sites\Default Web Site\fog" -type Directory
    New-Item "IIS:\Sites\Default Web Site\fog\service" -type Directory
    New-Item "IIS:\Sites\Default Web Site\fog\service\ipxe" -type Directory
    
    Create the following file: C:\inetpub\wwwroot\fog\service\ipxe\web.config and paste the following xml contents:
    <?xml version="1.0" encoding="UTF-8"?>
     <configuration>
         <system.webServer>
             <staticContent>
                 <mimeMap fileExtension="." mimeType="application/octet-stream" />
                 <mimeMap fileExtension=".*" mimeType="application/octet-stream" />
             </staticContent>
         </system.webServer>
     </configuration>
    
    nfsshare fogipxe=C:\inetpub\wwwroot\fog\service\ipxe -o rw sec=sys root unmapped=yes
    nfsshare fogpxe=C:\share\tftpboot -o rw sec=sys root unmapped=yes
    

    Install tftp32d server (third party application) because windows doesn’t have a native tftp server.

    1. Go to the following URL: http://tftpd32.jounin.net/tftpd32_download.html and download the tftpd64 service edition (installer)
    2. Launch the installer you just downloaded.
    3. Read and agree to EULA if you accept it continue.
    4. Select (all) Options: Add start menu shortcuts, Add desktop icon, Start service Tftp32_svc, start service monitoring
    5. Use default install location: C:\Program Files\Tftpd64_SE
    6. Tftpd64 Service console should launch
    7. Select the Settings button
    8. Select the GLOBAL tab
    9. Uncheck all options except TFTP Sever. The only selection option we need is “TFTP Server”.
    10. Select the TFTP tab
    11. For the base directory, select the browse button and then navigate to the c:\share\tftpboot folder
    12. Select OK
    13. In the tftp options section enable PXE Compatibility option. Leave all other settings at their default
    14. Press OK
      This concludes the install of the tftp server

    From fog server console logged in as root or with sudo rights. In this section we will copy all of the required files from the fog server to the windows storage node that are needed to transform windows into a fog storage node.

    mount -t nfs <win_storage-node_ip>:/images /mnt
    mkdir /mnt/dev
    touch /mnt/.mntcheck
    touch /mnt/dev/.mntcheck
    umount /mnt
    
    # copy the FOS image files
    mount -t nfs <win_storage-node_ip>:/fogipxe /mnt
    cp /var/www/html/fog/service/ipxe/* /mnt
    umount /mnt
    
    # Copy the iPXE boot files
    mount -t nfs <win_storage-node_ip>:/fogpxe /mnt
    cp -R /tftpboot/* /mnt
    umount /mnt
    

    Final clean up steps on Windows Storage node. In this section we’ll make a few final adjustments needed to complete the Storage Node installation.

    nfsshare fogipxe /delete
    icacls.exe "C:\inetpub\wwwroot\fog\*" /q /c /t /reset
    icacls.exe "C:\share\*" /q /c /t /reset
    nfsshare fogpxe /delete
    netsh advfirewall firewall add rule name=“TFTP Server” dir=in action=allow program="%ProgramFiles%\Tftpd64_SE\tftpd64_svc.exe"
    

    Installation Quality checks to perform before moving on to the fog server configuration. For these tests we’ll use a windows 7 workstation.

    First we need to test to see if the FTP server is working and we can login using the fog_user account we setup.

    C:\>ftp <win_storage-node_ip>
    Connected to <win_storage-node_ip>.
    220 Microsoft FTP Service
    User (<win_storage-node_ip>:(none)): fog_user
    331 Password required for fog_user.
    Password:
    230 User logged in.
    

    Next issue a dir command to see if we can see the files we created.

    ftp> dir
    200 PORT command successful.
    125 Data connection already open; Transfer starting.
    05-22-16  08:39PM       <DIR>          images
    05-22-16  07:41PM       <DIR>          snapins
    05-24-16  02:42PM       <DIR>          tftpboot
    226 Transfer complete.
    ftp: 144 bytes received in 0.00Seconds 144000.00Kbytes/sec.
    quit
    

    That completes the FTP test

    The next step is to test the tftp server

    C:\>tftp <win_storage-node_ip> get default.ipxe
    Transfer successful: 427 bytes in 1 second, 427 bytes/s
    

    If your tests matches the above then we can move onto the FOG part of the setup.

    Activate the FOG Plugin module
    Fog Configuration -> Plugin System
    FOG_PLUGINSYS_ENABLED = checked

    Enable the Location plugin
    Plugin Management
    Activate and install Location management plugin

    Add Windows Storage Node to FOG’s configuration
    Storage Management -> Add Storage node
    0_1495120891522_WinSNode_1.png


Log in to reply
 

329
Online

38727
Users

10554
Topics

99920
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.