[PATCH V2 0/7] (WIP) Storagepool SCSI/FC
by Rodrigo Trujillo
There is still some work to be done in this functionality.
V2:
- Implements Fibre Channel devices discover in the host
- Allow vms_create receive a volume to create the disk (if pool is SCSI)
- Create basic UI to select SCSI Host when creating SCSI FC pool
- Draft of UI to select LUN to create new VM when template has a SCSI
pool configured. (Need help of UI guys here!)
Rodrigo Trujillo (7):
Storagepool SCSI/FC: SCSI/Fibre Channel backend implementation
Storagepool SCSI/FC: Function to check libvirt version
Storagepool SCSI/FC: Assign SCSI fibre channel LUN as disk to a new
guest
Storagepool SCSI/FC: Implement node devices API backend
Storagepool SCSI/FC: Implement UI when a FC scsi_host will be the pool
Storagepool SCSI/FC: Create new VM with given SCSI FC LUN (backend)
Storagepool SCSI/FC: Draft UI to allow user to select a LUN to new VM
docs/API.md | 7 ++
src/kimchi/API.json | 19 ++++-
src/kimchi/control/devices.py | 40 +++++++++++
src/kimchi/control/host.py | 3 +
src/kimchi/model.py | 117 +++++++++++++++++++++++++++++--
src/kimchi/utils.py | 18 ++++-
src/kimchi/vmtemplate.py | 48 ++++++++++++-
ui/js/src/kimchi.api.js | 24 +++++++
ui/js/src/kimchi.guest_add_main.js | 32 +++++++++
ui/js/src/kimchi.storagepool_add_main.js | 40 ++++++++++-
ui/pages/i18n.html.tmpl | 1 +
ui/pages/storagepool-add.html.tmpl | 12 ++++
12 files changed, 350 insertions(+), 11 deletions(-)
create mode 100644 src/kimchi/control/devices.py
--
1.8.4.2
10 years, 10 months
Re: [Kimchi-devel] RFC: "Add disk to existing logical storage> pool"
by Frank Novak
> Date: Fri, 31 Jan 2014 11:42:47 -0200
> From: Daniel H Barboza <danielhb(a)linux.vnet.ibm.com>
> To: kimchi-devel(a)ovirt.org
> Subject: [Kimchi-devel] RFC: "Add disk to existing logical storage
> pool"
> Message-ID: <52EBA857.2020302(a)linux.vnet.ibm.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hello!
>
> I am almost delivering a first version of this feature but now I am
> having doubts in how it might work or not.
>
> My implementation would use vgextend and add a disk to an existing LVM
> pool. The question is that, in this process, all existing data in the
> added partition will be deleted. Is this ok? We can warn the user about
> it, of course. But I am not sure if this is the intended design.
>
> I've spoken with Aline a while ago and she agreed that the
> implementation would function similar to what we have today when
> creating a new LVM pool. We simply "do not care" about the potential
> data loss when adding the disk to an existing pool.
>
> Any thoughts?
>
Certainly if we are going to trash data, we do need to warn the user and
make sure they want to proceed...
I don't think that is necessarily bad, should be expected for knowledgable
admin...
Not sure there's an easy answer for add w/o loosing data (well certainly
backup/restore after)
Primary use case driving this was really the case of adding a new physical
disk to system and then add this to the storage pool..
I guess someone could want to take an in use disk from some other system,
or elsewhere on the same system, and want ot add that to the pool, thinking
that they could still use what was already on there... At this point, I
think we stick to KISS... maybe we include the warning/caveat in the Help
page for this as well...
>
> thanks!
>
>
>
> ------------------------------
>
Cheers,
Frank
-----------------------------------------------------------------------------------------------------------------------
Frank Novak ( 诺帆 nuò、fān )
STSM, SCEM Open Hypervisor
IBM Linux Technology Center
US: fnovak(a)us.ibm.com ; Notes: Frank Novak/Watson/IBM @IBMUS
cell : 919-671-7966
-------------------------------------------------------------------------------------------------------------------------
10 years, 10 months
[PATCH 0/4] Host's software update support
by Paulo Vital
This patch set provides support to host's software update operations.
At this point, an agnostic class is providing support to backend and
REST API operations. In addition, YUM (for RHEL and Fedora), APT (for
Debian and Ubuntu) and ZYPPER (for OpenSuse) specific classes are provided
to support the operation os each software update system.
There's no test case to check backend once the software update information
is volatile to each system/box.
To test the REST API, execute the following commands (all them are agnostic
of the host's distro):
1) Get list of all packages to be updated in the host:
$curl -H 'Content-type: application/json' -H 'Accept: application/json' http://localhost:8000/host/softwareupdate/ -X GET
2) Update the host system:
$ curl -H 'Content-type: application/json' -H 'Accept: application/json' http://localhost:8000/host/softwareupdate/update -X POST -d ''
Paulo Vital (4):
Host's software update: Update API.md
Host's software update: Update REST API
Host's software update: Update backend.
Host's software update: Update Makefile
docs/API.md | 20 ++++
src/kimchi/Makefile.am | 1 +
src/kimchi/control/host.py | 12 ++
src/kimchi/mockmodel.py | 12 ++
src/kimchi/model.py | 8 ++
src/kimchi/swupdate.py | 279 +++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 332 insertions(+)
create mode 100644 src/kimchi/swupdate.py
--
1.8.3.1
10 years, 10 months
[PATCH V2]Avoid useless libvirt error log produced by featuretest
by apporc
v2-v1:
1. Just hide the portocol type error, leave other error messages as it is.(Thanks Cristian)
2. Unregister the error handler when necessary.(Thanks Cristian)
3. Keep back kimchi log "*** Running feature tests ***", etc.(Thanks Cristian)
4. Move libvirt error handler function inside of Featuretest.(Thanks Aline)
v1:
Avoid useless libvirt error log produced by featuretest
apporc (1):
Avoid useless libvirt error log produced by featuretests
src/kimchi/featuretests.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
--
1.7.9.5
10 years, 10 months
[PATCH V2 1/2] Plugins: Fix plugins framework in kimchi
by Rodrigo Trujillo
If the plugin tab name string is not found in kimchi i18n file, the
tab name is set as 'unknown'. This patch also add more messages to
kimchis log, and fixes a problem with the plugins extra tabs file
location
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/server.py | 13 ++++++++++---
ui/js/src/kimchi.main.js | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index b820263..4fcb0df 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -28,6 +28,7 @@ import logging.handlers
import os
import sslcert
+
from kimchi import auth
from kimchi import config
from kimchi import model
@@ -208,14 +209,19 @@ class Server(object):
script_name = plugin_config['kimchi']['uri']
del plugin_config['kimchi']
+ tabs_extra_file = config.get_plugin_tab_xml(plugin_name)
plugin_config['/ui/config/tab-ext.xml'] = {
'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- config.get_plugin_tab_xml(plugin_name),
+ 'tools.staticfile.filename': tabs_extra_file,
'tools.nocache.on': True}
except KeyError:
continue
-
+ except IOError as e:
+ msg = "Failed to load plugin tabs file %s" %tabs_extra_file
+ cherrypy.log.error_log.error(msg)
+ cherrypy.log.error_log.error('Ignoring plugin "%s"',
+ plugin_name)
+ continue
try:
plugin_app = import_class(plugin_class)()
except ImportError:
@@ -223,6 +229,7 @@ class Server(object):
plugin_class)
continue
cherrypy.tree.mount(plugin_app, script_name, plugin_config)
+ cherrypy.log('Plugin loaded: %s' %plugin_class)
def _init_ssl(self, options):
ssl_server = cherrypy._cpserver.Server()
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js
index cc8afee..8b84a34 100644
--- a/ui/js/src/kimchi.main.js
+++ b/ui/js/src/kimchi.main.js
@@ -211,7 +211,7 @@ kimchi.getTabHtml = function(url) {
$(xmlData).find('tab').each(function() {
var $tab = $(this);
var titleKey = $tab.find('title').text();
- var title = i18n[titleKey];
+ var title = i18n[titleKey] || titleKey;
var path = $tab.find('path').text();
tabsHtml += "<li><a class='item' href=" + path + ">" + title + "</a></li>";
});
--
1.8.4.2
10 years, 10 months
Sprint 3 deadlines
by Aline Manera
Hi all,
As we agreed in last scrum meeting
<http://kimchi-project.github.io/kimchi/meetings/kimchi.scrum.2014-01-29-1...>
(Jan 29th), from now on all the sprints will have deadlines.
Which means the RFC or first patch series needs to be send to mail list
at the begging of the sprint.
Following are the dates I recommend everyone to follow for sprint 3.
*02/03 09:00 (**UTC-03:00*) - RFC or first patch series
By this date all tasks planned in the sprint
needs to have RFC or patch on mail list.
*02/10 **09:00 (**UTC-03:00*) - Next patch version
Address comments made on RFC and moving to
final patch series version.
It only applies to the tasks planned for the sprint.
All other patches are welcome any time - bug fixes, improvements, etc.
Regards,
Aline Manera
10 years, 10 months
[PATCH v2 1/2] Break the 'sample' plugin's monolithic model into several smaller ones
by Mark Wu
From: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
In kimchi the model is always a monolithic class. This is not good from
the point of modulization, and it is not necessary to put everything
into one big model. Unfortunately the problem will not get solved
unless we conduct enormous refactor against the whole controller-model
architecture.
This patch tries to mitigate the problem by firstly splitting the model
class into some smaller ones, than automatically mapping all sub-model
instance methods to a RootModel instance. As a demonstration, this patch
splits the 'sample' plugin's model.
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
plugins/__init__.py | 23 ++++++++++
plugins/sample/model.py | 109 ++++++++++++++++++++++++++++++------------------
src/kimchi/model.py | 26 ++++++++++++
3 files changed, 117 insertions(+), 41 deletions(-)
diff --git a/plugins/__init__.py b/plugins/__init__.py
index e69de29..4103a65 100644
--- a/plugins/__init__.py
+++ b/plugins/__init__.py
@@ -0,0 +1,23 @@
+#
+# Project Kimchi
+#
+# Copyright IBM, Corp. 2014
+#
+# Authors:
+# Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
diff --git a/plugins/sample/model.py b/plugins/sample/model.py
index 9a2f22f..e606176 100644
--- a/plugins/sample/model.py
+++ b/plugins/sample/model.py
@@ -21,79 +21,106 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
from kimchi.exception import InvalidOperation, NotFoundError
+from kimchi.model import RootModel
-class Model(object):
+class CirclesModel(object):
+ def __init__(self):
+ self._circles = {}
+
+ def create(self, params):
+ name = params['name']
+ if name in self._circles:
+ raise InvalidOperation("Circle %s already exists" % name)
+ self._circles[name] = Circle(params['radius'])
+ return name
+ def get_list(self):
+ return sorted(self._circles)
+
+
+class CircleModel(object):
+ def __init__(self, parent_model):
+ # Circel and Circles models are friends, it's OK to share _circles.
+ self._circles = parent_model._circles
+
+ def lookup(self, name):
+ try:
+ circle = self._circles[name]
+ except KeyError:
+ raise NotFoundError("Circle %s not found" % name)
+ return {'radius': circle.radius}
+
+ def update(self, name, params):
+ if name not in self._circles:
+ raise NotFoundError("Circle %s not found" % name)
+ self._circles[name].radius = params['radius']
+ return name
+
+ def delete(self, name):
+ try:
+ del self._circles[name]
+ except KeyError:
+ pass
+
+
+class RectanglesModel(object):
def __init__(self):
- self.rectangles = {}
- self.circles = {}
+ self._rectangles = {}
- def rectangles_create(self, params):
+ def create(self, params):
name = params['name']
- if name in self.rectangles:
+ if name in self._rectangles:
raise InvalidOperation("Rectangle %s already exists" % name)
- self.rectangles[name] = Rectangle(params['length'], params['width'])
+ self._rectangles[name] = Rectangle(params['length'], params['width'])
return name
- def rectangles_get_list(self):
- return sorted(self.rectangles)
+ def get_list(self):
+ return sorted(self._rectangles)
+
- def rectangle_lookup(self, name):
+class RectangleModel(object):
+ def __init__(self, parent_model):
+ self._rectangles = parent_model._rectangles
+
+ def lookup(self, name):
try:
- rectangle = self.rectangles[name]
+ rectangle = self._rectangles[name]
except KeyError:
raise NotFoundError("Rectangle %s not found" % name)
return {'length': rectangle.length, 'width': rectangle.width}
- def rectangle_update(self, name, params):
- if name not in self.rectangles:
+ def update(self, name, params):
+ if name not in self._rectangles:
raise NotFoundError("Rectangle %s not found" % name)
try:
- self.rectangles[name].length = params['length']
+ self._rectangles[name].length = params['length']
except KeyError:
pass
try:
- self.rectangles[name].width = params['width']
+ self._rectangles[name].width = params['width']
except KeyError:
pass
return name
- def rectangle_delete(self, name):
+ def delete(self, name):
try:
- del self.rectangles[name]
+ del self._rectangles[name]
except KeyError:
pass
- def circles_create(self, params):
- name = params['name']
- if name in self.circles:
- raise InvalidOperation("Circle %s already exists" % name)
- self.circles[name] = Circle(params['radius'])
- return name
- def circles_get_list(self):
- return sorted(self.circles)
-
- def circle_lookup(self, name):
- try:
- circle = self.circles[name]
- except KeyError:
- raise NotFoundError("Circle %s not found" % name)
- return {'radius': circle.radius}
+class Model(RootModel):
+ def __init__(self):
+ circles = CirclesModel()
+ circle = CircleModel(circles)
- def circle_update(self, name, params):
- if name not in self.circles:
- raise NotFoundError("Circle %s not found" % name)
- self.circles[name].radius = params['radius']
- return name
+ rectangles = RectanglesModel()
+ rectangle = RectangleModel(rectangles)
- def circle_delete(self, name):
- try:
- del self.circles[name]
- except KeyError:
- pass
+ return super(Model, self).__init__(
+ [circle, circles, rectangle, rectangles])
class Rectangle(object):
diff --git a/src/kimchi/model.py b/src/kimchi/model.py
index ea528c6..47f2d22 100644
--- a/src/kimchi/model.py
+++ b/src/kimchi/model.py
@@ -1853,3 +1853,29 @@ class LibvirtConnection(object):
# However the values need to be considered wisely to not affect
# hosts which are hosting a lot of virtual machines
return conn
+
+
+class RootModel(object):
+ '''
+ This model squashes all sub-model's public callable methods to itself.
+
+ Model methods are not limited to get_list, create, lookup, update, delete.
+ Controller can call generate_action_handler to generate new actions, which
+ call the related model methods. So all public callable methods of a
+ sub-model should be mapped to this model.
+ '''
+ def __init__(self, model_instances):
+ for model_instance in model_instances:
+ cls_name = model_instance.__class__.__name__
+ if cls_name.endswith('Model'):
+ method_prefix = cls_name[:-len('Model')].lower()
+ else:
+ method_prefix = cls_name.lower()
+
+ callables = [m for m in dir(model_instance)
+ if not m.startswith('_') and
+ callable(getattr(model_instance, m))]
+
+ for member_name in callables:
+ m = getattr(model_instance, member_name, None)
+ setattr(self, '%s_%s' % (method_prefix, member_name), m)
--
1.8.4.2
10 years, 10 months
[PATCH 00/23 V2] Refactor model
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
V1 -> V2:
- Rebase
- Create ConfigModel to acommodate new changes on control
- Update Makefile and spec files
Hi all,
This patch set splitted model.py into several model implementations.
One for each resource in kimchi.
It also includes a mechanism implemented by Zhou Zheng Sheng to automatically
load all the models in one. So we don't nee to change tests and controller
to work with new models.
It is just the first step.
I also will send a patch to split mockmodel
And finally, a new one to separate common code and specific code from models.
I am sending it separately because all that require a lot of work (and tests)
and also can conflict with new features.
I am planning to merge it on next Wed (when sprint 2 ends) so I hope those
changes will not impact so much any developer.
PS. it seems to to be a huge patch set but I just move code from one place to
another. There is no new implementation/feature in there.
Aline Manera (23):
refactor model: Separate libvirtconnection from model.py
refactor model: Move StoragePooldef from model to
libvirtstoragepools.py
refactor model: Create a common model builder
Create a model to join all model resources implementation
refactor model: Create a separated model for task resource
refactor model: Create a separated model for plugins resource
refactor model: Create a separated model for debug report resource
refactor model: Create a separated model for config resource
refactor model: Create a separated model for network resource
refactor model: Create a separated model for interface resource
refactor model: Create a separated model for storage pool resource
refactor model: Create a separated model for storage volume resource
refactor model: Create a separated model for storage server resource
refactor model: Create a separated model for storage target resource
refactor model: Create a separated model for template resource
refactor model: Create a separated model for vm resource
refactor model: Create a separated model for vm interface resource
refactor model: Create a separated model for host resource
Update server to use the new model
Update tests to use the new model
Update mockmodel imports
Delete former model.py and rename model_ to model
refactor model: Update makefile and specs files
Makefile.am | 1 +
configure.ac | 1 +
contrib/kimchi.spec.fedora.in | 1 +
contrib/kimchi.spec.suse.in | 1 +
src/kimchi/Makefile.am | 3 +-
src/kimchi/basemodel.py | 55 +
src/kimchi/control/config.py | 6 +-
src/kimchi/control/storagepools.py | 2 +-
src/kimchi/control/utils.py | 12 +-
src/kimchi/mockmodel.py | 27 +-
src/kimchi/model.py | 2029 --------------------------------
src/kimchi/model/Makefile.am | 28 +
src/kimchi/model/__init__.py | 21 +
src/kimchi/model/config.py | 98 ++
src/kimchi/model/debugreports.py | 167 +++
src/kimchi/model/host.py | 201 ++++
src/kimchi/model/interfaces.py | 46 +
src/kimchi/model/libvirtconnection.py | 122 ++
src/kimchi/model/libvirtstoragepool.py | 257 ++++
src/kimchi/model/model.py | 125 ++
src/kimchi/model/networks.py | 265 +++++
src/kimchi/model/plugins.py | 31 +
src/kimchi/model/storagepools.py | 246 ++++
src/kimchi/model/storageservers.py | 78 ++
src/kimchi/model/storagetargets.py | 86 ++
src/kimchi/model/storagevolumes.py | 176 +++
src/kimchi/model/tasks.py | 39 +
src/kimchi/model/templates.py | 172 +++
src/kimchi/model/utils.py | 33 +
src/kimchi/model/vmifaces.py | 135 +++
src/kimchi/model/vms.py | 447 +++++++
src/kimchi/server.py | 2 +-
src/kimchi/utils.py | 46 +-
tests/test_model.py | 91 +-
tests/test_storagepool.py | 4 +-
tests/utils.py | 4 +-
36 files changed, 2943 insertions(+), 2115 deletions(-)
create mode 100644 src/kimchi/basemodel.py
delete mode 100644 src/kimchi/model.py
create mode 100644 src/kimchi/model/Makefile.am
create mode 100644 src/kimchi/model/__init__.py
create mode 100644 src/kimchi/model/config.py
create mode 100644 src/kimchi/model/debugreports.py
create mode 100644 src/kimchi/model/host.py
create mode 100644 src/kimchi/model/interfaces.py
create mode 100644 src/kimchi/model/libvirtconnection.py
create mode 100644 src/kimchi/model/libvirtstoragepool.py
create mode 100644 src/kimchi/model/model.py
create mode 100644 src/kimchi/model/networks.py
create mode 100644 src/kimchi/model/plugins.py
create mode 100644 src/kimchi/model/storagepools.py
create mode 100644 src/kimchi/model/storageservers.py
create mode 100644 src/kimchi/model/storagetargets.py
create mode 100644 src/kimchi/model/storagevolumes.py
create mode 100644 src/kimchi/model/tasks.py
create mode 100644 src/kimchi/model/templates.py
create mode 100644 src/kimchi/model/utils.py
create mode 100644 src/kimchi/model/vmifaces.py
create mode 100644 src/kimchi/model/vms.py
--
1.7.10.4
10 years, 10 months
[PATCH v5 0/3] Reorganize kimchi's path vars generation code
by Mark Wu
This series of patches reorganize kimchi's path vars generation code
to allow plugin use kimchi s ui handler.
Changes:
v5:
Fix the test break on ubuntu because of system paths varies on
different distros (per Aline)
v4:
Fix the test break when installed to non system dirs. (per Shaohe)
v3:
Rebase
Only access the paths instance when the request is for html, which
can avoid forcibly installing paths to the plugin which just have
json requests.
v2:
Rebase
Remove the optimization for plugin paths since it just have a few
instantiations.
Mark Wu (3):
Reorganize the kimchi's paths gereneration code
Add test cases for paths generation code
Allow plugin use kimchi's ui handler
.gitignore | 1 +
src/kimchi/cachebust.py | 4 +-
src/kimchi/config.py.in | 155 +++++++++++++++++++-----------------------------
src/kimchi/root.py | 23 ++++---
src/kimchi/server.py | 14 +++--
src/kimchi/template.py | 17 ++++--
src/kimchi/utils.py | 6 +-
src/kimchid.in | 7 ++-
tests/Makefile.am | 9 ++-
tests/test_config.py.in | 85 ++++++++++++++++++++++++++
10 files changed, 196 insertions(+), 125 deletions(-)
create mode 100644 tests/test_config.py.in
--
1.8.4.2
10 years, 10 months
[PATCH V8] add a method to fix search permissions
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V6 -> V7
do not fix path search permission for others.
also fix read permission for file.
ShaoHe Feng (1):
add a method to fix search permissions
src/kimchi/utils.py | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 149 insertions(+)
--
1.8.4.2
10 years, 10 months