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

Added new storage node - images getting stuck in dev directory

Scheduled Pinned Locked Moved Solved
FOG Problems
4
22
6.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    glienhard
    last edited by Jan 21, 2016, 5:24 PM

    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

    T 1 Reply Last reply Jan 21, 2016, 5:46 PM Reply Quote 0
    • T
      Tom Elliott @glienhard
      last edited by Jan 21, 2016, 5:46 PM

      @glienhard what version of fog? That aside I Believe this to be due to the ftp timeout. This can be changed in fog settings on the GUI.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

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

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

      1 Reply Last reply Reply Quote 0
      • G
        glienhard
        last edited by Jan 21, 2016, 5:57 PM

        I’m using v1.2.0

        There is no timeout under tftp in the settings…

        W 1 Reply Last reply Jan 21, 2016, 6:05 PM Reply Quote 0
        • W
          Wayne Workman @glienhard
          last edited by Jan 21, 2016, 6:05 PM

          @glienhard FOG Web Interface -> FOG Configuration -> FOG Settings -> General Settings -> FOG_FTP_TIMEOUT

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
          Daily Clean Installation Results:
          https://fogtesting.fogproject.us/
          FOG Reporting:
          https://fog-external-reporting-results.fogproject.us/

          1 Reply Last reply Reply Quote 0
          • G
            glienhard
            last edited by Jan 21, 2016, 6:06 PM

            Hi Wayne,

            I don’t have FOG_FTP_TIMEOUT under the General Settings.

            W 1 Reply Last reply Jan 21, 2016, 6:32 PM Reply Quote 0
            • G
              glienhard
              last edited by Jan 21, 2016, 6:09 PM

              0_1453399702155_upload-139d7df0-8ac8-445c-860b-c820dca2c5b8

              1 Reply Last reply Reply Quote 0
              • W
                Wayne Workman @glienhard
                last edited by Jan 21, 2016, 6:32 PM

                @glienhard said:

                Hi Wayne,

                I don’t have FOG_FTP_TIMEOUT under the General Settings.

                Then it must be only in FOG Trunk right now (developmental version). Feel free to upgrade to trunk, or you will just have to change the command yourself in the web code if you stay on 1.2.0. And changing it yourself isn’t a big deal, really. You’re just changing a number (or maybe adding an argument to a command).

                Here’s the contents of my /var/www/html/fog/lib/fog/fogftp.class.php. Post yours and maybe we can figure something out?

                <?php
                class FOGFTP extends FOGGetSet {
                    protected $data = array(
                        'host' => '',
                        'username' => '',
                        'password' => '',
                        'port' => '',
                        'timeout' => '',
                    );
                    private $link;
                    private $loginLink;
                    private $lastConnectionHash;
                    public $passiveMode = true;
                    public function __destruct() {
                        $this->close(true);
                    }
                    public function connect() {
                        unset($error,$result);
                        $this->set('port',$this->getSetting('FOG_FTP_PORT'));
                        $this->set('timeout',$this->getSetting('FOG_FTP_TIMEOUT'));
                        $connectionHash = md5(serialize($this->data));
                        $connected = $this->link && $this->lastConnectionHash == $connectionHash;
                        if ($connected) return $this;
                        if (!($this->link = @ftp_connect($this->get('host'), $this->get('port'), $this->get('timeout')))) {
                            $error = error_get_last();
                            throw new Exception(sprintf('%s: Failed to connect. Host: %s, Error: %s', get_class($this), $this->get('host'), $error['message']));
                        } else 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);
                        $this->lastConnectionHash = $connectionHash;
                        return $this;
                    }
                    public function close($if = true) {
                        if ($this->link && $if) @ftp_close($this->link);
                        $this->link = null;
                        return $this;
                    }
                    public function put($remotePath, $localPath, $mode = FTP_BINARY) {
                        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 $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 nlist($remotePath) {
                        return @ftp_nlist($this->link,$remotePath);
                    }
                    public function exists($path) {
                        $dirlisting = $this->nlist(dirname($path));
                        return in_array($path,$dirlisting);
                    }
                    public function chdir($path) {
                        return @ftp_chdir($this->link, $path);
                    }
                    public function size($pathfile) {
                        $size = 0;
                        $filelist = @ftp_rawlist($this->link,$pathfile);
                        if ($filelist) {
                            foreach($filelist AS $i => $file) {
                                $fileinfo = preg_split('#\s+#',$file,null,PREG_SPLIT_NO_EMPTY);
                                $size += $fileinfo[4];
                            }
                            unset($file);
                        }
                        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 $i => &$file) $this->delete($file);
                                unset($file);
                                $this->delete($path);
                            }
                        }
                        return $this;
                    }
                }
                

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                Daily Clean Installation Results:
                https://fogtesting.fogproject.us/
                FOG Reporting:
                https://fog-external-reporting-results.fogproject.us/

                G 1 Reply Last reply Jan 21, 2016, 6:36 PM Reply Quote 0
                • W
                  Wayne Workman
                  last edited by Jan 21, 2016, 6:34 PM

                  Also, I found this on the web concerning the command used. It gives us a base to work from.
                  http://php.net/manual/en/function.ftp-connect.php

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                  Daily Clean Installation Results:
                  https://fogtesting.fogproject.us/
                  FOG Reporting:
                  https://fog-external-reporting-results.fogproject.us/

                  1 Reply Last reply Reply Quote 0
                  • G
                    glienhard @Wayne Workman
                    last edited by Wayne Workman Jan 21, 2016, 12:36 PM Jan 21, 2016, 6:36 PM

                    @Wayne-Workman

                    <?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;
                            }
                    }
                    
                    W 1 Reply Last reply Jan 21, 2016, 6:37 PM Reply Quote 0
                    • W
                      Wayne Workman @glienhard
                      last edited by Jan 21, 2016, 6:37 PM

                      @glienhard Oh well that couldn’t be easier. Change the timeout from 10 to something like 20 or 30.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                      Daily Clean Installation Results:
                      https://fogtesting.fogproject.us/
                      FOG Reporting:
                      https://fog-external-reporting-results.fogproject.us/

                      G 2 Replies Last reply Jan 21, 2016, 6:39 PM Reply Quote 0
                      • G
                        glienhard @Wayne Workman
                        last edited by Jan 21, 2016, 6:39 PM

                        @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!

                        1 Reply Last reply Reply Quote 0
                        • G
                          glienhard @Wayne Workman
                          last edited by Jan 21, 2016, 6:55 PM

                          @Wayne-Workman Still no luck…still stuck in the dev directory.

                          W 1 Reply Last reply Jan 21, 2016, 7:13 PM Reply Quote 0
                          • W
                            Wayne Workman @glienhard
                            last edited by Wayne Workman Jan 21, 2016, 1:14 PM Jan 21, 2016, 7:13 PM

                            @glienhard said:

                            @Wayne-Workman Still no luck…still stuck in the dev directory.

                            Can you verify what the root directory is on this SAN disk? Using ftp, change directory to the “root” directory with cd / and take a look around and figure out where you are.

                            also, to me, it’s just really confusing to have this new storage inside the old one. You can easily mount it to a new directory, something like /SANimages and then just copy/paste the existing entries in /etc/exports so you have a new NFS export called /SANimages, just increment the ID and change the paths.

                            Just some ideas.

                            @Tom-Elliott thoughts on why it isn’t working?

                            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                            Daily Clean Installation Results:
                            https://fogtesting.fogproject.us/
                            FOG Reporting:
                            https://fog-external-reporting-results.fogproject.us/

                            G 1 Reply Last reply Jan 21, 2016, 7:22 PM Reply Quote 0
                            • G
                              glienhard @Wayne Workman
                              last edited by Jan 21, 2016, 7:22 PM

                              @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)

                              W 1 Reply Last reply Jan 21, 2016, 7:24 PM Reply Quote 0
                              • W
                                Wayne Workman @glienhard
                                last edited by Wayne Workman Jan 21, 2016, 1:24 PM Jan 21, 2016, 7:24 PM

                                @glienhard How about…

                                /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)
                                /archive *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=2)
                                /archive/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=3)
                                

                                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                                Daily Clean Installation Results:
                                https://fogtesting.fogproject.us/
                                FOG Reporting:
                                https://fog-external-reporting-results.fogproject.us/

                                G 1 Reply Last reply Jan 21, 2016, 7:44 PM Reply Quote 0
                                • G
                                  glienhard @Wayne Workman
                                  last edited by Jan 21, 2016, 7:44 PM

                                  @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.

                                  W 1 Reply Last reply Jan 21, 2016, 7:53 PM Reply Quote 0
                                  • W
                                    Wayne Workman @glienhard
                                    last edited by Jan 21, 2016, 7:53 PM

                                    @glienhard Update the new storage node too, in the web ui.

                                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                                    Daily Clean Installation Results:
                                    https://fogtesting.fogproject.us/
                                    FOG Reporting:
                                    https://fog-external-reporting-results.fogproject.us/

                                    G 1 Reply Last reply Jan 21, 2016, 8:27 PM Reply Quote 0
                                    • G
                                      glienhard @Wayne Workman
                                      last edited by Jan 21, 2016, 8:27 PM

                                      @Wayne-Workman I did update the GUI as well. Unfortunately I’m still getting the same result.

                                      T 1 Reply Last reply Jan 21, 2016, 8:40 PM Reply Quote 0
                                      • T
                                        Tom Elliott @glienhard
                                        last edited by Jan 21, 2016, 8:40 PM

                                        @glienhard If you’re available, possibly, to do a teamviewer session to try to figure out why it’s not ftping, it’d be really amazing. Just hit me up in chat please (so as not to give out information on people being able to connect.)

                                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

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

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

                                        G 1 Reply Last reply Jan 21, 2016, 8:43 PM Reply Quote 1
                                        • G
                                          glienhard @Tom Elliott
                                          last edited by Jan 21, 2016, 8:43 PM

                                          @Tom-Elliott Thank Tom. Just sent you a chat

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            4/22
                                            Last post

                                          156

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project