[PATCH 0/5] Power (ppc) support patches
by Paulo Vital
This patch set enables Power(ppc) support by default on Kimchi.
Whithout them, the upstream code of Kimchi is not fully compatible
with the Power architecture.
Eli Qiao (2):
Add tablet to vmtemplate,to provides an absolute pointer device which
often helps with getting a consistent mouse cursor position in VNC.
Fix Bug 110927 - Sosreport throwing kimchi error Signed-off-by: Eli
Qiao <taget(a)linux.vnet.ibm.com>
Mark Wu (1):
Add sos plugin for kimchi
Paulo Vital (2):
PowerKVM: Workaround of numpy byte order bug on PowerPC
Add PowerKVM information as ISO otpion to installation.
contrib/kimchi.spec.fedora.in | 3 +++
src/kimchi/Makefile.am | 4 +++-
src/kimchi/isoinfo.py | 1 +
src/kimchi/osinfo.py | 5 +++--
src/kimchi/sos.py | 37 +++++++++++++++++++++++++++++++++++++
src/kimchi/vmtemplate.py | 5 +++++
src/kimchi/websocket.py | 7 +++++--
7 files changed, 57 insertions(+), 5 deletions(-)
create mode 100644 src/kimchi/sos.py
--
1.9.3
10 years, 2 months
[PATCH 0/2] PCI Passthrough: Add device to VM
by huoyuxin@linux.vnet.ibm.com
From: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
Yu Xin Huo (2):
Passthrough: Add PCI Devices to VM
update po files
po/en_US.po | 15 ++++++
po/kimchi.pot | 15 ++++++
po/pt_BR.po | 15 ++++++
po/zh_CN.po | 15 ++++++
ui/css/theme-default/guest-edit.css | 86 ++++++++++++++++++++++++++++++++++-
ui/js/src/kimchi.api.js | 55 ++++++++++++++++++++++
ui/js/src/kimchi.guest_edit_main.js | 66 +++++++++++++++++++++++++++
ui/pages/guest-edit.html.tmpl | 28 +++++++++++
8 files changed, 293 insertions(+), 2 deletions(-)
10 years, 2 months
Why do we use mockmodel?
by Crístian Viana
Hi!
After creating a few patches for Kimchi, it occurred to me that the
mockmodel design has more cons than pros. So I started wondering why we
still use it.
I understand - and totally agree - that we should have an extensive test
infrastructure to make sure the code runs as designed and to make it
very easy to find regression bugs on every new feature we implement. And
as Kimchi works very integrated to its host system, it may not be easy
to create expected/failed situations for things we don't always have
control.
But for every new feature we implement, we currently have to:
1) Implement the feature itself
2) Create tests for (1)
3) Implement the feature in a mock environment
4) Create tests for (3)
And by looking at some existing code, many of the mock tests don't
actually test anything. They're just there so we can say we have a mock
implementation and a test for it. Why create a mock function and a test
for the mock function if what we need is to test the real code? And a
lot of times, the mock implementation (and the tests) are just
copy/paste of the original feature. For me, that seems very tedious and
useless.
Why don't we get rid of the mockmodel and keep only the "real" model? I
understand that it's not so simple to remove it right away, that's why
I'm starting this discussion so we could see how to do it better - if
we're actually going to do it. What would we miss if we didn't have the
mockmodel anymore? I believe we'll need to be more careful when writing
tests which run on a real environment (i.e. we can't "leak" VMs,
networks, templates, or anything else) but at least we'll always test
real code and we won't be writing code that won't be used.
Please share your opinion with us.
Best regards,
Crístian.
10 years, 2 months
[PATCH] Backend support for templates with sockets, cores, and threads
by Christy Perez
In order to allow a guest to use SMT/hyperthreading, we should
enable passing in of the sockets, cores, and threads values when
creating a template.
All three values must be specified, as per the topology descr at
http://libvirt.org/formatdomain.html#elementsCPU
Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
docs/API.md | 7 +++++++
src/kimchi/API.json | 28 ++++++++++++++++++++++++++--
src/kimchi/control/templates.py | 11 ++++++++---
src/kimchi/osinfo.py | 2 +-
src/kimchi/vmtemplate.py | 22 ++++++++++++++++++++++
5 files changed, 64 insertions(+), 6 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index d75c55f..cb4d541 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -200,6 +200,13 @@ Represents a snapshot of the Virtual Machine's primary monitor.
Independent Computing Environments
* null: Graphics is disabled or type not supported
* listen: The network which the vnc/spice server listens on.
+ * cpu_info *(optional)*: CPU-specific information.
+ * topology: Specify sockets, threads, and cores to run the virtual CPU
+ threads on.
+ All three are required in order to specify cpu topology.
+ * sockets - The number of sockets to use.
+ * cores - The number of cores per socket.
+ * threads - The number of threads per core.
### Sub-Collection: Virtual Machine Network Interfaces
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index c3fc5e3..d510634 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -26,6 +26,28 @@
]
}
}
+ },
+ "cpu_info": {
+ "description": "Configure CPU specifics for a VM.",
+ "type": "object",
+ "properties": {
+ "topology": {
+ "description": "Configure the guest CPU topology.",
+ "type": "object",
+ "properties": {
+ "sockets": {
+ "type": "number"
+ },
+ "cores": {
+ "type": "number"
+ },
+ "threads": {
+ "type": "number"
+ }
+ },
+ "required": [ "sockets", "cores", "threads" ]
+ }
+ }
}
},
"properties": {
@@ -438,7 +460,8 @@
"type": "array",
"items": { "type": "string" }
},
- "graphics": { "$ref": "#/kimchitype/graphics" }
+ "graphics": { "$ref": "#/kimchitype/graphics" },
+ "cpu_info": { "$ref": "#/kimchitype/cpu_info" }
},
"additionalProperties": false,
"error": "KCHAPI0001E"
@@ -608,7 +631,8 @@
"type": "array",
"items": { "type": "string" }
},
- "graphics": { "$ref": "#/kimchitype/graphics" }
+ "graphics": { "$ref": "#/kimchitype/graphics" },
+ "cpu_info": { "$ref": "#/kimchitype/cpu_info" }
},
"additionalProperties": false,
"error": "KCHAPI0001E"
diff --git a/src/kimchi/control/templates.py b/src/kimchi/control/templates.py
index e17fa54..5ef35ce 100644
--- a/src/kimchi/control/templates.py
+++ b/src/kimchi/control/templates.py
@@ -38,13 +38,14 @@ def __init__(self, model, ident):
self.update_params = ["name", "folder", "icon", "os_distro",
"storagepool", "os_version", "cpus",
"memory", "cdrom", "disks", "networks",
- "graphics"]
+ "graphics", "cpu_info"]
self.uri_fmt = "/templates/%s"
self.clone = self.generate_action_handler('clone')
@property
def data(self):
- return {'name': self.ident,
+ return_data = {
+ 'name': self.ident,
'icon': self.info['icon'],
'invalid': self.info['invalid'],
'os_distro': self.info['os_distro'],
@@ -56,4 +57,8 @@ def data(self):
'storagepool': self.info['storagepool'],
'networks': self.info['networks'],
'folder': self.info.get('folder', []),
- 'graphics': self.info['graphics']}
+ 'graphics': self.info['graphics']
+ }
+ if (self.info.get('cpu_info')):
+ return_data['cpu_info'] = self.info['cpu_info']
+ return return_data
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 1ad353c..8492bb7 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -32,7 +32,7 @@
'power': ('ppc', 'ppc64')}
-common_spec = {'cpus': 1, 'cpu_cores': 1, 'cpu_threads': 1, 'memory': 1024,
+common_spec = {'cpus': 1, 'cpu_sockets': '1', 'cpu_cores': 1, 'cpu_threads': 1, 'memory': 1024,
'disks': [{'index': 0, 'size': 10}], 'cdrom_bus': 'ide',
'cdrom_index': 2, 'mouse_bus': 'ps2'}
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 761bac5..c64e61d 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -359,6 +359,22 @@ def _get_input_output_xml(self):
input_output += sound % self.info
return input_output
+ def _get_cpu_xml(self):
+
+ cpu_info = self.info.get('cpu_info')
+ if cpu_info is not None:
+ cpu_topo = cpu_info.get('topology')
+ if cpu_topo is not None:
+ return """
+ <cpu>
+ <topology sockets='%(sockets)s'
+ cores='%(cores)s'
+ threads='%(threads)s'/>
+ </cpu>
+ """ % cpu_topo
+
+ return ""
+
def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
params = dict(self.info)
params['name'] = vm_name
@@ -371,6 +387,11 @@ def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
graphics = kwargs.get('graphics')
params['graphics'] = self._get_graphics_xml(graphics)
+ if params.get('cpu_info') is not None:
+ params['cpu_info'] = self._get_cpu_xml()
+ else:
+ params['cpu_info'] = ''
+
# Current implementation just allows to create disk in one single
# storage pool, so we cannot mix the types (scsi volumes vs img file)
storage_type = self._get_storage_type()
@@ -401,6 +422,7 @@ def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
<uuid>%(uuid)s</uuid>
<memory unit='MiB'>%(memory)s</memory>
<vcpu>%(cpus)s</vcpu>
+ %(cpu_info)s
<os>
<type arch='%(arch)s'>hvm</type>
<boot dev='hd'/>
--
1.9.3
10 years, 2 months
[PATCH V2] Detect and enable help page from plugins tabs
by Rodrigo Trujillo
V1:
Kimchi is currently not able to configure and open help pages of any
plugin tab. This patch fixes this problem and removes the HELP button
if the plugin does not have a help configured properly.
Help pages for a plugin tab follow same Kimchi system:
- html help file should have the same name of plugin html tab file
- html files should be in plugin's " ui/pages/help/<LANG> " path
- plugin should add following lines to <PLUGIN_NAME>.conf:
* [/help]
* tools.staticdir.on = True
* tools.nocache.on = True
- plugins should add a <help> element with tab help html name in
"ui/config/tab-ext.xml", for each configured tab. If this
element does not exist, 'Help' will be disabled
V2:
- Changed the way that tab help html is being checked.
- Now, all tabs have the help html file checked (per language)
You can check enabling Sample plugin. Go to plugin Sample tab.
For en_US, the help button will be enabled. But if you logout
and change to other language, the help button will be disabled,
because the sample plugin does not have help in other languages.
Rodrigo Trujillo (1):
Detect and enable help pages for tabs and plugin tabs
plugins/sample/sample.conf.in | 4 ++++
plugins/sample/ui/pages/help/en_US/tab.html | 1 +
src/kimchi/config.py.in | 1 +
src/kimchi/utils.py | 9 ++++++--
ui/js/src/kimchi.main.js | 36 ++++++++++++++++++++++++++++-
5 files changed, 48 insertions(+), 3 deletions(-)
create mode 100644 plugins/sample/ui/pages/help/en_US/tab.html
--
1.9.3
10 years, 3 months
[PATCH] [wip-v1] Create template from guest (BACKEND)
by Rodrigo Trujillo
This patch implements new functionality that allows user to create a
template based on a givem virtual machine. Template will have same
number of CPUS, amount of Memory, CDROM attached, disks, etc.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/API.json | 6 ++++++
src/kimchi/i18n.py | 1 +
src/kimchi/model/templates.py | 34 ++++++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index c3fc5e3..e1e0218 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -385,6 +385,12 @@
"minimum": 512,
"error": "KCHTMPL0013E"
},
+ "vm": {
+ "description": "Virtual Machine which template will be based in",
+ "type": "string",
+ "minimum": 1,
+ "error": "KCHTMPL0025E"
+ },
"cdrom": {
"description": "Path for cdrom",
"type": "string",
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 2eae7e8..8b9c713 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -130,6 +130,7 @@ messages = {
"KCHTMPL0022E": _("Disk size must be greater than 1GB."),
"KCHTMPL0023E": _("Template base image must be a valid local image file"),
"KCHTMPL0024E": _("Cannot identify base image %(path)s format"),
+ "KCHTMPL0025E": _("Virtual machine name must be a string"),
"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 bf04304..15296b0 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -36,6 +36,7 @@ class TemplatesModel(object):
def __init__(self, **kargs):
self.objstore = kargs['objstore']
self.conn = kargs['conn']
+ self.kargs = kargs
def create(self, params):
name = params.get('name', '').strip()
@@ -68,6 +69,12 @@ class TemplatesModel(object):
except Exception:
raise InvalidParameter("KCHTMPL0003E", {'network': net_name,
'template': name})
+
+ # Template based in a given VM
+ vm = params.get('vm')
+ if vm:
+ params.update(self._get_vm_params(vm))
+
# Creates the template class with necessary information
# Checkings will be done while creating this class, so any exception
# will be raised here
@@ -83,6 +90,33 @@ class TemplatesModel(object):
return name
+ def _get_vm_params(self, vm):
+ from kimchi.model.vms import VMModel
+ vm_info = VMModel(**self.kargs).lookup(vm)
+ ret = {}
+
+ # Get CPUs, Memory, Graphics
+ ret['cpus'] = vm_info['cpus']
+ ret['memory'] = vm_info['memory']
+ ret['graphics'] = vm_info['graphics']
+
+ # CDROM
+ from kimchi.model.vmstorages import VMStoragesModel, VMStorageModel
+ vmStorages = VMStoragesModel(**self.kargs)
+ disks = vmStorages.get_list(vm)
+ vmStorage = VMStorageModel(**self.kargs)
+ for disk in disks:
+ disk_info = vmStorage.lookup(vm, disk)
+ if disk_info['type'] == 'cdrom':
+ # get first cdrom found
+ ret['cdrom'] = disk_info['path']
+ break
+ # ToDo:
+ # Get Disks
+ # Get StoragePool
+ # Get Networks
+ return ret
+
def get_list(self):
with self.objstore as session:
return session.get_list('template')
--
1.9.3
10 years, 3 months
[PATCH 0/4] WIP: Download remote image to storage pool
by Crístian Viana
This patchset is a work in progress. I'm sending it now so we can get early feedback.
The following problems are known:
- The previous "create" function (which is now called "_create_volume_with_capacity")
should be updated to the Task API. This will cause errors in existing tests.
- There is one unfinished error message.
- The tests and mockmodel are missing.
Any feedback is welcome.
Crístian Viana (4):
storagevolume: Split "create" function based on the parameters
storagevolume: Use a Task to create a new volume
storagevolume: Download remote images to a storage pool
storagevolume: Add download progress to task
src/kimchi/control/storagevolumes.py | 4 +-
src/kimchi/model/storagevolumes.py | 71 +++++++++++++++++++++++++++++++++++-
2 files changed, 72 insertions(+), 3 deletions(-)
--
1.9.3
10 years, 3 months
[PATCH 0/5] Discover Kimchi peers using openSLP
by Aline Manera
I haven't add the federation info to /config/capabilities because I thought in
always display the same message when any peers were found.
"No peers found.
More information at: <federation-help-page>"
Then we can use README-federation as the federation help page.
What do you think?
Aline Manera (5):
Update kimchi.config values according to command line input
Delete http_port from /config API as it is not in use anymore
Add federation option to Kimchi config file
Discover Kimchi peers using openSLP
Add documentation on how to enable federation on Kimchi
docs/API.md | 1 -
docs/README-federation.md | 27 +++++++++++++++++++++
src/kimchi.conf.in | 4 +++
src/kimchi/config.py.in | 1 +
src/kimchi/control/peers.py | 29 ++++++++++++++++++++++
src/kimchi/mockmodel.py | 11 ++++++---
src/kimchi/model/config.py | 3 +--
src/kimchi/model/peers.py | 59 +++++++++++++++++++++++++++++++++++++++++++++
src/kimchi/server.py | 1 -
src/kimchid.in | 36 +++++++++++++++++----------
tests/test_rest.py | 7 +++++-
11 files changed, 158 insertions(+), 21 deletions(-)
create mode 100644 docs/README-federation.md
create mode 100644 src/kimchi/control/peers.py
create mode 100644 src/kimchi/model/peers.py
--
1.9.3
10 years, 3 months
Mechanism for guest edits
by Brent Baude
Folks,
I'm about to send a patch to you guys that:
1) adds "serial" as a graphics type
2) allows you to edit the graphics type on a cold guest
In doing so and talking with Adam and Aline, it seems that a rework of
how the guest's xml is edited is in order. When you edit a template,
for example, the whole templates xml is basically re-instantiated and
only the values that kimchi cares about is added. The rest libvirt
fills in.
The editing of guest xmls differs from that mechanism. Right now the
actual xml is edited and resubmitted. If you think about editing
components of a guest (think about changing graphics types), you can see
where long-term there is an increased opportunity for the xml to become
complicated and maybe even incorrect. XML creep if you will.
So, we are thinking that the cold guest edition should more closely
follow how the template works, where critical parts that kimchi has
fields for is inserted and libvirt does the rest of the work. This will
also allow for future growth/change where new components are added.
I'll likely start a branch for it and get started on this. In the
meanwhile, I'll submit my graphics patches for a start.
Brent
10 years, 3 months
[V2] UI: List Kimchi Peers
by huoyuxin@linux.vnet.ibm.com
From: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
Signed-off-by: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
---
ui/css/theme-default/topbar.css | 36 +++++++++++++++++++++++++++++++++++-
ui/js/src/kimchi.api.js | 14 ++++++++++++++
ui/js/src/kimchi.main.js | 14 ++++++++++++++
ui/pages/kimchi-ui.html.tmpl | 10 ++++++++++
4 files changed, 73 insertions(+), 1 deletions(-)
diff --git a/ui/css/theme-default/topbar.css b/ui/css/theme-default/topbar.css
index bed4e19..127c56a 100644
--- a/ui/css/theme-default/topbar.css
+++ b/ui/css/theme-default/topbar.css
@@ -114,7 +114,7 @@
cursor: pointer;
display: block;
position: relative;
- height: 48px;
+ height: 52px;
margin: 0 12px;
}
@@ -174,3 +174,37 @@ a#btn-logout:hover {
display: none;
}
}
+
+.peers {
+ color: white;
+ cursor: pointer;
+ height: 52px;
+ margin: 0 12px;
+}
+
+.peers span {
+ margin-top: 25px;
+}
+
+.peers .arrow {
+ border: 6px solid transparent;
+ border-bottom: none;
+ border-top-color: white;
+ display: inline-block;
+ width: 0;
+}
+
+.peers .drowdown {
+ top: 45px;
+ right: 110px;
+ color: black;
+ padding: 10px 15px;
+ white-space: nowrap;
+ line-height: 12px;
+ width: inherit;
+}
+
+.peers .drowdown a {
+ display: block;
+ padding: 10px;
+}
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 4562992..8966cff 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -1098,5 +1098,19 @@ var kimchi = {
kimchi.message.error(data.responseJSON.reason);
}
});
+ },
+
+ getPeers : function(suc, err) {
+ kimchi.requestJSON({
+ url : kimchi.url + 'peers',
+ type : 'GET',
+ contentType : 'application/json',
+ dataType : 'json',
+ resend : true,
+ success : suc,
+ error : err ? err : function(data) {
+ kimchi.message.error(data.responseJSON.reason);
+ }
+ });
}
};
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js
index ba54b26..21ffca7 100644
--- a/ui/js/src/kimchi.main.js
+++ b/ui/js/src/kimchi.main.js
@@ -20,10 +20,24 @@ kimchi.tabMode = {};
kimchi.capabilities = undefined;
kimchi.getCapabilities(function(result) {
kimchi.capabilities = result;
+ kimchi.setupPeers();
}, function() {
kimchi.capabilities = {};
});
+kimchi.setupPeers = function(){
+ if(kimchi.capabilities.federation=="on"){
+ $('#peers').removeClass('hide-content');
+ kimchi.getPeers(function(data){
+ var hints = $('p', $('.drowdown', '#peers'));
+ data.length==0 ? hints.toggleClass('hide-content'): hints.addClass('hide-content');
+ for(var i=0; i<data.length; i++){
+ $('.drowdown', '#peers').append("<a href='"+data[i]+"' target='_blank'>"+data[i]+"</a>");
+ }
+ });
+ }
+};
+
kimchi.main = function() {
kimchi.popable();
diff --git a/ui/pages/kimchi-ui.html.tmpl b/ui/pages/kimchi-ui.html.tmpl
index 7bdf441..867ee36 100644
--- a/ui/pages/kimchi-ui.html.tmpl
+++ b/ui/pages/kimchi-ui.html.tmpl
@@ -71,6 +71,16 @@
<h1 id="logo"><img alt="Project Kimchi" src="images/theme-default/logo-white.png"></h1>
<ul class="nav-top">
<li>
+ <div id="peers" class="peers hide-content popable">
+ <span>$_("Peers")</span>
+ <span class="arrow"></span>
+ <div class="drowdown popover right-side">
+ <p>$_("Searching")...</p>
+ <p class="hide-content">$_("No peers found.")</p>
+ </div>
+ </div>
+ </li>
+ <li>
<div id="user" class="popable">
<span id="user-icon"></span>
<span id="user-name" class="empty-when-logged-off"></span>
--
1.7.1
10 years, 3 months