Great, thanks. I wanted to post the question just incase there was something else in the code that needed to be know.
It is all working as advertised now
Great, thanks. I wanted to post the question just incase there was something else in the code that needed to be know.
It is all working as advertised now
When I perform the git pull to obtain the latest Trunk, I get an error that changes need to be committed and then the git aborts. Here is the full transcript from the git pull. I have not manually made any changes to the referenced file.
root@srv01309:/opt/fogproject# git pull
remote: Counting objects: 289, done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 289 (delta 177), reused 147 (delta 147), pack-reused 69
Receiving objects: 100% (289/289), 2.37 MiB | 3.87 MiB/s, done.
Resolving deltas: 100% (182/182), completed with 50 local objects.
From https://github.com/fogproject/fogproject
456baa8..b84bae1 dev-branch -> origin/dev-branch
8f1e322..305260c svn -> origin/svn
Updating b8eb6fb..b84bae1
error: Your local changes to the following files would be overwritten by merge:
rpttmp/Hosts and Users.php
Please, commit your changes or stash them before you can merge.
Aborting
A few days ago we upgraded from v1.2 to Trunk 6050 with @Tom-Elliott help. After this upgrade we were not able to push any images that were made with v1.2. Today I updated to Trunk 6128 and still having the issue. Thanks!
Update for this topic.
After remounting the SAN to a different folder the image was still getting stuck in the dev directory. With @Tom-Elliott’s help we did an in-place upgrade to the latest Trunk. After doing this the image moved properly and there were no more issues. Thanks @Tom-Elliott!
@Tom-Elliott Thank Tom. Just sent you a chat
@Wayne-Workman I did update the GUI as well. Unfortunately I’m still getting the same result.
@Wayne-Workman I did have the dev directories set to async. I have moved the mount to /img_archive, updated the export file, and trying again.
@Wayne-Workman Here is what I have… I have an internal RAID array mounted to /images. Then I have the SAN mounted to /images/archive. (I did this because I thought it would be more friendly to FOG that way.) I can certainly remount the SAN to a different folder and give that a try. (I had had that thought as well.)
Here is what I have in my /etc/exports file:
/images *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)
/images/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)
/images/archive *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=2)
/images/archive/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=3)
@Wayne-Workman Still no luck…still stuck in the dev directory.
@Wayne-Workman Yep saw that myself. Since the iscsi is going across a 1Gbit link I’m changing it to 30 and will try again. I’ll keep you posted. Thanks!
<?php
/** \class FOGFTP
Globally accessible class.
It does the FTP Taskings for us.
Now that we're using iPXE, it's really
only used for Image Replication and upload tasks.
*/
class FOGFTP extends FOGGetSet
{
// Data
public $data = array(
'host' => '',
'username' => '',
'password' => '',
'port' => 21,
'timeout' => 10
);
// Links
private $link;
private $loginLink;
private $lastConnectionHash;
public $passiveMode = true;
public function connect()
{
// Return if - already connected && last connection is the same || details unset
$connectionHash = md5(serialize($this->data));
if (($this->link && $this->lastConnectionHash == $connectionHash) || !$this->get('host') || !$this->get('username') || !$this->get('password') || !$this->get('port'))
return $this;
// Connect
$this->link = @ftp_connect($this->get('host'), $this->get('port'), $this->get('timeout'));
if (!$this->link)
{
$error = error_get_last();
throw new Exception(sprintf('%s: Failed to connect. Host: %s, Error: %s', get_class($this), $this->get('host'), $error['message']));
}
// Login
if (!$this->loginLink = @ftp_login($this->link, $this->get('username'), $this->get('password')))
{
$error = error_get_last();
throw new Exception(sprintf('%s: Login failed. Host: %s, Username: %s, Password: %s, Error: %s', get_class($this), $this->get('host'), $this->get('username'), $this->get('password'), $error['message']));
}
if ($this->passiveMode)
ftp_pasv($this->link, true);
// Store connection hash
$this->lastConnectionHash = $connectionHash;
// Return
return $this;
}
public function close($if = true)
{
// Only if connected
if ($this->link && $if)
{
// Disconnect
@ftp_close($this->link);
// unset connection variable
unset($this->link);
}
// Return
return $this;
}
public function put($remotePath, $localPath, $mode = FTP_ASCII)
{
// Put file
if (!@ftp_put($this->link, $remotePath, $localPath, $mode))
{
$error = error_get_last();
throw new Exception(sprintf('%s: Failed to %s file. Remote Path: %s, Local Path: %s, Error: %s', get_class($this), __FUNCTION__, $remotePath, $localPath, $error['message']));
}
// Return
return $this;
}
public function rename($remotePath, $localPath)
{
if(@ftp_nlist($this->link,$localPath))
{
if(!@ftp_rename($this->link, $localPath, $remotePath))
{
$error = error_get_last();
throw new Exception(sprintf('%s: Failed to %s file. Remote Path: %s, Local Path: %s, Error: %s', get_class($this), __FUNCTION__, $remotePath, $localPath, $error['message']));
}
}
return $this;
}
public function chdir($path)
{
if (@ftp_chdir($this->link, $path))
return $this;
return false;
}
public function size($pathfile)
{
$size = 0;
if (@ftp_size($this->link,$pathfile) == -1)
{
$filelist = @ftp_nlist($this->link,$pathfile);
if ($filelist)
{
foreach($filelist AS $file)
$size += @ftp_size($this->link,$file);
}
}
else
$size = @ftp_size($this->link, $pathfile);
return ($size > 0 ? $size : 0);
}
public function mkdir($remotePath)
{
return @ftp_mkdir($this->link,$remotePath);
}
public function delete($path)
{
if (!(@ftp_delete($this->link, $path)||@ftp_rmdir($this->link,$path)))
{
$filelist = @ftp_nlist($this->link,$path);
if ($filelist)
{
foreach($filelist AS $file)
$this->delete($file);
$this->delete($path);
}
}
// Return
return $this;
}
}
Hi Wayne,
I don’t have FOG_FTP_TIMEOUT under the General Settings.
I’m using v1.2.0
There is no timeout under tftp in the settings…
I have added an iscsi SAN disk and mounted it to /images/archive on the server. I added the .mntcheck files to both the /images/archive and /images/archive/dev directories, changed the owner to fog:root, and set permissions to 777 for all files and directories in the new archive directory. I was able to successfully write an image to the /images/archive/dev/<MAC ADDRESS> but then it is not being moved into the /images/archive directory. I also made sure that the management username and password in the node settings was correct. I can manually ftp into the server and move the folder. Anyone have any ideas?
v/r
Garry LIenhard
Hi Wayne,
Thank you that worked perfectly!
When I tried to access the server after a reboot I got the error above. Through troubleshooting, I found that it was because mysql had some kind of hiccup and needed to be restarted. I’m guessing that mysql after FOG and that is why it had the problem. How do I get mysql to start before FOG? I’m running Ubuntu 14.04 with FOG 1.2. Thanks in advance!