Setting up a Windows 2012 server as a FOG Storage Node
-
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.
- Go to the following URL: http://tftpd32.jounin.net/tftpd32_download.html and download the tftpd64 service edition (installer)
- Launch the installer you just downloaded.
- Read and agree to EULA if you accept it continue.
- Select (all) Options: Add start menu shortcuts, Add desktop icon, Start service Tftp32_svc, start service monitoring
- Use default install location: C:\Program Files\Tftpd64_SE
- Tftpd64 Service console should launch
- Select the Settings button
- Select the GLOBAL tab
- Uncheck all options except TFTP Sever. The only selection option we need is “TFTP Server”.
- Select the TFTP tab
- For the base directory, select the browse button and then navigate to the c:\share\tftpboot folder
- Select OK
- In the tftp options section enable PXE Compatibility option. Leave all other settings at their default
- 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 = checkedEnable the Location plugin
Plugin Management
Activate and install Location management pluginAdd Windows Storage Node to FOG’s configuration
Storage Management -> Add Storage node
-
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.
-
@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?
-
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.
-
@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.
-
@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.
-