[PATCH V2] Update host number of cpus and total physical memory
by Jose Ricardo Ziviani
- The number of cpus and the total physical memory information
displayed in the host section can change, so them cannot be
static. This commit updates those values whenever a GET request
hits the backend looking for host information.
---
src/kimchi/model/host.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
index 4419bb3..588bb28 100644
--- a/src/kimchi/model/host.py
+++ b/src/kimchi/model/host.py
@@ -87,8 +87,8 @@ class HostModel(object):
res['cpu_model'] = line.split(':')[1].strip()
break
- res['cpus'] = psutil.NUM_CPUS
- res['memory'] = psutil.TOTAL_PHYMEM
+ res['cpus'] = 0
+ res['memory'] = 0L
# Include IBM PowerKVM name to supported distro names
_sup_distros = platform._supported_dists + ('ibm_powerkvm',)
@@ -102,6 +102,8 @@ class HostModel(object):
return res
def lookup(self, *name):
+ self.host_info['cpus'] = psutil._psplatform.get_num_cpus()
+ self.host_info['memory'] = psutil.phymem_usage().total
return self.host_info
def swupdate(self, *name):
--
1.9.1
9 years, 9 months
[PATCH V3] Number of CPUs and Physical Memory
by Jose Ricardo Ziviani
V3:
psutil has changed its interface to retrieve the number of CPUs, this
new V3 updates the code while supporting the old version (still needed).
Jose Ricardo Ziviani (1):
Update host number of cpus and total physical memory
src/kimchi/model/host.py | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
--
1.9.1
9 years, 9 months
[PATCH][RFC] Kimchi and relative URLs
by Frédéric Bonnard
From: Frederic Bonnard <frediz(a)linux.vnet.ibm.com>
Hi,
many people and distros use a subdirectory in the configuration of the system's webserver
to configure different websites.
The usual way to setup a website is thus to :
1. use the distro's webserver to serve all the websites
2. have a subdirectory to copy the configuration file that makes available a website
by only restarting the webserver (and removing the website is just done by removing
the configuration file and restart). Concerning this point, the classical
configurations can be :
a) a sub web location : https://website.org/webapp
b) a virtual host : http://webapp.website.org
a) and b) correspond each to different configuration files that are just dropped into :
- Ubuntu/Debian : /etc/{apache,nginx,..}/sites-available/{webapp_subweb,webapp_virthost}.conf
- Fedora/Opensuse : /etc/{httpd,nginx,..}/conf.d/
At the moment kimchi is launched with a private instance of nginx, not the system's
installed one and it would be nice to have this improved and this is covered in another thread :
http://lists.ovirt.org/pipermail/kimchi-devel/2015-February/009642.html
Provided that previous patch, one can use the distro's webserver to run proxy kimchi
and that fullfills 1.
Then for 2. one need a configuration file for either b) (provided for apache in the
link above ; I have also one for nginx ) and a), which I provide in this patch.
But this nginx configuration file is not enough for a sub web location configuration
as kimchi relies on absolute path based on / from the http://server/.
I tried to make URLs paths relative so that kimchi doesn't have to know where it has
been placed on the webserver, for example https://server/kimchi/ which will probably
be the URL used in distros.
I'm not a web developer and I tried to modify all failing requests with a a) configuration
with relative paths in mind. So I'd like comments on the way this is done, and this
may need more extensive testing (paths I didn't test).
Though I used that code back on a virtualhost configuration and it worked as well.
Thanks for your help,
F.
Frederic Bonnard (1):
Making urls relative
docs/Makefile.am | 1 +
docs/nginx.conf.subsite.ex | 37 +++++++
src/kimchi/screenshot.py | 2 +-
ui/css/theme-default/template_add.css | 20 ++--
ui/css/theme-default/topbar.css | 2 +-
ui/js/src/kimchi.api.js | 176 +++++++++++++++++-----------------
ui/js/src/kimchi.login.js | 2 +-
ui/pages/guest.html.tmpl | 2 +-
ui/pages/help/dita-help.xsl | 4 +-
ui/pages/kimchi-ui.html.tmpl | 4 +-
ui/pages/storagepool-add.html.tmpl | 2 +-
ui/pages/tabs/storage.html.tmpl | 2 +-
ui/pages/template-add.html.tmpl | 2 +-
13 files changed, 147 insertions(+), 109 deletions(-)
create mode 100644 docs/nginx.conf.subsite.ex
--
1.9.1
9 years, 9 months
[PATCH v3] test_model: Power arch fixes
by Daniel Henrique Barboza
changes in v3:
- rebase to latest master
changes in v2:
- changed iso_path to reflect the new ISO being created (Ubuntu 14.04)
Daniel Henrique Barboza (1):
test/test_model: Power architecture fixes
tests/iso_gen.py | 3 ++-
tests/test_model.py | 12 +++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
--
1.9.3
9 years, 9 months
[kimchi-devel][PATCH] Issue #623: Fix mismatch in host device details query
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Commit #902d2957 began to use splitted devices names,
while get detailed device still use original names.
Mismatched name results in error raised when listing host devices.
Fix it by using splitted device name as well.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/disks.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/disks.py b/src/kimchi/disks.py
index a092c17..5cf6885 100644
--- a/src/kimchi/disks.py
+++ b/src/kimchi/disks.py
@@ -64,7 +64,7 @@ def _get_dev_major_min(name):
dev_list = _get_lsblk_devs(keys)
for dev in dev_list:
- if dev['name'] == name:
+ if dev['name'].split()[0] == name:
maj_min = dev['maj:min']
break
else:
--
1.9.1
9 years, 9 months
[PATCH 0/3] Fix backend VM, POOL, NETWORK naming validation
by Rodrigo Trujillo
This patchset fixes the backend JSON name checkings when user creates
a new VM, POOL or NETWORK.
Rodrigo Trujillo (3):
Prohibits slashes '/' in VM name
Move slash checking in storagepool name from UI to backend
Fix Network create name checking in backend (slashes and quotes)
src/kimchi/API.json | 4 ++++
src/kimchi/i18n.py | 6 +++---
src/kimchi/model/utils.py | 3 ++-
ui/js/src/kimchi.storagepool_add_main.js | 5 -----
ui/pages/i18n.json.tmpl | 1 -
5 files changed, 9 insertions(+), 10 deletions(-)
--
2.1.0
9 years, 9 months
[PATCH] Github issue #630: fixing None.strip() error
by Daniel Henrique Barboza
This simple patch fixes the scenario in repositories.py where
baseurl or mirrorlist is None and the code was executing baseurl.strip()
and mirrorlist.strip(), leading to errors in tests/test_model.py
(test_repository_update) and probably other bugs.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
src/kimchi/repositories.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/repositories.py b/src/kimchi/repositories.py
index f1e1eb3..19c5810 100644
--- a/src/kimchi/repositories.py
+++ b/src/kimchi/repositories.py
@@ -275,10 +275,10 @@ class YumRepo(object):
config = params.get('config', {})
mirrorlist = config.get('mirrorlist', None)
- if len(baseurl.strip()) == 0:
+ if baseurl is not None and len(baseurl.strip()) == 0:
baseurl = None
- if len(mirrorlist.strip()) == 0:
+ if mirrorlist is not None and len(mirrorlist.strip()) == 0:
mirrorlist = None
if baseurl is None and mirrorlist is None:
--
1.9.3
9 years, 9 months
[PATCH] issue #628: Set ref_cnt=1 on cloned disks
by Crístian Viana
Cloned disks currently don't have ref_cnt stored locally, so they may
be attached again to another VM - or even to the same one.
When cloning a VM, set their disks' ref_cnt to 1 to prevent them from
being reattached.
Fix issue #628 (Storage volume ref_cnt is not updated after vm clone).
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
src/kimchi/model/vms.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 86c173f..af5e765 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -449,6 +449,10 @@ class VMModel(object):
vir_conn = self.conn.get()
+ def _delete_disk_from_objstore(path):
+ with self.objstore as session:
+ session.delete('storagevolume', path)
+
for i, path in enumerate(all_paths):
try:
vir_orig_vol = vir_conn.storageVolLookupByPath(path)
@@ -518,6 +522,11 @@ class VMModel(object):
xml = xml_item_update(xml, XPATH_DOMAIN_DISK_BY_FILE % path,
new_vol['path'], 'file')
+ # set the new disk's ref_cnt
+ with self.objstore as session:
+ session.store('storagevolume', new_vol['path'], {'ref_cnt': 1})
+ rollback.prependDefer(_delete_disk_from_objstore, new_vol['path'])
+
# remove the new volume should an error occur later
rollback.prependDefer(self.storagevolume.delete, new_pool_name,
new_vol_name)
--
2.1.0
9 years, 9 months
[PATCH 0/3] Fix issue #461 (backend)
by Crístian Viana
This patchset fixes the backend part of issue #461. The UI should also be
updated in order to use the metadata property. Other related fixes have been
committed as well.
Crístian Viana (3):
Handle empty variables when updating YUM repository
Use more generic message in repo mirror list error
issue #461: Add 'metalink' support for YUM repositories
src/kimchi/API.json | 5 +++++
src/kimchi/i18n.py | 5 +++--
src/kimchi/repositories.py | 25 +++++++++++++++++++------
3 files changed, 27 insertions(+), 8 deletions(-)
--
2.1.0
9 years, 9 months
RFC - New option 'Serial Console' in the template UI
by Jose Ricardo Ziviani
Hello everybody!
I'd like to hear from you if it would be nice to have a new option in
the Template UI to redirect the output to a serial console.
Today, there is a field called 'Graphics' with two options [VNC, Spice].
What if we have [VNC, Spice, Serial Console (no-graphic)]?
A drawback is the need of an external tool (like virsh console) to be
able to take the console, as Kimchi doesn't provide one.
What do you think?
Thank you!
--
Jose Ricardo Ziviani
-----------------------------
Software Engineer
Linux Technology Center - IBM
9 years, 9 months