Uploaded image for project: 'openATTIC'
  1. openATTIC
  2. OP-1880

It is not possible to create a volume in a Vagrant box

    XMLWordPrintable

    Details

      Description

      Currently it is not possible to create a volume within the UI. The UI still shows the new created volume, but in real the volume is not created if you check that via lvs in the CLI.

      To fix that the API_OS_USER variable in backend/settings.py must be modified to 'vagrant'.

      2017-01-26 09:49:19,275 - ERROR - Received error:
      Traceback (most recent call last):
       File "/home/vagrant/openattic/backend/systemd/management/commands/runsystemd.py", line 106, in _run_queue
       with Lockfile("/var/lock/openattic/acquire_lock"):
       File "/home/vagrant/openattic/backend/systemd/lockutils.py", line 190, in __enter__
       self.lock = acquire_lock(self.lockfile, self.max_wait)
       File "/home/vagrant/openattic/backend/systemd/lockutils.py", line 146, in acquire_lock
       openattic = pwd.getpwnam(settings.API_OS_USER)
      KeyError: 'getpwnam(): name not found: openattic'

      Additionally it is necessary to symlink the blkdevzero command to /bin.

      2017-01-26 10:33:07,012 - ERROR - openattic_systemd#_run_queue - Received error:
       Traceback (most recent call last):
       File "/home/vagrant/openattic/backend/systemd/management/commands/runsystemd.py", line 117, in _run_queue
       func(scope, *args, **kwargs)
       File "/home/vagrant/openattic/backend/lvm/systemapi.py", line 148, in lvcreate
       invoke(["blkdevzero", "/dev/%s/%s" % (vgname, lvname)])
       File "/home/vagrant/openattic/backend/systemd/procutils.py", line 57, in invoke
       stderr=subprocess.PIPE, close_fds=close_fds, env=procenv)
       File "/usr/lib/python2.7/subprocess.py", line 710, in _init_
       errread, errwrite)
       File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
       raise child_exception
       OSError: [Errno 2] No such file or directory

      Finally it is necessary to replace the hardcoded 'openattic' owner in FileSystem::configure_blockvolume (see backend/volumes/filesystems/filesystem.py) to API_OS_USER or something else to get this code running in a Vagrant box, too.

      2017-01-26 10:41:33,871 - ERROR - Received error:
       Traceback (most recent call last):
       File "/home/vagrant/openattic/backend/systemd/management/commands/runsystemd.py", line 117, in _run_queue
       func(scope, *args, **kwargs)
       File "/home/vagrant/openattic/backend/volumes/systemapi.py", line 60, in fs_chown
       invoke(cmd)
       File "/home/vagrant/openattic/backend/systemd/procutils.py", line 116, in invoke
       raise SystemError("%s failed: %s" % (cmdline, procerr))
       SystemError: "/bin/chown" "-R" "openattic:users" "/media/test3" failed: /bin/chown: invalid user: 'openattic:users'

        Attachments

          Activity

            People

            Assignee:
            vtheile Theile, Volker
            Reporter:
            vtheile Theile, Volker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: