[PATCH 0/3] Create and use jQuery form extensions
by Adam King
Update fundamental classes
Extend jQuery form handling
Make use of the new function in the edit repo
Adam King (3):
Extend base classes to support form processing
Extend jQuery form
Make use of the new forms handling capabilities
ui/js/src/kimchi.form.js | 76 +++++++++-------------------
ui/js/src/kimchi.grid.js | 2 +-
ui/js/src/kimchi.object.js | 85 ++++++++++++++++++++++++++++++++
ui/js/src/kimchi.repository_edit_main.js | 31 +-----------
ui/js/src/kimchi.string.js | 45 +++++++++++++++++
5 files changed, 154 insertions(+), 85 deletions(-)
create mode 100644 ui/js/src/kimchi.object.js
create mode 100644 ui/js/src/kimchi.string.js
--
1.8.1.4
10 years, 9 months
[PATCH V2 0/5] Fix 'disk full' issue
by Rodrigo Trujillo
V2:
Address Aline's comments:
- Change error message
- Aggregate 'if's
V1:
If the disk where objectstore (Kimchi database) is full, then a lot of
errors will be raised without any special treatment. This can lead the
system to an unexpected state.
This patchset modifies kimchi in order to give the right treatment to
exceptions, showing the error to the user or hidding when possible.
Rodrigo Trujillo (5):
Fix 'disk full' issue: Change objectstore exception handling
Fix 'disk full' issue: Fix Templates db store/delete error handling
Fix 'disk full' issue: Fix storage volume error handling
Fix 'disk full' issue: Fix storagepool and asynctasks error handling
Fix 'disk full' issue: Fix vms/screenshot db store/delete error
handling
src/kimchi/asynctask.py | 7 ++--
src/kimchi/i18n.py | 5 +++
src/kimchi/model/storagepools.py | 8 +++--
src/kimchi/model/storagevolumes.py | 49 ++++++++++++++++----------
src/kimchi/model/templates.py | 22 ++++++++----
src/kimchi/model/vms.py | 70 +++++++++++++++++++++++++++-----------
src/kimchi/objectstore.py | 7 ++++
7 files changed, 118 insertions(+), 50 deletions(-)
--
1.8.5.3
10 years, 9 months
Kimchi 1.2 is released!
by Aline Manera
On behalf of everyone who has worked hard on this release, I am pleased
to announce the availability of *Kimchi 1.**2*! This release adds many new
features including:
* Guest spice console support
* Manage guest CDROM devices
* iSCSI storage pool
* SCSI Fibre Channel storage pool
* NFS pool: Discover available export paths given an NFS server
* Bridge VLAN tagging
* Update system packages
* Manage system repositories
* Add help pages for each tab
We have worked hard to ensure that Kimchi runs well on the most popular
Linux distributions including: Fedora 20, Ubuntu 13.10, openSUSE 13.1,
and RHEL 6.5. Kimchi uses standard Linux interfaces so it should run
well on many other distributions too.
You can easily grab this release in tarball format or via git:
* https://github.com/kimchi-project/kimchi/archive/kimchi-1.2.0.tar.gz
* git clone https://github.com/kimchi-project/kimchi.git
Go ahead! Give it a try and let us know what you think!
Regards,
----
Aline Manera
10 years, 9 months
[PATCH] Remove LUN assignment in VM
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
It will be done in Template level.
Remove it from VM and update docs accordingly.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
docs/API.md | 2 --
src/kimchi/API.json | 9 +--------
src/kimchi/i18n.py | 2 --
src/kimchi/model/vms.py | 16 +---------------
4 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index f928320..65044f8 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -55,8 +55,6 @@ the following general conventions:
Independent Computing Environments
* null: Graphics is disabled or type not supported
* listen: The network which the vnc/spice server listens on.
- * volumes *(optional)*: List of Fibre channel LUN names to be assigned as
- disk to VM. Required if pool is type SCSI.
### Resource: Virtual Machine
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index 8ecd665..5ca94e3 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -190,14 +190,7 @@
"pattern": "^/storagepools/[^/]+/?$",
"error": "KCHVM0013E"
},
- "graphics": { "$ref": "#/kimchitype/graphics" },
- "volumes": {
- "description": "list of scsi volumes to be assigned to the new VM.",
- "type": "array",
- "items": { "type": "string" },
- "uniqueItems": true,
- "error": "KCHVM0018E"
- }
+ "graphics": { "$ref": "#/kimchitype/graphics" }
}
},
"vm_update": {
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 398d49a..fabb0b4 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -76,8 +76,6 @@ messages = {
"KCHVM0014E": _("Supported virtual machine graphics are spice or VNC"),
"KCHVM0015E": _("Graphics address to listen on must be IPv4 or IPv6"),
"KCHVM0016E": _("Specify a template to create a virtual machine from"),
- "KCHVM0017E": _("Volume list (LUNs names) not given."),
- "KCHVM0018E": _("Virtual machine volumes must be a list of strings with distinct LUNs names."),
"KCHVM0019E": _("Unable to start virtual machine %(name)s. Details: %(err)s"),
"KCHVM0020E": _("Unable to stop virtual machine %(name)s. Details: %(err)s"),
"KCHVM0021E": _("Unable to delete virtual machine %(name)s. Details: %(err)s"),
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index ef1d617..c8dfc90 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -29,7 +29,7 @@ from kimchi import vnc
from kimchi import xmlutils
from kimchi.config import READONLY_POOL_TYPE
from kimchi.exception import InvalidOperation, InvalidParameter
-from kimchi.exception import MissingParameter, NotFoundError, OperationFailed
+from kimchi.exception import NotFoundError, OperationFailed
from kimchi.model.config import CapabilitiesModel
from kimchi.model.templates import TemplateModel
from kimchi.model.utils import get_vm_name
@@ -153,11 +153,6 @@ class VMsModel(object):
'diskRdKB': diskRdKB,
'diskWrKB': diskWrKB})
- def _get_volume_path(self, pool, vol):
- conn = self.conn.get()
- pool = conn.storagePoolLookupByName(pool)
- return pool.storageVolLookupByName(vol).path()
-
def create(self, params):
conn = self.conn.get()
t_name = template_name_from_uri(params['template'])
@@ -186,15 +181,6 @@ class VMsModel(object):
vol_list = []
if t._get_storage_type() in ["iscsi", "scsi"]:
vol_list = []
- elif t._get_storage_type() in READONLY_POOL_TYPE:
- if not params.get('volumes'):
- raise MissingParameter('KCHVM0017E')
- else:
- # Get system path of the LUNs
- pool = t.info['storagepool'].split('/')[-1]
- for vol in params.get('volumes'):
- path = self._get_volume_path(pool, vol)
- vol_list.append((vol, path))
else:
vol_list = t.fork_vm_storage(vm_uuid)
--
1.7.10.4
10 years, 9 months
[PATCH] Translate pt_BR.po files
by Ramon Medeiros
Translation to pt_Br, by me and Rodrigo.
Ramon Medeiros (1):
Translate pt_BR.po file
po/pt_BR.po | 505 ++++++++++++++++++++++++++++++++----------------------------
1 file changed, 272 insertions(+), 233 deletions(-)
--
1.8.3.1
10 years, 9 months
[PATCH] bug fix: fix the string format %(pool).
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
a "s" should be subfix in string format %(pool).
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/i18n.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index de029f5..8b88cae 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -108,7 +108,7 @@ messages = {
"KCHTMPL0016E": _("Specify an ISO image as CDROM to create a template"),
"KCHTMPL0017E": _("All networks for the template must be specified in a list."),
"KCHTMPL0018E": _("Must specify a volume to a template, when storage pool is iscsi or scsi"),
- "KCHTMPL0019E": _("The volume: %(volume)s in not in storage pool %(pool)"),
+ "KCHTMPL0019E": _("The volume: %(volume)s in not in storage pool %(pool)s"),
"KCHPOOL0001E": _("Storage pool %(name)s already exists"),
"KCHPOOL0002E": _("Storage pool %(name)s does not exist"),
--
1.8.5.3
10 years, 9 months
[PATCH V3 0/3] Fix non persistent network handling
by Rodrigo Trujillo
V3:
Changes mockmodel and tests (Royce suggestion)
V2:
Address Ming comments:
- Updates API.md
- remove useless comments and return
V1:
Kimchi networks have the same problem storage had. Non persistent
networks are not stop, they are removed by libvirt and this causes
an error in Kimchi.
Rodrigo Trujillo (3):
Fix non persistent network handling (backend)
Fix non persistent network handling (frontend)
Fix non persistent network handling (mockmodel/tests)
docs/API.md | 2 ++
src/kimchi/control/networks.py | 3 ++-
src/kimchi/mockmodel.py | 7 +++++-
src/kimchi/model/networks.py | 3 ++-
tests/test_model.py | 1 +
tests/test_rest.py | 1 +
ui/js/src/kimchi.network.js | 55 ++++++++++++++++++++++++++++--------------
ui/pages/i18n.html.tmpl | 1 +
8 files changed, 52 insertions(+), 21 deletions(-)
--
1.8.5.3
10 years, 9 months
[PATCH] Add error handling for repo management
by Adam King
ListRepo call had no error handler.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.host.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
index acd8e8e..e94bad6 100644
--- a/ui/js/src/kimchi.host.js
+++ b/ui/js/src/kimchi.host.js
@@ -176,6 +176,15 @@ kimchi.host_main = function() {
repositoriesGrid.setData(repositories);
}
}
+ },
+ function(error) {
+ var message = error && error['responseJSON'] && error['responseJSON']['reason'];
+
+ if($.isFunction(gridCallback)) {
+ gridCallback([]);
+ }
+ repositoriesGrid &&
+ repositoriesGrid.showMessage(message || i18n['KCHUPD6008M']);
});
$('#repositories-grid-remove-button').prop('disabled', true);
--
1.8.1.4
10 years, 9 months
[PATCH v2] Logical Storage Pool: Detect and Enumerate Multipath Block Devices
by zhshzhou@linux.vnet.ibm.com
From: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
When creating a logical storage pool Kimci ignores multipath block
devices. This is on purpose because at the time the kimchi.disks was
implemented, there was not enough time to test every kind of devices.
This patch adds the missing support for multipath block devices. After
this patch, the kimchi.disks will include multipath devices in the
available partition list. The front-end code is also changed
accordingly.
v2
Use the major device number to determine if a deivce is a multipath one.
Use indexOf of the array object to determine if an element is in array.
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
src/kimchi/disks.py | 13 ++++++++++++-
ui/js/src/kimchi.storagepool_add_main.js | 3 ++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/disks.py b/src/kimchi/disks.py
index ce0c5bb..5f004b3 100644
--- a/src/kimchi/disks.py
+++ b/src/kimchi/disks.py
@@ -27,8 +27,19 @@ from kimchi.exception import OperationFailed
from kimchi.utils import kimchi_log
+def _get_friendly_dm_path(maj_min):
+ """ Returns user friendly dm path given the device number 'major:min' """
+ dm_name = "/sys/dev/block/%s/dm/name" % maj_min
+ with open(dm_name) as dm_f:
+ content = dm_f.read().rstrip('\n')
+ return "/dev/mapper/" + content
+
+
def _get_dev_node_path(maj_min):
""" Returns device node path given the device number 'major:min' """
+ if maj_min.startswith('253:'):
+ return _get_friendly_dm_path(maj_min)
+
uevent = "/sys/dev/block/%s/uevent" % maj_min
with open(uevent) as ueventf:
content = ueventf.read()
@@ -137,7 +148,7 @@ def get_partitions_names():
# leaf means a partition, a disk has no partition, or a disk not held
# by any multipath device. Physical volume belongs to no volume group
# is also listed. Extended partitions should not be listed.
- if not (dev['type'] in ['part', 'disk'] and
+ if not (dev['type'] in ['part', 'disk', 'mpath'] and
dev['fstype'] in ['', 'LVM2_member'] and
dev['mountpoint'] == "" and
_get_vgname(devNodePath) == "" and
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 10833be..a3b60f7 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -27,8 +27,9 @@ kimchi.initStorageAddPage = function() {
if (data.length > 0) {
var deviceHtml = $('#partitionTmpl').html();
var listHtml = '';
+ valid_types = ['part', 'disk', 'mpath'];
$.each(data, function(index, value) {
- if (value.type === 'part' || value.type === 'disk') {
+ if (valid_types.indexOf(value.type) != -1) {
listHtml += kimchi.template(deviceHtml, value);
}
});
--
1.8.5.3
10 years, 9 months
[PATCH] validate the volume parameter when the pool of template is iscsi or scsi
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
When the pool of template is iscsi or scsi, the volume parameter can not
be NULL.
And as we discussion, we do not mix disks from 2 different types of
storage pools, for instance: we do not create a template with 2
disks, where one comes from a SCSI pool and other is a .img in
a DIR pool.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/i18n.py | 2 ++
src/kimchi/model/templates.py | 50 +++++++++++++++++++++++++++++++++----------
2 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 1f84034..bcc15b7 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -107,6 +107,8 @@ messages = {
"KCHTMPL0015E": _("Invalid storage pool URI %(value)s specified for template"),
"KCHTMPL0016E": _("Specify an ISO image as CDROM to create a template"),
"KCHTMPL0017E": _("All networks for the template must be specified in a list."),
+ "KCHTMPL0018E": _("Must specify a volume to a template, when storage pool is iscsi or scsi"),
+ "KCHTMPL0019E": _("The volume: %(volume)s in not in storage pool %(pool)"),
"KCHPOOL0001E": _("Storage pool %(name)s already exists"),
"KCHPOOL0002E": _("Storage pool %(name)s does not exist"),
diff --git a/src/kimchi/model/templates.py b/src/kimchi/model/templates.py
index d49632e..0e5c2b2 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -55,15 +55,17 @@ class TemplatesModel(object):
params['name'] = name
conn = self.conn.get()
-
pool_uri = params.get(u'storagepool', '')
if pool_uri:
- pool_name = pool_name_from_uri(pool_uri)
try:
- conn.storagePoolLookupByName(pool_name.encode("utf-8"))
+ pool_name = pool_name_from_uri(pool_uri)
+ pool = conn.storagePoolLookupByName(pool_name.encode("utf-8"))
except Exception:
raise InvalidParameter("KCHTMPL0004E", {'pool': pool_name,
'template': name})
+ tmp_volumes = [disk['volume'] for disk in params.get('disks', [])
+ if 'volume' in disk]
+ self.template_volume_validate(tmp_volumes, pool)
for net_name in params.get(u'networks', []):
try:
@@ -83,6 +85,28 @@ class TemplatesModel(object):
with self.objstore as session:
return session.get_list('template')
+ def template_volume_validate(self, tmp_volumes, pool):
+ kwargs = {'conn': self.conn, 'objstore': self.objstore}
+ pool_type = xmlutils.xpath_get_text(pool.XMLDesc(0), "/pool/@type")[0]
+ pool_name = pool.name()
+
+ # as we discussion, we do not mix disks from 2 different types of
+ # storage pools, for instance: we do not create a template with 2
+ # disks, where one comes from a SCSI pool and other is a .img in
+ # a DIR pool.
+ if pool_type in ['iscsi', 'scsi']:
+ if not tmp_volumes:
+ raise InvalidParameter("KCHTMPL0018E")
+
+ storagevolumes = __import__("kimchi.model.storagevolumes",
+ fromlist=[''])
+ pool_volumes = storagevolumes.StorageVolumesModel(
+ **kwargs).get_list(pool_name)
+ vols = set(tmp_volumes) - set(pool_volumes)
+ if vols:
+ raise InvalidParameter("KCHTMPL0019E", {'pool': pool_name,
+ 'volume': vols})
+
class TemplateModel(object):
def __init__(self, **kargs):
@@ -128,18 +152,22 @@ class TemplateModel(object):
new_t.update(params)
ident = name
+ conn = self.conn.get()
pool_uri = new_t.get(u'storagepool', '')
- pool_name = pool_name_from_uri(pool_uri)
- try:
- conn = self.conn.get()
- conn.storagePoolLookupByName(pool_name.encode("utf-8"))
- except Exception:
- raise InvalidParameter("KCHTMPL0004E", {'pool': pool_name,
- 'template': name})
+
+ if pool_uri:
+ try:
+ pool_name = pool_name_from_uri(pool_uri)
+ pool = conn.storagePoolLookupByName(pool_name.encode("utf-8"))
+ except Exception:
+ raise InvalidParameter("KCHTMPL0004E", {'pool': pool_name,
+ 'template': name})
+ tmp_volumes = [disk['volume'] for disk in new_t.get('disks', [])
+ if 'volume' in disk]
+ self.templates.template_volume_validate(tmp_volumes, pool)
for net_name in params.get(u'networks', []):
try:
- conn = self.conn.get()
conn.networkLookupByName(net_name)
except Exception:
raise InvalidParameter("KCHTMPL0003E", {'network': net_name,
--
1.8.5.3
10 years, 9 months