[kimchi-devel][PATCH 0/6] Pool on existent VG
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Royce Lv (6):
Storagepool on existent VG: Update document
Add helper function to retrieve vg information
Update controller
Update model for existent VG
Update mockmodel tests
Fix fh leak in run_command subprocess
docs/API.md | 20 ++++++++++++++++
src/kimchi/control/host.py | 6 +++++
src/kimchi/i18n.py | 2 ++
src/kimchi/mockmodel.py | 9 ++++++++
src/kimchi/model/libvirtstoragepool.py | 11 +++++----
src/kimchi/model/storagepools.py | 28 +++++++++++++----------
src/kimchi/model/vgs.py | 42 ++++++++++++++++++++++++++++++++++
src/kimchi/utils.py | 22 ++++++++++++++++--
tests/test_mock_storagepool.py | 9 +++++++-
9 files changed, 130 insertions(+), 19 deletions(-)
create mode 100644 src/kimchi/model/vgs.py
--
2.1.0
9 years, 7 months
[RFC] Guest Network Boot support [Part1] - Create template and guest with support to Direct Boot
by Rodrigo Trujillo
Alan Evangelista (https://github.com/alanoe) and I are willing to
implement the support to Network Boot to Kimchi guests.
This is the first approach [Part1] we are going to develop: The direct boot
When finished, we are going to send [Part2] that will cover DHCP/TFTP, etc.
-------
This feature aims to develop Kimchi's support to create Guest that will
boot over Network using Libvirt Direct Boot
Libvirt details: https://libvirt.org/formatdomain.html#elementsOSKernel
Kimchi related bug: https://github.com/kimchi-project/kimchi/issues/372
We see three major changes in Kimchi code:
1- Change Template creation and update (BACKEND)
2- Change Template creation and update (FRONTEND)
3- Change Guest creation (BACKEND)
Details:
1- Change Template creation and update (BACKEND):
Backend is going to wait for these new parameters (json) in
Template creation or update:
"netboot": {
"kernel": "<KERNEL URL>",
"initrd": "<INITRD URL>",
"kernelargs": "<COMMAND LINE FOR KERNEL>",
"repository": "<PACKAGE REPOSITORY>" (optional)
}
Steps:
src/kimchi/API.json -> change "templates_create" and
"template_update" to receive above parameters;
src/kimchi/model/templates.py -> change
"TemplatesModel.create()" to check if "netboot" comes to save data properly
-> change "TemplateModel.update()" to check if
"netboot" comes and update data properly;
doc/API.md -> change to reflect new parameters;
src/kimchi/i18n.py -> add new errors if needed;
Other:
- Change templates auto tests if necessary;
- Change "VMTemplate" class in "src/kimchi/vmtemplate.py" in order
to probe DISTRO and VERSION;
2- Change Template creation and update (FRONTEND):
Front-end is going to have following changes:
- Add new entry in 'Add Template' window: "Network Direct
Installation";
- Create new window to allow user to provide new four parameters;
- Change Template update window. Add new tab to change or add
network installation parameters;
3- Change Guest creation (BACKEND)
Here it is necessary to change the XML creation, so we need to:
src/kimchi/vmtemplate.py -> change "VMTemplate.to_vm_xml()" to
check existence of parameter "netboot", then change <os> element properly.
Other:
- Change guests auto tests if necessary;
- Change xml (VMTemplate) auto test if necessary;
Rodrigo Trujillo
9 years, 7 months
[PATCH v2 0/4] issue #548: Hotplug network interfaces
by Crístian Deives
Here is the difference between this and the previous patchset:
- Patches 1, 2 and 3 have been added; they're just bug fixes, not
exactly related to the issue #548. Patch 4 remains the same.
Crístian Deives (4):
Parse osinfo.lookup return parameters correctly
Handle missing parameter "network" when attaching a NIC
Use default network model when attaching a NIC
issue #548: Hotplug network interfaces
src/kimchi/i18n.py | 1 -
src/kimchi/model/vmifaces.py | 57 +++++++++++++++++---------
src/kimchi/xmlutils/interface.py | 15 ++++++-
tests/test_model.py | 86 ++++++++++++++++++++--------------------
tests/test_rest.py | 5 +++
5 files changed, 100 insertions(+), 64 deletions(-)
--
2.1.0
9 years, 7 months
[PATCH v2] Create empty files on rpm build
by Ramon Medeiros
Changes
v2:
Only remove nginx conm
Issue #496 - System leftovers after uninstalling Kimchi
A rpm does not remove files that are not created by the installation. So,
all the files were provided by the package and now they can be
uninstalled. Beyond this, the function that creates the proxy conf
now accepts empty files to fill the configuration.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.fedora.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 9f7bb59..750dada 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -92,6 +92,10 @@ mkdir -p %{buildroot}/%{_localstatedir}/log/kimchi/
touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-access.log
touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-error.log
+# create /etc/kimchi structure
+mkdir -p %{buildroot}/%{_sysconfdir}/kimchi/
+touch %{buildroot}/%{_sysconfdir}/kimchi/nginx_kimchi.conf
+
# Install the systemd scripts
install -Dm 0644 contrib/kimchid.service.fedora %{buildroot}%{_unitdir}/kimchid.service
install -Dm 0640 src/firewalld.xml %{buildroot}%{_prefix}/lib/firewalld/services/kimchid.xml
@@ -161,6 +165,7 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/distros.d/opensuse.json
%{_sysconfdir}/kimchi/distros.d/ubuntu.json
%{_sysconfdir}/kimchi/distros.d/gentoo.json
+%{_sysconfdir}/kimchi/nginx_kimchi.conf
%{_sysconfdir}/kimchi/
%{_sharedstatedir}/kimchi/debugreports/
%{_sharedstatedir}/kimchi/screenshots/
--
1.8.3.1
9 years, 7 months
[PATCH v3 0/2] Remove nginx configuration on rpm -e
by Ramon Medeiros
Changes
v3:
Extend changes to suse
v2:
Remove only nginx conf. Let certificates on the machine
Ramon Medeiros (2):
Create empty files on rpm build
Remove nginx conf on suse
contrib/kimchi.spec.fedora.in | 5 +++++
contrib/kimchi.spec.suse.in | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
--
1.8.3.1
9 years, 7 months
[PATCH 1/2 V2] Set qcow2 as default disk format in new templates
by Rodrigo Trujillo
Users are allowed to provide disk format when creating a new Template.
However this is optional. This option sets qcow2 as default disk format
for every new Template created.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/osinfo.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 3c31346..ede2541 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -33,7 +33,8 @@ SUPPORTED_ARCHS = {'x86': ('i386', 'i686', 'x86_64'),
'ppc64le': ('ppc64le')}
-common_spec = {'cpus': 1, 'memory': 1024, 'disks': [{'index': 0, 'size': 10}],
+common_spec = {'cpus': 1, 'memory': 1024, 'disks': [{'index': 0, 'size': 10,
+ 'format': 'qcow2'}],
'cdrom_bus': 'ide', 'cdrom_index': 2, 'mouse_bus': 'ps2'}
--
2.1.0
9 years, 7 months
[PATCH V2] Template: Assign 'raw' to disk format if pool is 'logical' or [i]scsi
by Rodrigo Trujillo
Kimchi always creates raw disk format to new vm disks if the storagepool
is logical, iscsi or scsi. But, new templates where not using this
logic and was possible, through API calls, to create a template with a
SCSI storagepool and disk format vmdk, for instance.
This patch fixes this issue and makes necessary change in one of the
tests in order to avoid an error with _get_storage_type() and
deactivated storagepools.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/model/templates.py | 4 ++--
src/kimchi/vmtemplate.py | 5 +++++
tests/test_template.py | 2 ++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/templates.py b/src/kimchi/model/templates.py
index 6bc8aca..8a1820d 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -94,7 +94,7 @@ class TemplatesModel(object):
# Creates the template class with necessary information
# Checkings will be done while creating this class, so any exception
# will be raised here
- t = LibvirtVMTemplate(params, scan=True)
+ t = LibvirtVMTemplate(params, scan=True, conn=self.conn)
name = params['name']
try:
with self.objstore as session:
@@ -231,8 +231,8 @@ class TemplateModel(object):
class LibvirtVMTemplate(VMTemplate):
def __init__(self, args, scan=False, conn=None):
- VMTemplate.__init__(self, args, scan)
self.conn = conn
+ VMTemplate.__init__(self, args, scan)
def _storage_validate(self):
pool_uri = self.info['storagepool']
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 62772e5..3e4630d 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -75,6 +75,11 @@ class VMTemplate(object):
args['graphics'] = graphics
self.info.update(args)
+ # Assign right disk format to logical and [i]scsi storagepools
+ if self._get_storage_type() in ['logical', 'iscsi', 'scsi']:
+ for i, disk in enumerate(self.info['disks']):
+ self.info['disks'][i]['format'] = 'raw'
+
def _get_os_info(self, args, scan):
distro = version = 'unknown'
diff --git a/tests/test_template.py b/tests/test_template.py
index 23a24fb..acdb7c6 100644
--- a/tests/test_template.py
+++ b/tests/test_template.py
@@ -329,6 +329,8 @@ class TemplateTests(unittest.TestCase):
pool = {'type': 'dir', 'name': 'dir-pool', 'path': '/tmp/dir-pool'}
self.request('/storagepools', json.dumps(pool), 'POST')
+ pool_uri = '/storagepools/%s' % pool['name'].encode('utf-8')
+ self.request(pool_uri + '/activate', '{}', 'POST')
# Create a template using the custom network and pool
t = {'name': 'test', 'cdrom': '/tmp/mock.iso',
--
2.1.0
9 years, 7 months
[PATCH V2] Fix disk format lock during VM creation
by Rodrigo Trujillo
Users are able to pass the disk format (qcow, raw, etc) in disk Template
information. However, Kimchi is ignoring this information and always
creating QCOW2 disk images (if the storagepool is not 'LOGICAL') when it
creates a VM based on a given Template.
This patch fixes this problem.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/vmtemplate.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index ec477dd..62772e5 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -193,7 +193,6 @@ class VMTemplate(object):
def to_volume_list(self, vm_uuid):
storage_path = self._get_storage_path()
- fmt = 'raw' if self._get_storage_type() in ['logical'] else 'qcow2'
ret = []
for i, d in enumerate(self.info['disks']):
index = d.get('index', i)
@@ -201,11 +200,16 @@ class VMTemplate(object):
info = {'name': volume,
'capacity': d['size'],
- 'format': fmt,
+ 'format': d.get('format', 'qcow2'),
'path': '%s/%s' % (storage_path, volume)}
+ # Validate disk format
+ if self._get_storage_type() in ['logical'] and \
+ info['format'] != 'raw':
+ info['format'] = 'raw'
+
if 'logical' == self._get_storage_type() or \
- fmt not in ['qcow2', 'raw']:
+ info['format'] not in ['qcow2', 'raw']:
info['allocation'] = info['capacity']
else:
info['allocation'] = 0
--
2.1.0
9 years, 7 months
[RFC]Puppet deployment for Kimchi
by Royce Lv
Hi,
Kimchi's initial design concept is good out of box experience for
users. With features added, we have some advanced feature which needs
complex user set up (such as iscsi, nfs, ldap,peer discovery etc). This
makes testing, concept model set up, configuration not easy for new
users. To boost user experience, I would suggest to supply puppet script
samples for these set ups.
9 years, 7 months
[PATCH v4 0/7] Async Disk Creation
by Christy Perez
If a guest has a large disk, and uses a filesystem that requires
preallocation, it can take several minutes to create a VM. During that
time, kimchi is tied up by the VM creation.
This patch changes the VMs Collection to be an AsyncCollection.
Another change required for this was to create a more granular way to
query tasks. Currently it is not possible (using the API) to query tasks
for the same collection or resource type that may have different operations.
For example, VM cloning is also an asynchronous operation. For the guests tab,
the UI was querying all running tasks and displaying them with the Cloning
label. This picked up VMs that were being created as well. For more information
about how the tasks can be queried, see the updated API doc and the UI change.
Christy Perez (7):
Granular Task Queries: Backend
Granular task query test updates
Granular Task Queries: UI
Create guests asynchronously: Backend
Async vm creation test updates
VMs Async Create: UI
Translation update to add 'Creating'
docs/API.md | 16 ++++++
po/de_DE.po | 103 ++++++++++++++++++++-----------------
po/en_US.po | 83 +++++++++++++++++-------------
po/es_ES.po | 102 +++++++++++++++++++-----------------
po/fr_FR.po | 102 +++++++++++++++++++-----------------
po/it_IT.po | 102 +++++++++++++++++++-----------------
po/ja_JP.po | 102 +++++++++++++++++++-----------------
po/kimchi.pot | 84 +++++++++++++++++-------------
po/ko_KR.po | 102 +++++++++++++++++++-----------------
po/pt_BR.po | 102 +++++++++++++++++++-----------------
po/ru_RU.po | 102 +++++++++++++++++++-----------------
po/zh_CN.po | 102 +++++++++++++++++++-----------------
po/zh_TW.po | 102 +++++++++++++++++++-----------------
src/kimchi/control/vms.py | 4 +-
src/kimchi/mockmodel.py | 7 +--
src/kimchi/model/debugreports.py | 4 +-
src/kimchi/model/host.py | 4 +-
src/kimchi/model/storagepools.py | 2 +-
src/kimchi/model/storagevolumes.py | 12 +++--
src/kimchi/model/vms.py | 33 +++++++++---
src/kimchi/model/vmsnapshots.py | 5 +-
tests/test_authorization.py | 23 +++++----
tests/test_mockmodel.py | 12 +++--
tests/test_model.py | 60 ++++++++++++++-------
tests/test_model_storagevolume.py | 2 +-
tests/test_rest.py | 77 ++++++++++++++++++++-------
ui/css/theme-default/list.css | 18 +++++++
ui/js/src/kimchi.guest_main.js | 29 +++++++++--
ui/pages/guest.html.tmpl | 3 ++
29 files changed, 886 insertions(+), 613 deletions(-)
--
2.1.0
9 years, 7 months