Storage Node: No open slots, there are 0 before me
-
Server
- FOG Version: 1.4.0 stable
- OS: Centos 7.3
- OS: Win2012R2 (storage node)
Description
In a test setup with a FOG Master node and a WinStorage node. Replication happens as it should both nodes contain the same images.
I’m trying to force a pxe booting host to use the WinStorage node for deployment. On the master node I set max clients to 0 on the WinStorage node the client count is 10. This is similar to a typical setup with an external NAS acting like a fog storage node.
PXE booting the target computer results in “No open slots, there are 0 before me”.
The environment variables (on the pxe booting client) ftp, storage, and storage_ip all point to the master node.
I’m guessing either the master fog server doesn’t notice that the node max client is 0 and knows to roll over to the storage node, or the master fog server polls the WinStorage node and it doesn’t respond as expected (because the fog php code doesn’t exist on the storage node) so it uses itself, even if the max clients is 0.
The location plugin was not installed in this test environment.
-
Changing the master node to the WinStorage node didn’t make any changes to what the pxe client imaged from.
Disabling the master node in the storage management (with the WinStorage node enabled). Generated an error.
[Mon May 29 18:51:24.162257 2017] [:error] [pid 29073] [client 192.168.23.14:38006] PHP Warning: Division by zero in /var/www/html/fog/lib/fog/storagenode.class.php on line 293 [Mon May 29 18:52:43.118746 2017] [:error] [pid 29073] [client 192.168.50.173:46045] PHP Warning: Division by zero in /var/www/html/fog/lib/fog/storagenode.class.php on line 293, referer: http://192.168.50.192/fog/management/index.php?node=host&sub=deploy&id=2&type=1
-
Fairly sure I found this issue and it’s fixed in working branch for now.
The particular files you’ll need will be:
wget -O /var/www/fog/lib/fog/bootmenu.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working/packages/web/lib/fog/bootmenu.class.php
wget -O /var/www/fog/lib/fog/storagegroup.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working/packages/web/lib/fog/storagegroup.class.php
This should work properly now. Essentially it was sending storage information potentially twice and had some bad thoughts on getoptimalstoragenode and getenablednodes.
-
@Tom-Elliott Confirmed that your patch fixed rolling over to storage node if max clients = 0 on the master node.
I still get the divide by zero error if the master node is disabled by the check box in the storage node configuration if I try to deploy in that state. It does schedule the task (correctly not sure) but I get a web server timeout waiting for the gui to return from scheduling the task with the divide by zero error.
-
@george1421 Divide by 0 issue should be fixed with:
wget -O /var/www/fog/lib/fog/storagenode.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working/packages/web/lib/fog/storagenode.class.php
-
@Tom-Elliott The error continues to persist even after the update
The conditions are the master node is set to disabled in a storage group. When you attempt to deploy an image the deploy task get created and the above error is thrown and the page never refreshes only times out. If you pick another menu item them that page is painted.
Should the master know ever be disabled in a storage group? (probably not)
Would this ever happen in the wild?? (probably not)
Does it needs to be fixed ?? (only the developers will know that)