• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Setting up a Windows 2012 server as a FOG Storage Node

Scheduled Pinned Locked Moved
Tutorials
3
6
2.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    george1421 Moderator
    last edited by george1421 Jun 3, 2020, 6:26 AM May 17, 2017, 10:32 AM

    Proof of concept build, not intended for a production environment

    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

    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

    1 Reply Last reply Reply Quote 0
    • J
      Jamaal
      last edited by Jun 3, 2020, 12:17 AM

      George,

      How did this work for you? I’m thinking about doing this as I’m starting to run out of room on a hyper v box and thinking about just building a Windows Server 2019 vm and make it as a secondary storage server.

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by Jun 3, 2020, 6:13 AM

        @Jamaal What’s your actual aim when you consider adding another storage node? Sometimes the concept of this is being misunderstood and so it’s better to talk about this before you head into it. As well I may ask you what your FOG setup looks like as of now? Installed Linux directly on hardware or in a VM?

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        J 1 Reply Last reply Jun 3, 2020, 10:35 AM Reply Quote 0
        • J
          Jamaal @Sebastian Roth
          last edited by Jun 3, 2020, 10:35 AM

          @Sebastian-Roth

          Thanks for getting back to me Sebastian. So I have Fog on a vm via Windows Server 2019 running Ubuntu 18.xx, forgot the exact version. So I see I’m at 95 % on the fog server and I think it’s due to me saving Windows drivers to use when the laptops or desktops are done to bring them down after Fog images. I tried one day on how to make more space in Ubuntu, but I’m not really a Linux guy, only Windows.

          I know a little few commands based on this forum and looking things up in Google, so my goal is to at least have 50% storage space at all times so I don’t run out of space. If you can guide me, I appreciate it.

          G 1 Reply Last reply Jun 3, 2020, 12:24 PM Reply Quote 0
          • G
            george1421 Moderator @Jamaal
            last edited by Jun 3, 2020, 12:24 PM

            @Jamaal The tutorial was more of a proof of concept than something that should be used in production. Did it work, yeah. Would I probably use it… maybe not but some of the dedup capabilities in 2016 and 2019 make it sound intreaging.

            For your case if you have additional space on your VM host server you might consider adding an additional virtual disk to your fog server then adding it to the LVM group for your fog server. There are a number of ways to go about this, but that discussion should be moved to a new thread.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            J 1 Reply Last reply Jun 3, 2020, 1:22 PM Reply Quote 1
            • J
              Jamaal @george1421
              last edited by Jun 3, 2020, 1:22 PM

              @george1421 said in Setting up a Windows 2012 server as a FOG Storage Node:

              @Jamaal The tutorial was more of a proof of concept than something that should be used in production. Did it work, yeah. Would I probably use it… maybe not but some of the dedup capabilities in 2016 and 2019 make it sound intreaging.

              For your case if you have additional space on your VM host server you might consider adding an additional virtual disk to your fog server then adding it to the LVM group for your fog server. There are a number of ways to go about this, but that discussion should be moved to a new thread.

              Ok, I’ll create a new post, thanks for your assistance.

              1 Reply Last reply Reply Quote 0
              • G george1421 referenced this topic on Aug 21, 2023, 2:14 AM
              • 1 / 1
              1 / 1
              • First post
                3/6
                Last post

              227

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project