Giter Club home page Giter Club logo

ginger's People

Contributors

abhiramkulkarni avatar alinefm avatar atreyeemukhopadhyay avatar clnperez avatar danielhb avatar edwardbadboy avatar hari-g-m avatar jan-schneider avatar manjunbm avatar mesmriti avatar nagamani71 avatar peterpennings avatar potula-chandra avatar prsamy avatar rajatgupta21 avatar samhenri avatar sstoppler avatar sureshab avatar truja avatar wenwang1989 avatar yuxinhuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ginger's Issues

Interfaces getlist fails when bond interface is present

bash-4.3# curl -k -u Abhiram86:CHETU@1234 -H "Content-Type: application/json" -H "Accept: application/json" 'https://127.0.0.1:8001/plugins/ginger/network/interfaces'
{
"reason":"KCHIFACE0001E: KCHIFACE0001E",
"code":"404 Not Found"
} bash-4.3#
bash-4.3# ls -l /sys/class/net
total 0
-rw-r--r--. 1 root root 4096 Oct 14 14:49 bonding_masters
lrwxrwxrwx. 1 root root 0 Oct 14 11:53 enp0s25 -> ../../devices/pci0000:00/0000:00:19.0/net/enp0s25
lrwxrwxrwx. 1 root root 0 Oct 14 11:53 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx. 1 root root 0 Oct 14 11:54 virbr0 -> ../../devices/virtual/net/virbr0
lrwxrwxrwx. 1 root root 0 Oct 14 11:54 virbr0-nic -> ../../devices/virtual/net/virbr0-nic
lrwxrwxrwx. 1 root root 0 Oct 14 11:53 wlp3s0 -> ../../devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlp3s0
bash-4.3#

Reevaluate the use of libvirt in model/interfaces.py

This issue is related to bug #1 which I'm currently working on.

After working in the code, I noticed that the behavior is kind of "messed up" running ginger in Fedora 19:

  • when no IP address are set in the interface, setting a new IP in the UI works as intended
  • setting a new IP address wihen the interface already has a valid IP, a second IP is added to the same interface. Note that this is not the expected behavior, otherwise the UI should've shown it
  • setting new IPs will just keep adding more and more IP addresses in the interface.

Besides that, I am a bit skeptical about using libvirt to do that. First because using iproute2 is cleaner and easier to maintain, second because it is error prone. I've posted below one the errors that I've noticed while adding IPs using ginger. If we need to take action about Network Manager to reconfigure an IP in an interface to use libvirt, I would strongly suggest to change the code to use iproute2 instead.

Thoughts?


libvirt: Network Interface Driver error : internal error failed to create (start) interface em1: failed to execute external program - Running 'ifup em1' failed with exit code 4: Error: Connection activation failed: Device not managed by NetworkManager or unavailable
Traceback (most recent call last):
File "", line 1, in
File "/home/danielhb/kimchi/kimchi-upstream/src/kimchi/model/libvirtconnection.py", line 62, in wrapper
ret = f(_args, *_kwargs)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2319, in create
if ret == -1: raise libvirtError ('virInterfaceCreate() failed', net=self)

libvirt.libvirtError: internal error failed to create (start) interface em1: failed to execute external program - Running 'ifup em1' failed with exit code 4: Error: Connection activation failed: Device not managed by NetworkManager or unavailable

Ginger : Removal of libvirt dependency on interfaces

Ginger : Removal of libvirt dependency on interfaces

Ideally All host management plugins should not have any dependency on libvirt or any KVM components as such these plugins can be very well used on machines with out KVM installed.

So I guess forward we should eliminate such dependencies whenever possible.

Manage Filesystems using Ginger

Using the Ginger we would like to list/mount/unmount the filesystems used by the host. Here is the example of filesystems as seen from the host

df -hT

Filesystem              Type      Size  Used Avail Use% Mounted on
devtmpfs                devtmpfs  3.7G     0  3.7G   0% /dev
tmpfs                   tmpfs     3.8G  628K  3.8G   1% /dev/shm
tmpfs                   tmpfs     3.8G  1.2M  3.8G   1% /run
tmpfs                   tmpfs     3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/fedora-root ext4       50G   17G   30G  37% /
tmpfs                   tmpfs     3.8G   87M  3.7G   3% /tmp
/dev/sda1               ext4      477M  159M  289M  36% /boot
/dev/mapper/fedora-home ext4      237G   14G  211G   7% /home
tmpfs                   tmpfs     760M   24K  759M   1% /run/user/1000
tmpfs                   tmpfs     760M     0  760M   0% /run/user/0

Here is the proposal for Ginger to do file system management on the host -

Collection: File Systems

URI: /plugins/ginger/filesystems

Methods:

GET: Retrieve a summarized list of all mounted filesystems

POST: Mount a file system

  • blk_dev : Path of the device to be mounted.
  • mount_point : Mount point for the filesystem

Resource: File System

URI: /plugins/ginger/filesystems/:mount_point

Methods:

GET: Retrieve the full description of the mounted filesystem

  • use%: Percentage of the filesystem used
  • used: Amount of space used in filesystem
  • size: Total size of the filesystem
  • mounted_on: Mount point of the filesystem
  • avail : Total space available on the filesystem
  • device_name : Backing device name of the filesystem.
  • type : Filesystem type.

DELETE: Unmount the Filesystem

make clean does not clean artifacts generated by make rpm

After running make rpm, if you run make clean to clean all the build artifacts and get a clean source tree again, you'll still have files left from the make rpm process.

Steps to reproduce:

  1. make rpm
  2. make clean
  3. git status
    On branch master
    Your branch is up-to-date with 'origin/master'.
    Changes not staged for commit:
    (use "git add ..." to update what will be committed)
    (use "git checkout -- ..." to discard changes in working directory)
modified:   po/de_DE.po
modified:   po/en_US.po
modified:   po/es_ES.po
modified:   po/fr_FR.po
modified:   po/ginger.pot
modified:   po/it_IT.po
modified:   po/ja_JP.po
modified:   po/ko_KR.po
modified:   po/pt_BR.po
modified:   po/ru_RU.po
modified:   po/zh_CN.po
modified:   po/zh_TW.po

Untracked files:
(use "git add ..." to include in what will be committed)

build-aux/compile
po/de_DE.gmo
po/en_US.gmo
po/es_ES.gmo
po/fr_FR.gmo
po/it_IT.gmo
po/ja_JP.gmo
po/ko_KR.gmo
po/pt_BR.gmo
po/ru_RU.gmo
po/stamp-po
po/zh_CN.gmo
po/zh_TW.gmo

no changes added to commit (use "git add" and/or "git commit -a")
[laggarcia@lagarcia ginger]$

Add log level support to Ginger

Hi!
I've created a package for ginger on debian ppc64el but I got a few dependency issues :

  • tuned seems to not exist on debian
  • there are other errors for sensors that is not used on P8 for info retrieving. Onboard sensors info retrieving is not done with a classical tool
  • ginger makes use of IBM Serviceable Event Provider on PowerKVM (package serviceable.event.provider) but it's not available on debian as well and seems also closed source
  • vfio pci is not available on 3.16.0 used on debian ; this seems to be not available on debian's 3.16, but on later kernel (3.19 I saw) and on PowerKVM custom 3.10
  • I don't know about "Cannot find '' in path: No such file or directory"

Btw, I set "log_level = debug" but didn't got much more info about that last one.
Are these messages minor? (not breaking in some way)
Is it planned for ginger to deal with those ? maybe in a less scary way in the logs :)

If you need access to the P8 host on which I'm testing the packaging, just let me know by mail or irc (#4321-ubuntu@bluenet)

Output of kimchi-error.log

Loading AptUpdate features.
Loading AptUpdate features.
Failed to run command: tuned-adm active. [Errno 2] No such file or directory
Failed to run command: tuned-adm active. [Errno 2] No such file or directory
Failed to run command: tuned-adm. [Errno 2] No such file or directory
Failed to run command: tuned-adm. [Errno 2] No such file or directory
rc: 1 error: No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
returned from cmd: sensors -u
rc: 1 error: No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
returned from cmd: sensors -u
Failed to run command: /opt/ibm/seprovider/bin/getSubscriber. [Errno 2] No such file or directory
Failed to run command: /opt/ibm/seprovider/bin/getSubscriber. [Errno 2] No such file or directory
Failed to run command: /opt/ibm/seprovider/bin/sepcli status. [Errno 2] No such file or directory
Failed to run command: /opt/ibm/seprovider/bin/sepcli status. [Errno 2] No such file or directory
[19/Jan/2015:11:10:44] ENGINE Listening for SIGHUP.
[19/Jan/2015:11:10:44] ENGINE Listening for SIGHUP.
[19/Jan/2015:11:10:44] ENGINE Listening for SIGTERM.
[19/Jan/2015:11:10:44] ENGINE Listening for SIGTERM.
[19/Jan/2015:11:10:44] ENGINE Listening for SIGUSR1.
[19/Jan/2015:11:10:44] ENGINE Listening for SIGUSR1.
[19/Jan/2015:11:10:44] ENGINE Bus STARTING
[19/Jan/2015:11:10:44] ENGINE Bus STARTING
[19/Jan/2015:11:10:44] ENGINE Serving on http://127.0.0.1:8010
[19/Jan/2015:11:10:44] ENGINE Serving on http://127.0.0.1:8010
*** Running feature tests ***
*** Running feature tests ***
Cannot find '' in path: No such file or directory
Cannot find '' in path: No such file or directory
rc: 1 error: modprobe: FATAL: Module vfio-pci not found.
returned from cmd: modprobe vfio-pci
rc: 1 error: modprobe: FATAL: Module vfio-pci not found.
returned from cmd: modprobe vfio-pci
Unable to load Kernal module vfio-pci.

Unable to load Kernal module vfio-pci.

Failed to import plugin plugins.ginger.Ginger

Failed to import plugin plugins.ginger.Ginger

because model/utils.py is referring to
from wok.plugins.kimchi.disks import _get_dev_major_min
from wok.plugins.kimchi.disks import _get_dev_node_path

/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/model.py(35)()
-> from users import UsersModel, UserModel
(Pdb) n
/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/model.py(36)()
-> from swaps import SwapsModel, SwapModel
(Pdb) n
ImportError: 'No module named kimchi.disks'
/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/model.py(36)()
-> from swaps import SwapsModel, SwapModel
(Pdb) c

Update an interface on tab "Administration" -> "Network Configuration" fails

Update an interface on tab "Administration" -> "Network Configuration" fails

Work environment:
[ network-scripts]$ cat /etc/fedora-release
Fedora release 21 (Twenty One)

Steps to reproduce:

  1. Go to tab "Administration" -> "Network Configuration" fails
  2. Pick any interface which can be editable
  3. Change ip/netmask values and Save. Save succeeded at least for interface "lo" but when refreshed the page back, values are back to original (whatever before edit)
  4. For other interface still I see edit option enabled but when try to save, save failed "The Server encountered an unexpected condition which prevented it from fulfilling the request."

What is the expected behavior ? Is interface update allowed and what all the cases it allowed ?

Overlapping pop up windows

Environment: x86
Operating system: Fedora
Browser: Firefox
Steps performed:

  1. Installed WOK (https://github.com/kimchi-project/kimchi/tree/wok)
  2. Installed GINGER_WOK (https://github.com/kimchi-project/ginger/tree/ginger_wok)
  3. Started wokd daemon
  4. From browser launched https://127.0.0.1:8001
  5. Login screen displayed
  6. Entered userid and password
    screenshot from 2015-08-11 13 44 45

In the "User Management" section, click on "+" to add user. Add user pop up window will be displayed. Fill in the details, (i gave different passwords in "Password" and "Confirm Password" option) and click on submit.

screenshot from 2015-08-11 13 50 46

after clicking on "Submit" i get below display

screenshot from 2015-08-11 13 52 23

"Warning" window and "Add User" window are overlapped and can't see warning message.

Update README file

A few things to add:

  1. Mention SEP
  2. Getting Started Section

    2a. Include packages that need to be installed, and those that should be installed for certain components.

    2b. How to run from source with kimchi ($ ln -s /ginger/dir/path/ kimchi/plugins/ginger)

Anything else?

Retrieval of tasks using Task API fails

Retrieval of tasks using Task API fails

I am using task API for DASD formatting. It is generating a task when I run the code.
[root@zfwcec164 ginger]# curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"blk_size" : "4096"}' https://9.152.151.164:8001/plugins/ginger/dasddevs/0.0.0224/format

{
"status":"running",
"message":"OK",
"id":"1",
"target_uri":"/dasddevs/dasdc/blksize/4096"
}

But when I am trying to retrieve task status using task api to see whether it is finished or not, it is returning an empty list.
[root@zfwcec164 ginger]# curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" 'https://9.152.151.164:8001/tasks'
[]

When I am trying to retrieve task status with task api using task_id, it is giving this error.
[root@zfwcec164 ~]# curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" 'https://9.152.151.164:8001/tasks/1'

{
"reason":"WOKOBJST0001E: Unable to find 1 in datastore",
"code":"404 Not Found"
}

But then I tried looking at task data stored in wok objectstore_ginger database. From database, I can see the information saved inside the database but the task api is not able to fetch it.

[root@zfwcec164 ginger]# sqlite3 /var/lib/wok/objectstore_ginger
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE objects
(id TEXT, type TEXT, json TEXT, PRIMARY KEY (id, type));
INSERT INTO "objects" VALUES('1','task','{"status": "finished", "message": "OK", "id": "1", "target_uri": "/dasddevs/dasdc/blksize/4096"}');
COMMIT;
sqlite> ;
sqlite> .quit

It seems that Task API is trying to fetch task information from wok objectstore and not from wok objectstore_ginger, due to which it is returning empty list.

Do some update in code is required or am I accessing the task in some wrong way here?

Unit tests failing in Ubuntu

After a handful of new features entering upstream (and a lot more to come) the unit tests started to fail for Ubuntu due to the development being made considering only RPM (Fedora) distros

This issue will be used to track which unit tests are failing. I'll be actively working to try to close the gap between Ubuntu and Fedora, but any help is of course appreciated.

Current score for unit tests in Ubuntu 15.10:

======================================================================
ERROR: test_create_user (test_user_model.UserModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_user_model.py", line 51, in test_create_user
    users_model.create(params)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 185, in create
    gid = get_group_gid(groupname)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 53, in get_group_gid
    adm = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

======================================================================
ERROR: test_creating_existing_user_fails (test_user_model.UserModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_user_model.py", line 76, in test_creating_existing_user_fails
    users_model.create(params)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 185, in create
    gid = get_group_gid(groupname)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 53, in get_group_gid
    adm = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

======================================================================
ERROR: test_create_existing_user_fails (test_libuser.UserAdmTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_libuser.py", line 64, in test_create_existing_user_fails
    users.create_user(user, passwd)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 122, in create_user
    adm = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

======================================================================
ERROR: test_create_group (test_libuser.UserAdmTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_libuser.py", line 76, in test_create_group
    groups = users.get_groups()
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 38, in get_groups
    adm = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

======================================================================
ERROR: test_create_user (test_libuser.UserAdmTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_libuser.py", line 47, in test_create_user
    users.create_user(user, passwd)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 122, in create_user
    adm = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

======================================================================
ERROR: test_get_users_list (test_libuser.UserAdmTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_libuser.py", line 36, in test_get_users_list
    all_users = users.get_users(exclude_system_users=False)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 105, in get_users
    admin = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

======================================================================
ERROR: test_list_existing_groups (test_libuser.UserAdmTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_libuser.py", line 71, in test_list_existing_groups
    groups = users.get_groups()
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/models/users.py", line 38, in get_groups
    adm = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

======================================================================
FAIL: test_format_part (test_partitions.PartitionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_partitions.py", line 87, in test_format_part
    mock_format_part.assert_called_with(fstype, '/dev/' + name)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 334, in assert_called_with
    return mock.assert_called_with(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 925, in assert_called_with
    raise AssertionError('Expected call: %s\nNot called' % (expected,))
AssertionError: Expected call: _makefs('ext4', '/dev/sdb1')
Not called

======================================================================
FAIL: test_create_vg (test_vol_group.VolumeGroupsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_vol_group.py", line 58, in test_create_vg
    mock_create_vg.assert_called_with(vgname, pvpaths)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 334, in assert_called_with
    return mock.assert_called_with(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 925, in assert_called_with
    raise AssertionError('Expected call: %s\nNot called' % (expected,))
AssertionError: Expected call: _create_vg('testvg', ['/dev/sdb1'])
Not called

======================================================================
FAIL: test_create_lv (test_log_volume.LogicalVolumesTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/danielhb/kimchi/src/wok/plugins/ginger/tests/test_log_volume.py", line 58, in test_create_lv
    mock_create_lv.assert_called_with(vgname, size)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 334, in assert_called_with
    return mock.assert_called_with(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 925, in assert_called_with
    raise AssertionError('Expected call: %s\nNot called' % (expected,))
AssertionError: Expected call: _create_lv('testvg', '10M')
Not called

----------------------------------------------------------------------
Ran 68 tests in 14.721s

FAILED (failures=3, errors=7)

ginger wok API exceptions referring to kimchi errors

Installed wok and ginger_wok. Started wokd service.
Sample curl output which refers to Kimchi error code and failed to load corresponding reason.

[suresh@localhost wok]$ curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"name":"virbr3","editable":true,"ipaddr":"192.168.130.14","netmask":"255.255.255.192"}' https://127.0.0.1:8001/plugins/ginger/network/interfaces
Enter host password for user 'root':
{
"reason":"KCHAPI0005E: KCHAPI0005E",
"code":"405 Method Not Allowed"
}

WOK: Firmware update feature is getting displayed on x86 architecture

This bug was created for Kimchi project. But as it is related to Ginger I am moving it to here.
I didn't even tried to reproduce, I am only forwarding to the right project. =)

Please, check kimchi-project/kimchi#709 for more details.

Environment: x86
Operating system: Ubuntu
Browser: Mozilla Firefox
Steps performed:

  1. Installed WOK (https://github.com/kimchi-project/kimchi/tree/wok)
  2. Installed kimchi-wok plugin
  3. Installed ginger-wok plugin
  4. Started wokd daemon
  5. From browser launched https://127.0.0.1:8001
  6. Login screen displayed
  7. Entered userid and password
  8. WOK web page displayed with Kimchi and Ginger tabs
  9. Toggled between Administration tab(Ginger) and any Kimchi plugin tab

Problem: Power (ppc) firmware update feature is getting displayed

https://cloud.githubusercontent.com/assets/12508158/8746620/d6bed6f0-2ca8-11e5-91a5-23a8ff3ed529.jpg

Manage Swap Devices using Ginger

Using the Ginger we would like to list/add/remove the swap devices used by the host. Here is the example of swap devices attached to the host

cat /proc/swaps

Filename    Type    Size    Used    Priority
/dev/dm-2 partition 7864316 679660  -1

Here is the proposal for Ginger to do swap management on the host -

Collection: Swap devices

URI: /plugins/ginger/swaps

Methods:

GET: Retrieve a summarized list of all swap devices
POST: Create a swap device

  • type : Type could be either device or file. Linux allows you to use either the block device or a regular file as a swap device. We would like to have support for both types.
  • size : Only applicable if the swap device type is file. We need to know the size of the regular file that needs to be created which will act as a swap device.
  • file_loc : Absolute path of the device.

Resource: Swap Device

URI: /plugins/ginger/swaps/:device_name

Methods:

GET: Retrieve the full description of a Swap Device

  • filename: File name of the Swap Device
  • type: The type of the Swap Device. partition for the block device and file for the regular file.
  • size: Size of the Swap Device
  • used: Amount of Swap Device space used
  • priority : Priority of the Swap Device

DELETE: Remove the Swap Device

Add workaround for python libuser in Debian/Ubuntu install

After install and run Kimchi and Ginger in Ubuntu, if you open Administration tab (Ginger) it is going to return a server error message.

The error occurs because python-libuser fails with message:
File "/root/kimchi/plugins/ginger/models/users.py", line 234, in _get_user_profile
adm = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': No such file or directory

Seems that packages libuser and libuser1 in Ubuntu does not provide the libuser.conf file.

As workaround it is possible to run "sudo touch /etc/libuser.conf" to fix the problem.
Reference in lunchpad:
https://bugs.launchpad.net/ubuntu/+source/libuser/+bug/1387274

IPV6INIT is not present in lookup and not written into cfg file

bash-4.3# curl -u root -H "Content-Type: application/json" -H "Accept:application/json" -X PUT -d '{
>     "BASIC_INFO": {"DEVICE": "eth0"
>                  },
>     "IPV6_INFO": {"IPV6INIT": "yes",
>        "IPV6_AUTOCONF": "no",
>                "IPV6_DEFROUTE": "yes",
>                "DNSAddresses": ["fe80::120b:a9ff:fe00:4de1","fe80::120b:a9ff:fe00:4de2"],
>                "IPV6_PEERDNS": "yes",
>                "IPV6_PEERROUTES": "yes",
> "IPV6Addresses":[
>       {
>         "PREFIX":"64",
>         "IPADDR":"fe80::221:ccff:fe72:d02e"
>       },
>       {
>         "PREFIX":"24",
>         "IPADDR":"fe80::221:ccff:fe72:d02f"
>       }
>     ],
> "IPV6_DEFAULTGW":"fe80::221:ccff:fe72:d026"
> }
>  }' "http://localhost:8010/plugins/ginger/network/cfginterfaces/eth0"
Enter host password for user 'root':
{
  "IPV4_INFO":{},
  "BASIC_INFO":{
    "DEVICE":"eth0"
  },
  "IPV6_INFO":{
    "IPV6_DEFAULTGW":"fe80::221:ccff:fe72:d026",
    "IPV6_PEERDNS":"yes",
    "IPV6Addresses":[
      {
        "PREFIX":"64",
        "IPADDR":"fe80::221:ccff:fe72:d02e"
      },
      {
        "PREFIX":"24",
        "IPADDR":"fe80::221:ccff:fe72:d02f"
      }
    ],
    "IPV6_DEFROUTE":"yes",
    "DNSAddresses":[
      "fe80::120b:a9ff:fe00:4de1",
      "fe80::120b:a9ff:fe00:4de2"
    ],
    "IPV6_AUTOCONF":"no",
    "IPV6_PEERROUTES":"yes"
  }
}bash-4.3# cat ifcfg-eth0
DEVICE=eth0
IPV6_DEFAULTGW=fe80::221:ccff:fe72:d026
IPV6ADDR_SECONDARIES=fe80::221:ccff:fe72:d02f/24
DNS1=fe80::120b:a9ff:fe00:4de1
IPV6_PEERDNS=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
DNS2=fe80::120b:a9ff:fe00:4de2
IPV6ADDR=fe80::221:ccff:fe72:d02e/64
IPV6_PEERROUTES=yes
bash-4.3# 

IPV6INIT attribute needs to be incorporated

Mock Tests for Ginger-WOK branch

There are no mock tests created for ginger-WOK branch as found in master branch.
I am working on adding them to ginger-WOK, but I noticed the following:

  • The test cases in the master branch call utils defined in models. These have been modified in WOK branch.
    Should the test cases be modified accordingly for WOK branch to use the changed utils?

Changelog missing in source tarball

Hi,
could you add the Changelog file in the released tarball ?
I see it's the case for kimchi but not ginger, though there a script for that in build-aux/genChangelog
Maybe this is linked to issue #9, that is to say the tarballs are not generated the way they should be.
Thanks,
F.

Some unit tests are 'unstable', failing randomly

A couple of unit tests are failing at random. If you run the run_tests.sh script again after the failure there is a chance that it won't fail again. This was tested in a x86_64 running Fedora 22.

One of the tests that are acting randomly:

 ======================================================================
FAIL: test_create_vg (test_vol_group.VolumeGroupsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/danielhb/kimchi/wok/kimchi/src/wok/plugins/ginger/tests/test_vol_group.py", line 58, in test_create_vg
    mock_create_vg.assert_called_with(vgname, pvpaths)
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 334, in assert_called_with
    return mock.assert_called_with(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 925, in assert_called_with
    raise AssertionError('Expected call: %s\nNot called' % (expected,))
AssertionError: Expected call: _create_vg('testvg', ['/dev/sdb1'])
Not called

----------------------------------------------------------------------

I'll update this issue if I see the other test failing again.

Unable to login with newly created kimchi user ,virt user or admin user

When i try to login with created kimchi user,virt user or admin user its throwing message that username and password is incorrect.

I am running kimchi-ginger https://9.152.151.63:8001/#tabs/host "mozilla firefox ESR 31.8.0 ESR".

How to reproduce

1)Install and launch the kimchi.
2)Login with an admin user.(root).
3)Switch to administrator tab
4)Go to User management and create a kimchi user,virt user or admin user
5)Logout from admin user root
6)Login with created kimchi user,virt user or admin user

Actual behavior

1)Login fail with message "Username and password in incorrect."

Expected behavior

1)Login should be successful with created kimchi user,virt user or admin user.

Snaps

i) Created a kimchi user as "test"

nuew_kimchi_user_test

ii)Login fail with kimchi user "test"

login_with_kimchi_user_test

Add basic install documentation in the Wiki page

I installed the Ginger 1.3 debian package after updating to Kimchi 1.5.0 and installing python-libuser. I had to install Ginger with "dpkg -i --ignore-depends=kimchi ginger-1.3.0-0.noarch.deb" because Kimchi was installed from source on my system, therefore causing the Ginger installation fail due to the "unmet" dependency.

Anyway, now that it's installed I go to Kimchi and see absolutely nothing changed. I have restarted Kimchi twice. There is no indication that any plugins were installed anywhere. Is there another step? A URL I should know? Time to read the instructions, right? So I come here to figure out what I'm even supposed to be looking for and see, again, absolutely nothing. There is not one word here saying where to begin, or even how to install it. The readme and install files are literally empty. I can only assume there was anything at all in the 53KB debian package I installed. There is a ticket from February asking for documentation and nobody even responded. What gives?

This project sounds like an extremely useful extension to Kimchi, giving me the exact tools that made me look into other KVM management tools. Can you please take five minutes to tell the world how to turn it on?

Minimize/Maximize options in Administration tab

The Administration tab show a bunch of Ginger features in a listed table, where the first one is, by default, maximezed. You can minimize one item by clicking another one.

Would be nice to be able to minimize the open one without having to open another option.

Wok failing to import ginger plugin on ubuntu 14.04

Trying out the latest ginger code on ubuntu 14.04. None of the ginger API URIs are working (getting 404). Here is a snippet from wok-errors.log

Failed to import plugin plugins.ginger.Ginger
Failed to import plugin plugins.ginger.Ginger
[29/Oct/2015:16:15:49] ENGINE Listening for SIGHUP.
[29/Oct/2015:16:15:49] ENGINE Listening for SIGHUP.
[29/Oct/2015:16:15:49] ENGINE Listening for SIGTERM.
[29/Oct/2015:16:15:49] ENGINE Listening for SIGTERM.
[29/Oct/2015:16:15:49] ENGINE Listening for SIGUSR1.
[29/Oct/2015:16:15:49] ENGINE Listening for SIGUSR1.
[29/Oct/2015:16:15:49] ENGINE Bus STARTING
[29/Oct/2015:16:15:49] ENGINE Bus STARTING
[29/Oct/2015:16:15:49] ENGINE Serving on 127.0.0.1:8010
[29/Oct/2015:16:15:49] ENGINE Serving on 127.0.0.1:8010
*** Running feature tests *** 
*** Running feature tests *** 
internal error: Child process (/sbin/showmount --no-headers --exports localhost) unexpected exit status 1
internal error: Child process (/sbin/showmount --no-headers --exports localhost) unexpected exit status 1
*** Feature tests completed *** 
*** Feature tests completed *** 
[29/Oct/2015:16:15:50] ENGINE Bus STARTED
[29/Oct/2015:16:15:50] ENGINE Bus STARTED
[29/Oct/2015:16:16:12] ENGINE Started monitor thread 'Session cleanup'.
[29/Oct/2015:16:16:12] ENGINE Started monitor thread 'Session cleanup'.

Update existing Ginger and Gingerbase objstores with 'Version' field

Originally created on kimchi-project/kimchi#764
Please, check the discussion there.

After the patch set "Upgrade ObjectStore data to Kimchi-2.0" went upstream, existing Ginger objstore files fails to load with the following error:

[23/Nov/2015:10:45:18] ENGINE Started monitor thread 'Autoreloader'.
[23/Nov/2015:10:45:19] ENGINE Serving on http://127.0.0.1:37848
[23/Nov/2015:10:45:19] ENGINE Bus STARTED
Traceback (most recent call last):
File "/home/danielhb/kimchi/wok/kimchi/src/wok/asynctask.py", line 65, in _save_helper
session.store('task', self.id, obj)
File "/home/danielhb/kimchi/wok/kimchi/src/wok/objectstore.py", line 92, in store
(ident, obj_type, jsonstr, version))
OperationalError: table objects has no column named version

WOKASYNC0002E: WOKASYNC0002E

The changes made in Kimchi object store must be done in Ginger and Gingerbase object stores as well.

configure:1987: error: package version not defined

Hi,
I get the tarball of ginger from github to produce a debian package :
https://github.com/kimchi-project/ginger/tags and after running autoreconf,
the configure fails with :

configure: error: package version not defined

This seems to be due to PKG_VERSION not defined and checking further,
it should be defined by build-aux/pkg-version :

PKG_VERSION=`git describe --tags --match "ginger-[0-9]*" 2> /dev/null || cat VERSION 2> /dev/null`

Even if I put a build dependency to git in the debian environment, there is no .git in the tarball and the VERSION file is not there either. The latter should be produced from Makefile :

VERSION:
        @if test -d .git; then                                \
                git describe --abbrev=0 > $@;                     \
        fi

it is supposed to be generated as a result of make dist before delivering the tarball.

For now, I've patched pkg-version with the hardcoded version of ginger in the debian package :

-PKG_VERSION=`git describe --tags --match "ginger-[0-9]*" 2> /dev/null || cat VERSION 2> /dev/null`
+PKG_VERSION=`git describe --tags --match "ginger-[0-9]*" 2> /dev/null || echo ginger-1.3.0 2> /dev/null`

But I guess the source tarballs should provided a VERSION file already.

Manage Physical Volumes using Ginger

Using the Ginger we would like to list/create/remove the Physical Volumes used by the host. Here is the example of Physical Volumes as seen from the host

pvdisplay

  --- Physical volume ---
  PV Name               /dev/mapper/luks-92ee4956-3fd1-47fa-a603-9b8ad867f66d
  VG Name               fedora
  PV Size               297.60 GiB / not usable 2.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              76185
  Free PE               16
  Allocated PE          76169
  PV UUID               Yce0X3-H5vz-65P3-u7Fk-s7Nv-G903-4QJDnb

  "/dev/loop0" is a new physical volume of "10.00 MiB"
  --- NEW Physical volume ---
  PV Name               /dev/loop0
  VG Name               
  PV Size               10.00 MiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               u7OOoW-rL9W-DdJN-kHeM-doXt-grLD-S9yOdc

Here is the proposal for Ginger to do Physical Volume management on the host -

Collection: Physical Volumes

URI: /plugins/ginger/pvs

Methods:

GET: Retrieve a summarized list of all physical volumes

POST: Create a physical volume

  • pv_name : Path of the device to be used as PV.

Note - Default options are used for creating the PV. Later releases can implement other options.

Resource: Physical Volume

URI: /plugins/ginger/pvs/:pv_name

Methods:

GET: Retrieve the full description of the physical volume

  • PvName: Name of the physical volume
  • Allocatable: If the PV is allocatable, value is 'yes' otherwise 'no'
  • PvUUID: UUID of the physical volume
  • TotalPE: Total physical extent
  • AllocatedPE : Amount of physical extent allocated
  • PvSize : Size of the physical volume
  • PeSize : Size of the physical extent
  • FreePE : Number of free PEs
  • VgName : Name of the volume group to which the PV belongs

DELETE: Remove the physical volume

Note - Proposal to include volume group management and LVM management could be made at a later stage

List only those interfaces which are physically connected

Ginger version 1.2.1 lists all physically cable connected/disconnected interfaces.
While configuring network for an interface that doesn't have a cable connected, the following error is printed but nothing happens in UI:

GINNET0004E: Unable to update interface configuration. Details: internal error: failed to create (start) interface <iface_name>: unspecified error - interface <iface_name> failed to become active - possible disconnected cable.

Unable to compile Ginger

Hi,

After latest merges in Ginger code, I am not able to do make.

echo "Compiling .scss file src/ginger.scss"
Compiling .scss file src/ginger.scss
sassc -s expanded src/ginger.scss ginger.css
echo "Compiling .scss file src/host-admin.scss"
Compiling .scss file src/host-admin.scss
sassc -s expanded src/host-admin.scss host-admin.css
sassc: error: Error: file to import not found or unreadable: ../../../../../../../ui/css/src/modules/wok-variables
       Current dir: /home/harshal/git/ginger/ui/css/src/
        on line 20 of src/host-admin.scss
>> @import "../../../../../../../ui/css/src/modules/wok-variables";
   --------^

make[3]: *** [host-admin.css] Error 1
make[3]: Leaving directory `/home/harshal/git/ginger/ui/css'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/harshal/git/ginger/ui/css'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/harshal/git/ginger/ui'
make: *** [all-recursive] Error 1

Administration tab fails to load

I've compiled Kimchi and Ginger from source on an Ubuntu 14.04 system.
Everything works fine except I'm unable to open the administration tab.

The following error show in the kimchi log file

[17/Oct/2015:16:28:51] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/kimchi/root.py", line 92, in default
    return template.render(page, kwargs)
  File "/usr/lib/python2.7/dist-packages/kimchi/template.py", line 109, in render
    return render_cheetah_file(resource, data)
  File "/usr/lib/python2.7/dist-packages/kimchi/template.py", line 95, in render_cheetah_file
    return Template(file=filename, searchList=params).respond()
  File "_usr_share_kimchi_plugins_ginger_ui_pages_host_admin_html_tmpl.py", line 106, in respond
  File "/usr/lib/python2.7/gettext.py", line 484, in translation
    raise IOError(ENOENT, 'No translation file found for domain', domain)
IOError: [Errno 2] No translation file found for domain: 'ginger'

The file /etc/libuser.conf is present on my system.
Any pointers in how to solve this issue?

Optimize ginger plugin for loading the modules

Currently when we define new resource and collections, it needs to be added/imported to init.py , ginger.py and model.py .

Instead of that we can optimize to load the newly added files automatically similar to kimchi plugin and make this process easy for adding new resource/collection to these files.

./autogen.sh --- system failed with error

  1. Down loaded the source code from https://github.com/kimchi-project/ginger using "Download ZIP".
  2. Extracted the zip file
  3. Run autogen.sh failed with the following
    [chandra@localhost ginger-master]$ ./autogen.sh --system
    configure.ac:41: installing 'build-aux/compile'
    configure.ac:41: installing 'build-aux/config.guess'
    configure.ac:41: installing 'build-aux/config.sub'
    configure.ac:35: installing 'build-aux/install-sh'
    configure.ac:35: installing 'build-aux/missing'
    Makefile.am:29: installing 'build-aux/py-compile'
    configure: loading site script /usr/share/config.site
    configure: error: package version not defined

Machine Details: Fedora 21
$ uname -a
Linux localhost.localdomain 3.18.3-201.fc21.x86_64 #1 SMP Mon Jan 19 15:59:31 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

But when I tried download source code using git command "git clone https://github.com/kimchi-project/ginger" instead "Download ZIP", autogen.sh went fine with out any issues. Now I am able to install ginger successfully.

So was there a difference in git vs "Download ZIP" content ?

Thanks in advance,
Chandra

augeas warning message after running tests and exiting WoK

This warning message started after pushing the filesystem feature upstream:

Exception AttributeError: "'NoneType' object has no attribute '_libaugeas'" in <bound method Augeas.del of <augeas.Augeas object at 0x7f368bae9210>> ignored

I've investigated a bit and it appears that it's some misuse of the package. More info here: https://bugzilla.redhat.com/show_bug.cgi?id=1085835 .

This is not a critical issue but an annoying one. I appreciate if anyone can take a look into it, otherwise I'll do it when possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.