https://wiki.fogproject.org/wiki/api.php?action=feedcontributions&user=Wayne-workman.28155&feedformat=atomFOG Project - User contributions [en]2024-03-28T19:26:41ZUser contributionsMediaWiki 1.30.0https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12657Migrate FOG2022-07-16T19:41:22Z<p>Wayne-workman.28155: More OS changes</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu to CentOS, or from CentOS to Debian, or any other combination. I would recommend the latest Debian release. Go through the normal steps of setting up the OS.<br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. The old and new fog servers do not need to be the same version of fog. The only restriction here is that you cannot downgrade. You can go from older to newer, but not from newer to older.<br />
<br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu Server or Debian, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There are a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -R /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12656Migrate FOG2022-07-16T19:38:13Z<p>Wayne-workman.28155: OS recommendations</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu to CentOS, or from CentOS to Debian, or any other combination. I would recommend the latest Debian release. Go through the normal steps of setting up the OS.<br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. The old and new fog servers do not need to be the same version of fog. The only restriction here is that you cannot downgrade. You can go from older to newer, but not from newer to older.<br />
<br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There are a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -R /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12655Migrate FOG2022-07-16T19:37:21Z<p>Wayne-workman.28155: upgrade OS recommendations</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 CentOS 7, or from CentOS to Debian, the new OS does not need need to match the old. I would recommend the latest Debian release. Go through the normal steps of setting up the OS.<br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. The old and new fog servers do not need to be the same version of fog. The only restriction here is that you cannot downgrade. You can go from older to newer, but not from newer to older.<br />
<br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There are a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -R /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=FOG_Client&diff=12653FOG Client2021-12-03T22:21:37Z<p>Wayne-workman.28155: </p>
<hr />
<div>This article applies to the new FOG Client, version 0.10+<br />
<br />
== The Different Installers ==<br />
<br />
The different installers are located in your FOG server's web interface. The link is always at the very bottom of every page, even if you're not logged into the fog server.<br />
<br />
[[File:Fog client link.png]]<br />
<br />
[[File:New FOGClient download link.png]]<br />
<br />
'''FOGService.msi''' - Windows only, and is ideal for network deployment.<br />
<br />
'''SmartInstaller.exe''' - This is the new default installer. It will work on all platforms.<br />
<br />
'''Debugger.exe''' - This is not listed in the web interface but is available from github [https://github.com/FOGProject/fog-client/releases here]. Only use this when the above two are not working. This build has more detailed logs that you can use for troubleshooting or a bug report.<br />
<br />
== Installing - Windows ==<br />
<br />
'''Prerequisites'''<br />
* .NET Framework version 4.0+ (Note: .NET 4 client profile will NOT work)<br />
You can download the framework from here: <br />
<br />
[https://www.microsoft.com/en-us/download/details.aspx?id=40779 Microsoft .NET Framework 4.5.1 (Offline Installer) for Windows Vista SP2, Windows 7 SP1, Windows 8, Windows Server 2008 SP2 Windows Server 2008 R2 SP1 and Windows Server 2012]<br />
<br />
Windows 10 comes with a version of .Net that will work.<br />
<br />
'''Installation'''<br />
* May use SmartInstaller or msi. Simply download either one of them and run.<br />
* Reboot to complete installation.<br />
<br />
'''Windows Limitations'''<br />
* CUPS printers are not yet supported<br />
<br />
== Installing - Linux ==<br />
<br />
'''Prerequisites'''<br />
* Mono (latest stable build)<br />
* xprintidle - This dependency is optional. If not installed AutoLogOut will not run. xprintidle basically just returns the idle time of an x window, therefore on a system without a GUI it is not needed and should not be installed. It should be available in standard package managers. E.G. apt-get, yum, or dnf<br />
<br />
=== Installing Mono ===<br />
<br />
Many distributions come with an out of date version of mono in their package manager. Therefore, do not attempt to install via your package manager without the below modifications or take a look at the instructions found on their website: https://www.mono-project.com/download/stable/#download-lin-centos<br />
<br />
'''Debian:'''<br />
<pre><br />
sudo apt install apt-transport-https dirmngr gnupg ca-certificates<br />
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF<br />
echo "deb https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list<br />
sudo apt update<br />
sudo apt install mono-complete<br />
</pre><br />
<br />
'''Ubuntu:'''<br />
<pre><br />
sudo apt install gnupg ca-certificates<br />
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF<br />
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list<br />
sudo apt update<br />
sudo apt install mono-complete<br />
</pre><br />
<br />
'''CentOS'''<br />
<pre><br />
rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"<br />
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'<br />
yum install mono-complete<br />
</pre><br />
<br />
'''openSUSE and SLES'''<br />
<br />
You can install mono using SUSE One-Click files: [http://download.mono-project.com/repo/mono-complete.ymp http://download.mono-project.com/repo/mono-complete.ymp]<br />
<br />
'''others'''<br />
<br />
The FOG Client can be installed on any platform that can run the latest stable build of mono. To install:<br />
<br />
* Check your package manager for <font color="red">mono-complete</font>. After installing it run <font color="red">mono --version</font>. Ensure the version is at least 4.2._ . If it not, remove the package.<br />
* If your package manager had an old version of mono, see [http://www.mono-project.com/docs/compiling-mono/linux/ here] for how to compile mono<br />
<br />
If your system either has systemd or initd the client will be automatically configured to run on startup. If your system does not have either, you will need to configure your system to run the manual start command below on startup.<br />
<br />
To manually start and stop the service:<br />
<br />
<pre><br />
sudo /opt/fog-service/control.sh start<br />
</pre><br />
<pre><br />
sudo /opt/fog-service/control.sh stop<br />
</pre><br />
<br />
<br />
=== Installing fog-client SmartInstaller ===<br />
<br />
* Download SmartInstaller.exe from your FOG server and run the installer with mono.<br />
** <font color="red">sudo mono SmartInstaller.exe</font><br />
* The client will install to /opt/fog-service , and fog.log will be located at /opt/fog-service/fog.log<br />
<br />
The service is automatically configured to run on startup. To manually start and stop the service:<br />
<br />
<pre><br />
sudo systemctl start FOGService<br />
</pre><br />
<pre><br />
sudo systemctl stop FOGService<br />
</pre><br />
<br />
To uninstall:<br />
<br />
<pre><br />
sudo systemctl stop FOGService<br />
sudo mono SmartInstaller.exe uninstall<br />
</pre><br />
<br />
<br />
=== Linux Limitations ===<br />
* The FOG Tray is currently incompatible on linux systems. Regardless of what you set during installation, it will not run.<br />
* The following modules / features are not yet supported<br />
** Active Directory joining<br />
** PrinterManager<br />
<br />
== Installing - OSX ==<br />
<br />
'''Prerequisites'''<br />
* Mono (latest stable build)<br />
<br />
'''Installing Mono'''<br />
* If you are running El Capitan, navigate to [http://www.mono-project.com/download/#download-mac http://www.mono-project.com/download/#download-mac] and download <font color=”red”>Mono Universal Installer</font> <br />
* Otherwise, navigate to [http://www.mono-project.com/download/#download-mac http://www.mono-project.com/download/#download-mac] and download <font color=”red”>Mono 32-bit</font> <br />
<br />
'''Installation'''<br />
* Download SmartInstaller.exe from your FOG server and run the installer with mono.<br />
** <font color="red">sudo mono SmartInstaller.exe</font><br />
* The client will install to /opt/fog-service , and fog.log will be located at /opt/fog-service/fog.log<br />
* Reboot the system to complete the installation.<br />
<br />
The service is automatically configured to run on startup. To manually start and stop the service:<br />
<br />
<pre><br />
sudo launchctl load -w /Library/LaunchDaemons/org.freeghost.daemon.plist<br />
</pre><br />
<pre><br />
sudo launchctl unload -w /Library/LaunchDaemons/org.freeghost.daemon.plist<br />
</pre><br />
<br />
To uninstall:<br />
<br />
<pre><br />
sudo launchctl unload -w /Library/LaunchDaemons/org.freeghost.daemon.plist<br />
sudo mono SmartInstaller.exe uninstall<br />
</pre><br />
<br />
'''OSX Limitations'''<br />
* The follow modules / features are not yet supported<br />
** PrinterManager<br />
<br />
'''Logging'''<br />
<br />
You can find the client log file in /opt/fog-service/fog.log<br />
<br />
== Additional Details ==<br />
<br />
=== Features overview ===<br />
<br />
<br />
The purpose of the FOG Client is multi-fold.<br />
<br />
The client allows the host to automatically:<br />
* Auto logout -- Enables auto logout of users if inactive for specified period of time. 5 minute's is the minimum time as all others are way too soon, sometimes people may just be on a phone, or had to step out for a bathroom break.<br />
<br />
* Client Updater -- (Only on legacy clients) Allows the client to update it's modules if you had to customize things, or found a more recent build was needed for your environment.<br />
<br />
* Directory Cleaner -- (Only on legacy clients -- Only worked with Windows XP) Enables the client to remove directories on the host automatically. It lost operation after Windows XP due to UAC controls and better security mechanisms especially needed. Removed completely from the New client.<br />
<br />
* Display Manager -- Enables the client to adjust the resolution of the system on a per system basis, or global basis.<br />
<br />
* Power Management -- Allows you to specify a shutdown, WOL, or restart on a per-host basis. Format for the scheduling is CRON, and can be done on an individual host or through groups. There is no limit to the number of scheduled power tasks.<br />
<br />
* Host Registration -- Registers additional mac addresses to a pre-existing host if registered. The New client will also register the host under a pending status if the host is not already registered.<br />
<br />
* Hostname Changer -- Changes the hostname and joins the domain automatically.<br />
<br />
* Printer Manager -- Manages Printers for the host. Legacy client only added printer or added/removed printers. The No management for both new and legacy simply does nothing. Will remove all printers under Add/Remove type and only add back the printers as needed (Only Assigned Printers). Under Add Only (now FOG Managed Printers) only manages printers that are listed under the printer's GUI and those that are assigned to that host. In legacy client, it only added printers and never removed. Under the new client, it will ONLY manage printers assigned meaning if you remove a printer from a host, the new client will remove that printer.<br />
<br />
* Snapins -- Allows you to install programs or run scripts on the host similar to GPO or PDQDeploy.<br />
<br />
* Task Reboot -- This will just check if the client is in a tasking (other than a snapin tasking). If it is in a tasking, and the module is enabled, the host will be told to reboot. There is a third portion though in that if the user is logged in, and enforce is not enabled nothing will happen.<br />
<br />
* User Cleanup -- (Legacy clients only and again only on Windows XP). Works similar to Directory Cleanup but the entries you make are "safe" user profiles. If the user is not under this listing, it will be deleted. Will not work with the new client, and even legacy clients will not work on anything beyond Windows XP due to UAC and Interactive Service utilities.<br />
<br />
* User Tracker -- Just tracks who logs in/out of a client.<br />
<br />
=== Polling Behavior ===<br />
<br />
The new FOG Client found in FOG 1.3.0 and the Legacy FOG Client both rely on polling to get instructions. This means the FOG Client will regularly check with the specified FOG Server for settings and tasks. The New FOG Client's polling frequency can be adjusted in the FOG Web interface, by going to <font color="red">FOG Configuration -> FOG Settings -> FOG Client -> FOG_CLIENT_CHECKIN_TIME</font>. The minimum value is 30 seconds, anything specified lower than this will result in the FOG Client using 30 second polling intervals.<br />
<br />
The checkin-time is not rigid. There is an automatic and random staggering that is added to the checkin time. This prevents a large number of FOG Clients checking in at once in the event that all computers are started at the same time via WOL tasks.<br />
<br />
The frequency of the checkin-time determines how quickly the FOG Client will receive instructions from the FOG Server. If an image deployment is scheduled for a computer that is turned on, with a checkin-time of 60 seconds, means the FOG Client may begin initiating the task anywhere from 0 to 60 seconds + the random staggering time that is added. This same concept would apply to immediate power management tasks, snapin tasks, capture tasks, and so on. Scheduled tasks are not affected by this behavior, and if the target system is on when the scheduled task is to be ran, this will happen on time.<br />
<br />
=== Security Design ===<br />
<br />
Communications between the FOG Client (0.9.9+) and the FOG Server (1.3.0+) are secured using public key infrastructure.<br />
<br />
A Certificate Authority and private key is generated on the FOG server during first installation in this location:<br />
<br />
<pre>/opt/fog/snapins/ssl</pre><br />
<br />
The public certificate is generally located here:<br />
<pre>/var/www/html/fog/management/other/ssl</pre><br />
<br />
The client installs your servers’ certificate and the FOG Project certificate.<br />
<br />
The “FOG Project” CA (made by the FOG Project) serves two purposes:<br />
<br />
*SYSTEM level services need to be digitally signed otherwise windows will throw security errors. This can also be used to ensure no tampering was done with the client files<br />
<br />
*That certificate is used to “verify” upgrades. Lets say we release a patch for the client, the client will download the MSI from your server and check if it was signed by us. If the MSI was somehow tampered, the digital signature would no longer be valid.<br />
<br />
Using HTTP over HTTPS has no security benefit to the client. Why? Because all traffic is already encrypted. Here’s a very basic overview of how the new client communicates<br />
<br />
*Each client has a security token. This is used to prove to the server that the client is the actual host and not an impersonator. This token gets cycled constantly. When the client first makes contact, it encrypts its token and a proposed AES 256 key using RSA 4096 using your server’s public key. This public key is verified against the pinned server CA certificate by checking the x509 chain and fingerprints.<br />
<br />
*If the server accepts the security token and the new AES key, all traffic from that point on is AES 256 encrypted using that securely transmitted key.<br />
<br />
The whole point of our security model is to allow for secure communication over insecure medians.<br />
Even then, the client installation has an HTTPS option, but it serves no real security benefit.<br />
<br />
References: <br />
<br />
[https://forums.fogproject.org/topic/6325/invalid-security-token-without-any-security-tokens-being-set-also-ca-ssl-security-concerns/6 CA SSL security concerns]<br />
<br />
[https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning Certificate and Public Key Pinning]<br />
<br />
[https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Certificate_and_Public_Key_Pinning Transport_Layer_Protection_Cheat_Sheet]<br />
<br />
==== Reset encryption data ====<br />
<br />
This pertains to the new fog client available in FOG 1.3.0 and above, and does not apply to the legacy fog client that was available in 1.2.0 and below.<br />
<br />
The "Reset encryption data" button can be found in an individual host's "General" area. You may also find this button in Groups "General" area. The “Reset encryption data” is mainly doing one thing: Clearing the security token for a host or group of hosts.<br />
<br />
Each host has a security token used by the client. This token is private; only the client knows it and is protected. It is used to prove the identity of the host, ensuring no one ‘fakes’ being a certain host. So when you 'Reset Encryption Data", you are essentially telling the server that the first host to say that they are the host in question gets ‘locked’ in (pinned is the technical term).<br />
<br />
In order to have encrypted traffic, the handshake must occur. During the handshake the server proves its identity to the client, and the client proves its identity to the server (using the security token). If the handshake fails (due to a bad security token), encryption cannot occur.<br />
<br />
The most common scenario where the security tokens for a client will be incorrect is if you manually uninstall a client, and then install it.<br />
<br />
If your Web interface is functional, you may place all computers into a group, and use the group to reset encryption on all hosts by simply clicking the "Reset encryption" button on the group's basic page. If you're web interface isn't working correctly and you need to manually reset the encryption for all hosts, you may follow the below steps.<br />
<br />
<pre><br />
mysql<br />
use fog<br />
UPDATE hosts SET hostPubKey="", hostSecToken="", hostSecTime="0000-00-00 00:00:00";<br />
</pre><br />
<br />
<br />
=== Maintain Control Of Hosts When Building New Server ===<br />
<br />
Related Article: [[Migrate FOG]]<br />
<br />
This section only applies if your hosts have the new FOG client installed. The new FOG Client has been available in FOG since FOG 1.3.0.<br />
<br />
Because of the security model of FOG 1.3.0 and the new client, without the proper CA and ssl certificates present on a new fog server, any currently deployed hosts with the new fog client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts with existing new fog client deployments, you must copy this directory from the old server to the new server:<br />
<br />
* <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
Copy the directory to a temporary location first. I would suggest <font color="red">/root</font><br />
<br />
<pre>cp -R /opt/fog/snapins/ssl /root</pre><br />
<br />
Then you can use scp to copy the directory (or some other method) to your new fog server. Run the below command from the '''old''' server, Where x.x.x.x is the new fog server's address:<br />
<br />
<pre>scp -rp /opt/fog/snapins/ssl root@x.x.x.x:/root</pre><br />
<br />
Or, the reverse. Run the below command from the '''new''' server, where x.x.x.x is the old fog server's address.<br />
<br />
<pre>scp -rp root@x.x.x.x:/opt/fog/snapins/ssl /root</pre><br />
<br />
Next, install fog. After the installation is complete, delete the ssl folder the installer made, and place your old ssl (from /root that you copied) in there. The ownership should be fogproject:apache on Red-Hat variants, should be fogproject:www-data on Debian variants. <font color="red">IMPORTANT:</font> Then '''re-run the installer.''' Instructions for the folder manipulation are below, assuming you followed the above instructions. On the '''new''' server:<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
cp -R /root/ssl /opt/fog/snapins/ssl<br />
chown -R fogproject:apache /opt/fog/snapins/ssl #or fogproject:www-data for ubuntu and debian<br />
</pre><br />
<br />
If you do not care about maintaining control of existing hosts with existing new fog client deployments (because there is only 1 or 2), you can recreate your CA with the -C argument during installation: <br />
<br />
<pre>./installfog.sh -C</pre><br />
<br />
<font color="red">Note:</font> Recreating the CA (<font color="red">--recreate-CA</font> or <font color="red"> -C</font>) is '''very strongly advised against''' if you have many clients deployed already, because it resets the identity of the FOG Server. This causes all fog clients to distrust the server, and will require total reinstallation of all fog clients in an environment. However, you may recreate the keys (<font color="red">--recreate-keys</font>) safely and be able to still control the fog clients.<br />
<br />
=== FOG Client 0.10.0+ Installation Options ===<br />
<br />
==== Smart Installer ====<br />
<br />
SmartInstaller Switches<br />
<br />
All switches with <font color="red">--{OPTION}</font> can also be used as <font color="red">/{OPTION}</font><br />
<br />
* <font color="red">--server=</font> Specify the server address. Default is fogserver<br />
* <font color="red">--webroot=</font> Specify the webroot. Default is /fog<br />
* <font color="red">-h</font> or <font color="red">-https</font> Use https for server communication<br />
* <font color="red">-r</font> or <font color="red">-rootlog</font> Put fog.log in the root of the filesystem<br />
* <font color="red">-s</font> or <font color="red">--start</font> Automatically start the service after installation. Linux only<br />
* <font color="red">-t</font> or <font color="red">--tray</font> Enabled the FOG Tray and notifications - Windows and OSX only.<br />
* <font color="red">-u</font> or <font color="red">--uninstall</font> Uninstall the client<br />
* <font color="red">--upgrade</font> Upgrade the client<br />
* <font color="red">-l=</font> or <font color="red">--log=</font> Specify where to put the SmartInstaller log<br />
<br />
Reference: [https://news.fogproject.org/fog-client-v0-11-0-released-2/ https://news.fogproject.org/fog-client-v0-11-0-released-2/]<br />
<br />
==== MSI Switches ====<br />
<br />
<font color="red">msiexec /i FOGService.msi /quiet USETRAY="0" HTTPS="0" WEBADDRESS="192.168.1.X" WEBROOT="/fog" ROOTLOG="0"</font><br />
<br />
Firstly, all options are optional. Here’s what they all do:<br />
<br />
* <font color="red">USETRAY=</font> defaults to <font color="red">"1"</font>, if <font color="red">"0"</font> the tray will be hidden<br />
<br />
* <font color="red">HTTPS=</font> defaults to <font color="red">"0"</font>, if <font color="red">"1"</font> the client will use HTTPS (not recommended)<br />
<br />
* <font color="red">WEBADDRESS=</font> defaults to <font color="red">"fogserver"</font>, this is the ip/dns name of your server<br />
<br />
* <font color="red">WEBROOT=</font> defaults to <font color="red">"/fog"</font><br />
<br />
* <font color="red">ROOTLOG=</font> defaults to <font color="red">"0"</font>, if <font color="red">"1"</font> the fog.log will be at C:\fog.log, otherwise %PROGRAMFILES%\FOG\fog.log<br />
<br />
Reference: [https://forums.fogproject.org/topic/6222/msi-silent-install-without-tray-icon/2 https://forums.fogproject.org/topic/6222/msi-silent-install-without-tray-icon/2]<br />
<br />
=== FOG Client with Sysprep ===<br />
<br />
If you plan to use Sysprep before image capture and are also planning to use the FOG Client, You '''must''' disable the <font color="red">FOGService</font> service from running at boot before you Sysprep to take your image, and then re-enable it within your <font color="red">SetupComplete.cmd</font> file so that it is re-enabled '''after''' the image deployment is complete.<br />
<br />
Failing to do so will break the Sysprep post-deployment process with an error message that says "Windows Setup could not configure Windows to run on this computer’s hardware.”<br />
<br />
* Disable FOGService: <font color="red">Windows Control Pannel -> View by Small Icons -> Administrative Tools -> Services -> Right click FOGService -> Properties -> Startup Type -> Disabled</font><br />
<br />
* Re-enable FOGService post-imaging:<br />
<br />
Create the below file.<br />
<br />
<font color="red">C:\Windows\Setup\scripts\SetupComplete.cmd</font><br />
<br />
Place these lines within the file, and then save.<br />
<br />
<pre>sc config FOGService start= delayed-auto<br />
shutdown -t 0 -r</pre><br />
<br />
As the filename indicates, the script is called by windows after an image is deployed and post-sysprep operations are complete. It will re-enable the FOGService and then reboot the computer gracefully. After the computer reboots, the FOGService will start automatically and rename the computer if necessary, reboot if necessary, join the domain and reboot if necessary, and then perform any associated snapins.<br />
<br />
<font color="red">Note:</font> SetupComplete.cmd will not automatically run on OEM versions of windows, but will automatically run on Non-OEM versions of Windows. If you're using an OEM copy, you can use firstlogoncommands in unattend.xml to call SetupComplete.cmd<br />
<br />
<br />
An example of the firstlogincommands might be:<br />
<pre><component name=“Microsoft-Windows-Shell-Setup” processorArchitecture=“amd64” publicKeyToken=“31bf3856ad364e35” language=“neutral” versionScope=“nonSxS” xmlns:wcm=“http://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”><br />
<FirstLogonCommands><br />
<SynchronousCommand wcm:action=“add”><br />
<Description>SetupComplete</Description><br />
<Order>1</Order><br />
<CommandLine>C:\Windows\Setup\Scripts\SetupComplete.cmd</CommandLine><br />
<RequiresUserInput>false</RequiresUserInput><br />
</SynchronousCommand><br />
</FirstLogonCommands></pre><br />
<br />
=== More Information ===<br />
<br />
More information about the fog client can be found here: [https://github.com/FOGProject/fog-client https://github.com/FOGProject/fog-client]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12651Migrate FOG2021-09-22T02:02:47Z<p>Wayne-workman.28155: /* Export Images */</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS.<br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. The old and new fog servers do not need to be the same version of fog. The only restriction here is that you cannot downgrade. You can go from older to newer, but not from newer to older.<br />
<br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There are a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -R /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12650Migrate FOG2021-09-22T02:01:10Z<p>Wayne-workman.28155: /* Migrating images & database */</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS.<br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. The old and new fog servers do not need to be the same version of fog. The only restriction here is that you cannot downgrade. You can go from older to newer, but not from newer to older.<br />
<br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There are a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12649Migrate FOG2021-09-22T02:00:08Z<p>Wayne-workman.28155: /* Building the new server */</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS.<br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. The old and new fog servers do not need to be the same version of fog. The only restriction here is that you cannot downgrade. You can go from older to newer, but not from newer to older.<br />
<br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There is a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12648Migrate FOG2021-09-22T01:59:34Z<p>Wayne-workman.28155: /* Building the new server */</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS. The old and new fog servers do not need to be the same version of fog. The only restriction here is that you cannot downgrade. You can go from older to newer, but not from newer to older.<br />
<br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. <br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There is a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12641Migrate FOG2021-01-11T00:23:39Z<p>Wayne-workman.28155: </p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS. <br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. <br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There is a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fogproject:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fogproject:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12640Migrate FOG2021-01-11T00:16:49Z<p>Wayne-workman.28155: </p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS. <br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. <br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There is a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. We are getting rid of the "dev" directory we brought over before the move happens. Also eliminating the new server's "postdownloadscripts" directory before the move. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
rm -rf /images/postdownloadscripts > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fog:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fog:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12639Migrate FOG2021-01-11T00:13:41Z<p>Wayne-workman.28155: </p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS. <br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. <br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There is a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
rm -rf /images/dev/dev > /dev/null 2>&1<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fog:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fog:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12638Migrate FOG2021-01-11T00:08:09Z<p>Wayne-workman.28155: </p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS. <br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. <br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There is a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fogproject:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fog:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fog:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Reset_WebUI_FOG_password&diff=12590Reset WebUI FOG password2018-11-23T16:08:05Z<p>Wayne-workman.28155: </p>
<hr />
<div>This is an older article. See the new one here: [[Password Central]]<br />
<br />
== Overview ==<br />
If somehow you lose access to the FOG server web interface, you can use the following procedure to connect to the MySQL database and reset the password for any existing FOG user. These user accounts and passwords are only for logging into the FOG server web interface and should not be confused with other fog users in the operating system.<br />
<br />
== Reset password ==<br />
<br />
On the FOG server where the MySQL "fog" database is installed, execute the commands:<br />
<br />
*If the root user in MySQL does ''not'' have a password (or it's stored in <tt>~/.my.cnf</tt>):<br />
<pre><br />
sudo mysql -u root fog<br />
</pre><br />
<br />
*If the root user in MySQL does ''have'' a password:<br />
<pre><br />
sudo mysql -u root -p fog<br />
</pre><br />
<br />
*Run this query to reset the password. You can change users other than "fog" by changing the uName value in the query.<br />
<pre><br />
UPDATE users SET uPass = MD5('password') WHERE uName = 'fog';<br />
exit;<br />
</pre><br />
<br />
Login to the WebUI with:<br />
*Username: fog<br />
*Password: password (or whatever you used in the query above inside the MD5 call)</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=FOG_security&diff=12581FOG security2018-08-17T19:46:55Z<p>Wayne-workman.28155: /* FIREWALLD */</p>
<hr />
<div>= FOG Security =<br />
<br />
Below are some of the most basics steps you can take to increase the security of your FOG server(s)<br />
<br />
== Firewall Settings ==<br />
<br />
Below are instructions on how to make FOG work with your firewall left on. If you encounter any scenario where this configuration does not work, please let us know [https://forums.fogproject.org/topic/6162/firewall-configuration here].<br />
<br />
===FIREWALLD VS IPTABLES===<br />
<br />
Firewalld is an IPTables wrapper. It comes installed on Centos 7 and newer fedora installs. If you do not have firewalld then you most likely will have IPTables. To check if you have firewalld run firewall-cmd. If the command runs fine (no command not found error) then you have firewalld.<br />
<br />
===FIREWALLD===<br />
<br />
<pre>yum install firewalld -y<br />
systemctl start firewalld<br />
systemctl enable firewalld<br />
for service in http https tftp ftp mysql nfs mountd rpc-bind proxy-dhcp; do firewall-cmd --permanent --zone=public --add-service=$service; <br />
done<br />
<br />
echo "Open UDP port 49152 through 65532, the possible used ports for fog multicast" <br />
firewall-cmd --permanent --add-port=49152-65532/udp<br />
echo "Allow IGMP traffic for multicast"<br />
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p igmp -j ACCEPT<br />
systemctl restart firewalld.service<br />
echo "Done."<br />
</pre><br />
<br />
===IPTABLES===<br />
<br />
Does not include multicast, if you know how to do it please let us know in the [https://forums.fogproject.org/ forums]. <br />
<br />
<pre>echo "IPTABLES_MODULES=\"nf_conntract_tftp nf_conntrack_ftp nf_conntrack_netbios_ns\"" >> /etc/sysconfig/iptables-config<br />
for port in 80 443 21 3306 2049 20048 111 138 139 445; do iptables -I INPUT 1 -p tcp --dport $port -j ACCEPT; done<br />
for port in 69 111 4011 137; do iptables -I INPUT 1 -p udp --dport $port -j ACCEPT; done<br />
service iptables save</pre><br />
<br />
===DHCP & DNS===<br />
<br />
If you use your FOG Server for DHCP or DNS run these commands as well.<br />
<br />
'''Firewalld Additions'''<br />
<br />
<pre>for service in dhcp dns; do firewall-cmd --permanent --zone=public --add-service=$service; done<br />
firewall-cmd --reload</pre><br />
<br />
'''IPTables Additions'''<br />
<br />
<pre>iptables -I INPUT 1 -p tcp --dport 53 -j ACCEPT;<br />
for port in 53 67; do iptables -I INPUT 1 -p udp --dport $port -j ACCEPT; done<br />
service iptables save</pre><br />
<br />
-------------<br />
<br />
<font color="red">The below settings have been tested on FOG 0.29 and 0.30 only. Alot of this stuff still applies to 1.2.0 and 1.3.0, but only generally and needs adapted.</font><br />
<br />
=== Reference ===<br />
<br />
[https://forums.fogproject.org/topic/6162/firewall-configuration firewall-configuration]<br />
<br />
== Secure MySQL ==<br />
<br />
If you have not secure your MySQL Database since installation, whether it was installed by FOG or via other methods, you need to take a few steps to secure it.<br />
<br />
MySQL comes with a little script that enables you to implement some basic security to your database, you only have to run the script but MAKE SURE to take note of the passwords you will set since you will need to provide them to FOG.<br />
<br />
* Run the MySQL secure installation script, to run it do this<br />
<br />
sudo mysql_secure_installation<br />
<br />
''Read what the script states since it's important that you understand what you are doing.''<br />
<br />
The script will allow you to set a root password for your database since it was '''blank!''' now set your password and make sure to take note of it. FOG will need it.<br />
<br />
When you are done run<br />
<br />
/etc/init.d/mysqld reload<br />
<br />
<br />
[http://dev.mysql.com/doc/refman/5.0/en/mysql-secure-installation.html More info:]<br />
<br />
If your interested in further secure your MySQL you can go to the link below, however bear in mind that I have not tested those changes. <br />
[http://www.symantec.com/connect/articles/securing-mysql-step-step Securing MySQL: step-by-step]<br />
<br />
<br />
== Securing your Images ==<br />
<br />
When FOG captures an image, it creates one or more image files for that computer. Depending on how your using FOG you may wanna secure your images directory. Since it's not necessary for other users to access this files we will restrict the access to root and to FOG.<br />
<br />
To fix Images folder ownership run (assuming /images/ is where you have your FOG images)<br />
<br />
chown -R fog:root /images/<br />
<br />
Then do to set up permissions<br />
<br />
chmod -R 770 /images/<br />
<br />
In theory you could(should?) go with a more restrictive set of permissions however, in reality FOG usually complains if we do.<br />
<br />
<br />
== Securing NFS ==<br />
<br />
NFS Shares are harder to secure cause of its nature. They constantly change ports, and give how FOG access them is not so easy to secure them and at the same time keep FOG working.<br />
<br />
<br />
''More to come on how to secure NFS soon!''<br />
<br />
<br />
== Other issues ==<br />
<br />
Unfortunately FOG design doesn't leave much room for security. It's hard to tighten the server and keep FOG working, however this doesn't mean we should ignore this security holes, in contrary we must keep watching them to avoid intrusions.<br />
<br />
<br />
Here's a list of some of FOG security problems still to be addressed.<br />
<br />
<br />
* '''No SSL Support on Web UI:''' (Tested on FOG 0.29 and 0.30) Tests performed in Apache and the use of ''RequireSSL'' option with FOG, showed that it cannot deal with the use of SSL, when server enforce SSL connections FOG fails to connect properly.''(Seems like next FOG version 0.33 will support SSL on its Web UI)''<br />
* '''NFS Shares'''. FOG design allows it to capture(write) images via nfs, this requires access to the nfs share from any computer you want to capture images from. An attacker could fill your disk and/or erase all files in /images/dev since is mounted as read and write for any client.''(nfs share /images/ is read only)''<br />
* '''Public availability of files:''' Since FOG files are served via TFTP and PXE, this means any computer on your network can access those files (as longs as they can network boot). This includes the Linux kernel that FOG uses. So any password you set up in the FOG menu is not really relevant for a technical user or an attacker.<br />
* '''Installation advices:''' During installation FOG recommends to turn off SELinux because it can get in the way of the installation and the way FOG works. Although this certainly allows FOG to work, is not good practice to turn SELinux off. Is better to set SELinux in permissive mode, and then run a few test with FOG so we can allow only the things it needs, and then put it back on, this can take some time to configure properly but it's the safest way to work.<br />
<br />
Experimental SELinux instructions (dec 2015) can be found here: [https://forums.fogproject.org/topic/6154/selinux-policy SELinux Policy]<br />
<br />
== Informing FOG of Changes ==<br />
<br />
'''Note:''' Below settings are from 2012 and pre-FOG 1.0.0, Fog 1.3.0 uses the MySQL Credentials found in the /opt/fog/.fogsettings file. More information can be found at: [[.fogsettings]]<br />
<br />
''This assumes you ONLY performed the steps mentioned in this wiki, if you made any other changes this guide might be incomplete for you.''<br />
<br />
<br />
FOG will start to complain it cannot access the MySQL Database case we set up a root password. Lets give FOG the password<br />
<br />
* Go to <br />
/opt/fog/service/etc/config.php<br />
Make sure the fields '''MYSQL_USERNAME''' reads '''root''' (or whatever user you wanna use) and for '''MYSQL_PASSWORD''' write down the password. Example<br />
<br />
define( "MYSQL_PASSWORD", "thisISmySUPERpass0*$98!" );<br />
<br />
''If your running FOG and MySQL in the same host, you need to check the line '''MYSQL_HOST''' so it reads '''localhost'''''<br />
define( "MYSQL_HOST", "localhost" );<br />
<br />
* Now go to <br />
/var/www/html/fog/commons/config.php<br />
and check the same 3 fields that we did before.<br />
<br />
define( "MYSQL_HOST", "localhost" );<br />
define( "MYSQL_DATABASE", "fog" );<br />
define( "MYSQL_USERNAME", "root" );<br />
define( "MYSQL_PASSWORD", "thisISmySUPERpass0*$98!" );<br />
<br />
Save everything and try to access FOG again and your done =)<br />
<br />
== Related articles ==<br />
<br />
[[FOG_Client#Security_design]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=.fogsettings&diff=12580.fogsettings2018-08-01T23:58:50Z<p>Wayne-workman.28155: /* Example .fogsettings file */</p>
<hr />
<div>In most versions of FOG (including 1.2.0 and 1.3.0), the low-level settings that are used during installation and some settings that simply cannot be stored in the database are contained in the /opt/fog/.fogsettings file.<br />
<br />
This file contains the setup of variables used within the installer during upgrades/installs.<br />
<br />
<br />
= Example .fogsettings file =<br />
<br />
An example .fogsettings file<br />
<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Find more information about this file in the FOG Project wiki:<br />
## https://wiki.fogproject.org/wiki/index.php?title=.fogsettings<br />
## Version: 1.5.4.8<br />
## Install time: Wed 01 Aug 2018 06:57:53 PM CDT<br />
ipaddress='10.0.0.39'<br />
copybackold='0'<br />
interface='ens3'<br />
submask='255.255.255.0'<br />
routeraddress='10.0.0.1'<br />
plainrouter='10.0.0.1'<br />
dnsaddress='208.67.222.222'<br />
username='fog'<br />
password='pgyf0wC7N1Gl7RmkNuG0uNKPnM8KYYn28phazwnrwQs='<br />
osid='2'<br />
osname='Debian'<br />
dodhcp='N'<br />
bldhcp='0'<br />
dhcpd=''<br />
blexports='1'<br />
installtype='N'<br />
snmysqluser='root'<br />
snmysqlpass=''<br />
snmysqlhost='localhost'<br />
installlang='0'<br />
storageLocation='/images'<br />
fogupdateloaded=1<br />
docroot='/var/www/'<br />
webroot='/fog/'<br />
caCreated='yes'<br />
httpproto='http'<br />
startrange=''<br />
endrange=''<br />
bootfilename='undionly.kpxe'<br />
packages='apache2 bc build-essential cpp curl g++ gawk gcc genisoimage gzip htmldoc isolinux lftp libapache2-mod-php7.0 libc6 libcurl3 liblzma-dev m4 mysql-client mysql-server net-tools nfs-kernel-server openssh-server php7.0 php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php-gettext sysv-rc-conf tar tftpd-hpa tftp-hpa unzip vsftpd wget xinetd zlib1g '<br />
noTftpBuild=''<br />
notpxedefaultfile=''<br />
sslpath='/opt/fog/snapins/ssl/'<br />
backupPath='/home/'<br />
php_ver='7.0'<br />
php_verAdds='-7.0'<br />
sslprivkey='/opt/fog/snapins/ssl//.srvprivate.key'<br />
## End of FOG Settings<br />
</pre><br />
<br />
= Definitions =<br />
== Header/Footer ==<br />
=== Header ===<br />
Only gives some simplistic information to help users.<br />
Does no actions just gives some information.<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
</pre><br />
=== Footer ===<br />
Does no actions, just tells where FOG's default variables are setup<br />
Any new items will go below this, and you can add your own variables.<br />
You can add variables wherever you want.<br />
<pre><br />
## End of FOG Settings<br />
</pre><br />
== IP Address ==<br />
Defines the IP address of the node/server.<br />
This is also used on servers to setup the default.ipxe file.<br />
<pre><br />
ipaddress='192.168.1.5'<br />
</pre><br />
== Interface ==<br />
This just sets the storage nodes/server interface as it will be stored in the Database. This used to be used for multicast setups and for the bandwidth graph. This is now setup so it is only used on the bandwidth graph as we already know the ip address anyway. Multicast tasks can get their own interface instead of relying on user entry.<br />
<pre><br />
interface='eth0'<br />
</pre><br />
== Linux Login/FTP ==<br />
=== Username ===<br />
This variable is the user setup for the linux user on the server. This allows a user to login to the server/node under this username through linux. The purpose of this is more specifically setup for FTP usage.<br />
<pre><br />
username='fog'<br />
</pre><br />
=== Password ===<br />
This is the linux fog user password. It is randomly generated if the value is not already defined. Every update will reset the password to what is in this field. You should, if you predefined a fog user and the installation is the first time, create the /opt/fog/.fogsettings file. Only add the password field to ensure your password doesn't get changed accidentally.<br />
<pre><br />
password='Some!random_Password\here0918358'<br />
</pre><br />
== OS Information ==<br />
=== OS Identifier ===<br />
This is the OS identifier used during the installation. The value is numeric.<br />
<br />
Valid Values are:<br />
# Redhat based.<br />
# Debian based.<br />
# Arch<br />
<br />
<pre><br />
osid='2'<br />
</pre><br />
=== OS Name ===<br />
This is the name of the OS as it's being installed.<br />
<pre><br />
osname='Debian'<br />
</pre><br />
== DHCP ==<br />
=== DNS Address ===<br />
Used for DHCP setup.<br />
<pre><br />
dnsaddress='192.168.1.5'<br />
</pre><br />
=== dnsbootimage ===<br />
No longer used. It's purpose was originally because the FOS (Fog Operating System -- init.xz/init_32.xz/init.gz) did not dynamically get the dns address from DHCP as dhcp was not called.<br />
<pre><br />
dnsbootimage='192.168.1.5'<br />
</pre><br />
=== Subnet Mask ===<br />
This defines the subnet mask to use if the system is to be used as a DHCP server. It will assume the subnet mask of the interface being used, but can be changed later if you see fit.<br />
<pre><br />
submask='255.255.255.0'<br />
</pre><br />
=== Router Address ===<br />
This will setup the router address to use if the system is to be used as a DHCP server. It currently only sets as an ip address, but in the past contained the whole dhcp configuration string. The config string was removed as it would only work on isc-dhcp-server, when some might be using dnsmasq or another dhcp server.<br />
<pre><br />
routeraddress='192.168.1.1'<br />
</pre><br />
=== Plain Router ===<br />
Very similar to the Router Address elements above, but can be used to redirect to maybe another router/switch other than the main.<br />
<pre><br />
plainrouter='192.168.1.1'<br />
</pre><br />
=== dodhcp ===<br />
Just tells if we want fog to install dhcp.<br />
<pre><br />
dodhcp='N'<br />
</pre><br />
=== bldhcp ===<br />
Same, more or less, as dodhcp<br />
<pre><br />
bldhcp='0'<br />
</pre><br />
=== dhcpd ===<br />
Defines what package to install for dhcp server.<br />
<pre><br />
dhcpd='isc-dhcp-server'<br />
</pre><br />
=== startrange ===<br />
<pre><br />
startrange=''<br />
</pre><br />
=== endrange ===<br />
<pre><br />
endrange=''<br />
</pre><br />
=== bootfilename ===<br />
<pre><br />
bootfilename='undionly.kpxe'<br />
</pre><br />
== NFS ==<br />
Defines if the installer should rebuild the exports every time. Setting to 0 will ensure the exports file for nfs does not get rebuilt. Setting to 1 will update the exports file.<br />
<pre><br />
blexports='1'<br />
</pre><br />
== Type of installation ==<br />
Just tells the installer if this is going to be a full server, or a node. If it's a node, the value will be S. If it's a full server, the value will be N.<br />
<pre><br />
installtype='N'<br />
</pre><br />
== Database Information ==<br />
=== MySQL User ===<br />
This is the username to connect to the database as. Blank will default to connecting as user root.<br />
<pre><br />
snmysqluser=''<br />
</pre><br />
=== MySQL Password ===<br />
This is the password to connect to the database.<br />
<pre><br />
snmysqlpass=''<br />
</pre><br />
=== MySQL Host ===<br />
This is the host to connect to the database. Blank will default to localhost/127.0.0.1.<br />
<pre><br />
snmysqlhost=''<br />
</pre><br />
== Language ==<br />
Language packs for the OS can be installed. This enables more appropriate translations of information.<br />
<pre><br />
installlang='0'<br />
</pre><br />
== Donate ==<br />
Donate seems a bit strange a name for this. What it does, however, is not pass money. It's a different method that tells the server if it's going to allow mining of bitcoins during the imaging phases. Donation can be disabled later and this value will have no more effect during updates. It only operates to define setting during fresh installs.<br />
<pre><br />
donate='0'<br />
</pre><br />
== Image storage ==<br />
This defines the location for image storage. This is just a string value to the path of your images location.<br />
<pre><br />
storageLocation='/images'<br />
</pre><br />
<br />
== Updating ==<br />
This defines if the update file is loaded. 1 is the set value after fresh install. When the .fogsettings file is loaded this value is checked and tells the system to perform an update. If this isn't 1 or the variable is not found, it requests "input" from the user (unless you're running with the -y argument).<br />
<pre><br />
fogupdateloaded=1<br />
</pre><br />
<br />
== HTTP Configuration paths ==<br />
=== docroot ===<br />
This value tells httpd where the document root will be for the GUI.<br />
For example, when you go to http://127.0.0.1/ The document root is looking on the server at the docroot location for files to present to the user.<br />
<pre><br />
docroot='/var/www/html/'<br />
</pre><br />
=== webroot ===<br />
This value tells FOG where the webroot is. Webroot is the link to actually get to the FOG GUI. If the value is just '/' you would be accessing the FOG GUI with the link http://127.0.0.1/. If it's 'fog/' you are accessing the GUI as http://127.0.0.1/fog/.<br />
<pre><br />
webroot='fog/'<br />
</pre><br />
<br />
== caCreated ==<br />
<pre><br />
caCreated='yes'<br />
</pre><br />
== packages ==<br />
<br />
Debian 9 example as of August 1st, 2018. This requires the Remi repository to be installed (which the fog installer sets up for you).<br />
<pre><br />
packages='apache2 bc build-essential cpp curl g++ gawk gcc genisoimage gzip htmldoc isolinux lftp libapache2-mod-php7.0 libc6 libcurl3 liblzma-dev m4 mysql-client mysql-server net-tools nfs-kernel-server openssh-server php7.0 php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-mysqlnd php-gettext sysv-rc-conf tar tftpd-hpa tftp-hpa unzip vsftpd wget xinetd zlib1g'<br />
</pre><br />
<br />
CentOS 7 example as of August 1st, 2018. These packages require the epel repository (which the fog installer sets up for you).<br />
<pre><br />
packages='bc curl gcc gcc-c++ genisoimage gzip httpd lftp m4 make mod_ssl mtools mysql mysql-server net-tools nfs-utils php php-bcmath php-cli php-common php-fpm php-gd php-ldap php-mbstring php-mcrypt php-mysqlnd php-process syslinux tar tftp-server unzip vsftpd wget xinetd xz-devel'<br />
</pre><br />
<br />
== noTftpBuild ==<br />
<pre><br />
noTftpBuild=''<br />
</pre><br />
== nopxedefaultfile ==<br />
<pre><br />
notpxedefaultfile=''<br />
</pre><br />
== sslpath ==<br />
<pre><br />
sslpath='/opt/fog/snapins/ssl/'<br />
</pre><br />
== backupPath ==<br />
<pre><br />
backupPath='/home/'<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=.fogsettings&diff=12579.fogsettings2018-08-01T23:52:56Z<p>Wayne-workman.28155: /* packages */</p>
<hr />
<div>In most versions of FOG (including 1.2.0 and 1.3.0), the low-level settings that are used during installation and some settings that simply cannot be stored in the database are contained in the /opt/fog/.fogsettings file.<br />
<br />
This file contains the setup of variables used within the installer during upgrades/installs.<br />
<br />
<br />
= Example .fogsettings file =<br />
<br />
An example .fogsettings file<br />
<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
ipaddress='192.168.1.5'<br />
interface='eth0'<br />
submask='255.255.255.0'<br />
routeraddress='192.168.1.1'<br />
plainrouter='192.168.1.1'<br />
dnsaddress='192.168.1.1'<br />
dnsbootimage='192.168.1.1'<br />
username='fog'<br />
password='Some!random_Password\here0918358'<br />
osid='2'<br />
osname='Debian'<br />
dodhcp='N'<br />
bldhcp='0'<br />
dhcpd='isc-dhcp-server'<br />
blexports='1'<br />
installtype='N'<br />
snmysqluser=''<br />
snmysqlpass=''<br />
snmysqlhost=''<br />
installlang='0'<br />
donate='0'<br />
storageLocation='/images'<br />
fogupdateloaded=1<br />
docroot='/var/www/html/'<br />
webroot='fog/'<br />
caCreated='yes'<br />
startrange=''<br />
endrange=''<br />
bootfilename='undionly.kpxe'<br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
noTftpBuild=''<br />
notpxedefaultfile=''<br />
sslpath='/opt/fog/snapins/ssl/'<br />
backupPath='/home/'<br />
## End of FOG Settings<br />
</pre><br />
<br />
<br />
<br />
= Definitions =<br />
== Header/Footer ==<br />
=== Header ===<br />
Only gives some simplistic information to help users.<br />
Does no actions just gives some information.<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
</pre><br />
=== Footer ===<br />
Does no actions, just tells where FOG's default variables are setup<br />
Any new items will go below this, and you can add your own variables.<br />
You can add variables wherever you want.<br />
<pre><br />
## End of FOG Settings<br />
</pre><br />
== IP Address ==<br />
Defines the IP address of the node/server.<br />
This is also used on servers to setup the default.ipxe file.<br />
<pre><br />
ipaddress='192.168.1.5'<br />
</pre><br />
== Interface ==<br />
This just sets the storage nodes/server interface as it will be stored in the Database. This used to be used for multicast setups and for the bandwidth graph. This is now setup so it is only used on the bandwidth graph as we already know the ip address anyway. Multicast tasks can get their own interface instead of relying on user entry.<br />
<pre><br />
interface='eth0'<br />
</pre><br />
== Linux Login/FTP ==<br />
=== Username ===<br />
This variable is the user setup for the linux user on the server. This allows a user to login to the server/node under this username through linux. The purpose of this is more specifically setup for FTP usage.<br />
<pre><br />
username='fog'<br />
</pre><br />
=== Password ===<br />
This is the linux fog user password. It is randomly generated if the value is not already defined. Every update will reset the password to what is in this field. You should, if you predefined a fog user and the installation is the first time, create the /opt/fog/.fogsettings file. Only add the password field to ensure your password doesn't get changed accidentally.<br />
<pre><br />
password='Some!random_Password\here0918358'<br />
</pre><br />
== OS Information ==<br />
=== OS Identifier ===<br />
This is the OS identifier used during the installation. The value is numeric.<br />
<br />
Valid Values are:<br />
# Redhat based.<br />
# Debian based.<br />
# Arch<br />
<br />
<pre><br />
osid='2'<br />
</pre><br />
=== OS Name ===<br />
This is the name of the OS as it's being installed.<br />
<pre><br />
osname='Debian'<br />
</pre><br />
== DHCP ==<br />
=== DNS Address ===<br />
Used for DHCP setup.<br />
<pre><br />
dnsaddress='192.168.1.5'<br />
</pre><br />
=== dnsbootimage ===<br />
No longer used. It's purpose was originally because the FOS (Fog Operating System -- init.xz/init_32.xz/init.gz) did not dynamically get the dns address from DHCP as dhcp was not called.<br />
<pre><br />
dnsbootimage='192.168.1.5'<br />
</pre><br />
=== Subnet Mask ===<br />
This defines the subnet mask to use if the system is to be used as a DHCP server. It will assume the subnet mask of the interface being used, but can be changed later if you see fit.<br />
<pre><br />
submask='255.255.255.0'<br />
</pre><br />
=== Router Address ===<br />
This will setup the router address to use if the system is to be used as a DHCP server. It currently only sets as an ip address, but in the past contained the whole dhcp configuration string. The config string was removed as it would only work on isc-dhcp-server, when some might be using dnsmasq or another dhcp server.<br />
<pre><br />
routeraddress='192.168.1.1'<br />
</pre><br />
=== Plain Router ===<br />
Very similar to the Router Address elements above, but can be used to redirect to maybe another router/switch other than the main.<br />
<pre><br />
plainrouter='192.168.1.1'<br />
</pre><br />
=== dodhcp ===<br />
Just tells if we want fog to install dhcp.<br />
<pre><br />
dodhcp='N'<br />
</pre><br />
=== bldhcp ===<br />
Same, more or less, as dodhcp<br />
<pre><br />
bldhcp='0'<br />
</pre><br />
=== dhcpd ===<br />
Defines what package to install for dhcp server.<br />
<pre><br />
dhcpd='isc-dhcp-server'<br />
</pre><br />
=== startrange ===<br />
<pre><br />
startrange=''<br />
</pre><br />
=== endrange ===<br />
<pre><br />
endrange=''<br />
</pre><br />
=== bootfilename ===<br />
<pre><br />
bootfilename='undionly.kpxe'<br />
</pre><br />
== NFS ==<br />
Defines if the installer should rebuild the exports every time. Setting to 0 will ensure the exports file for nfs does not get rebuilt. Setting to 1 will update the exports file.<br />
<pre><br />
blexports='1'<br />
</pre><br />
== Type of installation ==<br />
Just tells the installer if this is going to be a full server, or a node. If it's a node, the value will be S. If it's a full server, the value will be N.<br />
<pre><br />
installtype='N'<br />
</pre><br />
== Database Information ==<br />
=== MySQL User ===<br />
This is the username to connect to the database as. Blank will default to connecting as user root.<br />
<pre><br />
snmysqluser=''<br />
</pre><br />
=== MySQL Password ===<br />
This is the password to connect to the database.<br />
<pre><br />
snmysqlpass=''<br />
</pre><br />
=== MySQL Host ===<br />
This is the host to connect to the database. Blank will default to localhost/127.0.0.1.<br />
<pre><br />
snmysqlhost=''<br />
</pre><br />
== Language ==<br />
Language packs for the OS can be installed. This enables more appropriate translations of information.<br />
<pre><br />
installlang='0'<br />
</pre><br />
== Donate ==<br />
Donate seems a bit strange a name for this. What it does, however, is not pass money. It's a different method that tells the server if it's going to allow mining of bitcoins during the imaging phases. Donation can be disabled later and this value will have no more effect during updates. It only operates to define setting during fresh installs.<br />
<pre><br />
donate='0'<br />
</pre><br />
== Image storage ==<br />
This defines the location for image storage. This is just a string value to the path of your images location.<br />
<pre><br />
storageLocation='/images'<br />
</pre><br />
<br />
== Updating ==<br />
This defines if the update file is loaded. 1 is the set value after fresh install. When the .fogsettings file is loaded this value is checked and tells the system to perform an update. If this isn't 1 or the variable is not found, it requests "input" from the user (unless you're running with the -y argument).<br />
<pre><br />
fogupdateloaded=1<br />
</pre><br />
<br />
== HTTP Configuration paths ==<br />
=== docroot ===<br />
This value tells httpd where the document root will be for the GUI.<br />
For example, when you go to http://127.0.0.1/ The document root is looking on the server at the docroot location for files to present to the user.<br />
<pre><br />
docroot='/var/www/html/'<br />
</pre><br />
=== webroot ===<br />
This value tells FOG where the webroot is. Webroot is the link to actually get to the FOG GUI. If the value is just '/' you would be accessing the FOG GUI with the link http://127.0.0.1/. If it's 'fog/' you are accessing the GUI as http://127.0.0.1/fog/.<br />
<pre><br />
webroot='fog/'<br />
</pre><br />
<br />
== caCreated ==<br />
<pre><br />
caCreated='yes'<br />
</pre><br />
== packages ==<br />
<br />
Debian 9 example as of August 1st, 2018. This requires the Remi repository to be installed (which the fog installer sets up for you).<br />
<pre><br />
packages='apache2 bc build-essential cpp curl g++ gawk gcc genisoimage gzip htmldoc isolinux lftp libapache2-mod-php7.0 libc6 libcurl3 liblzma-dev m4 mysql-client mysql-server net-tools nfs-kernel-server openssh-server php7.0 php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-mysqlnd php-gettext sysv-rc-conf tar tftpd-hpa tftp-hpa unzip vsftpd wget xinetd zlib1g'<br />
</pre><br />
<br />
CentOS 7 example as of August 1st, 2018. These packages require the epel repository (which the fog installer sets up for you).<br />
<pre><br />
packages='bc curl gcc gcc-c++ genisoimage gzip httpd lftp m4 make mod_ssl mtools mysql mysql-server net-tools nfs-utils php php-bcmath php-cli php-common php-fpm php-gd php-ldap php-mbstring php-mcrypt php-mysqlnd php-process syslinux tar tftp-server unzip vsftpd wget xinetd xz-devel'<br />
</pre><br />
<br />
== noTftpBuild ==<br />
<pre><br />
noTftpBuild=''<br />
</pre><br />
== nopxedefaultfile ==<br />
<pre><br />
notpxedefaultfile=''<br />
</pre><br />
== sslpath ==<br />
<pre><br />
sslpath='/opt/fog/snapins/ssl/'<br />
</pre><br />
== backupPath ==<br />
<pre><br />
backupPath='/home/'<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=.fogsettings&diff=12578.fogsettings2018-08-01T23:50:23Z<p>Wayne-workman.28155: /* packages */</p>
<hr />
<div>In most versions of FOG (including 1.2.0 and 1.3.0), the low-level settings that are used during installation and some settings that simply cannot be stored in the database are contained in the /opt/fog/.fogsettings file.<br />
<br />
This file contains the setup of variables used within the installer during upgrades/installs.<br />
<br />
<br />
= Example .fogsettings file =<br />
<br />
An example .fogsettings file<br />
<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
ipaddress='192.168.1.5'<br />
interface='eth0'<br />
submask='255.255.255.0'<br />
routeraddress='192.168.1.1'<br />
plainrouter='192.168.1.1'<br />
dnsaddress='192.168.1.1'<br />
dnsbootimage='192.168.1.1'<br />
username='fog'<br />
password='Some!random_Password\here0918358'<br />
osid='2'<br />
osname='Debian'<br />
dodhcp='N'<br />
bldhcp='0'<br />
dhcpd='isc-dhcp-server'<br />
blexports='1'<br />
installtype='N'<br />
snmysqluser=''<br />
snmysqlpass=''<br />
snmysqlhost=''<br />
installlang='0'<br />
donate='0'<br />
storageLocation='/images'<br />
fogupdateloaded=1<br />
docroot='/var/www/html/'<br />
webroot='fog/'<br />
caCreated='yes'<br />
startrange=''<br />
endrange=''<br />
bootfilename='undionly.kpxe'<br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
noTftpBuild=''<br />
notpxedefaultfile=''<br />
sslpath='/opt/fog/snapins/ssl/'<br />
backupPath='/home/'<br />
## End of FOG Settings<br />
</pre><br />
<br />
<br />
<br />
= Definitions =<br />
== Header/Footer ==<br />
=== Header ===<br />
Only gives some simplistic information to help users.<br />
Does no actions just gives some information.<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
</pre><br />
=== Footer ===<br />
Does no actions, just tells where FOG's default variables are setup<br />
Any new items will go below this, and you can add your own variables.<br />
You can add variables wherever you want.<br />
<pre><br />
## End of FOG Settings<br />
</pre><br />
== IP Address ==<br />
Defines the IP address of the node/server.<br />
This is also used on servers to setup the default.ipxe file.<br />
<pre><br />
ipaddress='192.168.1.5'<br />
</pre><br />
== Interface ==<br />
This just sets the storage nodes/server interface as it will be stored in the Database. This used to be used for multicast setups and for the bandwidth graph. This is now setup so it is only used on the bandwidth graph as we already know the ip address anyway. Multicast tasks can get their own interface instead of relying on user entry.<br />
<pre><br />
interface='eth0'<br />
</pre><br />
== Linux Login/FTP ==<br />
=== Username ===<br />
This variable is the user setup for the linux user on the server. This allows a user to login to the server/node under this username through linux. The purpose of this is more specifically setup for FTP usage.<br />
<pre><br />
username='fog'<br />
</pre><br />
=== Password ===<br />
This is the linux fog user password. It is randomly generated if the value is not already defined. Every update will reset the password to what is in this field. You should, if you predefined a fog user and the installation is the first time, create the /opt/fog/.fogsettings file. Only add the password field to ensure your password doesn't get changed accidentally.<br />
<pre><br />
password='Some!random_Password\here0918358'<br />
</pre><br />
== OS Information ==<br />
=== OS Identifier ===<br />
This is the OS identifier used during the installation. The value is numeric.<br />
<br />
Valid Values are:<br />
# Redhat based.<br />
# Debian based.<br />
# Arch<br />
<br />
<pre><br />
osid='2'<br />
</pre><br />
=== OS Name ===<br />
This is the name of the OS as it's being installed.<br />
<pre><br />
osname='Debian'<br />
</pre><br />
== DHCP ==<br />
=== DNS Address ===<br />
Used for DHCP setup.<br />
<pre><br />
dnsaddress='192.168.1.5'<br />
</pre><br />
=== dnsbootimage ===<br />
No longer used. It's purpose was originally because the FOS (Fog Operating System -- init.xz/init_32.xz/init.gz) did not dynamically get the dns address from DHCP as dhcp was not called.<br />
<pre><br />
dnsbootimage='192.168.1.5'<br />
</pre><br />
=== Subnet Mask ===<br />
This defines the subnet mask to use if the system is to be used as a DHCP server. It will assume the subnet mask of the interface being used, but can be changed later if you see fit.<br />
<pre><br />
submask='255.255.255.0'<br />
</pre><br />
=== Router Address ===<br />
This will setup the router address to use if the system is to be used as a DHCP server. It currently only sets as an ip address, but in the past contained the whole dhcp configuration string. The config string was removed as it would only work on isc-dhcp-server, when some might be using dnsmasq or another dhcp server.<br />
<pre><br />
routeraddress='192.168.1.1'<br />
</pre><br />
=== Plain Router ===<br />
Very similar to the Router Address elements above, but can be used to redirect to maybe another router/switch other than the main.<br />
<pre><br />
plainrouter='192.168.1.1'<br />
</pre><br />
=== dodhcp ===<br />
Just tells if we want fog to install dhcp.<br />
<pre><br />
dodhcp='N'<br />
</pre><br />
=== bldhcp ===<br />
Same, more or less, as dodhcp<br />
<pre><br />
bldhcp='0'<br />
</pre><br />
=== dhcpd ===<br />
Defines what package to install for dhcp server.<br />
<pre><br />
dhcpd='isc-dhcp-server'<br />
</pre><br />
=== startrange ===<br />
<pre><br />
startrange=''<br />
</pre><br />
=== endrange ===<br />
<pre><br />
endrange=''<br />
</pre><br />
=== bootfilename ===<br />
<pre><br />
bootfilename='undionly.kpxe'<br />
</pre><br />
== NFS ==<br />
Defines if the installer should rebuild the exports every time. Setting to 0 will ensure the exports file for nfs does not get rebuilt. Setting to 1 will update the exports file.<br />
<pre><br />
blexports='1'<br />
</pre><br />
== Type of installation ==<br />
Just tells the installer if this is going to be a full server, or a node. If it's a node, the value will be S. If it's a full server, the value will be N.<br />
<pre><br />
installtype='N'<br />
</pre><br />
== Database Information ==<br />
=== MySQL User ===<br />
This is the username to connect to the database as. Blank will default to connecting as user root.<br />
<pre><br />
snmysqluser=''<br />
</pre><br />
=== MySQL Password ===<br />
This is the password to connect to the database.<br />
<pre><br />
snmysqlpass=''<br />
</pre><br />
=== MySQL Host ===<br />
This is the host to connect to the database. Blank will default to localhost/127.0.0.1.<br />
<pre><br />
snmysqlhost=''<br />
</pre><br />
== Language ==<br />
Language packs for the OS can be installed. This enables more appropriate translations of information.<br />
<pre><br />
installlang='0'<br />
</pre><br />
== Donate ==<br />
Donate seems a bit strange a name for this. What it does, however, is not pass money. It's a different method that tells the server if it's going to allow mining of bitcoins during the imaging phases. Donation can be disabled later and this value will have no more effect during updates. It only operates to define setting during fresh installs.<br />
<pre><br />
donate='0'<br />
</pre><br />
== Image storage ==<br />
This defines the location for image storage. This is just a string value to the path of your images location.<br />
<pre><br />
storageLocation='/images'<br />
</pre><br />
<br />
== Updating ==<br />
This defines if the update file is loaded. 1 is the set value after fresh install. When the .fogsettings file is loaded this value is checked and tells the system to perform an update. If this isn't 1 or the variable is not found, it requests "input" from the user (unless you're running with the -y argument).<br />
<pre><br />
fogupdateloaded=1<br />
</pre><br />
<br />
== HTTP Configuration paths ==<br />
=== docroot ===<br />
This value tells httpd where the document root will be for the GUI.<br />
For example, when you go to http://127.0.0.1/ The document root is looking on the server at the docroot location for files to present to the user.<br />
<pre><br />
docroot='/var/www/html/'<br />
</pre><br />
=== webroot ===<br />
This value tells FOG where the webroot is. Webroot is the link to actually get to the FOG GUI. If the value is just '/' you would be accessing the FOG GUI with the link http://127.0.0.1/. If it's 'fog/' you are accessing the GUI as http://127.0.0.1/fog/.<br />
<pre><br />
webroot='fog/'<br />
</pre><br />
<br />
== caCreated ==<br />
<pre><br />
caCreated='yes'<br />
</pre><br />
== packages ==<br />
<br />
Debian example.<br />
<pre><br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
</pre><br />
<br />
CentOS 7 example as of August 1st, 2018. These packages require the epel repository (which the fog installer sets up for you).<br />
<pre><br />
bc curl gcc gcc-c++ genisoimage gzip httpd lftp m4 make mod_ssl mtools mysql mysql-server net-tools nfs-utils php php-bcmath php-cli php-common php-fpm php-gd php-ldap php-mbstring php-mcrypt php-mysqlnd php-process syslinux tar tftp-server unzip vsftpd wget xinetd xz-devel<br />
</pre><br />
<br />
== noTftpBuild ==<br />
<pre><br />
noTftpBuild=''<br />
</pre><br />
== nopxedefaultfile ==<br />
<pre><br />
notpxedefaultfile=''<br />
</pre><br />
== sslpath ==<br />
<pre><br />
sslpath='/opt/fog/snapins/ssl/'<br />
</pre><br />
== backupPath ==<br />
<pre><br />
backupPath='/home/'<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=.fogsettings&diff=12577.fogsettings2018-08-01T23:49:35Z<p>Wayne-workman.28155: </p>
<hr />
<div>In most versions of FOG (including 1.2.0 and 1.3.0), the low-level settings that are used during installation and some settings that simply cannot be stored in the database are contained in the /opt/fog/.fogsettings file.<br />
<br />
This file contains the setup of variables used within the installer during upgrades/installs.<br />
<br />
<br />
= Example .fogsettings file =<br />
<br />
An example .fogsettings file<br />
<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
ipaddress='192.168.1.5'<br />
interface='eth0'<br />
submask='255.255.255.0'<br />
routeraddress='192.168.1.1'<br />
plainrouter='192.168.1.1'<br />
dnsaddress='192.168.1.1'<br />
dnsbootimage='192.168.1.1'<br />
username='fog'<br />
password='Some!random_Password\here0918358'<br />
osid='2'<br />
osname='Debian'<br />
dodhcp='N'<br />
bldhcp='0'<br />
dhcpd='isc-dhcp-server'<br />
blexports='1'<br />
installtype='N'<br />
snmysqluser=''<br />
snmysqlpass=''<br />
snmysqlhost=''<br />
installlang='0'<br />
donate='0'<br />
storageLocation='/images'<br />
fogupdateloaded=1<br />
docroot='/var/www/html/'<br />
webroot='fog/'<br />
caCreated='yes'<br />
startrange=''<br />
endrange=''<br />
bootfilename='undionly.kpxe'<br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
noTftpBuild=''<br />
notpxedefaultfile=''<br />
sslpath='/opt/fog/snapins/ssl/'<br />
backupPath='/home/'<br />
## End of FOG Settings<br />
</pre><br />
<br />
<br />
<br />
= Definitions =<br />
== Header/Footer ==<br />
=== Header ===<br />
Only gives some simplistic information to help users.<br />
Does no actions just gives some information.<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
</pre><br />
=== Footer ===<br />
Does no actions, just tells where FOG's default variables are setup<br />
Any new items will go below this, and you can add your own variables.<br />
You can add variables wherever you want.<br />
<pre><br />
## End of FOG Settings<br />
</pre><br />
== IP Address ==<br />
Defines the IP address of the node/server.<br />
This is also used on servers to setup the default.ipxe file.<br />
<pre><br />
ipaddress='192.168.1.5'<br />
</pre><br />
== Interface ==<br />
This just sets the storage nodes/server interface as it will be stored in the Database. This used to be used for multicast setups and for the bandwidth graph. This is now setup so it is only used on the bandwidth graph as we already know the ip address anyway. Multicast tasks can get their own interface instead of relying on user entry.<br />
<pre><br />
interface='eth0'<br />
</pre><br />
== Linux Login/FTP ==<br />
=== Username ===<br />
This variable is the user setup for the linux user on the server. This allows a user to login to the server/node under this username through linux. The purpose of this is more specifically setup for FTP usage.<br />
<pre><br />
username='fog'<br />
</pre><br />
=== Password ===<br />
This is the linux fog user password. It is randomly generated if the value is not already defined. Every update will reset the password to what is in this field. You should, if you predefined a fog user and the installation is the first time, create the /opt/fog/.fogsettings file. Only add the password field to ensure your password doesn't get changed accidentally.<br />
<pre><br />
password='Some!random_Password\here0918358'<br />
</pre><br />
== OS Information ==<br />
=== OS Identifier ===<br />
This is the OS identifier used during the installation. The value is numeric.<br />
<br />
Valid Values are:<br />
# Redhat based.<br />
# Debian based.<br />
# Arch<br />
<br />
<pre><br />
osid='2'<br />
</pre><br />
=== OS Name ===<br />
This is the name of the OS as it's being installed.<br />
<pre><br />
osname='Debian'<br />
</pre><br />
== DHCP ==<br />
=== DNS Address ===<br />
Used for DHCP setup.<br />
<pre><br />
dnsaddress='192.168.1.5'<br />
</pre><br />
=== dnsbootimage ===<br />
No longer used. It's purpose was originally because the FOS (Fog Operating System -- init.xz/init_32.xz/init.gz) did not dynamically get the dns address from DHCP as dhcp was not called.<br />
<pre><br />
dnsbootimage='192.168.1.5'<br />
</pre><br />
=== Subnet Mask ===<br />
This defines the subnet mask to use if the system is to be used as a DHCP server. It will assume the subnet mask of the interface being used, but can be changed later if you see fit.<br />
<pre><br />
submask='255.255.255.0'<br />
</pre><br />
=== Router Address ===<br />
This will setup the router address to use if the system is to be used as a DHCP server. It currently only sets as an ip address, but in the past contained the whole dhcp configuration string. The config string was removed as it would only work on isc-dhcp-server, when some might be using dnsmasq or another dhcp server.<br />
<pre><br />
routeraddress='192.168.1.1'<br />
</pre><br />
=== Plain Router ===<br />
Very similar to the Router Address elements above, but can be used to redirect to maybe another router/switch other than the main.<br />
<pre><br />
plainrouter='192.168.1.1'<br />
</pre><br />
=== dodhcp ===<br />
Just tells if we want fog to install dhcp.<br />
<pre><br />
dodhcp='N'<br />
</pre><br />
=== bldhcp ===<br />
Same, more or less, as dodhcp<br />
<pre><br />
bldhcp='0'<br />
</pre><br />
=== dhcpd ===<br />
Defines what package to install for dhcp server.<br />
<pre><br />
dhcpd='isc-dhcp-server'<br />
</pre><br />
=== startrange ===<br />
<pre><br />
startrange=''<br />
</pre><br />
=== endrange ===<br />
<pre><br />
endrange=''<br />
</pre><br />
=== bootfilename ===<br />
<pre><br />
bootfilename='undionly.kpxe'<br />
</pre><br />
== NFS ==<br />
Defines if the installer should rebuild the exports every time. Setting to 0 will ensure the exports file for nfs does not get rebuilt. Setting to 1 will update the exports file.<br />
<pre><br />
blexports='1'<br />
</pre><br />
== Type of installation ==<br />
Just tells the installer if this is going to be a full server, or a node. If it's a node, the value will be S. If it's a full server, the value will be N.<br />
<pre><br />
installtype='N'<br />
</pre><br />
== Database Information ==<br />
=== MySQL User ===<br />
This is the username to connect to the database as. Blank will default to connecting as user root.<br />
<pre><br />
snmysqluser=''<br />
</pre><br />
=== MySQL Password ===<br />
This is the password to connect to the database.<br />
<pre><br />
snmysqlpass=''<br />
</pre><br />
=== MySQL Host ===<br />
This is the host to connect to the database. Blank will default to localhost/127.0.0.1.<br />
<pre><br />
snmysqlhost=''<br />
</pre><br />
== Language ==<br />
Language packs for the OS can be installed. This enables more appropriate translations of information.<br />
<pre><br />
installlang='0'<br />
</pre><br />
== Donate ==<br />
Donate seems a bit strange a name for this. What it does, however, is not pass money. It's a different method that tells the server if it's going to allow mining of bitcoins during the imaging phases. Donation can be disabled later and this value will have no more effect during updates. It only operates to define setting during fresh installs.<br />
<pre><br />
donate='0'<br />
</pre><br />
== Image storage ==<br />
This defines the location for image storage. This is just a string value to the path of your images location.<br />
<pre><br />
storageLocation='/images'<br />
</pre><br />
<br />
== Updating ==<br />
This defines if the update file is loaded. 1 is the set value after fresh install. When the .fogsettings file is loaded this value is checked and tells the system to perform an update. If this isn't 1 or the variable is not found, it requests "input" from the user (unless you're running with the -y argument).<br />
<pre><br />
fogupdateloaded=1<br />
</pre><br />
<br />
== HTTP Configuration paths ==<br />
=== docroot ===<br />
This value tells httpd where the document root will be for the GUI.<br />
For example, when you go to http://127.0.0.1/ The document root is looking on the server at the docroot location for files to present to the user.<br />
<pre><br />
docroot='/var/www/html/'<br />
</pre><br />
=== webroot ===<br />
This value tells FOG where the webroot is. Webroot is the link to actually get to the FOG GUI. If the value is just '/' you would be accessing the FOG GUI with the link http://127.0.0.1/. If it's 'fog/' you are accessing the GUI as http://127.0.0.1/fog/.<br />
<pre><br />
webroot='fog/'<br />
</pre><br />
<br />
== caCreated ==<br />
<pre><br />
caCreated='yes'<br />
</pre><br />
== packages ==<br />
<br />
Debian example:<br />
<pre><br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
</pre><br />
<br />
CentOS 7 example as of August 1st, 2018. These packages require the epel repository (which the fog installer sets up for you).<br />
<pre><br />
bc curl gcc gcc-c++ genisoimage gzip httpd lftp m4 make mod_ssl mtools mysql mysql-server net-tools nfs-utils php php-bcmath php-cli php-common php-fpm php-gd php-ldap php-mbstring php-mcrypt php-mysqlnd php-process syslinux tar tftp-server unzip vsftpd wget xinetd xz-devel<br />
</pre><br />
<br />
<br />
== noTftpBuild ==<br />
<pre><br />
noTftpBuild=''<br />
</pre><br />
== nopxedefaultfile ==<br />
<pre><br />
notpxedefaultfile=''<br />
</pre><br />
== sslpath ==<br />
<pre><br />
sslpath='/opt/fog/snapins/ssl/'<br />
</pre><br />
== backupPath ==<br />
<pre><br />
backupPath='/home/'<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=.fogsettings&diff=12576.fogsettings2018-08-01T23:47:54Z<p>Wayne-workman.28155: /* Example .fogsettings file */</p>
<hr />
<div>In most versions of FOG (including 1.2.0 and 1.3.0), the low-level settings that are used during installation and some settings that simply cannot be stored in the database are contained in the /opt/fog/.fogsettings file.<br />
<br />
This file contains the setup of variables used within the installer during upgrades/installs.<br />
<br />
<br />
= Example .fogsettings file =<br />
<br />
An example .fogsettings file<br />
<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
ipaddress='192.168.1.5'<br />
interface='eth0'<br />
submask='255.255.255.0'<br />
routeraddress='192.168.1.1'<br />
plainrouter='192.168.1.1'<br />
dnsaddress='192.168.1.1'<br />
dnsbootimage='192.168.1.1'<br />
username='fog'<br />
password='Some!random_Password\here0918358'<br />
osid='2'<br />
osname='Debian'<br />
dodhcp='N'<br />
bldhcp='0'<br />
dhcpd='isc-dhcp-server'<br />
blexports='1'<br />
installtype='N'<br />
snmysqluser=''<br />
snmysqlpass=''<br />
snmysqlhost=''<br />
installlang='0'<br />
donate='0'<br />
storageLocation='/images'<br />
fogupdateloaded=1<br />
docroot='/var/www/html/'<br />
webroot='fog/'<br />
caCreated='yes'<br />
startrange=''<br />
endrange=''<br />
bootfilename='undionly.kpxe'<br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
noTftpBuild=''<br />
notpxedefaultfile=''<br />
sslpath='/opt/fog/snapins/ssl/'<br />
backupPath='/home/'<br />
## End of FOG Settings<br />
</pre><br />
<br />
The above example file is for Debian based systems. Below are packages for CentOS 7 as of August 1st, 2018. These packages require the epel repository (which the fog installer sets up for you).<br />
<pre><br />
bc curl gcc gcc-c++ genisoimage gzip httpd lftp m4 make mod_ssl mtools mysql mysql-server net-tools nfs-utils php php-bcmath php-cli php-common php-fpm php-gd php-ldap php-mbstring php-mcrypt php-mysqlnd php-process syslinux tar tftp-server unzip vsftpd wget xinetd xz-devel<br />
</pre><br />
<br />
= Definitions =<br />
== Header/Footer ==<br />
=== Header ===<br />
Only gives some simplistic information to help users.<br />
Does no actions just gives some information.<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
</pre><br />
=== Footer ===<br />
Does no actions, just tells where FOG's default variables are setup<br />
Any new items will go below this, and you can add your own variables.<br />
You can add variables wherever you want.<br />
<pre><br />
## End of FOG Settings<br />
</pre><br />
== IP Address ==<br />
Defines the IP address of the node/server.<br />
This is also used on servers to setup the default.ipxe file.<br />
<pre><br />
ipaddress='192.168.1.5'<br />
</pre><br />
== Interface ==<br />
This just sets the storage nodes/server interface as it will be stored in the Database. This used to be used for multicast setups and for the bandwidth graph. This is now setup so it is only used on the bandwidth graph as we already know the ip address anyway. Multicast tasks can get their own interface instead of relying on user entry.<br />
<pre><br />
interface='eth0'<br />
</pre><br />
== Linux Login/FTP ==<br />
=== Username ===<br />
This variable is the user setup for the linux user on the server. This allows a user to login to the server/node under this username through linux. The purpose of this is more specifically setup for FTP usage.<br />
<pre><br />
username='fog'<br />
</pre><br />
=== Password ===<br />
This is the linux fog user password. It is randomly generated if the value is not already defined. Every update will reset the password to what is in this field. You should, if you predefined a fog user and the installation is the first time, create the /opt/fog/.fogsettings file. Only add the password field to ensure your password doesn't get changed accidentally.<br />
<pre><br />
password='Some!random_Password\here0918358'<br />
</pre><br />
== OS Information ==<br />
=== OS Identifier ===<br />
This is the OS identifier used during the installation. The value is numeric.<br />
<br />
Valid Values are:<br />
# Redhat based.<br />
# Debian based.<br />
# Arch<br />
<br />
<pre><br />
osid='2'<br />
</pre><br />
=== OS Name ===<br />
This is the name of the OS as it's being installed.<br />
<pre><br />
osname='Debian'<br />
</pre><br />
== DHCP ==<br />
=== DNS Address ===<br />
Used for DHCP setup.<br />
<pre><br />
dnsaddress='192.168.1.5'<br />
</pre><br />
=== dnsbootimage ===<br />
No longer used. It's purpose was originally because the FOS (Fog Operating System -- init.xz/init_32.xz/init.gz) did not dynamically get the dns address from DHCP as dhcp was not called.<br />
<pre><br />
dnsbootimage='192.168.1.5'<br />
</pre><br />
=== Subnet Mask ===<br />
This defines the subnet mask to use if the system is to be used as a DHCP server. It will assume the subnet mask of the interface being used, but can be changed later if you see fit.<br />
<pre><br />
submask='255.255.255.0'<br />
</pre><br />
=== Router Address ===<br />
This will setup the router address to use if the system is to be used as a DHCP server. It currently only sets as an ip address, but in the past contained the whole dhcp configuration string. The config string was removed as it would only work on isc-dhcp-server, when some might be using dnsmasq or another dhcp server.<br />
<pre><br />
routeraddress='192.168.1.1'<br />
</pre><br />
=== Plain Router ===<br />
Very similar to the Router Address elements above, but can be used to redirect to maybe another router/switch other than the main.<br />
<pre><br />
plainrouter='192.168.1.1'<br />
</pre><br />
=== dodhcp ===<br />
Just tells if we want fog to install dhcp.<br />
<pre><br />
dodhcp='N'<br />
</pre><br />
=== bldhcp ===<br />
Same, more or less, as dodhcp<br />
<pre><br />
bldhcp='0'<br />
</pre><br />
=== dhcpd ===<br />
Defines what package to install for dhcp server.<br />
<pre><br />
dhcpd='isc-dhcp-server'<br />
</pre><br />
=== startrange ===<br />
<pre><br />
startrange=''<br />
</pre><br />
=== endrange ===<br />
<pre><br />
endrange=''<br />
</pre><br />
=== bootfilename ===<br />
<pre><br />
bootfilename='undionly.kpxe'<br />
</pre><br />
== NFS ==<br />
Defines if the installer should rebuild the exports every time. Setting to 0 will ensure the exports file for nfs does not get rebuilt. Setting to 1 will update the exports file.<br />
<pre><br />
blexports='1'<br />
</pre><br />
== Type of installation ==<br />
Just tells the installer if this is going to be a full server, or a node. If it's a node, the value will be S. If it's a full server, the value will be N.<br />
<pre><br />
installtype='N'<br />
</pre><br />
== Database Information ==<br />
=== MySQL User ===<br />
This is the username to connect to the database as. Blank will default to connecting as user root.<br />
<pre><br />
snmysqluser=''<br />
</pre><br />
=== MySQL Password ===<br />
This is the password to connect to the database.<br />
<pre><br />
snmysqlpass=''<br />
</pre><br />
=== MySQL Host ===<br />
This is the host to connect to the database. Blank will default to localhost/127.0.0.1.<br />
<pre><br />
snmysqlhost=''<br />
</pre><br />
== Language ==<br />
Language packs for the OS can be installed. This enables more appropriate translations of information.<br />
<pre><br />
installlang='0'<br />
</pre><br />
== Donate ==<br />
Donate seems a bit strange a name for this. What it does, however, is not pass money. It's a different method that tells the server if it's going to allow mining of bitcoins during the imaging phases. Donation can be disabled later and this value will have no more effect during updates. It only operates to define setting during fresh installs.<br />
<pre><br />
donate='0'<br />
</pre><br />
== Image storage ==<br />
This defines the location for image storage. This is just a string value to the path of your images location.<br />
<pre><br />
storageLocation='/images'<br />
</pre><br />
<br />
== Updating ==<br />
This defines if the update file is loaded. 1 is the set value after fresh install. When the .fogsettings file is loaded this value is checked and tells the system to perform an update. If this isn't 1 or the variable is not found, it requests "input" from the user (unless you're running with the -y argument).<br />
<pre><br />
fogupdateloaded=1<br />
</pre><br />
<br />
== HTTP Configuration paths ==<br />
=== docroot ===<br />
This value tells httpd where the document root will be for the GUI.<br />
For example, when you go to http://127.0.0.1/ The document root is looking on the server at the docroot location for files to present to the user.<br />
<pre><br />
docroot='/var/www/html/'<br />
</pre><br />
=== webroot ===<br />
This value tells FOG where the webroot is. Webroot is the link to actually get to the FOG GUI. If the value is just '/' you would be accessing the FOG GUI with the link http://127.0.0.1/. If it's 'fog/' you are accessing the GUI as http://127.0.0.1/fog/.<br />
<pre><br />
webroot='fog/'<br />
</pre><br />
<br />
== caCreated ==<br />
<pre><br />
caCreated='yes'<br />
</pre><br />
== packages ==<br />
<pre><br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
</pre><br />
== noTftpBuild ==<br />
<pre><br />
noTftpBuild=''<br />
</pre><br />
== nopxedefaultfile ==<br />
<pre><br />
notpxedefaultfile=''<br />
</pre><br />
== sslpath ==<br />
<pre><br />
sslpath='/opt/fog/snapins/ssl/'<br />
</pre><br />
== backupPath ==<br />
<pre><br />
backupPath='/home/'<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Replication&diff=12575Replication2018-05-19T16:13:17Z<p>Wayne-workman.28155: /* Layman's replication rules */</p>
<hr />
<div>See also: [[Location Plugin]]<br />
<br />
= Overview =<br />
<br />
The intention of this posting is to explain replication in regards to how FOG handles it's image and snapin distribution to other nodes.<br />
<br />
= History =<br />
<br />
FOG Replication system was designed as a means to distribute images to nodes within the group it resided in. It operated on a per image system and only replicated images themselves.<br />
<br />
= Basic process =<br />
<br />
Replication works by taking the master node of a group and distributing to the "subordinate" nodes within that same group.<br />
<br />
= Rethought =<br />
<br />
Due to the nature of replication, and the complexities and layouts of some FOG environments, the process of replication has been modified.<br />
<br />
== Basic Changes ==<br />
<br />
# Snapins can now be replicated.<br />
# Replication can now distribute to multiple groups as well as nodes.<br />
## This is handled per each item.<br />
## (e.g. Both snapins and images must be assigned to at least one group, but can be assigned to multiple groups)<br />
# Both snapins and images can be individually "replicated" or "not replicated".<br />
# Both snapins and images can be individually "enabled" or "disabled".<br />
<br />
== Why? ==<br />
<br />
As stated in the basic history, replication only worked with images. It didn't, really, go that far either. It only replicated the /images folder (whatever it may have been defined as). It only replicated within a single group. It deleted any dubious / or purposefully extra data within. This enabled an attacker or accidental change of the master node to essentially wipe an image series simply by changing which node is a "master" node. For example, if you created a new node within a pre-existing group and defined that new node as the master, it would replicate it's contents (currently empty) to all other nodes in the group. Hopefully you see the problem with this idea. All an attacker would need to do, or an unknowing user, is create a blank node and define it as the master (as every node must belong to a group).<br />
<br />
== Lower-level Process ==<br />
Replication is handled at a per definition basis now. Any data contained within either the snapin or image storage locations that does not have a corresponding definition associated will remain untouched. This leaves the data used for that segment. For example, if you created an image definition and had a image defined there. Later on you delete the definition with the GUI, but chose not to delete the data, that data will remain wherever it had existed (on any or all nodes it exists on). It will NOT be replicated though because the FOG system knows nothing about it. The same premise is used to deal with snapins (they share a common method now.)<br />
<br />
== Higher-level Process ==<br />
# The image and/or snapin replication service starts.<br />
# This service starts by checking if they are the master node.<br />
# If they are they master node for the group they're working on, they find out which data they have.<br />
## Nodes technically cannot exist in multiple groups, but there is a way around this (though it's very uncommon).<br />
# Filter the data that is "not enabled" and/or "not to be replicated". Only enabled items with "replication" enable are selected to be replicated.<br />
# The replication method is called. As a part of this replication method, we start by seeing which data is to be replicated between multiple storage groups.<br />
# If the node currently checking is the "primary master group" for the data it's working, it will attempt replicating its data to the master of each of the other groups the data is assigned under.<br />
# If the node currently checking is the master of the group for the data it's working, it will attempt replicating its data to the other nodes within the group. (Remember, Storage Groups can only have one Master node. Likewise, there can only be one primary master group per item to be replicated.)<br />
<br />
== Layman's replication rules ==<br />
<br />
# An image has one storage group as it’s primary group, but can be associated to many storage groups.<br />
# The image will always capture to the primary group’s master storage node.<br />
# Replication looks for images that belong to multiple groups - and replicates from the primary master to the other associated group’s master nodes.<br />
# Replication then replicates images from each group’s masters to other ‘regular’ storage nodes in the master’s group.<br />
# A storage node can belong to multiple storage groups - you just need a storage node entry for each. For example, a non-master in one group can be a master in another group.</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Replication&diff=12574Replication2018-05-19T16:12:44Z<p>Wayne-workman.28155: Added layman's rules</p>
<hr />
<div>See also: [[Location Plugin]]<br />
<br />
= Overview =<br />
<br />
The intention of this posting is to explain replication in regards to how FOG handles it's image and snapin distribution to other nodes.<br />
<br />
= History =<br />
<br />
FOG Replication system was designed as a means to distribute images to nodes within the group it resided in. It operated on a per image system and only replicated images themselves.<br />
<br />
= Basic process =<br />
<br />
Replication works by taking the master node of a group and distributing to the "subordinate" nodes within that same group.<br />
<br />
= Rethought =<br />
<br />
Due to the nature of replication, and the complexities and layouts of some FOG environments, the process of replication has been modified.<br />
<br />
== Basic Changes ==<br />
<br />
# Snapins can now be replicated.<br />
# Replication can now distribute to multiple groups as well as nodes.<br />
## This is handled per each item.<br />
## (e.g. Both snapins and images must be assigned to at least one group, but can be assigned to multiple groups)<br />
# Both snapins and images can be individually "replicated" or "not replicated".<br />
# Both snapins and images can be individually "enabled" or "disabled".<br />
<br />
== Why? ==<br />
<br />
As stated in the basic history, replication only worked with images. It didn't, really, go that far either. It only replicated the /images folder (whatever it may have been defined as). It only replicated within a single group. It deleted any dubious / or purposefully extra data within. This enabled an attacker or accidental change of the master node to essentially wipe an image series simply by changing which node is a "master" node. For example, if you created a new node within a pre-existing group and defined that new node as the master, it would replicate it's contents (currently empty) to all other nodes in the group. Hopefully you see the problem with this idea. All an attacker would need to do, or an unknowing user, is create a blank node and define it as the master (as every node must belong to a group).<br />
<br />
== Lower-level Process ==<br />
Replication is handled at a per definition basis now. Any data contained within either the snapin or image storage locations that does not have a corresponding definition associated will remain untouched. This leaves the data used for that segment. For example, if you created an image definition and had a image defined there. Later on you delete the definition with the GUI, but chose not to delete the data, that data will remain wherever it had existed (on any or all nodes it exists on). It will NOT be replicated though because the FOG system knows nothing about it. The same premise is used to deal with snapins (they share a common method now.)<br />
<br />
== Higher-level Process ==<br />
# The image and/or snapin replication service starts.<br />
# This service starts by checking if they are the master node.<br />
# If they are they master node for the group they're working on, they find out which data they have.<br />
## Nodes technically cannot exist in multiple groups, but there is a way around this (though it's very uncommon).<br />
# Filter the data that is "not enabled" and/or "not to be replicated". Only enabled items with "replication" enable are selected to be replicated.<br />
# The replication method is called. As a part of this replication method, we start by seeing which data is to be replicated between multiple storage groups.<br />
# If the node currently checking is the "primary master group" for the data it's working, it will attempt replicating its data to the master of each of the other groups the data is assigned under.<br />
# If the node currently checking is the master of the group for the data it's working, it will attempt replicating its data to the other nodes within the group. (Remember, Storage Groups can only have one Master node. Likewise, there can only be one primary master group per item to be replicated.)<br />
<br />
== Layman's replication rules ==<br />
<br />
# An image has one group as it’s primary group, but can be associated to many storage groups.<br />
# The image will always capture to the primary group’s master storage node.<br />
# Replication looks for images that belong to multiple groups - and replicates from the primary master to the other associated group’s master nodes.<br />
# Replication then replicates images from each group’s masters to other ‘regular’ storage nodes in the master’s group.<br />
# A storage node can belong to multiple storage groups - you just need a storage node entry for each. For example, a non-master in one group can be a master in another group.</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Installation&diff=12573Installation2018-03-16T22:45:52Z<p>Wayne-workman.28155: Updated documentation.</p>
<hr />
<div>== Requirements ==<br />
Before diving right into the installation of FOG you need to decide which server OS you are going to use. FOG is made to install on RedHat based distro CentOS, Fedora, RHEL amongst others as well as Debian, Ubuntu and Arch Linux. Choose whichever you like most and have knowledge about! FOG is known to work with any of the above noted systems. Many [[Installation#Installation_manuals|installation manuals]] are available.<br />
<br />
This listing is for informational purposes only, as the required components will be automatically downloaded and installed by the FOG installation script: PHP 5/6/7, MySql 5+, Apache 2+, DHCP (any!), TFTP, FTP, NFS<br />
<br />
The LAMP setup can also be easily adjusted for a "WAMP (Windows Apache MySQL PHP) system" though will require a bit more knowledge of what packages to use and how to integrate with the FOG system.<br />
<br />
Please choose the distribution you have the most knowledge about, but the below list has the best support in FOG 1.3.0 right now. This list is by no means an absolute list to follow, though.<br />
<br />
* Ubuntu 14 or higher<br />
<br />
* Debian 8 or higher<br />
<br />
* Red Hat 6 or higher<br />
<br />
* Fedora 22 or higher<br />
<br />
* Any version of Arch.<br />
<br />
== Download FOG ==<br />
Please see: [[Getting_FOG]]<br />
<br />
== Installer ==<br />
The FOG installer comes as a complex shell script that will handle all the package installs and configuring the services for you. It must be run as root (sudo works as well) to be able to set things up properly. Running the installer on a new system for the first time it will ask you a couple of questions regarding your network configuration and services you want to install.<br />
<br />
=== Modes ===<br />
FOG can be installed in two different modes. First is the normal FOG server which does all of the work. Choose this option if you only want have a single FOG server in your network. The second option is to install a FOG storage node which will serve as a second place to store images on and serve images to more clients (when doing unicast). [[InstallationModes|Here]] you can find some more information about the two modes.<br />
<br />
FOG Server installation modes:<br />
* Normal Server: (Choice N) <br />
This is the typical installation type and<br />
will install all FOG components for you on this<br />
machine. Pick this option if you are unsure what to pick.<br />
<br />
* Storage Node: (Choice S)<br />
This install mode will only install the software required<br />
to make this server act as a node in a storage group<br />
<br />
=== Command line options ===<br />
The FOG installer has quite a few command line options. See the output below. You might want force FOG to setup the web interface via HTTPS, change the default PXE boot file or web root directory.<br />
<br />
./installfog.sh --help<br />
...<br />
* Found FOG Settings from previous install at: /opt/fog/.fogsettings<br />
* Performing upgrade using these settings<br />
<br />
<br />
Starting Debian based Installation<br />
<br />
<br />
Usage: ./installfog.sh [-h?dEUuHSCKYXT] [-f <filename>]<br />
[-D </directory/to/document/root/>] [-c <sslPath>]<br />
[-W <webroot/to/fog/after/docroot/>] [-B </backup/path/>]<br />
[-s <192.168.1.10>] [-e <192.168.1.254>] [-b <undionly.kpxe>]<br />
-h -? --help Display this info<br />
-d --no-defaults Don't guess defaults<br />
-U --no-upgrade Don't attempt to upgrade<br />
-H --no-htmldoc No htmldoc, means no PDFs<br />
-S --force-https Force HTTPS redirect<br />
-C --recreate-CA Recreate the CA Keys<br />
-K --recreate-keys Recreate the SSL Keys<br />
-Y -y --autoaccept Auto accept defaults and install<br />
-f --file Use different update file<br />
-c --ssl-file Specify the ssl path<br />
defaults to /opt/fog/snapins/ssl<br />
-D --docroot Specify the Apache Docroot for fog<br />
defaults to OS DocumentRoot<br />
-W --webroot Specify the web root url want fog to use<br />
(E.G. http://127.0.0.1/fog,<br />
http://127.0.0.1/)<br />
Defaults to /fog/<br />
-B --backuppath Specify the backup path<br />
--uninstall Uninstall FOG<br />
-s --startrange DHCP Start range<br />
-e --endrange DHCP End range<br />
-b --bootfile DHCP Boot file<br />
-E --no-exportbuild Skip building nfs file<br />
-X --exitFail Do not exit if item fails<br />
-T --no-tftpbuild Do not rebuild the tftpd config file<br />
-P --no-pxedefault Do not overwrite pxe default file<br />
<br />
<br />
<br />
=== .fogsettings ===<br />
<br />
Full article on the .fogsettings file can be found here: [[.fogsettings]]<br />
<br />
=== Backups ===<br />
TBD<br />
<br />
=== Errorlog ===<br />
TBD<br />
<br />
== Installation manuals ==<br />
=== CentOS ===<br />
[[CentOS 7| CentOS 7]], <br />
[[Installation on CentOS 6.4|CentOS 6.4]] (CentOS 6.5 also works), <br />
[[Installation on CentOS 5.3|CentOS 5.3]] (CentOS 5.4 & 5.5 also covered)<br />
<br />
<br />
=== Debian ===<br />
[[Debian 8]],<br />
[[Installation on Debian Lenny|Debian Wheezy]], <br />
[[Installation on Debian Lenny|Debian Squeeze]], <br />
[[Installation on Debian Lenny|Debian Lenny]]<br />
<br />
=== Fedora ===<br />
[[Fedora 25 Server]],<br />
[[Fedora 24 Server]],<br />
[[Fedora 23 Server]], <br />
[[Fedora_21_Server|Fedora 21 Server]], <br />
[[Installation on Fedora 13|Fedora 13]], <br />
[[Installation on Fedora 8| Fedora 8]],<br />
<br />
=== RHEL ===<br />
TBA<br />
<br />
<br />
=== Ubuntu ===<br />
[[Ubuntu 16.04]]<br />
[[Ubuntu 14.04|Ubuntu 14.10]] <span style="background-color:Yellow;"><span style="color:Black">(Buggy)</span></span>, <br />
[[Ubuntu 14.04]], <br />
[[Ubuntu 12.04|Ubuntu 13.10]], <br />
[[Ubuntu 12.04|Ubuntu 13.04]], <br />
[[Ubuntu 12.04|Ubuntu 12.10]], <br />
[[Ubuntu 12.04]], <br />
[[Ubuntu 11.04]], <br />
[[Ubuntu 10.10]], <br />
[[Ubuntu 10.04|Ubuntu 10.04]], <br />
[[Ubuntu 9.04|Ubuntu 9.04]], <br />
Ubuntu 8.10, <br />
Ubuntu 8.04, <br />
[[Installation on 7.10|Ubuntu 7.10]]<br />
<br />
== Virtualization ==<br />
FOG can be used on bare metal as well as in most virtual server and client setups. Some of the virtualization techniques are really great when used with FOG, e.g. snapshots. Some people use virtualization to prepare and capture their "golden (master / reference) images" all on one central location/server. Again like with the server OS we don't prefer any of the following or others that are out there. This is only a collection of hints and tricks plus maybe issues we know about.<br />
<br />
=== Hyper-V ===<br />
<br />
'''Using the New VM Wizard:'''<br />
<br />
Ensure the virtual switch your VM is connected to has a route to FOG!<br />
<br />
Create VM Wizard > Installation Options: Select "Install an operating system from network-based installation server"<br />
<br />
<br />
'''Existing VM:'''<br />
<br />
Ensure the virtual switch your VM is connected to has a route to FOG!<br />
<br />
Right click VM > Settings > BIOS<br />
<br />
Move "Network Adapter" (sometimes labeled "Legacy Network Adapter") to the top of the boot order.<br />
<br />
<br />
'''UEFI:'''<br />
<br />
UEFI/Secure Boot is an option with Hyper-V on Server 2012 on Generation 2 VMs. It is enabled by default, and can be disabled in VM Settings -> Firmware: Uncheck secure boot.<br />
<br />
Thanks to [https://forums.fogproject.org/user/moses moses]<br />
<br />
=== KVM/QEMU ===<br />
Can be used as kind of a lightweight desktop virtual environment to test FOG and master your images.<br />
Using this on the laptop as local test environment. Search forums and wiki but there is no valuable information about anyone using FOG on a KVM server. Asked user mxc as he seams to use it. Otherwise this will be a brief description on how to use this as I do it.<br />
<br />
# setup network tap device as kind of a local software switch to connect it all<br />
sudo tunctl -t tap0 -u <username><br />
sudo ifconfig tap0 x.x.x.x netmask 255.255.255.0 up<br />
<br />
# generate disk image file<br />
qemu-img create -f qcow2 hd.qcow2 10G<br />
<br />
# start VM using QEMU emulator (BIOS mode)<br />
qemu -m 512 -boot n -net nic,vlan=1 -net tap,vlan=1,ifname=tap0,script=/bin/true -hda hd.qcow2<br />
<br />
# start VM using real KVM virtualization (BIOS mode)<br />
kvm -m 512 -boot n -net nic,vlan=1,macaddr=00:00:00:00:00:05 -net tap,vlan=1,ifname=tap0,script=/bin/true -hda hd.qcow2<br />
<br />
# start VM as UEFI machine - as well using the more modern '-netdev' parameter<br />
kvm -m 512 -boot n -bios /usr/share/ovmf/OVMF.fd -device virtio-net-pci,netdev=hn0 -netdev tap,id=hn0,ifname=tap0,script=/bin/true -hda hd.qcow2<br />
<br />
=== OpenVZ ===<br />
OpenVZ (possibly within Proxmox) is mostly used to run the FOG server in a light weight kind of virtual environment. As OpenVZ is in nature similar to a chrooted environment you cannot actually PXE boot such a container. To install FOG as a server in OpenVZ you need to have NFS support on the host machine first and then add it to the container as well:<br />
<br />
$ lsmod | grep nfsd<br />
nfsd 312315 14<br />
$ grep nfsd /proc/filesystems<br />
nodev nfsd<br />
<br />
If you don't see the kernel module ''nfsd'' loaded you might need to install the nfs-kernel-server package and load the module (usually done by the nfs-kernel-server init script). As mentioned before you need to enable access to ''nfsd'' from within the container you want to install FOG to:<br />
<br />
$ vzctl stop $CONTAINER_ID<br />
$ vzctl set $CONTAINER_ID --feature nfsd:on --save<br />
$ vzctl start $CONTAINER_ID<br />
<br />
After that the installer should run through like it would installing on bare metal or any other virtual environment!<br />
<br />
'''Wake on LAN:'''<br />
<br />
To be able to send WOL and multicast packages the container needs a proper MAC address. This is only the case if you configure the container to use a network bridge (veth instead of venet!).<br />
<br />
=== VirtualBox ===<br />
Bridged network, host only. Older versions have (PXE?) bug - Tom knows about that.<br />
<br />
Have we seen this issue in the FOG forums yet? http://forum.ipxe.org/showthread.php?tid=7864<br />
<br />
=== VMWare ESXi ===<br />
Running a FOG client within an ESXi server is pretty close to what you would do on a bare metal machine:<br />
<br />
* Create VM as normal.<br />
* Choose network adapter other than VMX3 (e.g. e1000) as we have seen [https://forums.fogproject.org/topic/7108/fog-bzimage-failing-to-load-after-pxe-boot loading issues] with those virtual adapters.<br />
* Open VM Console, start up the VM. Press F2 on Boot Logo to enter BIOS.<br />
* Scroll over to boot tab, use + key to move Network boot to the top of the boot order.<br />
<br />
You can also do an on-demand network boot by hitting F9 on startup, if you don’t want to change the boot order permanently.<br />
<br />
'''UEFI:'''<br />
<br />
UEFI is disabled by default for VMs in ESXI 6.0+. To enable it for a VM, go to VM Settings > Options Tab > Advanced: Boot Options and change the boot firmware from BIOS to EFI.<br />
<br />
Thanks to [https://forums.fogproject.org/user/moses moses]<br />
<br />
=== VMWare Player ===<br />
Is this still in use?? Don't care if there is nothing about it in wiki or forums!<br />
<br />
=== Xen/XenServer ===<br />
See forums<br />
<br />
* [[Running pre-built virtual machines in Virtualbox|FOG 0.30 VM - Virtualbox]]<br />
* [[Installation on VMWare 0.27|FOG 0.27 VM - VMWare]]<br />
<br />
== Security ==<br />
<br />
[[FOG security]]<br />
<br />
== Troubleshooting ==<br />
IMPORTANT, what to do when the installer fails? Where are the logs?<br />
<br />
{{:Troubleshoot FOG}}</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12572Getting FOG2018-02-07T18:30:43Z<p>Wayne-workman.28155: </p>
<hr />
<div>Related Article: [[Upgrade_to_trunk]]<br />
<br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If updating a VM, snapshot/checkpoint it first.<br />
* If updating, backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch (latest stable release), skip to [[Getting_FOG#Running_the_installer]]. <br />
<br />
If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
git pull<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Kernel_Update&diff=12571Kernel Update2018-02-07T16:50:29Z<p>Wayne-workman.28155: /* Kernel Update feature */</p>
<hr />
<div>= Kernel Update feature =<br />
<br />
When running FOG 1.3.0 (In development as of Feb 2016), you may change what kernels are available to you via the Kernel Update feature. <br />
<br />
You may want to do this for a special or unique machine, or all machines, depending upon your needs. The feature is located here:<br />
<br />
Web interface -> FOG Configuration -> Kernel Update<br />
<br />
For 32 bit systems, choose a kernel that is x86 only, for 64 bit systems, choose one that is x86_x64 bit.<br />
<br />
[[File:FOG 1.3.0 Kernel Update Feature.png]]<br />
<br />
You may name your kernel uniquely to not overwrite the default kernel if you choose.<br />
<br />
[[File:FOG 1.3.0 kernel update name.png]]<br />
<br />
<br />
<br />
If you've named your new kernel <font color="red">bzImage</font> or <font color="red">bzImage32</font> then all 64 or all 32 bit clients will automatically begin using this new kernel. <br />
<br />
If you've named your kernel something unique (which is suggested), you may assign the kernel to a particular host. <br />
<br />
You may do this by setting the "Host Kernel" of a host to the file name you have chosen, as pictured below.<br />
<br />
<br />
<br />
[[File:FOG 1.3.0 Unique Kernel name graphic.png]]<br />
<br />
== Kernel Update Failure ==<br />
<br />
The new kernel is put in place using FTP, and the credentials used for this are in the TFTP Server area, located here:<br />
<br />
Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server<br />
<br />
If you experience the following error or a similar error, this is a FTP related issue and could be credentials, permissions, ownership, firewall, path, or SELinux related. Usually, it is credentials or path related.<br />
<br />
[[File:Kernel Update Failure.png]]<br />
<br />
<br />
You can set the FTP username and password and destination path used for kernel updates here:<br />
<br />
<br />
[[File:FOG 1.3.0 Kernel Update FTP Settings.png]]<br />
<br />
<br />
The above steps only skim the surface of the FTP issue, '''for a more complete guide''', please see: [[Troubleshoot FTP]]<br />
<br />
= Manual update to latest kernel =<br />
<br />
For CentOS 7+, Fedora 19+, RHEL 7+, Debian8+, and Ubuntu14+ you may manually update the kernel and/or the inits to the latest by following the below steps.<br />
<br />
You may copy/paste the entire script to backup all kernels/inits and download all new ones.<br />
<br />
<pre><br />
#Delete previous backed up kernels & inits.<br />
rm -rf /var/www/html/fog/service/ipxe/old<br />
<br />
#Make a directory to put old kernels & inits into.<br />
mkdir /var/www/html/fog/service/ipxe/old<br />
<br />
#Move old inits, get new ones.<br />
mv /var/www/html/fog/service/ipxe/init.xz /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/inits/init.xz -O /var/www/html/fog/service/ipxe/init.xz<br />
mv /var/www/html/fog/service/ipxe/init_32.xz /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/inits/init_32.xz -O /var/www/html/fog/service/ipxe/init_32.xz<br />
<br />
#Move old kernels, get new ones.<br />
mv /var/www/html/fog/service/ipxe/bzImage /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/kernels/bzImage -O /var/www/html/fog/service/ipxe/bzImage<br />
mv /var/www/html/fog/service/ipxe/bzImage32 /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/kernels/bzImage32 -O /var/www/html/fog/service/ipxe/bzImage32<br />
<br />
#Reset Ownership:<br />
#Fedora, CentOS, RHEL:<br />
chown -R fog:apache /var/www/html/fog/service/ipxe<br />
#Ubuntu, Debian:<br />
chown -R fog:www-data /var/www/html/fog/service/ipxe<br />
<br />
#Set permissions:<br />
chmod -R 775 /var/www/html/fog/service/ipxe<br />
<br />
#Script complete.<br />
echo DONE!<br />
</pre><br />
<br />
Steps for older Ubuntu and older Debian would be simiar, but the destination would be /var/www instead of /var/www/html.</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Kernel_Update&diff=12570Kernel Update2018-02-07T16:50:11Z<p>Wayne-workman.28155: /* Kernel Update feature */</p>
<hr />
<div>= Kernel Update feature =<br />
<br />
When running FOG 1.3.0 (In development as of Feb 2016), you may change what kernels are available to you via the Kernel Update feature. You may want to do this for a special or unique machine, or all machines, depending upon your needs. The feature is located here:<br />
<br />
Web interface -> FOG Configuration -> Kernel Update<br />
<br />
For 32 bit systems, choose a kernel that is x86 only, for 64 bit systems, choose one that is x86_x64 bit.<br />
<br />
[[File:FOG 1.3.0 Kernel Update Feature.png]]<br />
<br />
You may name your kernel uniquely to not overwrite the default kernel if you choose.<br />
<br />
[[File:FOG 1.3.0 kernel update name.png]]<br />
<br />
<br />
<br />
If you've named your new kernel <font color="red">bzImage</font> or <font color="red">bzImage32</font> then all 64 or all 32 bit clients will automatically begin using this new kernel. <br />
<br />
If you've named your kernel something unique (which is suggested), you may assign the kernel to a particular host. You may do this by setting the "Host Kernel" of a host to the file name you have chosen, as pictured below.<br />
<br />
<br />
<br />
[[File:FOG 1.3.0 Unique Kernel name graphic.png]]<br />
<br />
== Kernel Update Failure ==<br />
<br />
The new kernel is put in place using FTP, and the credentials used for this are in the TFTP Server area, located here:<br />
<br />
Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server<br />
<br />
If you experience the following error or a similar error, this is a FTP related issue and could be credentials, permissions, ownership, firewall, path, or SELinux related. Usually, it is credentials or path related.<br />
<br />
[[File:Kernel Update Failure.png]]<br />
<br />
<br />
You can set the FTP username and password and destination path used for kernel updates here:<br />
<br />
<br />
[[File:FOG 1.3.0 Kernel Update FTP Settings.png]]<br />
<br />
<br />
The above steps only skim the surface of the FTP issue, '''for a more complete guide''', please see: [[Troubleshoot FTP]]<br />
<br />
= Manual update to latest kernel =<br />
<br />
For CentOS 7+, Fedora 19+, RHEL 7+, Debian8+, and Ubuntu14+ you may manually update the kernel and/or the inits to the latest by following the below steps.<br />
<br />
You may copy/paste the entire script to backup all kernels/inits and download all new ones.<br />
<br />
<pre><br />
#Delete previous backed up kernels & inits.<br />
rm -rf /var/www/html/fog/service/ipxe/old<br />
<br />
#Make a directory to put old kernels & inits into.<br />
mkdir /var/www/html/fog/service/ipxe/old<br />
<br />
#Move old inits, get new ones.<br />
mv /var/www/html/fog/service/ipxe/init.xz /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/inits/init.xz -O /var/www/html/fog/service/ipxe/init.xz<br />
mv /var/www/html/fog/service/ipxe/init_32.xz /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/inits/init_32.xz -O /var/www/html/fog/service/ipxe/init_32.xz<br />
<br />
#Move old kernels, get new ones.<br />
mv /var/www/html/fog/service/ipxe/bzImage /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/kernels/bzImage -O /var/www/html/fog/service/ipxe/bzImage<br />
mv /var/www/html/fog/service/ipxe/bzImage32 /var/www/html/fog/service/ipxe/old<br />
wget https://fogproject.org/kernels/bzImage32 -O /var/www/html/fog/service/ipxe/bzImage32<br />
<br />
#Reset Ownership:<br />
#Fedora, CentOS, RHEL:<br />
chown -R fog:apache /var/www/html/fog/service/ipxe<br />
#Ubuntu, Debian:<br />
chown -R fog:www-data /var/www/html/fog/service/ipxe<br />
<br />
#Set permissions:<br />
chmod -R 775 /var/www/html/fog/service/ipxe<br />
<br />
#Script complete.<br />
echo DONE!<br />
</pre><br />
<br />
Steps for older Ubuntu and older Debian would be simiar, but the destination would be /var/www instead of /var/www/html.</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL&diff=12569Troubleshoot MySQL2018-01-30T01:43:57Z<p>Wayne-workman.28155: /* MySQL Config File */</p>
<hr />
<div>=MySQL's role in FOG=<br />
<br />
MySQL is used to hold information and metadata about hosts, images, groups, snapins, various web-level fog settings, and other things. It does not house the actual image data. In newer Linux, it's being phased out in favor of MariaDB. All commands for MySQL will work for MariaDB.<br />
<br />
=Easy & quick MySQL test=<br />
<br />
For the main server and all storage nodes, you may test to see if there is a proper database connection happening or not by visiting the below URL. Replace the x.x.x.x with the IP address of the system you wish to test, and test each system one by one.<br />
<br />
<font color="red">http://x.x.x.x/fog/service/getversion.php</font><br />
<br />
If everything is working, the output will '''only''' report the server's FOG version and nothing else. All servers in a distributed FOG system should always be kept on the same version.<br />
<br />
=Manually Testing MySQL=<br />
<br />
On your FOG server, you can check passwords and the existence of the FOG database by issuing these commands:<br />
<br />
No Password: <br />
<br />
<pre>mysql -D fog<br />
exit</pre><br />
<br />
Test with a username and password (note '''no space''' between -p and the password):<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -D fog<br />
exit</pre><br />
<br />
For a remote server or from a storage node, use:<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog<br />
exit</pre><br />
<br />
* X.X.X.X represents where you'd put the remote host's IP address.<br />
* '''-u''' is username<br />
* '''-p''' is password<br />
* '''-h''' is host<br />
* '''-d''' is database<br />
<br />
=MySQL Service=<br />
<br />
== CentOS / RHEL / Fedora ==<br />
<br />
Check status:<br />
<br />
<pre>systemctl status mysql</pre><br />
<br />
Restart service:<br />
<br />
<pre>systemctl restart mysql</pre><br />
<br />
== Debian / Ubuntu ==<br />
<br />
Check status:<br />
<br />
<pre>service mysql status</pre><br />
<br />
Restart service:<br />
<br />
<pre>service mysql restart</pre><br />
<br />
=MySQL Config File=<br />
<br />
The location of this file varies based on the distribution of Linux you're using. Usually it's called my.cnf and it's probably best to just issue a search command for the file and then figure out which one of the results it is, generally you can pick it out quickly based on the path that the file is in. Here's how to search:<br />
<br />
<pre>find / -type f -name my.cnf</pre><br />
<br />
Here is a sample output from Fedora 23:<br />
<br />
<pre>/etc/my.cnf<br />
/etc/my.cnf.d<br />
/etc/my.cnf.d/mysql-clients.cnf<br />
/etc/my.cnf.d/client.cnf<br />
/etc/my.cnf.d/mariadb-server.cnf<br />
/etc/my.cnf.d/tokudb.cnf</pre><br />
<br />
In this case, the first result is the right file, <font color="red">/etc/my.cnf</font> Looking into this particular file (on Fedora 23), there is a line that says <font color="red">!includedir /etc/my.cnf.d</font> This means any files in that directory, <font color="red">/etc/my.cnf.d</font> are included in MySQL's configuration.<br />
<br />
=MySQL credentials for FOG Main and Storage Nodes=<br />
<br />
The installer sets up FOG with the MySQL Credentials given during installation. These credentials are then stored inside of <font color="red">/opt/fog/.fogsettings</font> for use with the next installation/update. Fog builds a particular web file, <font color="red">/var/www/html/fog/lib/fog/config.class.php</font> this file's settings are what the FOG web front end uses to access MySQL and other things as well.<br />
<br />
If those files have incorrect credentials, then there will be mysql permission and access errors in the Apache error logs, and maybe computers will not be able to boot from the FOG Main server or storage nodes either. <font color="red">bind-address</font> defined inside of the my.cnf file can also cause this.<br />
<br />
By default, FOG does not set any MySQL password for the main fog server, but FOG Storage nodes MUST use the fogstorage mysql user (or some remote-enabled user that has permissions to the fog db). Storage Nodes communicate with the main FOG server's MySQL database directly in order to update tasking and to present proper boot.php iPXE scripts to clients. This Username/password is auto-generated during installation and can be found here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS and FOG_STORAGENODE_MYSQLUSER</font><br />
<br />
From a FOG Storage node, you may try this username & password combination using the example above in the testing section.<br />
<br />
See also: [[Password Central]]<br />
<br />
=Reset MySQL fog user and password=<br />
<br />
<pre>mysql<br />
DROP USER 'fog'@'localhost';<br />
<br />
#Create the user using a password:<br />
CREATE USER 'fog'@'localhost' IDENTIFIED BY 'YourPasswordGoesHere';<br />
<br />
#Create the user without a password:<br />
CREATE USER 'fog'@'localhost';<br />
<br />
GRANT ALL ON fog.* TO 'fog'@'localhost';<br />
exit</pre><br />
<br />
Newer MySql and Ubuntu 16+ method:<br />
<br />
<pre><br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or:<br />
ALTER USER 'fog'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or no password:<br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY '';<br />
</pre><br />
<br />
=Change MySQL user's password=<br />
<br />
You can change a user's password and where they are able to connect from with this command:<br />
<pre><br />
#Enable only local access:<br />
SET PASSWORD FOR 'fogstorage'@'localhost' = PASSWORD('PasswordHere');<br />
<br />
#Enable access from remotely:<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
</pre><br />
<br />
=Manually export / import Fog database=<br />
<br />
Related article: [[Migrate FOG]]<br />
<br />
Export:<br />
<br />
<pre>mysqldump -u USERNAME -pPASSWORD -h HOSTNAME fog > fogDB.sql</pre><br />
<br />
Import:<br />
<br />
<pre>mysql -u USERNAME -pPASSWORD -h HOSTNAME fog < fogDB.sql</pre><br />
<br />
<br />
Example using root and 13375p3@k as the password on the local host.<br />
<br />
<pre>#Exporting my DB locally on my FOG server...<br />
mysql -u root -p13375p3@k fog > fog_backup.sql<br />
<br />
#Here is an import example...<br />
mysql -u root -p13375p3@k fog < fog_backup.sql<br />
<br />
#Here is an example of exporting a remote DB to your current directory, <br />
#where x.x.x.x would be replaced by the IP of the remote system...<br />
<br />
mysql -u root -p13375p3@k -h x.x.x.x fog > fog_backup.sql</pre><br />
<br />
=Enable remote mysql access=<br />
<br />
Generally this isn't needed, as a "fogstorage" user is already setup with remote access for storage node purposes by the FOG Installer (In 1.3.0). However if you wanted ease of interaction to do testing or development on the FOG database via remote access with a third party tool (such as [http://www.heidisql.com/ HeidiSQL]), then you'd need to enable remote access on an account, or make a new account and enable remote access for it.<br />
<br />
<pre><br />
mysql<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
GRANT ALL PRIVILEGES ON fog.* TO 'fogstorage'@'%' IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;<br />
FLUSH PRIVILEGES;<br />
</pre><br />
<br />
If you want to restrict access to a specific IP, replace the percent symbol (%) with an IP.<br />
<br />
Some systems have a bind address set. You can disable that in the my.cnf file. Search for that file with this:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Comment out these lines with a hash tag #<br />
<pre>#skip-networking<br />
#bind-address = 127.0.0.1</pre><br />
<br />
=Increase maximum simultaneous MySQL connections=<br />
<br />
If you're imaging 50 to 200 computers simultaneously, or simply have a very large amount of hosts, you'll find the below settings helpful.<br />
<br />
<pre>mysql<br />
SET GLOBAL max_connections = 200;<br />
flush hosts;</pre><br />
<br />
<br />
Open the my.cnf file and make the below change.<br />
<br />
'''Fedora 20,21,22:'''<br />
<br />
/etc/my.cnf<br />
<br />
'''Ubuntu 14:'''<br />
<br />
/etc/mysql/my.cnf<br />
<br />
<pre>max_connections = 200</pre><br />
<br />
then restart mysql<br />
<br />
=Repair broken database=<br />
<br />
If you've filled the partition that contains the MySQL Database file completely full, it's highly likely that your MySQL database is now corrupted (and probably several other things too if your really unlucky). You can check for issues and attempt to repair them like this:<br />
<br />
<pre>mysqlcheck -r fog</pre><br />
<br />
If you're able to successfully repair the database, promptly do a DB export via the Web interface or manually via the steps in this article, and then start thinking about migrating/fixing your FOG server so the partition table layout is optimal and safe so this doesn't happen again.<br />
<br />
You really should try to avoid housing your images and snapins on important partitions, and should instead place images and snapins on their own partition. Setting up a partition for images and snapins is most easily done during OS installation - but can be done afterwards albeit there are many more steps and many more chances to make mistakes. <br />
<br />
There are numerous tutorials in the Forums and some bits of information about it in the Wiki, but generally you would create a mount point called <font color="red">/images</font> and give that partition as much space as you can. You should still allow the <font color="red">/</font> , possibly <font color="red">/home</font> , and a swap partition the size it needs. For minimal installs, the <font color="red">/</font> partition at minimum can operate on 6GB but I would recommend 20GB. The swap partition should be equal to the amount of RAM, or double. The <font color="red">/home</font> partition should be sizable if you are using a GUI, something like 20GB. If not using a GUI, probably 10GB would be fine. Optionally, you can also create a partition for <font color="red">/opt</font> and give it 20 or so GB.<br />
<br />
For Linux newcomers, it's important to note that if your using a GUI to install the OS, setting these partitions is usually intuitive and very easy now-a-days.<br />
<br />
=Ubuntu 13.04 14.04 15.04 and higher with FOG 1.2.0=<br />
<br />
<br />
Ubuntu has issues with mysql. Particularly anything 13 and greater seems to be hugely a problem from my experience.<br />
<br />
When this happens, fog will run normally after the server boots for 10 or 15 minutes and then mysql crashes, which forces a "Update the Database Schema" message when trying to use fog, and the schema updater does not fix the problem.<br />
<br />
To test if this is the issue, simply try to restart MySQL (please note this is only temporary) and see if the problem goes away:<br />
<br />
<pre>sudo service mysql restart</pre><br />
<br />
A fix has been reported with this issue. <br />
Here are the instructions to fix it:<br />
<br />
Open this file:<br />
<br />
<pre>sudo vi /var/www/fog/lib/fog/Config.class.php</pre><br />
<br />
Notate both the host, username & password and then close the above file.<br />
Open this file:<br />
<br />
<pre>sudo vi /opt/fog/.fogsettings</pre><br />
<br />
Fill in the following portions:<br />
<br />
*snmysqluser="{root}"<br />
<br />
*snmysqlpass="{PasswordIfYouHaveOne}"<br />
<br />
*snmysqlhost="{localhost}"<br />
<br />
Reset the mySQL database password to be what is in the config files.<br />
<br />
Then run this:<br />
<br />
<pre>sudo dpkg-reconfigure mysql-server-5.5</pre><br />
<br />
Enter in the new password when prompted.<br />
<br />
<br />
If you still have issues re-run the installer.<br />
<br />
=The DB and Multicast=<br />
<br />
For issues with Multicast, the DB tables associated with that could be dirty. You'll know this is the case if clients just sit at the partclone screen doing nothing.<br />
<br />
<pre>TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;</pre><br />
<br />
Via MySQL cli or phpmyadmin (easy to install)<br />
<br />
Please also see: [[Troubleshoot Downloading - Multicast]] and [[Multicast]]<br />
<br />
= Database Maintenance Commands =<br />
<br />
Sometimes, a host will be created with an ID of 0 (zero). Sometimes, there are MAC addresses that loose their association with a host, and in a sense become orphaned. Sometimes there are tasks that just need cleared out. Sometimes there are hosts without MACs. Sometimes groups of ID 0 get made, sometimes snapins of ID 0 get made. Sometimes snapins are associated with hosts that don't exist anymore. Other things go wrong sometimes. These things cause problems with FOG's operation and need cleared out in order to have a clean & healthy database. The below commands are intended to run on FOG 1.3, 1.4, and 1.5 series, they will clear these problems for you. This also fixes problems with multicast occasionally, where the partclone screen just sits there doing nothing.<br />
<br />
<pre><br />
# No password:<br />
mysql -D fog<br />
<br />
# Password:<br />
mysql --user=UsernameHere --password=PasswordHere -D fog<br />
<br />
<br />
# The following chunk of commands will clean out most problems and are safe:<br />
DELETE FROM `hosts` WHERE `hostID` = '0';<br />
DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0';<br />
DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0';<br />
DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0';<br />
DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0';<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC` WHERE `hmPrimary` = '1');<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`);<br />
DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `tasks` WHERE `taskStateID` IN ("1","2","3");<br />
DELETE FROM `snapinTasks` WHERE `stState` in ("1","2","3");<br />
TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;<br />
<br />
<br />
# This one clears the history table which can get pretty large:<br />
TRUNCATE TABLE history;<br />
<br />
<br />
# This one will clear the userTracking table, This table is where user login/logout (for host computers, not the fog server) is stored. This table can also get pretty large.<br />
TRUNCATE TABLE userTracking;<br />
<br />
quit<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12568Getting FOG2018-01-09T18:24:04Z<p>Wayne-workman.28155: /* Using the desired FOG branch */</p>
<hr />
<div>Related Article: [[Upgrade_to_trunk]]<br />
<br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If updating a VM, snapshot/checkpoint it first.<br />
* If updating, backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch (latest stable release), skip to [[Getting_FOG#Running_the_installer]]. <br />
<br />
If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
git pull<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12567Getting FOG2017-12-18T23:31:12Z<p>Wayne-workman.28155: /* Read First */</p>
<hr />
<div>Related Article: [[Upgrade_to_trunk]]<br />
<br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If updating a VM, snapshot/checkpoint it first.<br />
* If updating, backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch (latest stable release), skip to [[Getting_FOG#Running_the_installer]]. <br />
<br />
If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12566Getting FOG2017-12-18T21:55:14Z<p>Wayne-workman.28155: /* Using the desired FOG branch */</p>
<hr />
<div>Related Article: [[Upgrade_to_trunk]]<br />
<br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch (latest stable release), skip to [[Getting_FOG#Running_the_installer]]. <br />
<br />
If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12565Getting FOG2017-12-16T14:25:35Z<p>Wayne-workman.28155: </p>
<hr />
<div>Related Article: [[Upgrade_to_trunk]]<br />
<br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch (latest stable release), skip to [[Getting_FOG#Running_the_installer]]. If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Upgrade_to_trunk&diff=12564Upgrade to trunk2017-12-16T14:25:08Z<p>Wayne-workman.28155: </p>
<hr />
<div>Related Article: [[Getting_FOG]]<br />
<br />
<noinclude>= Methods =</noinclude><br />
* To get the very latest version of FOG you need to follow the below instructions.<br />
<br />
* Remember these are mostly betas so there are bound to be bugs, but with bugs also comes fixes of the issues found in the "Stable Release"<br />
* If you have nodes they will also need to be upgraded! (Excluding Beta [[Windows_Storage_Node | Windows Nodes]])<br />
<br />
= Git =<br />
* Update and then Install git (or 'yum' instead of 'apt-get' if you are running a RedHat based OS)<br />
<br />
<pre><br />
sudo apt-get update && apt-get install git<br />
</pre><br />
<br />
* Initial checkout and installation<br />
<pre><br />
sudo -i<br />
git clone https://github.com/FOGProject/fogproject.git /root/fogproject<br />
cd /root/fogproject<br />
git checkout dev-branch<br />
cd bin<br />
./installfog.sh<br />
</pre><br />
<br />
== Update to latest ==<br />
As the development tree of FOG changes quiet often (pretty much daily!) you might want to update to the very latest version from time to time. To do this use the following commands:<br />
<pre><br />
cd /root/fogproject<br />
git checkout dev-branch<br />
git pull<br />
cd bin<br />
./installfog.sh<br />
</pre><br />
<br />
== Check your git version ==<br />
<br />
<pre><br />
cd /root/fogproject<br />
git log -1<noinclude><br />
</pre><br />
<br />
<br />
<br />
= Congratulations =<br />
* Congrats! You have now upgraded to the "bleeding edge" of FOG deployment. It is your responsibility to keep upgraded until the next "Stable Release". Until then you will see in the ''cloud'' of your ''Web Gui'' '''rXXXX'''. This indicates the revision you are now on.<br />
* You can check for updates to the revisions under [[File:1.3.0 fog configuration.png]] '''Fog Configuration'''. This will state the version you are on and what the lastest revision is.<br />
<br />
= Additional information on SVN and git & FOG Trunk =<br />
<br />
FOG developmental versions are called "revisions." Revisions are normally stable for the PRIMARY functions of FOG: '''IMAGE > NAME > JOIN TO DOMAIN using UNICAST and MULTICAST'''<br />
<br />
Other features in FOG revisions (not directly related to the imaging process) '''are sometimes broken'''. The developers are pretty good about fixing issues when someone finds and reports it. These other features usually do not impact imaging. Additionally, if you encounter an issue, let us know about it in the [https://forums.fogproject.org/ forums] and someone is likely to help and/or fix it quickly, making a new "revision" that you can download and install very quickly using the above methods.<br />
<br />
However, with the current revisions, you'll benefit from a '''plethora of bug fixes''', a much '''wider range of supported host hardware''', and '''new features'''!<br />
<br />
Updating FOG from one revision to a newer one usually takes less than a minute or two. Fog uses your settings from previous installations so you don't have to answer questions about the installation or set additional configurations. '''FOG supports upgrading, but not downgrading'''. If you would like to roll-back to a previous version, generally, this can only be done by reverting to a previous snap-shot taken from a virtualized machine that FOG is installed on.<br />
<br />
It's advised to backup your database and export your hosts (and label the files) prior to upgrading. You can do that like this on 1.2.0 and higher:<br />
<br />
* FOG Configuration -> Configuration Save -> Export<br />
* Host Management -> Export Hosts -> Export<br />
<br />
You may install FOG Trunk on a server that does not have FOG installed already.<br />
<br />
= Check what version you're running =<br />
<br />
On your FOG's web GUI login page, you can quickly check what revision you're running:<br />
<br />
[[File:FOG Revision in cloud.png]]<br />
= Video Tutorials =<br />
</noinclude><br />
<includeonly>==== Video Tutorials ====</includeonly><br />
<br />
<font color="red">Note:</font> Video plays in Chrome or Firefox with html5 plugin<br />
<br />
External video link: [https://youtu.be/4XtY70nCg_A FOG upgrade to trunk - Git method ]<br />
<br />
<embedvideo service="youtube">https://youtu.be/4XtY70nCg_A</embedvideo><br />
<br />
External video link: [https://youtu.be/nlYWhjkjPR8 FOG upgrade existing Git repo ]<br />
<br />
<embedvideo service="youtube">https://youtu.be/nlYWhjkjPR8</embedvideo></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12563Getting FOG2017-12-16T14:24:03Z<p>Wayne-workman.28155: /* Using the desired FOG branch */</p>
<hr />
<div><br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch (latest stable release), skip to [[Getting_FOG#Running_the_installer]]. If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12562Getting FOG2017-12-16T14:23:47Z<p>Wayne-workman.28155: /* Using the desired FOG branch */</p>
<hr />
<div><br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
'''If you want to use the master branch (latest stable release), skip to [[Getting_FOG#Running_the_installer]]''' If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12561Getting FOG2017-12-16T14:23:02Z<p>Wayne-workman.28155: /* Using the desired FOG branch */</p>
<hr />
<div><br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
'''If you want to use the master branch (latest stable release), skip to ''' If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12560Getting FOG2017-12-16T14:22:42Z<p>Wayne-workman.28155: /* Using the desired FOG branch */</p>
<hr />
<div><br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
'''If you want to use the master branch (latest stable release), skip to the next section.''' If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_Web_Interface&diff=12559Troubleshoot Web Interface2017-12-16T14:15:55Z<p>Wayne-workman.28155: /* High CPU load from web interface */</p>
<hr />
<div>Page under construction. Below you'll find notes that are being collected to make into an article.<br />
<br />
= Apache Error Logs =<br />
<br />
You can manually view the apache error logs by either using vim, cat, or tail. The most popular way is with tail so we will demonstrate that way. Often times, problems with the web interface will have associated errors in apache's log file. Researching this error normally leads you to the corrective action necessary - or at least provides you with an error you can post on the forums with your issue.<br />
<br />
RHEL/CentOS/Fedora:<br />
<font color="red">tail -n 100 /var/log/httpd/error_log</font><br />
<br />
Debian/Ubuntu:<br />
<font color="red">tail -n 100 /var/log/apache2/error.log</font><br />
<br />
<br />
= Fatal error: Allowed memory size of xxxxxxxx bytes exhausted =<br />
<br />
Reference: [https://forums.fogproject.org/topic/6234/fog-version-5507-cannot-access-host-management Fog Version 5507 Cannot Access Host Management]<br />
<br />
'''Solution:''' Raise the web interface's memory limit:<br />
<font color="red">FOG Configuration -> FOG Settings -> General Settings -> FOG_MEMORY_LIMIT</font> <br />
<br />
It’s done in megs, so 128 = 128M, 256 = 256M etc…<br />
<br />
After changing this, a reboot is recommended.<br />
<br />
= Manually test WOL =<br />
<br />
This is the web address to manually test FOG's WOL functionality:<br />
<br />
<pre>http://x.x.x.x/fog/management/index.php?sub=wakeEmUp&mac=aa:bb:cc:dd:ee:ff</pre><br />
<br />
Where x.x.x.x is your FOG server's IP address, and aa:bb:cc:dd:ee:ff is the MAC address of the host you wish to wake up.<br />
<br />
For instance, if my FOG server's IP is 10.0.0.7 and the target host's MAC is 14:fe:b5:df:fc:7e I would then put the below web address into the address bar of a web browser and then press enter / click go. <br />
<br />
[http://10.0.0.7/fog/management/index.php?sub=wakeEmUp&mac=14:fe:b5:df:fc:7e http://10.0.0.7/fog/management/index.php?sub=wakeEmUp&mac=14:fe:b5:df:fc:7e]<br />
<br />
After doing this, the target host will be sent a WOL packet from the FOG server.<br />
<br />
= Manually check a host's iPXE script =<br />
<br />
Below is the web address used to check a particular host's iPXE script that the fog server gives it when it's network booting. You would replace x.x.x.x with your fog server's IP address, and replace the MAC address with the host's actual mac address.<br />
<br />
<pre><br />
x.x.x.x/fog/service/ipxe/boot.php?mac=aa:bb:cc:dd:ee:ff<br />
</pre><br />
<br />
= High CPU load from web interface =<br />
<br />
There is a tool called apachetop that will list the amount of requests every file served by Apache receives, along with the total amount of data sent via that file. This tool will prove invaluable in solving web load issues.<br />
<br />
To install apachetop on Fedora 23:<br />
<br />
<pre>dnf install apachetop -y</pre><br />
<br />
Then to run it, simply type:<br />
<br />
<pre>apachetop</pre><br />
<br />
apachetop is available for other distributions too.<br />
<br />
Other tools to look into are <font color="red">iftop</font> ran with this command: <font color="red">iftop -n</font> and just plain-old <font color="red">top</font><br />
<br />
See also DB Maintenance commands: [[Troubleshoot_MySQL#Database_Maintenance_Commands]]<br />
<br />
= High CPU load from apache =<br />
<br />
Here are threads about high CPU load:<br />
<br />
[https://forums.fogproject.org/topic/6020/fog-svn-5020-and-above-cpu-hammered-thread/20?page=2 fog-svn-5020-and-above-cpu-hammered-thread]<br />
<br />
[https://forums.fogproject.org/topic/6469/tons-of-httpd-processes tons-of-httpd-processes]<br />
<br />
[https://forums.fogproject.org/topic/6277/not-sure-if-its-a-bug-or-a-feature-high-fog-server-cpu-on-dashboard/22 not-sure-if-its-a-bug-or-a-feature-high-fog-server-cpu-on-dashboard]<br />
<br />
[https://forums.fogproject.org/topic/6901/high-cpu-usage-from-multiple-httpd-processes-version-5800?page=1 high-cpu-usage-from-multiple-httpd-processes-version-5800]<br />
<br />
[https://forums.fogproject.org/topic/6940/high-cpu-fog-services-after-update-r5029-v6759 high-cpu-fog-services-after-update-r5029-v6759]<br />
<br />
[https://forums.fogproject.org/topic/7234/after-update-of-fog-trunk-php-errors after-update-of-fog-trunk-php-errors]<br />
<br />
[https://forums.fogproject.org/topic/7215/high-cpu-php-errors-after-update-to-trunk-github-7234 high-cpu-php-errors-after-update-to-trunk-github-7234]<br />
<br />
[https://forums.fogproject.org/topic/4929/fog-3396-high-cpu-utilization-when-auto-update-is-running-on-the-active-tasks-page fog-3396-high-cpu-utilization-when-auto-update-is-running-on-the-active-tasks-page]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL&diff=12558Troubleshoot MySQL2017-12-16T14:13:49Z<p>Wayne-workman.28155: /* Database Maintenance Commands */</p>
<hr />
<div>=MySQL's role in FOG=<br />
<br />
MySQL is used to hold information and metadata about hosts, images, groups, snapins, various web-level fog settings, and other things. It does not house the actual image data. In newer Linux, it's being phased out in favor of MariaDB. All commands for MySQL will work for MariaDB.<br />
<br />
=Easy & quick MySQL test=<br />
<br />
For the main server and all storage nodes, you may test to see if there is a proper database connection happening or not by visiting the below URL. Replace the x.x.x.x with the IP address of the system you wish to test, and test each system one by one.<br />
<br />
<font color="red">http://x.x.x.x/fog/service/getversion.php</font><br />
<br />
If everything is working, the output will '''only''' report the server's FOG version and nothing else. All servers in a distributed FOG system should always be kept on the same version.<br />
<br />
=Manually Testing MySQL=<br />
<br />
On your FOG server, you can check passwords and the existence of the FOG database by issuing these commands:<br />
<br />
No Password: <br />
<br />
<pre>mysql -D fog<br />
exit</pre><br />
<br />
Test with a username and password (note '''no space''' between -p and the password):<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -D fog<br />
exit</pre><br />
<br />
For a remote server or from a storage node, use:<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog<br />
exit</pre><br />
<br />
* X.X.X.X represents where you'd put the remote host's IP address.<br />
* '''-u''' is username<br />
* '''-p''' is password<br />
* '''-h''' is host<br />
* '''-d''' is database<br />
<br />
=MySQL Service=<br />
<br />
== CentOS / RHEL / Fedora ==<br />
<br />
Check status:<br />
<br />
<pre>systemctl status mysql</pre><br />
<br />
Restart service:<br />
<br />
<pre>systemctl restart mysql</pre><br />
<br />
== Debian / Ubuntu ==<br />
<br />
Check status:<br />
<br />
<pre>service mysql status</pre><br />
<br />
Restart service:<br />
<br />
<pre>service mysql restart</pre><br />
<br />
=MySQL Config File=<br />
<br />
The location of this file varies based on the distribution of Linux you're using. Usually it's called my.cnf and it's probably best to just issue a search command for the file and then figure out which one of the results it is, generally you can pick it out quickly based on the path that the file is in. Here's how to search:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Here is a sample output from Fedora 23:<br />
<br />
<pre>/etc/my.cnf<br />
/etc/my.cnf.d<br />
/etc/my.cnf.d/mysql-clients.cnf<br />
/etc/my.cnf.d/client.cnf<br />
/etc/my.cnf.d/mariadb-server.cnf<br />
/etc/my.cnf.d/tokudb.cnf</pre><br />
<br />
In this case, the first result is the right file, <font color="red">/etc/my.cnf</font> Looking into this particular file (on Fedora 23), there is a line that says <font color="red">!includedir /etc/my.cnf.d</font> This means any files in that directory, <font color="red">/etc/my.cnf.d</font> are included in MySQL's configuration.<br />
<br />
<br />
=MySQL credentials for FOG Main and Storage Nodes=<br />
<br />
The installer sets up FOG with the MySQL Credentials given during installation. These credentials are then stored inside of <font color="red">/opt/fog/.fogsettings</font> for use with the next installation/update. Fog builds a particular web file, <font color="red">/var/www/html/fog/lib/fog/config.class.php</font> this file's settings are what the FOG web front end uses to access MySQL and other things as well.<br />
<br />
If those files have incorrect credentials, then there will be mysql permission and access errors in the Apache error logs, and maybe computers will not be able to boot from the FOG Main server or storage nodes either. <font color="red">bind-address</font> defined inside of the my.cnf file can also cause this.<br />
<br />
By default, FOG does not set any MySQL password for the main fog server, but FOG Storage nodes MUST use the fogstorage mysql user (or some remote-enabled user that has permissions to the fog db). Storage Nodes communicate with the main FOG server's MySQL database directly in order to update tasking and to present proper boot.php iPXE scripts to clients. This Username/password is auto-generated during installation and can be found here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS and FOG_STORAGENODE_MYSQLUSER</font><br />
<br />
From a FOG Storage node, you may try this username & password combination using the example above in the testing section.<br />
<br />
See also: [[Password Central]]<br />
<br />
=Reset MySQL fog user and password=<br />
<br />
<pre>mysql<br />
DROP USER 'fog'@'localhost';<br />
<br />
#Create the user using a password:<br />
CREATE USER 'fog'@'localhost' IDENTIFIED BY 'YourPasswordGoesHere';<br />
<br />
#Create the user without a password:<br />
CREATE USER 'fog'@'localhost';<br />
<br />
GRANT ALL ON fog.* TO 'fog'@'localhost';<br />
exit</pre><br />
<br />
Newer MySql and Ubuntu 16+ method:<br />
<br />
<pre><br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or:<br />
ALTER USER 'fog'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or no password:<br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY '';<br />
</pre><br />
<br />
=Change MySQL user's password=<br />
<br />
You can change a user's password and where they are able to connect from with this command:<br />
<pre><br />
#Enable only local access:<br />
SET PASSWORD FOR 'fogstorage'@'localhost' = PASSWORD('PasswordHere');<br />
<br />
#Enable access from remotely:<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
</pre><br />
<br />
=Manually export / import Fog database=<br />
<br />
Related article: [[Migrate FOG]]<br />
<br />
Export:<br />
<br />
<pre>mysqldump -u USERNAME -pPASSWORD -h HOSTNAME fog > fogDB.sql</pre><br />
<br />
Import:<br />
<br />
<pre>mysql -u USERNAME -pPASSWORD -h HOSTNAME fog < fogDB.sql</pre><br />
<br />
<br />
Example using root and 13375p3@k as the password on the local host.<br />
<br />
<pre>#Exporting my DB locally on my FOG server...<br />
mysql -u root -p13375p3@k fog > fog_backup.sql<br />
<br />
#Here is an import example...<br />
mysql -u root -p13375p3@k fog < fog_backup.sql<br />
<br />
#Here is an example of exporting a remote DB to your current directory, <br />
#where x.x.x.x would be replaced by the IP of the remote system...<br />
<br />
mysql -u root -p13375p3@k -h x.x.x.x fog > fog_backup.sql</pre><br />
<br />
=Enable remote mysql access=<br />
<br />
Generally this isn't needed, as a "fogstorage" user is already setup with remote access for storage node purposes by the FOG Installer (In 1.3.0). However if you wanted ease of interaction to do testing or development on the FOG database via remote access with a third party tool (such as [http://www.heidisql.com/ HeidiSQL]), then you'd need to enable remote access on an account, or make a new account and enable remote access for it.<br />
<br />
<pre><br />
mysql<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
GRANT ALL PRIVILEGES ON fog.* TO 'fogstorage'@'%' IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;<br />
FLUSH PRIVILEGES;<br />
</pre><br />
<br />
If you want to restrict access to a specific IP, replace the percent symbol (%) with an IP.<br />
<br />
Some systems have a bind address set. You can disable that in the my.cnf file. Search for that file with this:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Comment out these lines with a hash tag #<br />
<pre>#skip-networking<br />
#bind-address = 127.0.0.1</pre><br />
<br />
=Increase maximum simultaneous MySQL connections=<br />
<br />
If you're imaging 50 to 200 computers simultaneously, or simply have a very large amount of hosts, you'll find the below settings helpful.<br />
<br />
<pre>mysql<br />
SET GLOBAL max_connections = 200;<br />
flush hosts;</pre><br />
<br />
<br />
Open the my.cnf file and make the below change.<br />
<br />
'''Fedora 20,21,22:'''<br />
<br />
/etc/my.cnf<br />
<br />
'''Ubuntu 14:'''<br />
<br />
/etc/mysql/my.cnf<br />
<br />
<pre>max_connections = 200</pre><br />
<br />
then restart mysql<br />
<br />
=Repair broken database=<br />
<br />
If you've filled the partition that contains the MySQL Database file completely full, it's highly likely that your MySQL database is now corrupted (and probably several other things too if your really unlucky). You can check for issues and attempt to repair them like this:<br />
<br />
<pre>mysqlcheck -r fog</pre><br />
<br />
If you're able to successfully repair the database, promptly do a DB export via the Web interface or manually via the steps in this article, and then start thinking about migrating/fixing your FOG server so the partition table layout is optimal and safe so this doesn't happen again.<br />
<br />
You really should try to avoid housing your images and snapins on important partitions, and should instead place images and snapins on their own partition. Setting up a partition for images and snapins is most easily done during OS installation - but can be done afterwards albeit there are many more steps and many more chances to make mistakes. <br />
<br />
There are numerous tutorials in the Forums and some bits of information about it in the Wiki, but generally you would create a mount point called <font color="red">/images</font> and give that partition as much space as you can. You should still allow the <font color="red">/</font> , possibly <font color="red">/home</font> , and a swap partition the size it needs. For minimal installs, the <font color="red">/</font> partition at minimum can operate on 6GB but I would recommend 20GB. The swap partition should be equal to the amount of RAM, or double. The <font color="red">/home</font> partition should be sizable if you are using a GUI, something like 20GB. If not using a GUI, probably 10GB would be fine. Optionally, you can also create a partition for <font color="red">/opt</font> and give it 20 or so GB.<br />
<br />
For Linux newcomers, it's important to note that if your using a GUI to install the OS, setting these partitions is usually intuitive and very easy now-a-days.<br />
<br />
=Ubuntu 13.04 14.04 15.04 and higher with FOG 1.2.0=<br />
<br />
<br />
Ubuntu has issues with mysql. Particularly anything 13 and greater seems to be hugely a problem from my experience.<br />
<br />
When this happens, fog will run normally after the server boots for 10 or 15 minutes and then mysql crashes, which forces a "Update the Database Schema" message when trying to use fog, and the schema updater does not fix the problem.<br />
<br />
To test if this is the issue, simply try to restart MySQL (please note this is only temporary) and see if the problem goes away:<br />
<br />
<pre>sudo service mysql restart</pre><br />
<br />
A fix has been reported with this issue. <br />
Here are the instructions to fix it:<br />
<br />
Open this file:<br />
<br />
<pre>sudo vi /var/www/fog/lib/fog/Config.class.php</pre><br />
<br />
Notate both the host, username & password and then close the above file.<br />
Open this file:<br />
<br />
<pre>sudo vi /opt/fog/.fogsettings</pre><br />
<br />
Fill in the following portions:<br />
<br />
*snmysqluser="{root}"<br />
<br />
*snmysqlpass="{PasswordIfYouHaveOne}"<br />
<br />
*snmysqlhost="{localhost}"<br />
<br />
Reset the mySQL database password to be what is in the config files.<br />
<br />
Then run this:<br />
<br />
<pre>sudo dpkg-reconfigure mysql-server-5.5</pre><br />
<br />
Enter in the new password when prompted.<br />
<br />
<br />
If you still have issues re-run the installer.<br />
<br />
=The DB and Multicast=<br />
<br />
For issues with Multicast, the DB tables associated with that could be dirty. You'll know this is the case if clients just sit at the partclone screen doing nothing.<br />
<br />
<pre>TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;</pre><br />
<br />
Via MySQL cli or phpmyadmin (easy to install)<br />
<br />
Please also see: [[Troubleshoot Downloading - Multicast]] and [[Multicast]]<br />
<br />
= Database Maintenance Commands =<br />
<br />
Sometimes, a host will be created with an ID of 0 (zero). Sometimes, there are MAC addresses that loose their association with a host, and in a sense become orphaned. Sometimes there are tasks that just need cleared out. Sometimes there are hosts without MACs. Sometimes groups of ID 0 get made, sometimes snapins of ID 0 get made. Sometimes snapins are associated with hosts that don't exist anymore. Other things go wrong sometimes. These things cause problems with FOG's operation and need cleared out in order to have a clean & healthy database. The below commands are intended to run on FOG 1.3, 1.4, and 1.5 series, they will clear these problems for you. This also fixes problems with multicast occasionally, where the partclone screen just sits there doing nothing.<br />
<br />
<pre><br />
# No password:<br />
mysql -D fog<br />
<br />
# Password:<br />
mysql --user=UsernameHere --password=PasswordHere -D fog<br />
<br />
<br />
# The following chunk of commands will clean out most problems and are safe:<br />
DELETE FROM `hosts` WHERE `hostID` = '0';<br />
DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0';<br />
DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0';<br />
DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0';<br />
DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0';<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC` WHERE `hmPrimary` = '1');<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`);<br />
DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `tasks` WHERE `taskStateID` IN ("1","2","3");<br />
DELETE FROM `snapinTasks` WHERE `stState` in ("1","2","3");<br />
TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;<br />
<br />
<br />
# This one clears the history table which can get pretty large:<br />
TRUNCATE TABLE history;<br />
<br />
<br />
# This one will clear the userTracking table, This table is where user login/logout (for host computers, not the fog server) is stored. This table can also get pretty large.<br />
TRUNCATE TABLE userTracking;<br />
<br />
quit<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL&diff=12557Troubleshoot MySQL2017-12-16T14:13:12Z<p>Wayne-workman.28155: /* Database Maintenance Commands */</p>
<hr />
<div>=MySQL's role in FOG=<br />
<br />
MySQL is used to hold information and metadata about hosts, images, groups, snapins, various web-level fog settings, and other things. It does not house the actual image data. In newer Linux, it's being phased out in favor of MariaDB. All commands for MySQL will work for MariaDB.<br />
<br />
=Easy & quick MySQL test=<br />
<br />
For the main server and all storage nodes, you may test to see if there is a proper database connection happening or not by visiting the below URL. Replace the x.x.x.x with the IP address of the system you wish to test, and test each system one by one.<br />
<br />
<font color="red">http://x.x.x.x/fog/service/getversion.php</font><br />
<br />
If everything is working, the output will '''only''' report the server's FOG version and nothing else. All servers in a distributed FOG system should always be kept on the same version.<br />
<br />
=Manually Testing MySQL=<br />
<br />
On your FOG server, you can check passwords and the existence of the FOG database by issuing these commands:<br />
<br />
No Password: <br />
<br />
<pre>mysql -D fog<br />
exit</pre><br />
<br />
Test with a username and password (note '''no space''' between -p and the password):<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -D fog<br />
exit</pre><br />
<br />
For a remote server or from a storage node, use:<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog<br />
exit</pre><br />
<br />
* X.X.X.X represents where you'd put the remote host's IP address.<br />
* '''-u''' is username<br />
* '''-p''' is password<br />
* '''-h''' is host<br />
* '''-d''' is database<br />
<br />
=MySQL Service=<br />
<br />
== CentOS / RHEL / Fedora ==<br />
<br />
Check status:<br />
<br />
<pre>systemctl status mysql</pre><br />
<br />
Restart service:<br />
<br />
<pre>systemctl restart mysql</pre><br />
<br />
== Debian / Ubuntu ==<br />
<br />
Check status:<br />
<br />
<pre>service mysql status</pre><br />
<br />
Restart service:<br />
<br />
<pre>service mysql restart</pre><br />
<br />
=MySQL Config File=<br />
<br />
The location of this file varies based on the distribution of Linux you're using. Usually it's called my.cnf and it's probably best to just issue a search command for the file and then figure out which one of the results it is, generally you can pick it out quickly based on the path that the file is in. Here's how to search:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Here is a sample output from Fedora 23:<br />
<br />
<pre>/etc/my.cnf<br />
/etc/my.cnf.d<br />
/etc/my.cnf.d/mysql-clients.cnf<br />
/etc/my.cnf.d/client.cnf<br />
/etc/my.cnf.d/mariadb-server.cnf<br />
/etc/my.cnf.d/tokudb.cnf</pre><br />
<br />
In this case, the first result is the right file, <font color="red">/etc/my.cnf</font> Looking into this particular file (on Fedora 23), there is a line that says <font color="red">!includedir /etc/my.cnf.d</font> This means any files in that directory, <font color="red">/etc/my.cnf.d</font> are included in MySQL's configuration.<br />
<br />
<br />
=MySQL credentials for FOG Main and Storage Nodes=<br />
<br />
The installer sets up FOG with the MySQL Credentials given during installation. These credentials are then stored inside of <font color="red">/opt/fog/.fogsettings</font> for use with the next installation/update. Fog builds a particular web file, <font color="red">/var/www/html/fog/lib/fog/config.class.php</font> this file's settings are what the FOG web front end uses to access MySQL and other things as well.<br />
<br />
If those files have incorrect credentials, then there will be mysql permission and access errors in the Apache error logs, and maybe computers will not be able to boot from the FOG Main server or storage nodes either. <font color="red">bind-address</font> defined inside of the my.cnf file can also cause this.<br />
<br />
By default, FOG does not set any MySQL password for the main fog server, but FOG Storage nodes MUST use the fogstorage mysql user (or some remote-enabled user that has permissions to the fog db). Storage Nodes communicate with the main FOG server's MySQL database directly in order to update tasking and to present proper boot.php iPXE scripts to clients. This Username/password is auto-generated during installation and can be found here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS and FOG_STORAGENODE_MYSQLUSER</font><br />
<br />
From a FOG Storage node, you may try this username & password combination using the example above in the testing section.<br />
<br />
See also: [[Password Central]]<br />
<br />
=Reset MySQL fog user and password=<br />
<br />
<pre>mysql<br />
DROP USER 'fog'@'localhost';<br />
<br />
#Create the user using a password:<br />
CREATE USER 'fog'@'localhost' IDENTIFIED BY 'YourPasswordGoesHere';<br />
<br />
#Create the user without a password:<br />
CREATE USER 'fog'@'localhost';<br />
<br />
GRANT ALL ON fog.* TO 'fog'@'localhost';<br />
exit</pre><br />
<br />
Newer MySql and Ubuntu 16+ method:<br />
<br />
<pre><br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or:<br />
ALTER USER 'fog'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or no password:<br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY '';<br />
</pre><br />
<br />
=Change MySQL user's password=<br />
<br />
You can change a user's password and where they are able to connect from with this command:<br />
<pre><br />
#Enable only local access:<br />
SET PASSWORD FOR 'fogstorage'@'localhost' = PASSWORD('PasswordHere');<br />
<br />
#Enable access from remotely:<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
</pre><br />
<br />
=Manually export / import Fog database=<br />
<br />
Related article: [[Migrate FOG]]<br />
<br />
Export:<br />
<br />
<pre>mysqldump -u USERNAME -pPASSWORD -h HOSTNAME fog > fogDB.sql</pre><br />
<br />
Import:<br />
<br />
<pre>mysql -u USERNAME -pPASSWORD -h HOSTNAME fog < fogDB.sql</pre><br />
<br />
<br />
Example using root and 13375p3@k as the password on the local host.<br />
<br />
<pre>#Exporting my DB locally on my FOG server...<br />
mysql -u root -p13375p3@k fog > fog_backup.sql<br />
<br />
#Here is an import example...<br />
mysql -u root -p13375p3@k fog < fog_backup.sql<br />
<br />
#Here is an example of exporting a remote DB to your current directory, <br />
#where x.x.x.x would be replaced by the IP of the remote system...<br />
<br />
mysql -u root -p13375p3@k -h x.x.x.x fog > fog_backup.sql</pre><br />
<br />
=Enable remote mysql access=<br />
<br />
Generally this isn't needed, as a "fogstorage" user is already setup with remote access for storage node purposes by the FOG Installer (In 1.3.0). However if you wanted ease of interaction to do testing or development on the FOG database via remote access with a third party tool (such as [http://www.heidisql.com/ HeidiSQL]), then you'd need to enable remote access on an account, or make a new account and enable remote access for it.<br />
<br />
<pre><br />
mysql<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
GRANT ALL PRIVILEGES ON fog.* TO 'fogstorage'@'%' IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;<br />
FLUSH PRIVILEGES;<br />
</pre><br />
<br />
If you want to restrict access to a specific IP, replace the percent symbol (%) with an IP.<br />
<br />
Some systems have a bind address set. You can disable that in the my.cnf file. Search for that file with this:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Comment out these lines with a hash tag #<br />
<pre>#skip-networking<br />
#bind-address = 127.0.0.1</pre><br />
<br />
=Increase maximum simultaneous MySQL connections=<br />
<br />
If you're imaging 50 to 200 computers simultaneously, or simply have a very large amount of hosts, you'll find the below settings helpful.<br />
<br />
<pre>mysql<br />
SET GLOBAL max_connections = 200;<br />
flush hosts;</pre><br />
<br />
<br />
Open the my.cnf file and make the below change.<br />
<br />
'''Fedora 20,21,22:'''<br />
<br />
/etc/my.cnf<br />
<br />
'''Ubuntu 14:'''<br />
<br />
/etc/mysql/my.cnf<br />
<br />
<pre>max_connections = 200</pre><br />
<br />
then restart mysql<br />
<br />
=Repair broken database=<br />
<br />
If you've filled the partition that contains the MySQL Database file completely full, it's highly likely that your MySQL database is now corrupted (and probably several other things too if your really unlucky). You can check for issues and attempt to repair them like this:<br />
<br />
<pre>mysqlcheck -r fog</pre><br />
<br />
If you're able to successfully repair the database, promptly do a DB export via the Web interface or manually via the steps in this article, and then start thinking about migrating/fixing your FOG server so the partition table layout is optimal and safe so this doesn't happen again.<br />
<br />
You really should try to avoid housing your images and snapins on important partitions, and should instead place images and snapins on their own partition. Setting up a partition for images and snapins is most easily done during OS installation - but can be done afterwards albeit there are many more steps and many more chances to make mistakes. <br />
<br />
There are numerous tutorials in the Forums and some bits of information about it in the Wiki, but generally you would create a mount point called <font color="red">/images</font> and give that partition as much space as you can. You should still allow the <font color="red">/</font> , possibly <font color="red">/home</font> , and a swap partition the size it needs. For minimal installs, the <font color="red">/</font> partition at minimum can operate on 6GB but I would recommend 20GB. The swap partition should be equal to the amount of RAM, or double. The <font color="red">/home</font> partition should be sizable if you are using a GUI, something like 20GB. If not using a GUI, probably 10GB would be fine. Optionally, you can also create a partition for <font color="red">/opt</font> and give it 20 or so GB.<br />
<br />
For Linux newcomers, it's important to note that if your using a GUI to install the OS, setting these partitions is usually intuitive and very easy now-a-days.<br />
<br />
=Ubuntu 13.04 14.04 15.04 and higher with FOG 1.2.0=<br />
<br />
<br />
Ubuntu has issues with mysql. Particularly anything 13 and greater seems to be hugely a problem from my experience.<br />
<br />
When this happens, fog will run normally after the server boots for 10 or 15 minutes and then mysql crashes, which forces a "Update the Database Schema" message when trying to use fog, and the schema updater does not fix the problem.<br />
<br />
To test if this is the issue, simply try to restart MySQL (please note this is only temporary) and see if the problem goes away:<br />
<br />
<pre>sudo service mysql restart</pre><br />
<br />
A fix has been reported with this issue. <br />
Here are the instructions to fix it:<br />
<br />
Open this file:<br />
<br />
<pre>sudo vi /var/www/fog/lib/fog/Config.class.php</pre><br />
<br />
Notate both the host, username & password and then close the above file.<br />
Open this file:<br />
<br />
<pre>sudo vi /opt/fog/.fogsettings</pre><br />
<br />
Fill in the following portions:<br />
<br />
*snmysqluser="{root}"<br />
<br />
*snmysqlpass="{PasswordIfYouHaveOne}"<br />
<br />
*snmysqlhost="{localhost}"<br />
<br />
Reset the mySQL database password to be what is in the config files.<br />
<br />
Then run this:<br />
<br />
<pre>sudo dpkg-reconfigure mysql-server-5.5</pre><br />
<br />
Enter in the new password when prompted.<br />
<br />
<br />
If you still have issues re-run the installer.<br />
<br />
=The DB and Multicast=<br />
<br />
For issues with Multicast, the DB tables associated with that could be dirty. You'll know this is the case if clients just sit at the partclone screen doing nothing.<br />
<br />
<pre>TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;</pre><br />
<br />
Via MySQL cli or phpmyadmin (easy to install)<br />
<br />
Please also see: [[Troubleshoot Downloading - Multicast]] and [[Multicast]]<br />
<br />
= Database Maintenance Commands =<br />
<br />
Sometimes, a host will be created with an ID of 0 (zero). Sometimes, there are MAC addresses that loose their association with a host, and in a sense become orphaned. Sometimes there are tasks that just need cleared out. Sometimes there are hosts without MACs. Sometimes groups of ID 0 get made, sometimes snapins of ID 0 get made. Sometimes snapins are associated with hosts that don't exist anymore. Other things go wrong sometimes. These things cause problems with FOG's operation and need cleared out in order to have a clean & healthy database. The below commands are intended to run on FOG 1.3, 1.4, and 1.5 series, they will clear these problems for you. This also fixes problems with multicast occasionally, where the partclone screen just sits there doing nothing.<br />
<br />
<pre><br />
# No password:<br />
mysql -D fog<br />
<br />
# Password:<br />
mysql --user=UsernameHere --password=PasswordHere -D fog<br />
<br />
<br />
# The following chunk of commands are safe to run on any fog system, and will clean out most problems:<br />
DELETE FROM `hosts` WHERE `hostID` = '0';<br />
DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0';<br />
DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0';<br />
DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0';<br />
DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0';<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC` WHERE `hmPrimary` = '1');<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`);<br />
DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `tasks` WHERE `taskStateID` IN ("1","2","3");<br />
DELETE FROM `snapinTasks` WHERE `stState` in ("1","2","3");<br />
TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;<br />
<br />
<br />
# This one clears the history table which can get pretty large:<br />
TRUNCATE TABLE history;<br />
<br />
<br />
# This one will clear the userTracking table, This table is where user login/logout (for host computers, not the fog server) is stored. This table can also get pretty large.<br />
TRUNCATE TABLE userTracking;<br />
<br />
quit<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL&diff=12556Troubleshoot MySQL2017-12-16T14:08:48Z<p>Wayne-workman.28155: /* Database Maintenance Commands */</p>
<hr />
<div>=MySQL's role in FOG=<br />
<br />
MySQL is used to hold information and metadata about hosts, images, groups, snapins, various web-level fog settings, and other things. It does not house the actual image data. In newer Linux, it's being phased out in favor of MariaDB. All commands for MySQL will work for MariaDB.<br />
<br />
=Easy & quick MySQL test=<br />
<br />
For the main server and all storage nodes, you may test to see if there is a proper database connection happening or not by visiting the below URL. Replace the x.x.x.x with the IP address of the system you wish to test, and test each system one by one.<br />
<br />
<font color="red">http://x.x.x.x/fog/service/getversion.php</font><br />
<br />
If everything is working, the output will '''only''' report the server's FOG version and nothing else. All servers in a distributed FOG system should always be kept on the same version.<br />
<br />
=Manually Testing MySQL=<br />
<br />
On your FOG server, you can check passwords and the existence of the FOG database by issuing these commands:<br />
<br />
No Password: <br />
<br />
<pre>mysql -D fog<br />
exit</pre><br />
<br />
Test with a username and password (note '''no space''' between -p and the password):<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -D fog<br />
exit</pre><br />
<br />
For a remote server or from a storage node, use:<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog<br />
exit</pre><br />
<br />
* X.X.X.X represents where you'd put the remote host's IP address.<br />
* '''-u''' is username<br />
* '''-p''' is password<br />
* '''-h''' is host<br />
* '''-d''' is database<br />
<br />
=MySQL Service=<br />
<br />
== CentOS / RHEL / Fedora ==<br />
<br />
Check status:<br />
<br />
<pre>systemctl status mysql</pre><br />
<br />
Restart service:<br />
<br />
<pre>systemctl restart mysql</pre><br />
<br />
== Debian / Ubuntu ==<br />
<br />
Check status:<br />
<br />
<pre>service mysql status</pre><br />
<br />
Restart service:<br />
<br />
<pre>service mysql restart</pre><br />
<br />
=MySQL Config File=<br />
<br />
The location of this file varies based on the distribution of Linux you're using. Usually it's called my.cnf and it's probably best to just issue a search command for the file and then figure out which one of the results it is, generally you can pick it out quickly based on the path that the file is in. Here's how to search:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Here is a sample output from Fedora 23:<br />
<br />
<pre>/etc/my.cnf<br />
/etc/my.cnf.d<br />
/etc/my.cnf.d/mysql-clients.cnf<br />
/etc/my.cnf.d/client.cnf<br />
/etc/my.cnf.d/mariadb-server.cnf<br />
/etc/my.cnf.d/tokudb.cnf</pre><br />
<br />
In this case, the first result is the right file, <font color="red">/etc/my.cnf</font> Looking into this particular file (on Fedora 23), there is a line that says <font color="red">!includedir /etc/my.cnf.d</font> This means any files in that directory, <font color="red">/etc/my.cnf.d</font> are included in MySQL's configuration.<br />
<br />
<br />
=MySQL credentials for FOG Main and Storage Nodes=<br />
<br />
The installer sets up FOG with the MySQL Credentials given during installation. These credentials are then stored inside of <font color="red">/opt/fog/.fogsettings</font> for use with the next installation/update. Fog builds a particular web file, <font color="red">/var/www/html/fog/lib/fog/config.class.php</font> this file's settings are what the FOG web front end uses to access MySQL and other things as well.<br />
<br />
If those files have incorrect credentials, then there will be mysql permission and access errors in the Apache error logs, and maybe computers will not be able to boot from the FOG Main server or storage nodes either. <font color="red">bind-address</font> defined inside of the my.cnf file can also cause this.<br />
<br />
By default, FOG does not set any MySQL password for the main fog server, but FOG Storage nodes MUST use the fogstorage mysql user (or some remote-enabled user that has permissions to the fog db). Storage Nodes communicate with the main FOG server's MySQL database directly in order to update tasking and to present proper boot.php iPXE scripts to clients. This Username/password is auto-generated during installation and can be found here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS and FOG_STORAGENODE_MYSQLUSER</font><br />
<br />
From a FOG Storage node, you may try this username & password combination using the example above in the testing section.<br />
<br />
See also: [[Password Central]]<br />
<br />
=Reset MySQL fog user and password=<br />
<br />
<pre>mysql<br />
DROP USER 'fog'@'localhost';<br />
<br />
#Create the user using a password:<br />
CREATE USER 'fog'@'localhost' IDENTIFIED BY 'YourPasswordGoesHere';<br />
<br />
#Create the user without a password:<br />
CREATE USER 'fog'@'localhost';<br />
<br />
GRANT ALL ON fog.* TO 'fog'@'localhost';<br />
exit</pre><br />
<br />
Newer MySql and Ubuntu 16+ method:<br />
<br />
<pre><br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or:<br />
ALTER USER 'fog'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or no password:<br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY '';<br />
</pre><br />
<br />
=Change MySQL user's password=<br />
<br />
You can change a user's password and where they are able to connect from with this command:<br />
<pre><br />
#Enable only local access:<br />
SET PASSWORD FOR 'fogstorage'@'localhost' = PASSWORD('PasswordHere');<br />
<br />
#Enable access from remotely:<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
</pre><br />
<br />
=Manually export / import Fog database=<br />
<br />
Related article: [[Migrate FOG]]<br />
<br />
Export:<br />
<br />
<pre>mysqldump -u USERNAME -pPASSWORD -h HOSTNAME fog > fogDB.sql</pre><br />
<br />
Import:<br />
<br />
<pre>mysql -u USERNAME -pPASSWORD -h HOSTNAME fog < fogDB.sql</pre><br />
<br />
<br />
Example using root and 13375p3@k as the password on the local host.<br />
<br />
<pre>#Exporting my DB locally on my FOG server...<br />
mysql -u root -p13375p3@k fog > fog_backup.sql<br />
<br />
#Here is an import example...<br />
mysql -u root -p13375p3@k fog < fog_backup.sql<br />
<br />
#Here is an example of exporting a remote DB to your current directory, <br />
#where x.x.x.x would be replaced by the IP of the remote system...<br />
<br />
mysql -u root -p13375p3@k -h x.x.x.x fog > fog_backup.sql</pre><br />
<br />
=Enable remote mysql access=<br />
<br />
Generally this isn't needed, as a "fogstorage" user is already setup with remote access for storage node purposes by the FOG Installer (In 1.3.0). However if you wanted ease of interaction to do testing or development on the FOG database via remote access with a third party tool (such as [http://www.heidisql.com/ HeidiSQL]), then you'd need to enable remote access on an account, or make a new account and enable remote access for it.<br />
<br />
<pre><br />
mysql<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
GRANT ALL PRIVILEGES ON fog.* TO 'fogstorage'@'%' IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;<br />
FLUSH PRIVILEGES;<br />
</pre><br />
<br />
If you want to restrict access to a specific IP, replace the percent symbol (%) with an IP.<br />
<br />
Some systems have a bind address set. You can disable that in the my.cnf file. Search for that file with this:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Comment out these lines with a hash tag #<br />
<pre>#skip-networking<br />
#bind-address = 127.0.0.1</pre><br />
<br />
=Increase maximum simultaneous MySQL connections=<br />
<br />
If you're imaging 50 to 200 computers simultaneously, or simply have a very large amount of hosts, you'll find the below settings helpful.<br />
<br />
<pre>mysql<br />
SET GLOBAL max_connections = 200;<br />
flush hosts;</pre><br />
<br />
<br />
Open the my.cnf file and make the below change.<br />
<br />
'''Fedora 20,21,22:'''<br />
<br />
/etc/my.cnf<br />
<br />
'''Ubuntu 14:'''<br />
<br />
/etc/mysql/my.cnf<br />
<br />
<pre>max_connections = 200</pre><br />
<br />
then restart mysql<br />
<br />
=Repair broken database=<br />
<br />
If you've filled the partition that contains the MySQL Database file completely full, it's highly likely that your MySQL database is now corrupted (and probably several other things too if your really unlucky). You can check for issues and attempt to repair them like this:<br />
<br />
<pre>mysqlcheck -r fog</pre><br />
<br />
If you're able to successfully repair the database, promptly do a DB export via the Web interface or manually via the steps in this article, and then start thinking about migrating/fixing your FOG server so the partition table layout is optimal and safe so this doesn't happen again.<br />
<br />
You really should try to avoid housing your images and snapins on important partitions, and should instead place images and snapins on their own partition. Setting up a partition for images and snapins is most easily done during OS installation - but can be done afterwards albeit there are many more steps and many more chances to make mistakes. <br />
<br />
There are numerous tutorials in the Forums and some bits of information about it in the Wiki, but generally you would create a mount point called <font color="red">/images</font> and give that partition as much space as you can. You should still allow the <font color="red">/</font> , possibly <font color="red">/home</font> , and a swap partition the size it needs. For minimal installs, the <font color="red">/</font> partition at minimum can operate on 6GB but I would recommend 20GB. The swap partition should be equal to the amount of RAM, or double. The <font color="red">/home</font> partition should be sizable if you are using a GUI, something like 20GB. If not using a GUI, probably 10GB would be fine. Optionally, you can also create a partition for <font color="red">/opt</font> and give it 20 or so GB.<br />
<br />
For Linux newcomers, it's important to note that if your using a GUI to install the OS, setting these partitions is usually intuitive and very easy now-a-days.<br />
<br />
=Ubuntu 13.04 14.04 15.04 and higher with FOG 1.2.0=<br />
<br />
<br />
Ubuntu has issues with mysql. Particularly anything 13 and greater seems to be hugely a problem from my experience.<br />
<br />
When this happens, fog will run normally after the server boots for 10 or 15 minutes and then mysql crashes, which forces a "Update the Database Schema" message when trying to use fog, and the schema updater does not fix the problem.<br />
<br />
To test if this is the issue, simply try to restart MySQL (please note this is only temporary) and see if the problem goes away:<br />
<br />
<pre>sudo service mysql restart</pre><br />
<br />
A fix has been reported with this issue. <br />
Here are the instructions to fix it:<br />
<br />
Open this file:<br />
<br />
<pre>sudo vi /var/www/fog/lib/fog/Config.class.php</pre><br />
<br />
Notate both the host, username & password and then close the above file.<br />
Open this file:<br />
<br />
<pre>sudo vi /opt/fog/.fogsettings</pre><br />
<br />
Fill in the following portions:<br />
<br />
*snmysqluser="{root}"<br />
<br />
*snmysqlpass="{PasswordIfYouHaveOne}"<br />
<br />
*snmysqlhost="{localhost}"<br />
<br />
Reset the mySQL database password to be what is in the config files.<br />
<br />
Then run this:<br />
<br />
<pre>sudo dpkg-reconfigure mysql-server-5.5</pre><br />
<br />
Enter in the new password when prompted.<br />
<br />
<br />
If you still have issues re-run the installer.<br />
<br />
=The DB and Multicast=<br />
<br />
For issues with Multicast, the DB tables associated with that could be dirty. You'll know this is the case if clients just sit at the partclone screen doing nothing.<br />
<br />
<pre>TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;</pre><br />
<br />
Via MySQL cli or phpmyadmin (easy to install)<br />
<br />
Please also see: [[Troubleshoot Downloading - Multicast]] and [[Multicast]]<br />
<br />
= Database Maintenance Commands =<br />
<br />
Sometimes, a host will be created with an ID of 0 (zero). Sometimes, there are MAC addresses that loose their association with a host, and in a sense become orphaned. Sometimes there are tasks that just need cleared out. Sometimes there are hosts without MACs. Sometimes groups of ID 0 get made, sometimes snapins of ID 0 get made. Sometimes snapins are associated with hosts that don't exist anymore. Other things go wrong sometimes. These things cause problems with FOG's operation and need cleared out in order to have a clean & healthy database. The below commands are intended to run on FOG 1.3, 1.4, and 1.5 series, they will clear these problems for you. This also fixes problems with multicast occasionally, where the partclone screen just sits there doing nothing.<br />
<br />
<pre><br />
# No password:<br />
mysql -D fog<br />
<br />
# Password:<br />
mysql --user=UsernameHere --password=PasswordHere -D fog<br />
<br />
<br />
DELETE FROM `hosts` WHERE `hostID` = '0';<br />
DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0';<br />
DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0';<br />
DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0';<br />
DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0';<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC` WHERE `hmPrimary` = '1');<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`);<br />
DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `tasks` WHERE `taskStateID` IN ("1","2","3");<br />
DELETE FROM `snapinTasks` WHERE `stState` in ("1","2","3");<br />
TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;<br />
<br />
<br />
quit<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL&diff=12555Troubleshoot MySQL2017-12-16T14:08:12Z<p>Wayne-workman.28155: /* Database Maintenance Commands */</p>
<hr />
<div>=MySQL's role in FOG=<br />
<br />
MySQL is used to hold information and metadata about hosts, images, groups, snapins, various web-level fog settings, and other things. It does not house the actual image data. In newer Linux, it's being phased out in favor of MariaDB. All commands for MySQL will work for MariaDB.<br />
<br />
=Easy & quick MySQL test=<br />
<br />
For the main server and all storage nodes, you may test to see if there is a proper database connection happening or not by visiting the below URL. Replace the x.x.x.x with the IP address of the system you wish to test, and test each system one by one.<br />
<br />
<font color="red">http://x.x.x.x/fog/service/getversion.php</font><br />
<br />
If everything is working, the output will '''only''' report the server's FOG version and nothing else. All servers in a distributed FOG system should always be kept on the same version.<br />
<br />
=Manually Testing MySQL=<br />
<br />
On your FOG server, you can check passwords and the existence of the FOG database by issuing these commands:<br />
<br />
No Password: <br />
<br />
<pre>mysql -D fog<br />
exit</pre><br />
<br />
Test with a username and password (note '''no space''' between -p and the password):<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -D fog<br />
exit</pre><br />
<br />
For a remote server or from a storage node, use:<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog<br />
exit</pre><br />
<br />
* X.X.X.X represents where you'd put the remote host's IP address.<br />
* '''-u''' is username<br />
* '''-p''' is password<br />
* '''-h''' is host<br />
* '''-d''' is database<br />
<br />
=MySQL Service=<br />
<br />
== CentOS / RHEL / Fedora ==<br />
<br />
Check status:<br />
<br />
<pre>systemctl status mysql</pre><br />
<br />
Restart service:<br />
<br />
<pre>systemctl restart mysql</pre><br />
<br />
== Debian / Ubuntu ==<br />
<br />
Check status:<br />
<br />
<pre>service mysql status</pre><br />
<br />
Restart service:<br />
<br />
<pre>service mysql restart</pre><br />
<br />
=MySQL Config File=<br />
<br />
The location of this file varies based on the distribution of Linux you're using. Usually it's called my.cnf and it's probably best to just issue a search command for the file and then figure out which one of the results it is, generally you can pick it out quickly based on the path that the file is in. Here's how to search:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Here is a sample output from Fedora 23:<br />
<br />
<pre>/etc/my.cnf<br />
/etc/my.cnf.d<br />
/etc/my.cnf.d/mysql-clients.cnf<br />
/etc/my.cnf.d/client.cnf<br />
/etc/my.cnf.d/mariadb-server.cnf<br />
/etc/my.cnf.d/tokudb.cnf</pre><br />
<br />
In this case, the first result is the right file, <font color="red">/etc/my.cnf</font> Looking into this particular file (on Fedora 23), there is a line that says <font color="red">!includedir /etc/my.cnf.d</font> This means any files in that directory, <font color="red">/etc/my.cnf.d</font> are included in MySQL's configuration.<br />
<br />
<br />
=MySQL credentials for FOG Main and Storage Nodes=<br />
<br />
The installer sets up FOG with the MySQL Credentials given during installation. These credentials are then stored inside of <font color="red">/opt/fog/.fogsettings</font> for use with the next installation/update. Fog builds a particular web file, <font color="red">/var/www/html/fog/lib/fog/config.class.php</font> this file's settings are what the FOG web front end uses to access MySQL and other things as well.<br />
<br />
If those files have incorrect credentials, then there will be mysql permission and access errors in the Apache error logs, and maybe computers will not be able to boot from the FOG Main server or storage nodes either. <font color="red">bind-address</font> defined inside of the my.cnf file can also cause this.<br />
<br />
By default, FOG does not set any MySQL password for the main fog server, but FOG Storage nodes MUST use the fogstorage mysql user (or some remote-enabled user that has permissions to the fog db). Storage Nodes communicate with the main FOG server's MySQL database directly in order to update tasking and to present proper boot.php iPXE scripts to clients. This Username/password is auto-generated during installation and can be found here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS and FOG_STORAGENODE_MYSQLUSER</font><br />
<br />
From a FOG Storage node, you may try this username & password combination using the example above in the testing section.<br />
<br />
See also: [[Password Central]]<br />
<br />
=Reset MySQL fog user and password=<br />
<br />
<pre>mysql<br />
DROP USER 'fog'@'localhost';<br />
<br />
#Create the user using a password:<br />
CREATE USER 'fog'@'localhost' IDENTIFIED BY 'YourPasswordGoesHere';<br />
<br />
#Create the user without a password:<br />
CREATE USER 'fog'@'localhost';<br />
<br />
GRANT ALL ON fog.* TO 'fog'@'localhost';<br />
exit</pre><br />
<br />
Newer MySql and Ubuntu 16+ method:<br />
<br />
<pre><br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or:<br />
ALTER USER 'fog'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or no password:<br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY '';<br />
</pre><br />
<br />
=Change MySQL user's password=<br />
<br />
You can change a user's password and where they are able to connect from with this command:<br />
<pre><br />
#Enable only local access:<br />
SET PASSWORD FOR 'fogstorage'@'localhost' = PASSWORD('PasswordHere');<br />
<br />
#Enable access from remotely:<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
</pre><br />
<br />
=Manually export / import Fog database=<br />
<br />
Related article: [[Migrate FOG]]<br />
<br />
Export:<br />
<br />
<pre>mysqldump -u USERNAME -pPASSWORD -h HOSTNAME fog > fogDB.sql</pre><br />
<br />
Import:<br />
<br />
<pre>mysql -u USERNAME -pPASSWORD -h HOSTNAME fog < fogDB.sql</pre><br />
<br />
<br />
Example using root and 13375p3@k as the password on the local host.<br />
<br />
<pre>#Exporting my DB locally on my FOG server...<br />
mysql -u root -p13375p3@k fog > fog_backup.sql<br />
<br />
#Here is an import example...<br />
mysql -u root -p13375p3@k fog < fog_backup.sql<br />
<br />
#Here is an example of exporting a remote DB to your current directory, <br />
#where x.x.x.x would be replaced by the IP of the remote system...<br />
<br />
mysql -u root -p13375p3@k -h x.x.x.x fog > fog_backup.sql</pre><br />
<br />
=Enable remote mysql access=<br />
<br />
Generally this isn't needed, as a "fogstorage" user is already setup with remote access for storage node purposes by the FOG Installer (In 1.3.0). However if you wanted ease of interaction to do testing or development on the FOG database via remote access with a third party tool (such as [http://www.heidisql.com/ HeidiSQL]), then you'd need to enable remote access on an account, or make a new account and enable remote access for it.<br />
<br />
<pre><br />
mysql<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
GRANT ALL PRIVILEGES ON fog.* TO 'fogstorage'@'%' IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;<br />
FLUSH PRIVILEGES;<br />
</pre><br />
<br />
If you want to restrict access to a specific IP, replace the percent symbol (%) with an IP.<br />
<br />
Some systems have a bind address set. You can disable that in the my.cnf file. Search for that file with this:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Comment out these lines with a hash tag #<br />
<pre>#skip-networking<br />
#bind-address = 127.0.0.1</pre><br />
<br />
=Increase maximum simultaneous MySQL connections=<br />
<br />
If you're imaging 50 to 200 computers simultaneously, or simply have a very large amount of hosts, you'll find the below settings helpful.<br />
<br />
<pre>mysql<br />
SET GLOBAL max_connections = 200;<br />
flush hosts;</pre><br />
<br />
<br />
Open the my.cnf file and make the below change.<br />
<br />
'''Fedora 20,21,22:'''<br />
<br />
/etc/my.cnf<br />
<br />
'''Ubuntu 14:'''<br />
<br />
/etc/mysql/my.cnf<br />
<br />
<pre>max_connections = 200</pre><br />
<br />
then restart mysql<br />
<br />
=Repair broken database=<br />
<br />
If you've filled the partition that contains the MySQL Database file completely full, it's highly likely that your MySQL database is now corrupted (and probably several other things too if your really unlucky). You can check for issues and attempt to repair them like this:<br />
<br />
<pre>mysqlcheck -r fog</pre><br />
<br />
If you're able to successfully repair the database, promptly do a DB export via the Web interface or manually via the steps in this article, and then start thinking about migrating/fixing your FOG server so the partition table layout is optimal and safe so this doesn't happen again.<br />
<br />
You really should try to avoid housing your images and snapins on important partitions, and should instead place images and snapins on their own partition. Setting up a partition for images and snapins is most easily done during OS installation - but can be done afterwards albeit there are many more steps and many more chances to make mistakes. <br />
<br />
There are numerous tutorials in the Forums and some bits of information about it in the Wiki, but generally you would create a mount point called <font color="red">/images</font> and give that partition as much space as you can. You should still allow the <font color="red">/</font> , possibly <font color="red">/home</font> , and a swap partition the size it needs. For minimal installs, the <font color="red">/</font> partition at minimum can operate on 6GB but I would recommend 20GB. The swap partition should be equal to the amount of RAM, or double. The <font color="red">/home</font> partition should be sizable if you are using a GUI, something like 20GB. If not using a GUI, probably 10GB would be fine. Optionally, you can also create a partition for <font color="red">/opt</font> and give it 20 or so GB.<br />
<br />
For Linux newcomers, it's important to note that if your using a GUI to install the OS, setting these partitions is usually intuitive and very easy now-a-days.<br />
<br />
=Ubuntu 13.04 14.04 15.04 and higher with FOG 1.2.0=<br />
<br />
<br />
Ubuntu has issues with mysql. Particularly anything 13 and greater seems to be hugely a problem from my experience.<br />
<br />
When this happens, fog will run normally after the server boots for 10 or 15 minutes and then mysql crashes, which forces a "Update the Database Schema" message when trying to use fog, and the schema updater does not fix the problem.<br />
<br />
To test if this is the issue, simply try to restart MySQL (please note this is only temporary) and see if the problem goes away:<br />
<br />
<pre>sudo service mysql restart</pre><br />
<br />
A fix has been reported with this issue. <br />
Here are the instructions to fix it:<br />
<br />
Open this file:<br />
<br />
<pre>sudo vi /var/www/fog/lib/fog/Config.class.php</pre><br />
<br />
Notate both the host, username & password and then close the above file.<br />
Open this file:<br />
<br />
<pre>sudo vi /opt/fog/.fogsettings</pre><br />
<br />
Fill in the following portions:<br />
<br />
*snmysqluser="{root}"<br />
<br />
*snmysqlpass="{PasswordIfYouHaveOne}"<br />
<br />
*snmysqlhost="{localhost}"<br />
<br />
Reset the mySQL database password to be what is in the config files.<br />
<br />
Then run this:<br />
<br />
<pre>sudo dpkg-reconfigure mysql-server-5.5</pre><br />
<br />
Enter in the new password when prompted.<br />
<br />
<br />
If you still have issues re-run the installer.<br />
<br />
=The DB and Multicast=<br />
<br />
For issues with Multicast, the DB tables associated with that could be dirty. You'll know this is the case if clients just sit at the partclone screen doing nothing.<br />
<br />
<pre>TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;</pre><br />
<br />
Via MySQL cli or phpmyadmin (easy to install)<br />
<br />
Please also see: [[Troubleshoot Downloading - Multicast]] and [[Multicast]]<br />
<br />
= Database Maintenance Commands =<br />
<br />
Sometimes, a host will be created with an ID of 0 (zero). Sometimes, there are MAC addresses that loose their association with a host, and in a sense become orphaned. Sometimes there are tasks that just need cleared out. Sometimes there are hosts without MACs. Sometimes groups of ID 0 get made, sometimes snapins of ID 0 get made. Sometimes snapins are associated with hosts that don't exist anymore. Other things go wrong sometimes. These things cause problems with FOG's operation and need cleared out in order to have a clean & healthy database. The below commands are intended to run on FOG 1.3, 1.4, and 1.5 series, they will clear these problems for you. This also fixes problems with multicast occasionally, where the partclone screen just sits there doing nothing.<br />
<br />
<pre><br />
# No password:<br />
mysql -D fog<br />
<br />
#Password:<br />
mysql --user=UsernameHere --password=PasswordHere -D fog<br />
<br />
<br />
DELETE FROM `hosts` WHERE `hostID` = '0';<br />
DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0';<br />
DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0';<br />
DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0';<br />
DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0';<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC` WHERE `hmPrimary` = '1');<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`);<br />
DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `tasks` WHERE `taskStateID` IN ("1","2","3");<br />
DELETE FROM `snapinTasks` WHERE `stState` in ("1","2","3");<br />
TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;<br />
<br />
<br />
quit<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL&diff=12554Troubleshoot MySQL2017-12-16T14:07:26Z<p>Wayne-workman.28155: /* Database Maintenance Commands */ Added multicast cleaning to db maintenance commands.</p>
<hr />
<div>=MySQL's role in FOG=<br />
<br />
MySQL is used to hold information and metadata about hosts, images, groups, snapins, various web-level fog settings, and other things. It does not house the actual image data. In newer Linux, it's being phased out in favor of MariaDB. All commands for MySQL will work for MariaDB.<br />
<br />
=Easy & quick MySQL test=<br />
<br />
For the main server and all storage nodes, you may test to see if there is a proper database connection happening or not by visiting the below URL. Replace the x.x.x.x with the IP address of the system you wish to test, and test each system one by one.<br />
<br />
<font color="red">http://x.x.x.x/fog/service/getversion.php</font><br />
<br />
If everything is working, the output will '''only''' report the server's FOG version and nothing else. All servers in a distributed FOG system should always be kept on the same version.<br />
<br />
=Manually Testing MySQL=<br />
<br />
On your FOG server, you can check passwords and the existence of the FOG database by issuing these commands:<br />
<br />
No Password: <br />
<br />
<pre>mysql -D fog<br />
exit</pre><br />
<br />
Test with a username and password (note '''no space''' between -p and the password):<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -D fog<br />
exit</pre><br />
<br />
For a remote server or from a storage node, use:<br />
<br />
<pre>mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog<br />
exit</pre><br />
<br />
* X.X.X.X represents where you'd put the remote host's IP address.<br />
* '''-u''' is username<br />
* '''-p''' is password<br />
* '''-h''' is host<br />
* '''-d''' is database<br />
<br />
=MySQL Service=<br />
<br />
== CentOS / RHEL / Fedora ==<br />
<br />
Check status:<br />
<br />
<pre>systemctl status mysql</pre><br />
<br />
Restart service:<br />
<br />
<pre>systemctl restart mysql</pre><br />
<br />
== Debian / Ubuntu ==<br />
<br />
Check status:<br />
<br />
<pre>service mysql status</pre><br />
<br />
Restart service:<br />
<br />
<pre>service mysql restart</pre><br />
<br />
=MySQL Config File=<br />
<br />
The location of this file varies based on the distribution of Linux you're using. Usually it's called my.cnf and it's probably best to just issue a search command for the file and then figure out which one of the results it is, generally you can pick it out quickly based on the path that the file is in. Here's how to search:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Here is a sample output from Fedora 23:<br />
<br />
<pre>/etc/my.cnf<br />
/etc/my.cnf.d<br />
/etc/my.cnf.d/mysql-clients.cnf<br />
/etc/my.cnf.d/client.cnf<br />
/etc/my.cnf.d/mariadb-server.cnf<br />
/etc/my.cnf.d/tokudb.cnf</pre><br />
<br />
In this case, the first result is the right file, <font color="red">/etc/my.cnf</font> Looking into this particular file (on Fedora 23), there is a line that says <font color="red">!includedir /etc/my.cnf.d</font> This means any files in that directory, <font color="red">/etc/my.cnf.d</font> are included in MySQL's configuration.<br />
<br />
<br />
=MySQL credentials for FOG Main and Storage Nodes=<br />
<br />
The installer sets up FOG with the MySQL Credentials given during installation. These credentials are then stored inside of <font color="red">/opt/fog/.fogsettings</font> for use with the next installation/update. Fog builds a particular web file, <font color="red">/var/www/html/fog/lib/fog/config.class.php</font> this file's settings are what the FOG web front end uses to access MySQL and other things as well.<br />
<br />
If those files have incorrect credentials, then there will be mysql permission and access errors in the Apache error logs, and maybe computers will not be able to boot from the FOG Main server or storage nodes either. <font color="red">bind-address</font> defined inside of the my.cnf file can also cause this.<br />
<br />
By default, FOG does not set any MySQL password for the main fog server, but FOG Storage nodes MUST use the fogstorage mysql user (or some remote-enabled user that has permissions to the fog db). Storage Nodes communicate with the main FOG server's MySQL database directly in order to update tasking and to present proper boot.php iPXE scripts to clients. This Username/password is auto-generated during installation and can be found here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS and FOG_STORAGENODE_MYSQLUSER</font><br />
<br />
From a FOG Storage node, you may try this username & password combination using the example above in the testing section.<br />
<br />
See also: [[Password Central]]<br />
<br />
=Reset MySQL fog user and password=<br />
<br />
<pre>mysql<br />
DROP USER 'fog'@'localhost';<br />
<br />
#Create the user using a password:<br />
CREATE USER 'fog'@'localhost' IDENTIFIED BY 'YourPasswordGoesHere';<br />
<br />
#Create the user without a password:<br />
CREATE USER 'fog'@'localhost';<br />
<br />
GRANT ALL ON fog.* TO 'fog'@'localhost';<br />
exit</pre><br />
<br />
Newer MySql and Ubuntu 16+ method:<br />
<br />
<pre><br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or:<br />
ALTER USER 'fog'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';<br />
#Or no password:<br />
ALTER USER 'fog'@'localhost' IDENTIFIED WITH mysql_native_password BY '';<br />
</pre><br />
<br />
=Change MySQL user's password=<br />
<br />
You can change a user's password and where they are able to connect from with this command:<br />
<pre><br />
#Enable only local access:<br />
SET PASSWORD FOR 'fogstorage'@'localhost' = PASSWORD('PasswordHere');<br />
<br />
#Enable access from remotely:<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
</pre><br />
<br />
=Manually export / import Fog database=<br />
<br />
Related article: [[Migrate FOG]]<br />
<br />
Export:<br />
<br />
<pre>mysqldump -u USERNAME -pPASSWORD -h HOSTNAME fog > fogDB.sql</pre><br />
<br />
Import:<br />
<br />
<pre>mysql -u USERNAME -pPASSWORD -h HOSTNAME fog < fogDB.sql</pre><br />
<br />
<br />
Example using root and 13375p3@k as the password on the local host.<br />
<br />
<pre>#Exporting my DB locally on my FOG server...<br />
mysql -u root -p13375p3@k fog > fog_backup.sql<br />
<br />
#Here is an import example...<br />
mysql -u root -p13375p3@k fog < fog_backup.sql<br />
<br />
#Here is an example of exporting a remote DB to your current directory, <br />
#where x.x.x.x would be replaced by the IP of the remote system...<br />
<br />
mysql -u root -p13375p3@k -h x.x.x.x fog > fog_backup.sql</pre><br />
<br />
=Enable remote mysql access=<br />
<br />
Generally this isn't needed, as a "fogstorage" user is already setup with remote access for storage node purposes by the FOG Installer (In 1.3.0). However if you wanted ease of interaction to do testing or development on the FOG database via remote access with a third party tool (such as [http://www.heidisql.com/ HeidiSQL]), then you'd need to enable remote access on an account, or make a new account and enable remote access for it.<br />
<br />
<pre><br />
mysql<br />
SET PASSWORD FOR 'fogstorage'@'%' = PASSWORD('PasswordHere');<br />
GRANT ALL PRIVILEGES ON fog.* TO 'fogstorage'@'%' IDENTIFIED BY 'PasswordHere' WITH GRANT OPTION;<br />
FLUSH PRIVILEGES;<br />
</pre><br />
<br />
If you want to restrict access to a specific IP, replace the percent symbol (%) with an IP.<br />
<br />
Some systems have a bind address set. You can disable that in the my.cnf file. Search for that file with this:<br />
<br />
<pre>find / | grep /my.cnf</pre><br />
<br />
Comment out these lines with a hash tag #<br />
<pre>#skip-networking<br />
#bind-address = 127.0.0.1</pre><br />
<br />
=Increase maximum simultaneous MySQL connections=<br />
<br />
If you're imaging 50 to 200 computers simultaneously, or simply have a very large amount of hosts, you'll find the below settings helpful.<br />
<br />
<pre>mysql<br />
SET GLOBAL max_connections = 200;<br />
flush hosts;</pre><br />
<br />
<br />
Open the my.cnf file and make the below change.<br />
<br />
'''Fedora 20,21,22:'''<br />
<br />
/etc/my.cnf<br />
<br />
'''Ubuntu 14:'''<br />
<br />
/etc/mysql/my.cnf<br />
<br />
<pre>max_connections = 200</pre><br />
<br />
then restart mysql<br />
<br />
=Repair broken database=<br />
<br />
If you've filled the partition that contains the MySQL Database file completely full, it's highly likely that your MySQL database is now corrupted (and probably several other things too if your really unlucky). You can check for issues and attempt to repair them like this:<br />
<br />
<pre>mysqlcheck -r fog</pre><br />
<br />
If you're able to successfully repair the database, promptly do a DB export via the Web interface or manually via the steps in this article, and then start thinking about migrating/fixing your FOG server so the partition table layout is optimal and safe so this doesn't happen again.<br />
<br />
You really should try to avoid housing your images and snapins on important partitions, and should instead place images and snapins on their own partition. Setting up a partition for images and snapins is most easily done during OS installation - but can be done afterwards albeit there are many more steps and many more chances to make mistakes. <br />
<br />
There are numerous tutorials in the Forums and some bits of information about it in the Wiki, but generally you would create a mount point called <font color="red">/images</font> and give that partition as much space as you can. You should still allow the <font color="red">/</font> , possibly <font color="red">/home</font> , and a swap partition the size it needs. For minimal installs, the <font color="red">/</font> partition at minimum can operate on 6GB but I would recommend 20GB. The swap partition should be equal to the amount of RAM, or double. The <font color="red">/home</font> partition should be sizable if you are using a GUI, something like 20GB. If not using a GUI, probably 10GB would be fine. Optionally, you can also create a partition for <font color="red">/opt</font> and give it 20 or so GB.<br />
<br />
For Linux newcomers, it's important to note that if your using a GUI to install the OS, setting these partitions is usually intuitive and very easy now-a-days.<br />
<br />
=Ubuntu 13.04 14.04 15.04 and higher with FOG 1.2.0=<br />
<br />
<br />
Ubuntu has issues with mysql. Particularly anything 13 and greater seems to be hugely a problem from my experience.<br />
<br />
When this happens, fog will run normally after the server boots for 10 or 15 minutes and then mysql crashes, which forces a "Update the Database Schema" message when trying to use fog, and the schema updater does not fix the problem.<br />
<br />
To test if this is the issue, simply try to restart MySQL (please note this is only temporary) and see if the problem goes away:<br />
<br />
<pre>sudo service mysql restart</pre><br />
<br />
A fix has been reported with this issue. <br />
Here are the instructions to fix it:<br />
<br />
Open this file:<br />
<br />
<pre>sudo vi /var/www/fog/lib/fog/Config.class.php</pre><br />
<br />
Notate both the host, username & password and then close the above file.<br />
Open this file:<br />
<br />
<pre>sudo vi /opt/fog/.fogsettings</pre><br />
<br />
Fill in the following portions:<br />
<br />
*snmysqluser="{root}"<br />
<br />
*snmysqlpass="{PasswordIfYouHaveOne}"<br />
<br />
*snmysqlhost="{localhost}"<br />
<br />
Reset the mySQL database password to be what is in the config files.<br />
<br />
Then run this:<br />
<br />
<pre>sudo dpkg-reconfigure mysql-server-5.5</pre><br />
<br />
Enter in the new password when prompted.<br />
<br />
<br />
If you still have issues re-run the installer.<br />
<br />
=The DB and Multicast=<br />
<br />
For issues with Multicast, the DB tables associated with that could be dirty. You'll know this is the case if clients just sit at the partclone screen doing nothing.<br />
<br />
<pre>TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;</pre><br />
<br />
Via MySQL cli or phpmyadmin (easy to install)<br />
<br />
Please also see: [[Troubleshoot Downloading - Multicast]] and [[Multicast]]<br />
<br />
= Database Maintenance Commands =<br />
<br />
Sometimes, a host will be created with an ID of 0 (zero). Sometimes, there are MAC addresses that loose their association with a host, and in a sense become orphaned. Sometimes there are tasks that just need cleared out. Sometimes there are hosts without MACs. Sometimes groups of ID 0 get made, sometimes snapins of ID 0 get made. Sometimes snapins are associated with hosts that don't exist anymore. Other things go wrong sometimes. These things cause problems with FOG's operation and need cleared out in order to have a clean & healthy database. The below commands are intended to run on FOG 1.3, 1.4, and 1.5 series, they will clear these problems for you. This also fixes problems with multicast occasionally, where the db gets gummed up with bad multicast data.<br />
<br />
<pre><br />
# No password:<br />
mysql -D fog<br />
<br />
#Password:<br />
mysql --user=UsernameHere --password=PasswordHere -D fog<br />
<br />
<br />
DELETE FROM `hosts` WHERE `hostID` = '0';<br />
DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0';<br />
DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0';<br />
DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0';<br />
DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0';<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC` WHERE `hmPrimary` = '1');<br />
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`);<br />
DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`);<br />
DELETE FROM `tasks` WHERE `taskStateID` IN ("1","2","3");<br />
DELETE FROM `snapinTasks` WHERE `stState` in ("1","2","3");<br />
TRUNCATE TABLE multicastSessions; <br />
TRUNCATE TABLE multicastSessionsAssoc; <br />
DELETE FROM tasks WHERE taskTypeId=8;<br />
<br />
<br />
quit<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=.fogsettings&diff=12553.fogsettings2017-12-08T13:45:22Z<p>Wayne-workman.28155: </p>
<hr />
<div>In most versions of FOG (including 1.2.0 and 1.3.0), the low-level settings that are used during installation and some settings that simply cannot be stored in the database are contained in the /opt/fog/.fogsettings file.<br />
<br />
This file contains the setup of variables used within the installer during upgrades/installs.<br />
<br />
<br />
= Example .fogsettings file =<br />
<br />
An example .fogsettings file<br />
<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
ipaddress='192.168.1.5'<br />
interface='eth0'<br />
submask='255.255.255.0'<br />
routeraddress='192.168.1.1'<br />
plainrouter='192.168.1.1'<br />
dnsaddress='192.168.1.1'<br />
dnsbootimage='192.168.1.1'<br />
username='fog'<br />
password='Some!random_Password\here0918358'<br />
osid='2'<br />
osname='Debian'<br />
dodhcp='N'<br />
bldhcp='0'<br />
dhcpd='isc-dhcp-server'<br />
blexports='1'<br />
installtype='N'<br />
snmysqluser=''<br />
snmysqlpass=''<br />
snmysqlhost=''<br />
installlang='0'<br />
donate='0'<br />
storageLocation='/images'<br />
fogupdateloaded=1<br />
docroot='/var/www/html/'<br />
webroot='fog/'<br />
caCreated='yes'<br />
startrange=''<br />
endrange=''<br />
bootfilename='undionly.kpxe'<br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
noTftpBuild=''<br />
notpxedefaultfile=''<br />
sslpath='/opt/fog/snapins/ssl/'<br />
backupPath='/home/'<br />
## End of FOG Settings<br />
</pre><br />
= Definitions =<br />
== Header/Footer ==<br />
=== Header ===<br />
Only gives some simplistic information to help users.<br />
Does no actions just gives some information.<br />
<pre><br />
## Start of FOG Settings<br />
## Created by the FOG Installer<br />
## Version: 7625<br />
## Install time: Sat 14 May 2016 08:05:18 PM EDT<br />
</pre><br />
=== Footer ===<br />
Does no actions, just tells where FOG's default variables are setup<br />
Any new items will go below this, and you can add your own variables.<br />
You can add variables wherever you want.<br />
<pre><br />
## End of FOG Settings<br />
</pre><br />
== IP Address ==<br />
Defines the IP address of the node/server.<br />
This is also used on servers to setup the default.ipxe file.<br />
<pre><br />
ipaddress='192.168.1.5'<br />
</pre><br />
== Interface ==<br />
This just sets the storage nodes/server interface as it will be stored in the Database. This used to be used for multicast setups and for the bandwidth graph. This is now setup so it is only used on the bandwidth graph as we already know the ip address anyway. Multicast tasks can get their own interface instead of relying on user entry.<br />
<pre><br />
interface='eth0'<br />
</pre><br />
== Linux Login/FTP ==<br />
=== Username ===<br />
This variable is the user setup for the linux user on the server. This allows a user to login to the server/node under this username through linux. The purpose of this is more specifically setup for FTP usage.<br />
<pre><br />
username='fog'<br />
</pre><br />
=== Password ===<br />
This is the linux fog user password. It is randomly generated if the value is not already defined. Every update will reset the password to what is in this field. You should, if you predefined a fog user and the installation is the first time, create the /opt/fog/.fogsettings file. Only add the password field to ensure your password doesn't get changed accidentally.<br />
<pre><br />
password='Some!random_Password\here0918358'<br />
</pre><br />
== OS Information ==<br />
=== OS Identifier ===<br />
This is the OS identifier used during the installation. The value is numeric.<br />
<br />
Valid Values are:<br />
# Redhat based.<br />
# Debian based.<br />
# Arch<br />
<br />
<pre><br />
osid='2'<br />
</pre><br />
=== OS Name ===<br />
This is the name of the OS as it's being installed.<br />
<pre><br />
osname='Debian'<br />
</pre><br />
== DHCP ==<br />
=== DNS Address ===<br />
Used for DHCP setup.<br />
<pre><br />
dnsaddress='192.168.1.5'<br />
</pre><br />
=== dnsbootimage ===<br />
No longer used. It's purpose was originally because the FOS (Fog Operating System -- init.xz/init_32.xz/init.gz) did not dynamically get the dns address from DHCP as dhcp was not called.<br />
<pre><br />
dnsbootimage='192.168.1.5'<br />
</pre><br />
=== Subnet Mask ===<br />
This defines the subnet mask to use if the system is to be used as a DHCP server. It will assume the subnet mask of the interface being used, but can be changed later if you see fit.<br />
<pre><br />
submask='255.255.255.0'<br />
</pre><br />
=== Router Address ===<br />
This will setup the router address to use if the system is to be used as a DHCP server. It currently only sets as an ip address, but in the past contained the whole dhcp configuration string. The config string was removed as it would only work on isc-dhcp-server, when some might be using dnsmasq or another dhcp server.<br />
<pre><br />
routeraddress='192.168.1.1'<br />
</pre><br />
=== Plain Router ===<br />
Very similar to the Router Address elements above, but can be used to redirect to maybe another router/switch other than the main.<br />
<pre><br />
plainrouter='192.168.1.1'<br />
</pre><br />
=== dodhcp ===<br />
Just tells if we want fog to install dhcp.<br />
<pre><br />
dodhcp='N'<br />
</pre><br />
=== bldhcp ===<br />
Same, more or less, as dodhcp<br />
<pre><br />
bldhcp='0'<br />
</pre><br />
=== dhcpd ===<br />
Defines what package to install for dhcp server.<br />
<pre><br />
dhcpd='isc-dhcp-server'<br />
</pre><br />
=== startrange ===<br />
<pre><br />
startrange=''<br />
</pre><br />
=== endrange ===<br />
<pre><br />
endrange=''<br />
</pre><br />
=== bootfilename ===<br />
<pre><br />
bootfilename='undionly.kpxe'<br />
</pre><br />
== NFS ==<br />
Defines if the installer should rebuild the exports every time. Setting to 0 will ensure the exports file for nfs does not get rebuilt. Setting to 1 will update the exports file.<br />
<pre><br />
blexports='1'<br />
</pre><br />
== Type of installation ==<br />
Just tells the installer if this is going to be a full server, or a node. If it's a node, the value will be S. If it's a full server, the value will be N.<br />
<pre><br />
installtype='N'<br />
</pre><br />
== Database Information ==<br />
=== MySQL User ===<br />
This is the username to connect to the database as. Blank will default to connecting as user root.<br />
<pre><br />
snmysqluser=''<br />
</pre><br />
=== MySQL Password ===<br />
This is the password to connect to the database.<br />
<pre><br />
snmysqlpass=''<br />
</pre><br />
=== MySQL Host ===<br />
This is the host to connect to the database. Blank will default to localhost/127.0.0.1.<br />
<pre><br />
snmysqlhost=''<br />
</pre><br />
== Language ==<br />
Language packs for the OS can be installed. This enables more appropriate translations of information.<br />
<pre><br />
installlang='0'<br />
</pre><br />
== Donate ==<br />
Donate seems a bit strange a name for this. What it does, however, is not pass money. It's a different method that tells the server if it's going to allow mining of bitcoins during the imaging phases. Donation can be disabled later and this value will have no more effect during updates. It only operates to define setting during fresh installs.<br />
<pre><br />
donate='0'<br />
</pre><br />
== Image storage ==<br />
This defines the location for image storage. This is just a string value to the path of your images location.<br />
<pre><br />
storageLocation='/images'<br />
</pre><br />
<br />
== Updating ==<br />
This defines if the update file is loaded. 1 is the set value after fresh install. When the .fogsettings file is loaded this value is checked and tells the system to perform an update. If this isn't 1 or the variable is not found, it requests "input" from the user (unless you're running with the -y argument).<br />
<pre><br />
fogupdateloaded=1<br />
</pre><br />
<br />
== HTTP Configuration paths ==<br />
=== docroot ===<br />
This value tells httpd where the document root will be for the GUI.<br />
For example, when you go to http://127.0.0.1/ The document root is looking on the server at the docroot location for files to present to the user.<br />
<pre><br />
docroot='/var/www/html/'<br />
</pre><br />
=== webroot ===<br />
This value tells FOG where the webroot is. Webroot is the link to actually get to the FOG GUI. If the value is just '/' you would be accessing the FOG GUI with the link http://127.0.0.1/. If it's 'fog/' you are accessing the GUI as http://127.0.0.1/fog/.<br />
<pre><br />
webroot='fog/'<br />
</pre><br />
<br />
== caCreated ==<br />
<pre><br />
caCreated='yes'<br />
</pre><br />
== packages ==<br />
<pre><br />
packages='apache2 php7.0 php7.0-json php7.0-gd php7.0-cli php7.0-curl mysql-server mysql-client tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext php7.0-mcrypt php7.0-mysql curl libc6 libcurl3 zlib1g php7.0-fpm libapache2-mod-php7.0 php7.0-mbstring'<br />
</pre><br />
== noTftpBuild ==<br />
<pre><br />
noTftpBuild=''<br />
</pre><br />
== nopxedefaultfile ==<br />
<pre><br />
notpxedefaultfile=''<br />
</pre><br />
== sslpath ==<br />
<pre><br />
sslpath='/opt/fog/snapins/ssl/'<br />
</pre><br />
== backupPath ==<br />
<pre><br />
backupPath='/home/'<br />
</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=FOG_Client&diff=12552FOG Client2017-12-07T02:24:17Z<p>Wayne-workman.28155: /* Maintain Control Of Hosts When Building New Server */</p>
<hr />
<div>This article applies to the new FOG Client, version 0.10+<br />
<br />
== The Different Installers ==<br />
<br />
The different installers are located in your FOG server's web interface. The link is always at the very bottom of every page, even if you're not logged into the fog server.<br />
<br />
[[File:Fog client link.png]]<br />
<br />
[[File:New FOGClient download link.png]]<br />
<br />
'''FOGService.msi''' - Windows only, and is ideal for network deployment.<br />
<br />
'''SmartInstaller.exe''' - This is the new default installer. It will work on all platforms.<br />
<br />
'''Debugger.exe''' - This is not listed in the web interface but is available from github [https://github.com/FOGProject/fog-client/releases here]. Only use this when the above two are not working. This build has more detailed logs that you can use for troubleshooting or a bug report.<br />
<br />
== Installing - Windows ==<br />
<br />
'''Prerequisites'''<br />
* .NET Framework version 4.0+ (Note: .NET 4 client profile will NOT work)<br />
You can download the framework from here: <br />
<br />
[https://www.microsoft.com/en-us/download/details.aspx?id=40779 Microsoft .NET Framework 4.5.1 (Offline Installer) for Windows Vista SP2, Windows 7 SP1, Windows 8, Windows Server 2008 SP2 Windows Server 2008 R2 SP1 and Windows Server 2012]<br />
<br />
Windows 10 comes with a version of .Net that will work.<br />
<br />
'''Installation'''<br />
* May use SmartInstaller or msi. Simply download either one of them and run.<br />
* Reboot to complete installation.<br />
<br />
'''Limitations'''<br />
* CUPS printers are not yet supported<br />
<br />
== Installing - Linux ==<br />
<br />
Installation instructions derived from [http://www.mono-project.com/docs/getting-started/install/linux/ http://www.mono-project.com/docs/getting-started/install/linux/]<br />
<br />
'''Prerequisites'''<br />
* Mono (latest stable build)<br />
* xprintidle - This dependency is optional. If not installed AutoLogOut will not run. xprintidle basically just returns the idle time of an x window, therefore on a system without a GUI it is not needed and should not be installed. It should be available in standard package managers. E.G. apt-get, yum, or dnf<br />
<br />
'''Installing Mono'''<br />
Many distributions come with an out of date version of mono in their package manager. Therefore, do not attempt to install via your package manager without the below modifications<br />
<br />
=== Debian 8+, Ubuntu 13.10+, and derivatives ===<br />
<br />
To install:<br />
<br />
<pre><br />
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF<br />
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list<br />
sudo apt-get update<br />
sudo apt-get install mono-complete<br />
sudo apt-get install xprintidle<br />
</pre><br />
<br />
* Download SmartInstaller.exe from your FOG server and run the installer with mono.<br />
** <font color="red">sudo mono SmartInstaller.exe</font><br />
* The client will install to /opt/fog-service , and fog.log will be located at /opt/fog-service/fog.log<br />
<br />
<br />
The service is automatically configured to run on startup. To manually start and stop the service:<br />
<br />
<pre><br />
sudo service FOGService start<br />
</pre><br />
<pre><br />
sudo service FOGService stop<br />
</pre><br />
<br />
To uninstall:<br />
<br />
<pre><br />
sudo service FOGService stop<br />
sudo mono SmartInstaller.exe uninstall<br />
</pre><br />
<br />
=== CentOS 7, Fedora 19+, and derivatives ===<br />
<br />
To install:<br />
<br />
<pre><br />
yum install yum-utils<br />
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"<br />
yum-config-manager --add-repo http://download.mono-project.com/repo/centos/<br />
yum install mono-complete<br />
yum install xprintidle<br />
</pre><br />
<br />
* Download SmartInstaller.exe from your FOG server and run the installer with mono.<br />
** <font color="red">sudo mono SmartInstaller.exe</font><br />
* The client will install to /opt/fog-service , and fog.log will be located at /opt/fog-service/fog.log<br />
<br />
The service is automatically configured to run on startup. To manually start and stop the service:<br />
<br />
<pre><br />
sudo systemctl start FOGService<br />
</pre><br />
<pre><br />
sudo systemctl stop FOGService<br />
</pre><br />
<br />
To uninstall:<br />
<br />
<pre><br />
sudo systemctl stop FOGService<br />
sudo mono SmartInstaller.exe uninstall<br />
</pre><br />
<br />
=== openSUSE and SLES ===<br />
<br />
You can install mono using SUSE One-Click files: [http://download.mono-project.com/repo/mono-complete.ymp http://download.mono-project.com/repo/mono-complete.ymp]<br />
<br />
=== Other ===<br />
<br />
The FOG Client can be installed on any platform that can run the latest stable build of mono.<br />
<br />
To install:<br />
<br />
* Check your package manager for <font color="red">mono-complete</font>. After installing it run <font color="red">mono --version</font>. Ensure the version is at least 4.2._ . If it not, remove the package.<br />
* If your package manager had an old version of mono, see [http://www.mono-project.com/docs/compiling-mono/linux/ here] for how to compile mono<br />
<br />
* Download SmartInstaller.exe from your FOG server and run the installer with mono.<br />
** <font color="red">sudo mono SmartInstaller.exe</font><br />
* The client will install to /opt/fog-service , and fog.log will be located at /opt/fog-service/fog.log<br />
<br />
If your system either has systemd or initd the client will be automatically configured to run on startup. If your system does not have either, you will need to configure your system to run the manual start command below on startup.<br />
<br />
To manually start and stop the service:<br />
<br />
<pre><br />
sudo /opt/fog-service/control.sh start<br />
</pre><br />
<pre><br />
sudo /opt/fog-service/control.sh stop<br />
</pre><br />
<br />
===Limitations===<br />
* The FOG Tray is currently incompatible on linux systems. Regardless of what you set during installation, it will not run.<br />
* The following modules / features are not yet supported<br />
** Active Directory joining<br />
** PrinterManager<br />
<br />
== Installing - OSX ==<br />
<br />
'''Prerequisites'''<br />
* Mono (latest stable build)<br />
<br />
'''Installing Mono'''<br />
* If you are running El Capitan, navigate to [http://www.mono-project.com/download/#download-mac http://www.mono-project.com/download/#download-mac] and download <font color=”red”>Mono Universal Installer</font> <br />
* Otherwise, navigate to [http://www.mono-project.com/download/#download-mac http://www.mono-project.com/download/#download-mac] and download <font color=”red”>Mono 32-bit</font> <br />
<br />
'''Installation'''<br />
* Download SmartInstaller.exe from your FOG server and run the installer with mono.<br />
** <font color="red">sudo mono SmartInstaller.exe</font><br />
* The client will install to /opt/fog-service , and fog.log will be located at /opt/fog-service/fog.log<br />
* Reboot the system to complete the installation.<br />
<br />
The service is automatically configured to run on startup. To manually start and stop the service:<br />
<br />
<pre><br />
sudo launchctl load -w /Library/LaunchDaemons/org.freeghost.daemon.plist<br />
</pre><br />
<pre><br />
sudo launchctl unload -w /Library/LaunchDaemons/org.freeghost.daemon.plist<br />
</pre><br />
<br />
To uninstall:<br />
<br />
<pre><br />
sudo launchctl unload -w /Library/LaunchDaemons/org.freeghost.daemon.plist<br />
sudo mono SmartInstaller.exe uninstall<br />
</pre><br />
<br />
'''Limitations'''<br />
* The follow modules / features are not yet supported<br />
** PrinterManager<br />
<br />
'''Logging'''<br />
<br />
You can find the client log file in /opt/fog-service/fog.log<br />
<br />
== Additional Details ==<br />
<br />
=== Features overview ===<br />
<br />
<br />
The purpose of the FOG Client is multi-fold.<br />
<br />
The client allows the host to automatically:<br />
* Auto logout -- Enables auto logout of users if inactive for specified period of time. 5 minute's is the minimum time as all others are way too soon, sometimes people may just be on a phone, or had to step out for a bathroom break.<br />
<br />
* Client Updater -- (Only on legacy clients) Allows the client to update it's modules if you had to customize things, or found a more recent build was needed for your environment.<br />
<br />
* Directory Cleaner -- (Only on legacy clients -- Only worked with Windows XP) Enables the client to remove directories on the host automatically. It lost operation after Windows XP due to UAC controls and better security mechanisms especially needed. Removed completely from the New client.<br />
<br />
* Display Manager -- Enables the client to adjust the resolution of the system on a per system basis, or global basis.<br />
<br />
* Power Management -- Allows you to specify a shutdown, WOL, or restart on a per-host basis. Format for the scheduling is CRON, and can be done on an individual host or through groups. There is no limit to the number of scheduled power tasks.<br />
<br />
* Host Registration -- Registers additional mac addresses to a pre-existing host if registered. The New client will also register the host under a pending status if the host is not already registered.<br />
<br />
* Hostname Changer -- Changes the hostname and joins the domain automatically.<br />
<br />
* Printer Manager -- Manages Printers for the host. Legacy client only added printer or added/removed printers. The No management for both new and legacy simply does nothing. Will remove all printers under Add/Remove type and only add back the printers as needed (Only Assigned Printers). Under Add Only (now FOG Managed Printers) only manages printers that are listed under the printer's GUI and those that are assigned to that host. In legacy client, it only added printers and never removed. Under the new client, it will ONLY manage printers assigned meaning if you remove a printer from a host, the new client will remove that printer.<br />
<br />
* Snapins -- Allows you to install programs or run scripts on the host similar to GPO or PDQDeploy.<br />
<br />
* Task Reboot -- This will just check if the client is in a tasking (other than a snapin tasking). If it is in a tasking, and the module is enabled, the host will be told to reboot. There is a third portion though in that if the user is logged in, and enforce is not enabled nothing will happen.<br />
<br />
* User Cleanup -- (Legacy clients only and again only on Windows XP). Works similar to Directory Cleanup but the entries you make are "safe" user profiles. If the user is not under this listing, it will be deleted. Will not work with the new client, and even legacy clients will not work on anything beyond Windows XP due to UAC and Interactive Service utilities.<br />
<br />
* User Tracker -- Just tracks who logs in/out of a client.<br />
<br />
=== Polling Behavior ===<br />
<br />
The new FOG Client found in FOG 1.3.0 and the Legacy FOG Client both rely on polling to get instructions. This means the FOG Client will regularly check with the specified FOG Server for settings and tasks. The New FOG Client's polling frequency can be adjusted in the FOG Web interface, by going to <font color="red">FOG Configuration -> FOG Settings -> FOG Client -> FOG_CLIENT_CHECKIN_TIME</font>. The minimum value is 30 seconds, anything specified lower than this will result in the FOG Client using 30 second polling intervals.<br />
<br />
The checkin-time is not rigid. There is an automatic and random staggering that is added to the checkin time. This prevents a large number of FOG Clients checking in at once in the event that all computers are started at the same time via WOL tasks.<br />
<br />
The frequency of the checkin-time determines how quickly the FOG Client will receive instructions from the FOG Server. If an image deployment is scheduled for a computer that is turned on, with a checkin-time of 60 seconds, means the FOG Client may begin initiating the task anywhere from 0 to 60 seconds + the random staggering time that is added. This same concept would apply to immediate power management tasks, snapin tasks, capture tasks, and so on. Scheduled tasks are not affected by this behavior, and if the target system is on when the scheduled task is to be ran, this will happen on time.<br />
<br />
=== Security Design ===<br />
<br />
Communications between the FOG Client (0.9.9+) and the FOG Server (1.3.0+) are secured using public key infrastructure.<br />
<br />
A Certificate Authority and private key is generated on the FOG server during first installation in this location:<br />
<br />
<pre>/opt/fog/snapins/ssl</pre><br />
<br />
The public certificate is generally located here:<br />
<pre>/var/www/html/fog/management/other/ssl</pre><br />
<br />
The client installs your servers’ certificate and the FOG Project certificate.<br />
<br />
The “FOG Project” CA (made by the FOG Project) serves two purposes:<br />
<br />
*SYSTEM level services need to be digitally signed otherwise windows will throw security errors. This can also be used to ensure no tampering was done with the client files<br />
<br />
*That certificate is used to “verify” upgrades. Lets say we release a patch for the client, the client will download the MSI from your server and check if it was signed by us. If the MSI was somehow tampered, the digital signature would no longer be valid.<br />
<br />
Using HTTP over HTTPS has no security benefit to the client. Why? Because all traffic is already encrypted. Here’s a very basic overview of how the new client communicates<br />
<br />
*Each client has a security token. This is used to prove to the server that the client is the actual host and not an impersonator. This token gets cycled constantly. When the client first makes contact, it encrypts its token and a proposed AES 256 key using RSA 4096 using your server’s public key. This public key is verified against the pinned server CA certificate by checking the x509 chain and fingerprints.<br />
<br />
*If the server accepts the security token and the new AES key, all traffic from that point on is AES 256 encrypted using that securely transmitted key.<br />
<br />
The whole point of our security model is to allow for secure communication over insecure medians.<br />
Even then, the client installation has an HTTPS option, but it serves no real security benefit.<br />
<br />
References: <br />
<br />
[https://forums.fogproject.org/topic/6325/invalid-security-token-without-any-security-tokens-being-set-also-ca-ssl-security-concerns/6 CA SSL security concerns]<br />
<br />
[https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning Certificate and Public Key Pinning]<br />
<br />
[https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Certificate_and_Public_Key_Pinning Transport_Layer_Protection_Cheat_Sheet]<br />
<br />
==== Reset encryption data ====<br />
<br />
This pertains to the new fog client available in FOG 1.3.0 and above, and does not apply to the legacy fog client that was available in 1.2.0 and below.<br />
<br />
The "Reset encryption data" button can be found in an individual host's "General" area. You may also find this button in Groups "General" area. The “Reset encryption data” is mainly doing one thing: Clearing the security token for a host or group of hosts.<br />
<br />
Each host has a security token used by the client. This token is private; only the client knows it and is protected. It is used to prove the identity of the host, ensuring no one ‘fakes’ being a certain host. So when you 'Reset Encryption Data", you are essentially telling the server that the first host to say that they are the host in question gets ‘locked’ in (pinned is the technical term).<br />
<br />
In order to have encrypted traffic, the handshake must occur. During the handshake the server proves its identity to the client, and the client proves its identity to the server (using the security token). If the handshake fails (due to a bad security token), encryption cannot occur.<br />
<br />
The most common scenario where the security tokens for a client will be incorrect is if you manually uninstall a client, and then install it.<br />
<br />
If your Web interface is functional, you may place all computers into a group, and use the group to reset encryption on all hosts by simply clicking the "Reset encryption" button on the group's basic page. If you're web interface isn't working correctly and you need to manually reset the encryption for all hosts, you may follow the below steps.<br />
<br />
<pre><br />
mysql<br />
use fog<br />
UPDATE hosts SET hostPubKey="", hostSecToken="", hostSecTime="0000-00-00 00:00:00";<br />
</pre><br />
<br />
<br />
=== Maintain Control Of Hosts When Building New Server ===<br />
<br />
Related Article: [[Migrate FOG]]<br />
<br />
This section only applies if your hosts have the new FOG client installed. The new FOG Client has been available in FOG since FOG 1.3.0.<br />
<br />
Because of the security model of FOG 1.3.0 and the new client, without the proper CA and ssl certificates present on a new fog server, any currently deployed hosts with the new fog client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts with existing new fog client deployments, you must copy this directory from the old server to the new server:<br />
<br />
* <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
Copy the directory to a temporary location first. I would suggest <font color="red">/root</font><br />
<br />
<pre>cp -R /opt/fog/snapins/ssl /root</pre><br />
<br />
Then you can use scp to copy the directory (or some other method) to your new fog server. Run the below command from the '''old''' server, Where x.x.x.x is the new fog server's address:<br />
<br />
<pre>scp -rp /opt/fog/snapins/ssl root@x.x.x.x:/root</pre><br />
<br />
Or, the reverse. Run the below command from the '''new''' server, where x.x.x.x is the old fog server's address.<br />
<br />
<pre>scp -rp root@x.x.x.x:/opt/fog/snapins/ssl /root</pre><br />
<br />
Next, install fog. After the installation is complete, delete the ssl folder the installer made, and place your old ssl (from /root that you copied) in there. The ownership should be fog:apache on Red-Hat variants, should be fog:www-data on Debian variants. <font color="red">IMPORTANT:</font> Then '''re-run the installer.''' Instructions for the folder manipulation are below, assuming you followed the above instructions. On the '''new''' server:<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
cp -R /root/ssl /opt/fog/snapins/ssl<br />
chown -R fog:apache /opt/fog/snapins/ssl #or fog:www-data for ubuntu and debian<br />
</pre><br />
<br />
If you do not care about maintaining control of existing hosts with existing new fog client deployments (because there is only 1 or 2), you can recreate your CA with the -C argument during installation: <br />
<br />
<pre>./installfog.sh -C</pre><br />
<br />
<font color="red">Note:</font> Recreating the CA (<font color="red">--recreate-CA</font> or <font color="red"> -C</font>) is '''very strongly advised against''' if you have many clients deployed already, because it resets the identity of the FOG Server. This causes all fog clients to distrust the server, and will require total reinstallation of all fog clients in an environment. However, you may recreate the keys (<font color="red">--recreate-keys</font>) safely and be able to still control the fog clients.<br />
<br />
=== FOG Client 0.10.0+ Installation Options ===<br />
<br />
==== Smart Installer ====<br />
<br />
SmartInstaller Switches<br />
<br />
All switches with <font color="red">--{OPTION}</font> can also be used as <font color="red">/{OPTION}</font><br />
<br />
* <font color="red">--server=</font> Specify the server address. Default is fogserver<br />
* <font color="red">--webroot=</font> Specify the webroot. Default is /fog<br />
* <font color="red">-h</font> or <font color="red">-https</font> Use https for server communication<br />
* <font color="red">-r</font> or <font color="red">-rootlog</font> Put fog.log in the root of the filesystem<br />
* <font color="red">-s</font> or <font color="red">--start</font> Automatically start the service after installation. Linux only<br />
* <font color="red">-t</font> or <font color="red">--tray</font> Enabled the FOG Tray and notifications - Windows and OSX only.<br />
* <font color="red">-u</font> or <font color="red">--uninstall</font> Uninstall the client<br />
* <font color="red">--upgrade</font> Upgrade the client<br />
* <font color="red">-l=</font> or <font color="red">--log=</font> Specify where to put the SmartInstaller log<br />
<br />
Reference: [https://news.fogproject.org/fog-client-v0-11-0-released-2/ https://news.fogproject.org/fog-client-v0-11-0-released-2/]<br />
<br />
==== MSI Switches ====<br />
<br />
<font color="red">msiexec /i FOGService.msi /quiet USETRAY="0" HTTPS="0" WEBADDRESS="192.168.1.X" WEBROOT="/fog" ROOTLOG="0"</font><br />
<br />
Firstly, all options are optional. Here’s what they all do:<br />
<br />
* <font color="red">USETRAY=</font> defaults to <font color="red">"1"</font>, if <font color="red">"0"</font> the tray will be hidden<br />
<br />
* <font color="red">HTTPS=</font> defaults to <font color="red">"0"</font>, if <font color="red">"1"</font> the client will use HTTPS (not recommended)<br />
<br />
* <font color="red">WEBADDRESS=</font> defaults to <font color="red">"fogserver"</font>, this is the ip/dns name of your server<br />
<br />
* <font color="red">WEBROOT=</font> defaults to <font color="red">"/fog"</font><br />
<br />
* <font color="red">ROOTLOG=</font> defaults to <font color="red">"0"</font>, if <font color="red">"1"</font> the fog.log will be at C:\fog.log, otherwise %PROGRAMFILES%\FOG\fog.log<br />
<br />
Reference: [https://forums.fogproject.org/topic/6222/msi-silent-install-without-tray-icon/2 https://forums.fogproject.org/topic/6222/msi-silent-install-without-tray-icon/2]<br />
<br />
=== FOG Client with Sysprep ===<br />
<br />
If you plan to use Sysprep before image capture and are also planning to use the FOG Client, You '''must''' disable the <font color="red">FOGService</font> service from running at boot before you Sysprep to take your image, and then re-enable it within your <font color="red">SetupComplete.cmd</font> file so that it is re-enabled '''after''' the image deployment is complete.<br />
<br />
Failing to do so will break the Sysprep post-deployment process with an error message that says "Windows Setup could not configure Windows to run on this computer’s hardware.”<br />
<br />
* Disable FOGService: <font color="red">Windows Control Pannel -> View by Small Icons -> Administrative Tools -> Services -> Right click FOGService -> Properties -> Startup Type -> Disabled</font><br />
<br />
* Re-enable FOGService post-imaging:<br />
<br />
Create the below file.<br />
<br />
<font color="red">C:\Windows\Setup\scripts\SetupComplete.cmd</font><br />
<br />
Place these lines within the file, and then save.<br />
<br />
<pre>sc config FOGService start= auto<br />
shutdown -t 0 -r</pre><br />
<br />
As the filename indicates, the script is called by windows after an image is deployed and post-sysprep operations are complete. It will re-enable the FOGService and then reboot the computer gracefully. After the computer reboots, the FOGService will start automatically and rename the computer if necessary, reboot if necessary, join the domain and reboot if necessary, and then perform any associated snapins.<br />
<br />
<font color="red">Note:</font> SetupComplete.cmd will not automatically run on OEM versions of windows, but will automatically run on Non-OEM versions of Windows. If you're using an OEM copy, you can use firstlogoncommands in unattend.xml to call SetupComplete.cmd<br />
<br />
<br />
An example of the firstlogincommands might be:<br />
<pre><component name=“Microsoft-Windows-Shell-Setup” processorArchitecture=“amd64” publicKeyToken=“31bf3856ad364e35” language=“neutral” versionScope=“nonSxS” xmlns:wcm=“http://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”><br />
<FirstLogonCommands><br />
<SynchronousCommand wcm:action=“add”><br />
<Description>SetupComplete</Description><br />
<Order>1</Order><br />
<CommandLine>C:\Windows\Setup\Scripts\SetupComplete.cmd</CommandLine><br />
<RequiresUserInput>false</RequiresUserInput><br />
</SynchronousCommand><br />
</FirstLogonCommands></pre><br />
<br />
=== More Information ===<br />
<br />
More information about the fog client can be found here: [https://github.com/FOGProject/fog-client https://github.com/FOGProject/fog-client]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG&diff=12551Migrate FOG2017-12-07T02:23:23Z<p>Wayne-workman.28155: /* If old server was FOG 1.3.0+ */</p>
<hr />
<div>= Overview =<br />
<br />
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and sure than attempting an OS upgrade, which is risky and might leave you with a broken server. It's more safe and more sure because we know exactly what to move over and how to do it. An OS upgrade is risky because if you upgrade and it doesn't work or leaves fog in an unusable state, we have no idea what broke or how to fix it without exhaustive troubleshooting that may or may not lead to a solution. Migrating from an old box to a new box also leaves your old box intact, which is another safety net in this method.<br />
<br />
We are going to address the key spots:<br />
<br />
* Building a new server - general guidelines.<br />
* Migrating the database from the old server to the new one.<br />
* Migrating the images from the old server to the new one.<br />
* Migrating SSL information from the old server to the new one.<br />
* Adjusting a few places in the new web interface after migration to use the new IP.<br />
* Adjusting your DHCP settings if you aren't running DHCP on the new server.<br />
<br />
= Building the new server =<br />
<br />
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. The chosen distribution does not need to be the same as the old server. For example you can go from Ubuntu 12 to CentOS 7 or from CentOS 6 to Debian 8, etc. I would recommend [[CentOS 7]] or [[Debian 8]] or Debian 9. Go through the normal steps of setting up the OS. <br />
<br />
<font color="red">Do not</font> create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. <br />
<br />
Name the server <font color="green">fogserver</font> if possible. You can name the server during OS installation for most distributions. Ubuntu & Debian explicitly ask you what to name the server. In the installer for CentOS 7, RHEL, and Fedora you would set the server name in the network area, bottom left.<br />
<br />
Set a static IP or create a DHCP reservation for the server. You can set a static IP in the installer for Fedora, RHEL, and CentOS in the network area. Ubuntu & Debian only ask for a manual configuration if DHCP fails.<br />
<br />
After an IP is set, use your DNS server and create an 'A' record for the server's name and IP, [http://lmgtfy.com/?q=DNS+A+record Google search DNS A record] if you're unsure how to do that.<br />
<br />
To install FOG, follow an appropriate [https://wiki.fogproject.org/wiki/index.php?title=Installation#Installation_manuals installation manual] or the [[Upgrade to trunk]] article. <br />
<br />
CentOS and Fedora have security related settings that need set before installation. For Ubuntu 16.04 Server or Debian 8, it would be worth your time to see how to setup your server's partitions optimally via the example configuration videos in their installation manuals, the same applies for RHEL, CentOS, and Fedora. How the partitions are laid out for FOG can make the difference between a healthy server and a crashed server a year from now.<br />
<br />
= Migrating images & database =<br />
<br />
The entire point of migrating is usually saving your host registrations, group configurations, image assignments, and your images. There is a great number of ways to move these, but for inexperienced or beginner Linux users I would recommend leveraging NFS on the new FOG Server.<br />
<br />
Related articles: <br />
<br />
* [[Migrate images manually]]<br />
<br />
* [[Troubleshoot_MySQL#Manually_export_.2F_import_Fog_database]]<br />
<br />
Because the new FOG Server provides an NFS share, this is the easiest approach. This method is also uniform across the different distributions. This approach also works whether the old FOG Server's web interface is functional or not.<br />
<br />
=== Mounting ===<br />
<br />
Via Terminal or SSH on the '''old''' FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.<br />
<br />
<pre><br />
mkdir /new <br />
mount x.x.x.x:/images/dev /new<br />
</pre><br />
<br />
=== Export DB ===<br />
<br />
We will export the database and move the export to the new server. This is performed on the '''old''' FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysqldump -B fog > /new/fogdb.sql<br />
<br />
#Password with root user.<br />
mysqldump -B fog -u root -p > /new/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysqldump -B fog -h localhost > /new/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysqldump -B fog -h 127.0.0.1 > /new/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysqldump -B fog -h localhost -u root -p > /new/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysqldump -B fog -h 127.0.0.1 -u root -p > /new/fogdb.sql<br />
</pre><br />
<br />
=== Export Images ===<br />
<br />
Now to move over the images. Again, this is performed on the '''old''' FOG server. The more images you have, the longer the below command will take to execute.<br />
<br />
<pre><br />
cp -r /images/* /new<br />
</pre><br />
<br />
=== Importing DB ===<br />
<br />
Via Terminal or SSH on the '''new''' FOG server, we now need to import the database. Assuming you followed the above steps for exporting exactly, one of the below methods will work for you.<br />
<br />
<pre><br />
#No password.<br />
mysql -D fog < /images/dev/fogdb.sql<br />
<br />
#Password with root user.<br />
mysql -D fog -u root -p < /images/dev/fogdb.sql<br />
<br />
#No password, localhost.<br />
mysql -D fog -h localhost < /images/dev/fogdb.sql<br />
<br />
#No password, local loopback.<br />
mysql -D fog -h 127.0.0.1 < /images/dev/fogdb.sql<br />
<br />
#Password with localhost.<br />
mysql -D fog -h localhost -u root -p < /images/dev/fogdb.sql<br />
<br />
#Password with local loopback.<br />
mysql -D fog -h 127.0.0.1 -u root -p < /images/dev/fogdb.sql<br />
</pre><br />
<br />
After the database is successfully imported, you should delete the old file or move it. This is done on the '''new''' server. Here's the command to delete it:<br />
<br />
<pre><br />
rm -f /images/dev/fogdb.sql<br />
</pre><br />
<br />
It's important to note that this step will make the new server's web interface credentials the same as whatever the old server's was. If you don't know what the password is, you can follow steps here to reset the default web interface password: [[Password_Central#Web_Interface]]<br />
<br />
=== Arranging Images ===<br />
<br />
This step is performed on the '''new''' FOG server. In this step we're simply moving the images to where they are supposed to be and setting the correct permissions. This step assumes that your new server's images directory is in the default location and you followed the above steps for moving them over exactly.<br />
<br />
<pre><br />
rm -f /images/dev/.mntcheck<br />
mv /images/dev/* /images<br />
touch /images/dev/.mntcheck<br />
chown -R fog:root /images<br />
chmod -R 777 /images<br />
</pre><br />
<br />
== If old server was FOG 1.3.0+ ==<br />
<br />
Related article: [[FOG_Client#Maintain_Control_Of_Hosts_When_Building_New_Server]]<br />
<br />
Because of the security model of FOG 1.3.0+ and the new FOG Client, without the proper CA and ssl certificates present on the new fog server, any currently deployed hosts with the new FOG Client installed will ignore the new server and not accept commands from it. This is by design.<br />
<br />
In order to maintain control of existing hosts that have existing new FOG Clients installed or existing images that have the new FOG Client built into them, you must copy this directory from the old server to the new server: <font color="red">/opt/fog/snapins/ssl</font><br />
<br />
<br />
On the '''old''' FOG server, copy the ssl directory to the new server.<br />
<br />
<pre><br />
cp -R /opt/fog/snapins/ssl /new<br />
</pre><br />
<br />
On the '''new''' FOG Server, delete the existing ssl directory and then move the old ssl directory to the proper location, and then set permissions.<br />
<br />
<pre><br />
rm -rf /opt/fog/snapins/ssl<br />
mv /images/dev/ssl /opt/fog/snapins<br />
<br />
#Fedora, CentOS, and RHEL users should use this command to set permissions:<br />
chown -R fog:apache /opt/fog/snapins/ssl<br />
<br />
#Debian, Ubuntu, and Ubuntu variant users should use this command to set permissions:<br />
chown -R fog:www-data /opt/fog/snapins/ssl<br />
</pre><br />
<br />
<font color="red">IMPORTANT:</font> To complete the ssl migration, on the '''new''' FOG Server, re-run the fog installer that you used for installing fog.<br />
<br />
= Fix IP Addresses, Passwords, and Interface on new server =<br />
<br />
Related articles:<br />
<br />
* [[Change FOG Server IP Address]]<br />
<br />
* [[.fogsettings]]<br />
<br />
* [[Password Central]]<br />
<br />
* [[Troubleshoot FTP]]<br />
<br />
Related tool: [https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP]<br />
<br />
<br />
Because we have imported the old database into the new server in order to preserve all of the host data, image definitions, group definitions, image assignments, and so on, we also imported all of the old server's IP Addresses and passwords along with it. This can't be helped using the approach we took - which is the approach to take if your web interface on the old server was just completely not working. Because of this, we need to change just a few places in the FOG Web GUI, and change the old FOG Server's IP address to the new FOG Server's IP Address, and update a few passwords. <br />
<br />
First, we must find out what the new FOG Password and new interface is. On the '''new''' FOG Server, run this command and note the outputted lines that begin with <font color="red">password=</font> and <font color="red">interface=</font><br />
<br />
<pre><br />
cat /opt/fog/.fogsettings<br />
</pre><br />
<br />
You'll want to copy/paste the password because of it's length.<br />
<br />
Paste the password into the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> Password</font> and update the <font color="red">Interface</font> field with the new interface name also.<br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font><br />
<br />
Update the IP Address in the below fields in the '''new''' FOG Server's web interface:<br />
<br />
* <font color="red">Web Interface -> Storage Management -> [click node name] -> IP Address</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Web Server -> FOG_WEB_HOST</font><br />
* <font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_HOST</font><br />
<br />
= If FOG isn't doing DHCP =<br />
<br />
Related articles:<br />
<br />
* [[Modifying existing DHCP server to work with FOG]]<br />
<br />
* [[BIOS and UEFI Co-Existence]]<br />
<br />
* [[ProxyDHCP with dnsmasq]]<br />
<br />
If you have an existing dedicated DHCP server, you'll need to update it. Completing this step will make the new FOG Server "live". You can make the old FOG Server "live" again by rolling back this step.<br />
<br />
== Windows Server DHCP ==<br />
<br />
Use Remote Desktop to connect to the DHCP Server. Open the Run Dialog with the hotkeys Windows+R and type <font color="red">dhcpmgmt.msc</font> and press enter or click run. The DHCP Management GUI should open.<br />
<br />
Navigate through the left-most menus to IPv4 -> subnet -> Scope Options. Look for options 066 and 067, they should be plainly visible.<br />
<br />
Change option 066 from the old FOG Server's IP address to the new FOG Server's IP Address.<br />
<br />
Check option 067, if it's set to anything besides <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font> then you should change it to one of the previously mentioned values in red.<br />
<br />
== Linux / ISC-DHCP ==<br />
<br />
Open Terminal on your DHCP Server, or SSH to the server.<br />
<br />
If you're not already root, become root with <font color="red">sudo -i</font><br />
<br />
Use your favorite editor to edit this file: <font color="red">/etc/dhcp/dhcpd.conf</font> <br />
<br />
I like to use [[Vi]]. Using Vi as your editor:<br />
<br />
<pre><br />
vi /etc/dhcp/dhcpd.conf<br />
</pre><br />
<br />
Look for these two lines throughout the document: <br />
<br />
* <font color="red">next-server</font><br />
<br />
* <font color="red">filename</font><br />
<br />
Change the value of next-server to the new FOG Server's IP Address. If you have just a simple DHCP configuration and filename only appears one time in the configuration, you will likely want this to be set to <font color="red">undionly.kpxe</font> or <font color="red">undionly.kkpxe</font><br />
<br />
After making changes and saving them, restart the DHCP service. On new Linux distributions this can typically be accomplished with:<br />
<br />
<pre>systemctl restart dhcpd</pre><br />
<br />
If you have issues with restarting DHCP, get the full status of it with:<br />
<br />
<pre>systemctl status dhcpd -l</pre></div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12550Getting FOG2017-11-29T20:20:12Z<p>Wayne-workman.28155: </p>
<hr />
<div><br />
= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch, skip to the next section. If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12549Getting FOG2017-11-29T20:19:24Z<p>Wayne-workman.28155: </p>
<hr />
<div>= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch, skip to the next section. If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Getting_FOG&diff=12548Getting FOG2017-11-29T20:18:35Z<p>Wayne-workman.28155: Created page with "= Read First = * If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes. * If you..."</p>
<hr />
<div>= Read First =<br />
<br />
* If you have a multi-node setup, they all need to be on the same version of FOG. Start by updating the master/web server, then update all your nodes.<br />
* If your fog server is in a VM, snapshot/checkpoint it first.<br />
* Backup your database first via: <font color="red">Web GUI -> FOG Configuration -> Configuration Save -> Export Database -> Export</font><br />
<br />
= FOG has branches =<br />
<br />
What's a branch? In development terms, a branch is different states of the code. The developers of FOG keep the latest stable version in the <font color="red">master</font> branch. Release candidates are kept in <font color="red">dev-branch</font> and often you will be asked to try this branch to overcome some problem. The latest changes to FOG are kept in the <font color="red">working</font> branch. These latest changes may have broken something but generally the working branch is workable.<br />
<br />
<br />
= Installing GIT =<br />
<br />
The preferred method of getting FOG is via GIT. [https://en.wikipedia.org/wiki/Git Read about git here.] First you'll need to install git onto your chosen Linux server. There's a couple ways to do this below.<br />
<br />
== Install GIT on Debian or Ubuntu ==<br />
<br />
<pre><br />
sudo -i<br />
apt-get -y install git<br />
</pre><br />
<br />
== Install GIT on CentOS 7 or RHEL 7 ==<br />
<br />
<pre><br />
sudo -i<br />
yum -y install git<br />
</pre><br />
<br />
== Install GIT on CentOS 8, RHEL 8, or Fedora ==<br />
<br />
<pre><br />
sudo -i<br />
dnf -y install git<br />
</pre><br />
<br />
= Getting FOG =<br />
<br />
Now that GIT is installed, you should be able to clone the FOG repository. Generally we recommend to put the repository inside of <font color="red">/root</font> but if you've done this sort of thing before, put it wherever you want. Here's how we clone FOG:<br />
<br />
<pre><br />
sudo -i<br />
cd /root<br />
git clone https://github.com/FOGProject/fogproject.git<br />
cd fogproject<br />
</pre><br />
<br />
= Using the desired FOG branch =<br />
<br />
If you want to use the master branch, skip to the next section. If you'd like to use the dev-branch, use this command:<br />
<br />
<pre><br />
git checkout dev-branch<br />
</pre><br />
<br />
If you would like to use the working branch, use this command:<br />
<br />
<pre><br />
git checkout working<br />
</pre><br />
<br />
To go back to master at a later date, always update your repository via the <font color="red">git pull</font> command like this:<br />
<pre><br />
sudo -i<br />
cd /root/fogproject<br />
git pull<br />
git checkout master<br />
</pre><br />
<br />
= Running the installer =<br />
<br />
To start the installation process, you would follow the below steps. Running the installer must be done as root.<br />
<br />
<pre><br />
sudo -i<br />
cd /root/fogproject/bin<br />
./installfog.sh<br />
</pre><br />
<br />
= Installation arguments =<br />
<br />
The FOG installer has installation arguments available. You can get them all by using this command with the installer:<br />
<br />
<pre><br />
./installfog.sh --help<br />
</pre><br />
<br />
If you wanted the installer to 'just go' and use all defaults, use this command:<br />
<br />
<pre><br />
./installfog.sh -y<br />
</pre><br />
<br />
If you want the installer to follow a configuration with the -y argument, just create a .fogsettings file ahead of time and put it here: <font color="red">/opt/fog/.fogsettings</font> You can copy another server's file but will need to update the IP settings. Here's a writeup on the fogsettings file: [[.fogsettings]]</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Password_Central&diff=12547Password Central2017-11-23T15:49:33Z<p>Wayne-workman.28155: /* 1.4.0 and 1.5.0 series */</p>
<hr />
<div>This article reflects settings in the 1.3.0 release.<br />
<br />
= Web Interface =<br />
<br />
Default username is <font color="red">fog</font><br />
<br />
Default password is <font color="red">password</font><br />
<br />
If you lose this password, and you have root access to the main fog server, you can reset it to the default via CLI.<br />
== 1.2.0 and lower ==<br />
NOTE: Can still be used for 1.3.0<br />
<pre><br />
mysql -D fog<br />
UPDATE `users` SET `uPass` = MD5('password') WHERE `uName` = 'fog';<br />
quit<br />
</pre><br />
<br />
== 1.3.0 series ==<br />
<pre><br />
mysql -D fog<br />
UPDATE `users` SET `uPass` = '$2y$11$g0Hu8OaOStuPk7WWYGh6Wu4PLlZDZGOkzMwEEAk.rZMrI9IdDwno.' WHERE `uName` = 'fog';<br />
quit<br />
</pre><br />
<br />
Alternatively, if the <font color="red">fog</font> user does not exist, you may create it with the default password via CLI.<br />
<br />
<pre><br />
mysql -D fog<br />
INSERT INTO `users` (`uName`,`uPass`,`uCreateBy`,`uType`) VALUES ('fog','$2y$11$g0Hu8OaOStuPk7WWYGh6Wu4PLlZDZGOkzMwEEAk.rZMrI9IdDwno.','localAdmin','0');<br />
quit<br />
</pre><br />
<br />
== 1.4.0 and 1.5.0 series ==<br />
<br />
For 1.4 and 1.5, there are some other fields needed when recreating a new user. Here's how to do that:<br />
<br />
<pre><br />
mysql -D fog<br />
INSERT INTO users (uName,uPass,uCreateDate,uCreateBy,uType,uDisplay,uAllowAPI,uAPIToken) VALUES('fog','$2y$11$A2D/RijXM.qL7KYrMVo7f.Gfomq6vO6NpL6pEHQIY1OzUci7wBOjC','2017-11-23 9:48:00','localAdmin',0,'fog',1,'');<br />
quit<br />
</pre><br />
<br />
= Storage Management Credentials =<br />
<br />
Accessed via the web interface, and then clicking on "Storage Management" in the ribbon. In here, you can view the storage nodes connected to your fog server. <br />
<br />
By clicking on one of the storage nodes, you enter into that storage node's settings area. In here are the FTP credentials labeled 'username' and 'password' used for managing this storage node. Please see [[Troubleshoot FTP]] for '''further troubleshooting'''.<br />
<br />
= Active Directory =<br />
<br />
There are three places where you can set Active Directory joining credentials. Two are persistent.<br />
<br />
== Global Defaults ==<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_USER</font><br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_PASSWORD</font><br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_PASSWORD_LEGACY</font><br />
<br />
These three areas are just place-holders. When ticking the checkbox to join a host to Active Directory (explained below), these global settings are what is used to populate the fields. These fields are also what is used when saying "Y" to joining Active Directory via network booting and doing a "Full Host Registration".<br />
<br />
The FOG_AD_DEFAULT_PASSWORD field is used only for the new fog client. This field is typed in as plain-text, and upon saving, is encrypted using an industry-standard encryption technique. Please read through [[FOG_Client#Security_Design]] for more details on this.<br />
<br />
The FOG_AD_DEFAULT_PASSWORD_LEGACY field is only used with the legacy fog client. This value must be encrypted first by "fogcrypt.exe". This program runs on windows via command prompt only, and is available for download at the bottom of every page in the fog web interface, including the login page. After running your password through this program, you would copy/paste the encrypted string it produces into the FOG_AD_DEFAULT_PASSWORD field. This field '''should not be set''' if you do not intend to use the legacy client. It's also '''strongly advised not use the legacy client''', and instead use the new fog client due to security concerns.<br />
<br />
== Host Settings ==<br />
<br />
You may individually set unique user/pass and domain information on a per-host basis if you wish. You can get to this area like this:<br />
<br />
<font color="red">Web Interface -> Host Management -> [list all hosts or search] -> Click on the desired host -> Click "Active Directory"</font><br />
<br />
In this area, there are a few fields. When checking the "Join Domain after image task" checkbox, if global defaults are set, they are auto-populated into these fields. You may manually enter these fields with whatever domain/user/password you wish.<br />
<br />
The two password fields "Domain Password" and "Domain Password Legacy" are explained above in the "Global Defaults" area.<br />
<br />
== Group Settings ==<br />
<br />
You may set Active Directory credentials on many hosts at once via groups. After setting AD Credentials here and then coming back to check this area in groups, you will see that the field is always blank. The settings are not applied to the group, but instead to each individual host within the group. If you check the individual hosts (explained above), you will see that your settings have applied. Hosts later added to the group will not receive the previously applied settings, because the settings do not apply to the group, but instead to each individual host in the group and only at the time of applying the settings.<br />
<br />
You can go to this area like this:<br />
<br />
<font color="red">Web Interface -> Group Management -> [list all groups or search] -> Click the desired group -> Click "Active Directory"</font><br />
<br />
The two password fields "Domain Password" and "Domain Password Legacy" are explained above in the "Global Defaults" area.<br />
<br />
= MySQL =<br />
<br />
Related article: [[Troubleshoot_MySQL]]<br />
<br />
== For Storage Nodes ==<br />
<br />
FOG 1.3.0 storage nodes communicate with the main server's database to get various work done. During installation, the installer will prompt you for a <font color="red">FOG_STORAGENODE_MYSQLUSER</font> and a <font color="red">FOG_STORAGENODE_MYSQLPASS</font>. <br />
<br />
The default username is <font color="red">fogstorage</font><br />
<br />
The password is always unique, and can be retrieved via the web interface here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS</font><br />
<br />
You would copy/paste this password value into the installer during installation.<br />
<br />
If you need to change this password or username or server address later on a storage node, you may edit the <font color="red">/opt/fog/.fogsettings</font> on that particular node to update the password and then re-run the installer to complete changes. You may edit the file with Vi like this:<br />
<br />
<font color="red">vi /opt/fog/.fogsettings</font><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, look for the fields <font color="red">snmysqluser=</font> and <font color="red">snmysqlpass=</font> and <font color="red">snmysqlhost=</font>. That's where you'd change the values, and then after saving and closing, re-run the installer to complete changes.<br />
<br />
To change the password in MySQL, you would run one of the below commands on '''the main fog server'''.<br />
<br />
Newer versions of MySQL and Ubuntu 16+:<br />
<br />
<pre>mysql<br />
ALTER USER 'fogstorage'@'%' IDENTIFIED WITH mysql_native_password BY 'NewPassGoesHere';</pre><br />
<br />
Older versions of MySQL:<br />
<br />
<pre>mysql<br />
ALTER USER 'fogstorage'@'%' IDENTIFIED BY 'NewPassGoesHere';</pre><br />
<br />
== For Main Server ==<br />
<br />
Typically, the user, password, and host is normally blank for the main server. The installer, unless told otherwise when it prompts, will assume a blank password.<br />
<br />
To change the password in MySQL, it would be something like one of these:<br />
<br />
Newer versions of MySQL and Ubuntu 16+:<br />
<br />
<pre>mysql<br />
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';</pre><br />
<br />
Older versions of MySQL:<br />
<br />
<pre>mysql<br />
ALTER USER 'root'@'localhost' IDENTIFIED BY '';</pre><br />
<br />
After having changed the password, it may be necessary to update the value inside of <font color="red">/opt/fog/.fogsettings</font> on the main server. You may edit the file with Vi like this:<br />
<br />
<font color="red">vi /opt/fog/.fogsettings</font><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, look for the fields <font color="red">snmysqluser=</font> and <font color="red">snmysqlpass=</font> and <font color="red">snmysqlhost=</font>. That's where you'd change the values, and then after saving and closing, re-run the installer to complete changes.<br />
<br />
= Proxy Settings =<br />
<br />
If your organization uses a Proxy Server to access the web, you may set credentials and other settings for this '''if needed''' here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Proxy Settings</font><br />
<br />
= Kernel Updates =<br />
<br />
The username and password for FOG 1.3.0 kernel updates is oddly named, as you will see below. These credentials are the ones used when placing newly downloaded kernels and inits onto the server. They are used via FTP. See [[Kernel Update]] for more information on the process.<br />
<br />
The username and password is located here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font> and <font color="red">FOG_TFTP_FTP_USERNAME</font><br />
<br />
= Local "fog" user =<br />
<br />
Please do not use the local "fog" user account on the server to do back-end work. Create another account and use that. When building a new server, create a work account and do not create a "fog" user. This is absolutely not needed as the installer will create and maintain this user account.<br />
<br />
The "fog" user is a local linux account on your fog server or fog storage node. It's also the account used by default for FTP access to any storage nodes (see Storage Management Credentials above).<br />
<br />
To reset this password, you need to be this user, or root.<br />
<br />
On any Linux system, you can elevate an administrative account to root like this:<br />
<br />
<pre>sudo -i</pre><br />
<br />
And then provide your password.<br />
<br />
You may change the fog password like this:<br />
<br />
<pre>passwd fog</pre><br />
<br />
You'll be prompted for the new password, and then to re-enter it again.<br />
<br />
Please see [[Troubleshoot FTP]] for a more complete article on this topic.<br />
<br />
= .fogsettings =<br />
<br />
Located here: <font color="red">/opt/fog/.fogsettings</font><br />
<br />
You may edit it with Vi like this:<br />
<br />
<pre>vi /opt/fog/.fogsettings</pre><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, there are a whole lot of settings, passwords, addresses, etc. You should re-run the fog installer after changing any settings in this file. The important settings in here in relation to the scope of this article are:<br />
<br />
* <font color="red">password=</font> This is what the installer uses to reset the local account, <font color="red">username</font><br />
** Make sure this is set correctly or you'll find that every time you update or re-run the installer, you will have FTP failure, or have locked yourself out of your server!<br />
<br />
* <font color="red">username=</font> This is the local account to be managed by the installer, and used by fog for many things, to include FTP.<br />
<br />
* <font color="red">snmysqluser=</font> This is the username to access the MySQL server.<br />
<br />
* <font color="red">snmysqlpass=</font> This is the password to access the MySQL server.<br />
<br />
* <font color="red">snmysqlhost=</font> This is the MySQL server address.<br />
<br />
Please see [[.fogsettings]] for a complete listing and details.<br />
<br />
= config.class.php =<br />
<br />
Typically located here: <font color="red">/var/www/html/fog/lib/fog/config.class.php</font><br />
<br />
You may view the file like this:<br />
<br />
<pre>cat /var/www/html/fog/lib/fog/config.class.php</pre><br />
<br />
Used to be in '''older versions''' of FOG, this is where passwords and such would be set. It's no longer necessary to edit this file to set passwords, as the installer completely rebuilds this file every time it's ran. You simply need to make sure that the settings inside of <font color="red">/opt/fog/.fogsettings</font> are correct and then re-run the installer to update this file.<br />
<br />
That said, you can view this file if you wish to see if passwords are being set correctly in it. Note that any changes manually made here but not reflected inside of .fogsettings will '''simply be overwritten''' upon the next fog update or re-run of the installer.</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Password_Central&diff=12546Password Central2017-11-23T15:44:16Z<p>Wayne-workman.28155: /* Web Interface */</p>
<hr />
<div>This article reflects settings in the 1.3.0 release.<br />
<br />
= Web Interface =<br />
<br />
Default username is <font color="red">fog</font><br />
<br />
Default password is <font color="red">password</font><br />
<br />
If you lose this password, and you have root access to the main fog server, you can reset it to the default via CLI.<br />
== 1.2.0 and lower ==<br />
NOTE: Can still be used for 1.3.0<br />
<pre><br />
mysql -D fog<br />
UPDATE `users` SET `uPass` = MD5('password') WHERE `uName` = 'fog';<br />
quit<br />
</pre><br />
<br />
== 1.3.0 series ==<br />
<pre><br />
mysql -D fog<br />
UPDATE `users` SET `uPass` = '$2y$11$g0Hu8OaOStuPk7WWYGh6Wu4PLlZDZGOkzMwEEAk.rZMrI9IdDwno.' WHERE `uName` = 'fog';<br />
quit<br />
</pre><br />
<br />
Alternatively, if the <font color="red">fog</font> user does not exist, you may create it with the default password via CLI.<br />
<br />
<pre><br />
mysql -D fog<br />
INSERT INTO `users` (`uName`,`uPass`,`uCreateBy`,`uType`) VALUES ('fog','$2y$11$g0Hu8OaOStuPk7WWYGh6Wu4PLlZDZGOkzMwEEAk.rZMrI9IdDwno.','localAdmin','0');<br />
quit<br />
</pre><br />
<br />
== 1.4.0 and 1.5.0 series ==<br />
<br />
For 1.4 and 1.5, there are some other fields needed when recreating the FOG User. Here's how to do that:<br />
<br />
<pre><br />
mysql -D fog<br />
INSERT INTO `users` VALUES (1,'fog','$2y$11$A2D/RijXM.qL7KYrMVo7f.Gfomq6vO6NpL6pEHQIY1OzUci7wBOjC','2017-07-29 11:04:28','fog',0,'','1','56ad9a7c45718a4e7fde5a5adde70f42352817567baf236eed29811a3751f9e5ecccf9512a3e307928bb89d6491e1ca9893d1bde101bcb162dd8fcce37bf047d');<br />
quit<br />
</pre><br />
<br />
= Storage Management Credentials =<br />
<br />
Accessed via the web interface, and then clicking on "Storage Management" in the ribbon. In here, you can view the storage nodes connected to your fog server. <br />
<br />
By clicking on one of the storage nodes, you enter into that storage node's settings area. In here are the FTP credentials labeled 'username' and 'password' used for managing this storage node. Please see [[Troubleshoot FTP]] for '''further troubleshooting'''.<br />
<br />
= Active Directory =<br />
<br />
There are three places where you can set Active Directory joining credentials. Two are persistent.<br />
<br />
== Global Defaults ==<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_USER</font><br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_PASSWORD</font><br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_PASSWORD_LEGACY</font><br />
<br />
These three areas are just place-holders. When ticking the checkbox to join a host to Active Directory (explained below), these global settings are what is used to populate the fields. These fields are also what is used when saying "Y" to joining Active Directory via network booting and doing a "Full Host Registration".<br />
<br />
The FOG_AD_DEFAULT_PASSWORD field is used only for the new fog client. This field is typed in as plain-text, and upon saving, is encrypted using an industry-standard encryption technique. Please read through [[FOG_Client#Security_Design]] for more details on this.<br />
<br />
The FOG_AD_DEFAULT_PASSWORD_LEGACY field is only used with the legacy fog client. This value must be encrypted first by "fogcrypt.exe". This program runs on windows via command prompt only, and is available for download at the bottom of every page in the fog web interface, including the login page. After running your password through this program, you would copy/paste the encrypted string it produces into the FOG_AD_DEFAULT_PASSWORD field. This field '''should not be set''' if you do not intend to use the legacy client. It's also '''strongly advised not use the legacy client''', and instead use the new fog client due to security concerns.<br />
<br />
== Host Settings ==<br />
<br />
You may individually set unique user/pass and domain information on a per-host basis if you wish. You can get to this area like this:<br />
<br />
<font color="red">Web Interface -> Host Management -> [list all hosts or search] -> Click on the desired host -> Click "Active Directory"</font><br />
<br />
In this area, there are a few fields. When checking the "Join Domain after image task" checkbox, if global defaults are set, they are auto-populated into these fields. You may manually enter these fields with whatever domain/user/password you wish.<br />
<br />
The two password fields "Domain Password" and "Domain Password Legacy" are explained above in the "Global Defaults" area.<br />
<br />
== Group Settings ==<br />
<br />
You may set Active Directory credentials on many hosts at once via groups. After setting AD Credentials here and then coming back to check this area in groups, you will see that the field is always blank. The settings are not applied to the group, but instead to each individual host within the group. If you check the individual hosts (explained above), you will see that your settings have applied. Hosts later added to the group will not receive the previously applied settings, because the settings do not apply to the group, but instead to each individual host in the group and only at the time of applying the settings.<br />
<br />
You can go to this area like this:<br />
<br />
<font color="red">Web Interface -> Group Management -> [list all groups or search] -> Click the desired group -> Click "Active Directory"</font><br />
<br />
The two password fields "Domain Password" and "Domain Password Legacy" are explained above in the "Global Defaults" area.<br />
<br />
= MySQL =<br />
<br />
Related article: [[Troubleshoot_MySQL]]<br />
<br />
== For Storage Nodes ==<br />
<br />
FOG 1.3.0 storage nodes communicate with the main server's database to get various work done. During installation, the installer will prompt you for a <font color="red">FOG_STORAGENODE_MYSQLUSER</font> and a <font color="red">FOG_STORAGENODE_MYSQLPASS</font>. <br />
<br />
The default username is <font color="red">fogstorage</font><br />
<br />
The password is always unique, and can be retrieved via the web interface here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS</font><br />
<br />
You would copy/paste this password value into the installer during installation.<br />
<br />
If you need to change this password or username or server address later on a storage node, you may edit the <font color="red">/opt/fog/.fogsettings</font> on that particular node to update the password and then re-run the installer to complete changes. You may edit the file with Vi like this:<br />
<br />
<font color="red">vi /opt/fog/.fogsettings</font><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, look for the fields <font color="red">snmysqluser=</font> and <font color="red">snmysqlpass=</font> and <font color="red">snmysqlhost=</font>. That's where you'd change the values, and then after saving and closing, re-run the installer to complete changes.<br />
<br />
To change the password in MySQL, you would run one of the below commands on '''the main fog server'''.<br />
<br />
Newer versions of MySQL and Ubuntu 16+:<br />
<br />
<pre>mysql<br />
ALTER USER 'fogstorage'@'%' IDENTIFIED WITH mysql_native_password BY 'NewPassGoesHere';</pre><br />
<br />
Older versions of MySQL:<br />
<br />
<pre>mysql<br />
ALTER USER 'fogstorage'@'%' IDENTIFIED BY 'NewPassGoesHere';</pre><br />
<br />
== For Main Server ==<br />
<br />
Typically, the user, password, and host is normally blank for the main server. The installer, unless told otherwise when it prompts, will assume a blank password.<br />
<br />
To change the password in MySQL, it would be something like one of these:<br />
<br />
Newer versions of MySQL and Ubuntu 16+:<br />
<br />
<pre>mysql<br />
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';</pre><br />
<br />
Older versions of MySQL:<br />
<br />
<pre>mysql<br />
ALTER USER 'root'@'localhost' IDENTIFIED BY '';</pre><br />
<br />
After having changed the password, it may be necessary to update the value inside of <font color="red">/opt/fog/.fogsettings</font> on the main server. You may edit the file with Vi like this:<br />
<br />
<font color="red">vi /opt/fog/.fogsettings</font><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, look for the fields <font color="red">snmysqluser=</font> and <font color="red">snmysqlpass=</font> and <font color="red">snmysqlhost=</font>. That's where you'd change the values, and then after saving and closing, re-run the installer to complete changes.<br />
<br />
= Proxy Settings =<br />
<br />
If your organization uses a Proxy Server to access the web, you may set credentials and other settings for this '''if needed''' here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Proxy Settings</font><br />
<br />
= Kernel Updates =<br />
<br />
The username and password for FOG 1.3.0 kernel updates is oddly named, as you will see below. These credentials are the ones used when placing newly downloaded kernels and inits onto the server. They are used via FTP. See [[Kernel Update]] for more information on the process.<br />
<br />
The username and password is located here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font> and <font color="red">FOG_TFTP_FTP_USERNAME</font><br />
<br />
= Local "fog" user =<br />
<br />
Please do not use the local "fog" user account on the server to do back-end work. Create another account and use that. When building a new server, create a work account and do not create a "fog" user. This is absolutely not needed as the installer will create and maintain this user account.<br />
<br />
The "fog" user is a local linux account on your fog server or fog storage node. It's also the account used by default for FTP access to any storage nodes (see Storage Management Credentials above).<br />
<br />
To reset this password, you need to be this user, or root.<br />
<br />
On any Linux system, you can elevate an administrative account to root like this:<br />
<br />
<pre>sudo -i</pre><br />
<br />
And then provide your password.<br />
<br />
You may change the fog password like this:<br />
<br />
<pre>passwd fog</pre><br />
<br />
You'll be prompted for the new password, and then to re-enter it again.<br />
<br />
Please see [[Troubleshoot FTP]] for a more complete article on this topic.<br />
<br />
= .fogsettings =<br />
<br />
Located here: <font color="red">/opt/fog/.fogsettings</font><br />
<br />
You may edit it with Vi like this:<br />
<br />
<pre>vi /opt/fog/.fogsettings</pre><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, there are a whole lot of settings, passwords, addresses, etc. You should re-run the fog installer after changing any settings in this file. The important settings in here in relation to the scope of this article are:<br />
<br />
* <font color="red">password=</font> This is what the installer uses to reset the local account, <font color="red">username</font><br />
** Make sure this is set correctly or you'll find that every time you update or re-run the installer, you will have FTP failure, or have locked yourself out of your server!<br />
<br />
* <font color="red">username=</font> This is the local account to be managed by the installer, and used by fog for many things, to include FTP.<br />
<br />
* <font color="red">snmysqluser=</font> This is the username to access the MySQL server.<br />
<br />
* <font color="red">snmysqlpass=</font> This is the password to access the MySQL server.<br />
<br />
* <font color="red">snmysqlhost=</font> This is the MySQL server address.<br />
<br />
Please see [[.fogsettings]] for a complete listing and details.<br />
<br />
= config.class.php =<br />
<br />
Typically located here: <font color="red">/var/www/html/fog/lib/fog/config.class.php</font><br />
<br />
You may view the file like this:<br />
<br />
<pre>cat /var/www/html/fog/lib/fog/config.class.php</pre><br />
<br />
Used to be in '''older versions''' of FOG, this is where passwords and such would be set. It's no longer necessary to edit this file to set passwords, as the installer completely rebuilds this file every time it's ran. You simply need to make sure that the settings inside of <font color="red">/opt/fog/.fogsettings</font> are correct and then re-run the installer to update this file.<br />
<br />
That said, you can view this file if you wish to see if passwords are being set correctly in it. Note that any changes manually made here but not reflected inside of .fogsettings will '''simply be overwritten''' upon the next fog update or re-run of the installer.</div>Wayne-workman.28155https://wiki.fogproject.org/wiki/index.php?title=Password_Central&diff=12545Password Central2017-11-23T15:38:43Z<p>Wayne-workman.28155: /* 1.3.0 and higher */</p>
<hr />
<div>This article reflects settings in the 1.3.0 release.<br />
<br />
= Web Interface =<br />
<br />
Default username is <font color="red">fog</font><br />
<br />
Default password is <font color="red">password</font><br />
<br />
If you lose this password, and you have root access to the main fog server, you can reset it to the default via CLI.<br />
== 1.2.0 and lower ==<br />
NOTE: Can still be used for 1.3.0<br />
<pre><br />
mysql -D fog<br />
UPDATE `users` SET `uPass` = MD5('password') WHERE `uName` = 'fog';<br />
quit<br />
</pre><br />
<br />
== 1.3.0 series ==<br />
<pre><br />
mysql -D fog<br />
UPDATE `users` SET `uPass` = '$2y$11$g0Hu8OaOStuPk7WWYGh6Wu4PLlZDZGOkzMwEEAk.rZMrI9IdDwno.' WHERE `uName` = 'fog';<br />
quit<br />
</pre><br />
<br />
Alternatively, if the <font color="red">fog</font> user does not exist, you may create it with the default password via CLI.<br />
<br />
<pre><br />
mysql -D fog<br />
INSERT INTO `users` (`uName`,`uPass`,`uCreateBy`,`uType`) VALUES ('fog','$2y$11$g0Hu8OaOStuPk7WWYGh6Wu4PLlZDZGOkzMwEEAk.rZMrI9IdDwno.','localAdmin','0');<br />
quit<br />
</pre><br />
<br />
= Storage Management Credentials =<br />
<br />
Accessed via the web interface, and then clicking on "Storage Management" in the ribbon. In here, you can view the storage nodes connected to your fog server. <br />
<br />
By clicking on one of the storage nodes, you enter into that storage node's settings area. In here are the FTP credentials labeled 'username' and 'password' used for managing this storage node. Please see [[Troubleshoot FTP]] for '''further troubleshooting'''.<br />
<br />
= Active Directory =<br />
<br />
There are three places where you can set Active Directory joining credentials. Two are persistent.<br />
<br />
== Global Defaults ==<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_USER</font><br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_PASSWORD</font><br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Active Directory Defaults -> FOG_AD_DEFAULT_PASSWORD_LEGACY</font><br />
<br />
These three areas are just place-holders. When ticking the checkbox to join a host to Active Directory (explained below), these global settings are what is used to populate the fields. These fields are also what is used when saying "Y" to joining Active Directory via network booting and doing a "Full Host Registration".<br />
<br />
The FOG_AD_DEFAULT_PASSWORD field is used only for the new fog client. This field is typed in as plain-text, and upon saving, is encrypted using an industry-standard encryption technique. Please read through [[FOG_Client#Security_Design]] for more details on this.<br />
<br />
The FOG_AD_DEFAULT_PASSWORD_LEGACY field is only used with the legacy fog client. This value must be encrypted first by "fogcrypt.exe". This program runs on windows via command prompt only, and is available for download at the bottom of every page in the fog web interface, including the login page. After running your password through this program, you would copy/paste the encrypted string it produces into the FOG_AD_DEFAULT_PASSWORD field. This field '''should not be set''' if you do not intend to use the legacy client. It's also '''strongly advised not use the legacy client''', and instead use the new fog client due to security concerns.<br />
<br />
== Host Settings ==<br />
<br />
You may individually set unique user/pass and domain information on a per-host basis if you wish. You can get to this area like this:<br />
<br />
<font color="red">Web Interface -> Host Management -> [list all hosts or search] -> Click on the desired host -> Click "Active Directory"</font><br />
<br />
In this area, there are a few fields. When checking the "Join Domain after image task" checkbox, if global defaults are set, they are auto-populated into these fields. You may manually enter these fields with whatever domain/user/password you wish.<br />
<br />
The two password fields "Domain Password" and "Domain Password Legacy" are explained above in the "Global Defaults" area.<br />
<br />
== Group Settings ==<br />
<br />
You may set Active Directory credentials on many hosts at once via groups. After setting AD Credentials here and then coming back to check this area in groups, you will see that the field is always blank. The settings are not applied to the group, but instead to each individual host within the group. If you check the individual hosts (explained above), you will see that your settings have applied. Hosts later added to the group will not receive the previously applied settings, because the settings do not apply to the group, but instead to each individual host in the group and only at the time of applying the settings.<br />
<br />
You can go to this area like this:<br />
<br />
<font color="red">Web Interface -> Group Management -> [list all groups or search] -> Click the desired group -> Click "Active Directory"</font><br />
<br />
The two password fields "Domain Password" and "Domain Password Legacy" are explained above in the "Global Defaults" area.<br />
<br />
= MySQL =<br />
<br />
Related article: [[Troubleshoot_MySQL]]<br />
<br />
== For Storage Nodes ==<br />
<br />
FOG 1.3.0 storage nodes communicate with the main server's database to get various work done. During installation, the installer will prompt you for a <font color="red">FOG_STORAGENODE_MYSQLUSER</font> and a <font color="red">FOG_STORAGENODE_MYSQLPASS</font>. <br />
<br />
The default username is <font color="red">fogstorage</font><br />
<br />
The password is always unique, and can be retrieved via the web interface here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS</font><br />
<br />
You would copy/paste this password value into the installer during installation.<br />
<br />
If you need to change this password or username or server address later on a storage node, you may edit the <font color="red">/opt/fog/.fogsettings</font> on that particular node to update the password and then re-run the installer to complete changes. You may edit the file with Vi like this:<br />
<br />
<font color="red">vi /opt/fog/.fogsettings</font><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, look for the fields <font color="red">snmysqluser=</font> and <font color="red">snmysqlpass=</font> and <font color="red">snmysqlhost=</font>. That's where you'd change the values, and then after saving and closing, re-run the installer to complete changes.<br />
<br />
To change the password in MySQL, you would run one of the below commands on '''the main fog server'''.<br />
<br />
Newer versions of MySQL and Ubuntu 16+:<br />
<br />
<pre>mysql<br />
ALTER USER 'fogstorage'@'%' IDENTIFIED WITH mysql_native_password BY 'NewPassGoesHere';</pre><br />
<br />
Older versions of MySQL:<br />
<br />
<pre>mysql<br />
ALTER USER 'fogstorage'@'%' IDENTIFIED BY 'NewPassGoesHere';</pre><br />
<br />
== For Main Server ==<br />
<br />
Typically, the user, password, and host is normally blank for the main server. The installer, unless told otherwise when it prompts, will assume a blank password.<br />
<br />
To change the password in MySQL, it would be something like one of these:<br />
<br />
Newer versions of MySQL and Ubuntu 16+:<br />
<br />
<pre>mysql<br />
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';</pre><br />
<br />
Older versions of MySQL:<br />
<br />
<pre>mysql<br />
ALTER USER 'root'@'localhost' IDENTIFIED BY '';</pre><br />
<br />
After having changed the password, it may be necessary to update the value inside of <font color="red">/opt/fog/.fogsettings</font> on the main server. You may edit the file with Vi like this:<br />
<br />
<font color="red">vi /opt/fog/.fogsettings</font><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, look for the fields <font color="red">snmysqluser=</font> and <font color="red">snmysqlpass=</font> and <font color="red">snmysqlhost=</font>. That's where you'd change the values, and then after saving and closing, re-run the installer to complete changes.<br />
<br />
= Proxy Settings =<br />
<br />
If your organization uses a Proxy Server to access the web, you may set credentials and other settings for this '''if needed''' here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> Proxy Settings</font><br />
<br />
= Kernel Updates =<br />
<br />
The username and password for FOG 1.3.0 kernel updates is oddly named, as you will see below. These credentials are the ones used when placing newly downloaded kernels and inits onto the server. They are used via FTP. See [[Kernel Update]] for more information on the process.<br />
<br />
The username and password is located here:<br />
<br />
<font color="red">Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_PASSWORD</font> and <font color="red">FOG_TFTP_FTP_USERNAME</font><br />
<br />
= Local "fog" user =<br />
<br />
Please do not use the local "fog" user account on the server to do back-end work. Create another account and use that. When building a new server, create a work account and do not create a "fog" user. This is absolutely not needed as the installer will create and maintain this user account.<br />
<br />
The "fog" user is a local linux account on your fog server or fog storage node. It's also the account used by default for FTP access to any storage nodes (see Storage Management Credentials above).<br />
<br />
To reset this password, you need to be this user, or root.<br />
<br />
On any Linux system, you can elevate an administrative account to root like this:<br />
<br />
<pre>sudo -i</pre><br />
<br />
And then provide your password.<br />
<br />
You may change the fog password like this:<br />
<br />
<pre>passwd fog</pre><br />
<br />
You'll be prompted for the new password, and then to re-enter it again.<br />
<br />
Please see [[Troubleshoot FTP]] for a more complete article on this topic.<br />
<br />
= .fogsettings =<br />
<br />
Located here: <font color="red">/opt/fog/.fogsettings</font><br />
<br />
You may edit it with Vi like this:<br />
<br />
<pre>vi /opt/fog/.fogsettings</pre><br />
<br />
Instructions on using Vi: [[vi]]<br />
<br />
In this file, there are a whole lot of settings, passwords, addresses, etc. You should re-run the fog installer after changing any settings in this file. The important settings in here in relation to the scope of this article are:<br />
<br />
* <font color="red">password=</font> This is what the installer uses to reset the local account, <font color="red">username</font><br />
** Make sure this is set correctly or you'll find that every time you update or re-run the installer, you will have FTP failure, or have locked yourself out of your server!<br />
<br />
* <font color="red">username=</font> This is the local account to be managed by the installer, and used by fog for many things, to include FTP.<br />
<br />
* <font color="red">snmysqluser=</font> This is the username to access the MySQL server.<br />
<br />
* <font color="red">snmysqlpass=</font> This is the password to access the MySQL server.<br />
<br />
* <font color="red">snmysqlhost=</font> This is the MySQL server address.<br />
<br />
Please see [[.fogsettings]] for a complete listing and details.<br />
<br />
= config.class.php =<br />
<br />
Typically located here: <font color="red">/var/www/html/fog/lib/fog/config.class.php</font><br />
<br />
You may view the file like this:<br />
<br />
<pre>cat /var/www/html/fog/lib/fog/config.class.php</pre><br />
<br />
Used to be in '''older versions''' of FOG, this is where passwords and such would be set. It's no longer necessary to edit this file to set passwords, as the installer completely rebuilds this file every time it's ran. You simply need to make sure that the settings inside of <font color="red">/opt/fog/.fogsettings</font> are correct and then re-run the installer to update this file.<br />
<br />
That said, you can view this file if you wish to see if passwords are being set correctly in it. Note that any changes manually made here but not reflected inside of .fogsettings will '''simply be overwritten''' upon the next fog update or re-run of the installer.</div>Wayne-workman.28155