[PATCH] Bug 431 Fix
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/js/src/kimchi.storage_main.js | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 28b2b58..9a45b65 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -21,7 +21,7 @@ kimchi.doListStoragePools = function() {
if (result && result.length) {
var listHtml = '';
$.each(result, function(index, value) {
- value.usage = parseInt(value.allocated / value.capacity * 100) || 0;
+ value.usage = Math.round(value.allocated / value.capacity * 100) || 0;
value.capacity = kimchi.changetoProperUnit(value.capacity,1);
value.allocated = kimchi.changetoProperUnit(value.allocated,1);
value.enableExt = value.type==="logical" ? "" : "hide-content";
@@ -313,7 +313,12 @@ kimchi.initLogicalPoolExtend = function() {
$("input[type='checkbox']:checked", "#logicalPoolExtend").each(function(){
devicePaths.push($(this).prop('value'));
})
- kimchi.updateStoragePool($("#logicalPoolExtend").dialog("option", "poolName"),{disks: devicePaths});
+ kimchi.updateStoragePool($("#logicalPoolExtend").dialog("option", "poolName"),{disks: devicePaths},function(data){
+ var item = $("#"+$("#logicalPoolExtend").dialog("option", "poolName"));
+ $(".usage", $(".storage-name", item)).text((Math.round(data.allocated/data.capacity*100)||0)+"%");
+ $(".storage-text", $(".storage-capacity", item)).text(kimchi.changetoProperUnit(data.capacity,1));
+ $(".storage-text", $(".storage-allocate", item)).text(kimchi.changetoProperUnit(data.allocated,1));
+ });
$(this).dialog("close");
}
}]
--
1.7.1
10 years, 3 months
[PATCH] Bugfix:#424 Edit Template, "Disk (GB)" is changing with storage pool
by Wen Wang
From: Wen Wang <wenwang(a)linux.vnet.ibm.com>
This patch fix the bug that value of "Disk(GB)" input box is changing
with the item of "Storage Pool" in "Templates" --> "Actions" --> "Edit"
-->"Edit Templates" dialogue. This might be comfusing to user when
changing the "Storage Pool", "Disk(GB)" is changed with it without even
notice. This might confuse the users and is not necessary. Solved by
removing the change.
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.template_edit_main.js | 25 -------------------------
1 files changed, 0 insertions(+), 25 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index cb43091..61d23b4 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -117,31 +117,6 @@ kimchi.template_edit_main = function() {
});
});
- $('#template-edit-storagePool').change(function() {
- storagepool = $(this).val();
- var storageArray = storagepool.split("/");
- if (storageArray.length > 3) {
- volumeName = storageArray.pop();
- poolName = storageArray.pop();
- kimchi.getStoragePoolVolume(poolName, volumeName, function(result) {
- $('input[name="disks"]', templateEditForm).val(result.capacity / Math.pow(1024,3));
- $('input[name="disks"]', templateEditForm).attr('disabled','disabled');
- return false;
- }, function (err) {
- kimchi.message.error(err.responseJSON.reason);
- });
- } else {
- if (origPool == storagepool) {
- // Previous disk size value
- $('input[name="disks"]', templateEditForm).val(origDisks[0].size);
- } else {
- // Default disk size value
- $('input[name="disks"]', templateEditForm).val(10);
- }
- $('input[name="disks"]', templateEditForm).removeAttr('disabled');
- }
- });
-
$('#tmpl-edit-button-save').on('click', function() {
var editableFields = [ 'name', 'cpus', 'memory', 'storagepool', 'disks', 'graphics'];
var data = {};
--
1.7.1
10 years, 3 months
[PATCH] issue #429: Properly set rollback function when creating vlan tagged bridged
by Aline Manera
The rollback function must be defined right after the action.
It is not linked to the exception raised.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/model/networks.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/kimchi/model/networks.py b/src/kimchi/model/networks.py
index 73e7ace..0ea9449 100644
--- a/src/kimchi/model/networks.py
+++ b/src/kimchi/model/networks.py
@@ -216,12 +216,11 @@ class NetworksModel(object):
'err': error_msg})
with RollbackContext() as rollback:
-
try:
vlan_tagged_br = conn.interfaceDefineXML(br_xml, 0)
+ rollback.prependDefer(vlan_tagged_br.destroy)
vlan_tagged_br.create(0)
except libvirt.libvirtError as e:
- rollback.prependDefer(vlan_tagged_br.destroy)
raise OperationFailed(e.message)
else:
return br_name
--
1.9.3
10 years, 3 months
[PATCH] issue #415: Do not allow renaming a debug report to the same name
by Crístian Viana
If the user tries to rename a debug report to the same name (i.e. not
actually rename...), Kimchi displays an error message indicating that
a debug report with that name already exists.
Check the new report name before renaming it, and if it hasn't changed,
display a message indicating that the name is the same as the
original one.
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.report_rename_main.js | 8 ++++++++
ui/pages/i18n.json.tmpl | 1 +
2 files changed, 9 insertions(+)
diff --git a/ui/js/src/kimchi.report_rename_main.js b/ui/js/src/kimchi.report_rename_main.js
index 03c3c3a..6ee56d9 100644
--- a/ui/js/src/kimchi.report_rename_main.js
+++ b/ui/js/src/kimchi.report_rename_main.js
@@ -24,6 +24,14 @@ kimchi.report_rename_main = function() {
return false;
}
var reportName = nameTextbox.val();
+
+ // if the user hasn't changed the report's name,
+ // nothing should be done.
+ if (reportName == kimchi.selectedReport) {
+ kimchi.message.error.code('KCHDR6013M');
+ return false;
+ }
+
var validator = RegExp("^[A-Za-z0-9-]*$");
if (!validator.test(reportName)) {
kimchi.message.error.code('KCHDR6011M');
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index 659bec8..c52b175 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -115,6 +115,7 @@
"KCHDR6010M": "$_("Download")",
"KCHDR6011M": "$_("Report name should contain only letters, digits, underscore ('_') and/or hyphen ('-').")",
"KCHDR6012M": "$_("Pending...")",
+ "KCHDR6013M": "$_("Report name is the same as the original one.")",
"KCHVM6001M": "$_("This will delete the virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
"KCHVM6002M": "$_("Power off Confirmation")",
--
1.9.3
10 years, 3 months
[PATCH V2] Bugfix:#424 Edit Template, "Disk (GB)" is changing with storage pool
by Wen Wang
From: Wen Wang <wenwang(a)linux.vnet.ibm.com>
V1 -> V2:
Considering iSCSI and SCSI situation that we need to have the input box
disabled when choosing iSCSI and SCSI for storage pool and enable when
choosing others.
This patch fix the bug that value of "Disk(GB)" input box is changing
with the item of "Storage Pool" in "Templates" --> "Actions" --> "Edit"
-->"Edit Templates" dialogue. This might be comfusing to user when
changing the "Storage Pool", "Disk(GB)" is changed with it without even
notice. This might confuse the users and is not necessary. Solved by
removing the change.
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.template_edit_main.js | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index cb43091..8133878 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -131,13 +131,6 @@ kimchi.template_edit_main = function() {
kimchi.message.error(err.responseJSON.reason);
});
} else {
- if (origPool == storagepool) {
- // Previous disk size value
- $('input[name="disks"]', templateEditForm).val(origDisks[0].size);
- } else {
- // Default disk size value
- $('input[name="disks"]', templateEditForm).val(10);
- }
$('input[name="disks"]', templateEditForm).removeAttr('disabled');
}
});
--
1.7.1
10 years, 3 months
[PATCH] Update Chinese transtation to po
by Wen Wang
From: Wen Wang <wenwang(a)linux.vnet.ibm.com>
Update the Chinese translation support
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
po/zh_CN.po | 186 ++++++++++++++++++++++++++++++-----------------------------
1 files changed, 95 insertions(+), 91 deletions(-)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index e6f9ac7..193fa58 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -20,14 +20,14 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-16 14:11-0300\n"
+"POT-Creation-Date: 2014-09-18 13:24+0800\n"
"PO-Revision-Date: 2013-06-27 10:48+0000\n"
"Last-Translator: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
"Language-Team: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
-"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh_CN\n"
"Generated-By: pygettext.py 1.5\n"
"X-Poedit-Country: CHINA\n"
"X-Poedit-Language: Chinese\n"
@@ -35,7 +35,7 @@ msgstr ""
#, python-format
msgid "Unknown parameter %(value)s"
-msgstr ""
+msgstr "未知变量 %(value)s"
#, python-format
msgid "Delete is not allowed for %(resource)s"
@@ -64,7 +64,7 @@ msgid "Parameters does not match requirement in schema: %(err)s"
msgstr "参数不符合要求的格式:%(err)s"
msgid "You don't have permission to perform this operation."
-msgstr ""
+msgstr "您没有权限执行这项操作。"
msgid "Datastore is not initiated in the model object."
msgstr "尚未为model对象初始化数据存储。"
@@ -111,7 +111,7 @@ msgstr "无法登录iSCSI主机%(host)s上的目标%(target)s。"
#, python-format
msgid "Unable to find ISO file %(filename)s"
-msgstr ""
+msgstr "未能找到ISO文件 %(filename)s"
#, python-format
msgid "The ISO file %(filename)s is not bootable"
@@ -141,8 +141,8 @@ msgstr "ISO文件%(filename)s的卷描述符格式错误"
msgid ""
"The hypervisor doesn't have permission to use this ISO %(filename)s. "
"Consider moving it under /var/lib/libvirt, or set the search permission to "
-"file access control lists for '%(user)s' user if possible, or add the "
-"'%(user)s' to the ISO path group, or (not recommended) 'chmod -R o+x "
+"file access control lists for '%(user)s' user if possible, or add the '%"
+"(user)s' to the ISO path group, or (not recommended) 'chmod -R o+x "
"'path_to_iso'.Details: %(err)s"
msgstr ""
"hypervisor没有访问ISO文件%(filename)s的权限。可以将ISO移到/var/lib/libvirt目"
@@ -150,14 +150,14 @@ msgstr ""
"或者为所有的用户增加访问权限 'chmod -R o+x '(不推荐)。详情:%(err)s"
msgid "An error occurred when probing image OS information."
-msgstr ""
+msgstr "搜索镜像操作系统信息时发生错误。"
msgid "No OS information found in given image."
-msgstr ""
+msgstr "在指定的镜像文件中未发现操作系统信息。"
#, python-format
msgid "Unable to read image file %(filename)s"
-msgstr ""
+msgstr "未能读取镜像文件 %(filename)s"
#, python-format
msgid "Virtual machine %(name)s already exists"
@@ -172,6 +172,8 @@ msgid ""
"Unable to rename virtual machine %(name)s. The name %(new_name)s is already "
"in use or the virtual machine is not powered off."
msgstr ""
+"未能实现虚拟机 %(name)s 重命名,名称 %(new_name)s 已被使用或者该虚拟机未关"
+"机。"
#, python-format
msgid "Unable to retrieve screenshot for stopped virtual machine %(name)s"
@@ -182,7 +184,7 @@ msgstr "该服务器不支持远程ISO镜像。"
#, python-format
msgid "Screenshot is not supported on virtual machine %(name)s"
-msgstr ""
+msgstr "虚拟机 %(name)s 不支持快照"
#, python-format
msgid "Unable to create virtual machine %(name)s. Details: %(err)s"
@@ -198,21 +200,21 @@ msgstr "不能获取虚拟机%(name)s。详情:%(err)s"
#, python-format
msgid "Unable to connect to powered off virtual machine %(name)s."
-msgstr ""
+msgstr "虚拟机 %(name)s 连接关闭失败。"
msgid "Virtual machine name must be a string"
msgstr "虚拟机名字必须是个字符串"
#, python-format
msgid "Invalid template URI %(value)s specified for virtual machine"
-msgstr ""
+msgstr "无效的虚拟机模板URI %(value)s"
#, python-format
msgid "Invalid storage pool URI %(value)s specified for virtual machine"
-msgstr ""
+msgstr "无效的虚拟机存储池URI %(value)s"
msgid "Supported virtual machine graphics are Spice or VNC"
-msgstr ""
+msgstr "虚拟机图形界面仅支持Spice以及VNC"
msgid "Graphics address to listen on must be IPv4 or IPv6"
msgstr "远程图形访问的监听地址必须是IPv4或IPv6地址。"
@@ -237,13 +239,13 @@ msgid "Unable to reset virtual machine %(name)s. Details: %(err)s"
msgstr "未能重置虚拟机%(name)s。详情:%(err)s"
msgid "User name list must be an array"
-msgstr ""
+msgstr "用户名列表必须为一个数组"
msgid "User name must be a string"
msgstr "用户名必须是一个字符串"
msgid "Group name list must be an array"
-msgstr ""
+msgstr "组名称列表必须为一个数组"
msgid "Group name must be a string"
msgstr "用户组名称必须是一个字符串"
@@ -266,10 +268,10 @@ msgid ""
msgstr "无法获得虚拟机 %(name)s的元数据,详情:%(err)s"
msgid "The guest console password must be a string."
-msgstr ""
+msgstr "客户机控制台密码必须为一个字符串。"
msgid "The life time for the guest console password must be a number."
-msgstr ""
+msgstr "客户机命令行密码有效时间必须是一个数字。"
#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
@@ -354,17 +356,17 @@ msgid "Invalid storage pool URI %(value)s specified for template"
msgstr "给模板指定了无效的存储池URI %(value)s"
msgid "Specify an ISO image as CDROM or a base image to create a template"
-msgstr ""
+msgstr "指定一个ISO镜像作为创建模板的CDROM或者基础镜像"
msgid "All networks for the template must be specified in a list."
msgstr "为模板指定的网络必须在一个列表中"
msgid "Specify a volume to a template when storage pool is iSCSI or SCSI"
-msgstr ""
+msgstr "当存储池类型为iSCSI或者SCSI的时候须为模板指定一个卷"
#, python-format
msgid "The volume %(volume)s is not in storage pool %(pool)s"
-msgstr ""
+msgstr "卷%(volume)s不在存储池%(pool)s中"
#, python-format
msgid "Unable to create template due error: %(err)s"
@@ -378,11 +380,11 @@ msgid "Disk size must be greater than 1GB."
msgstr "磁盘大小必须大于1GB。"
msgid "Template base image must be a valid local image file"
-msgstr ""
+msgstr "模板基础镜像必须为一个有效的本地镜像文件"
#, python-format
msgid "Cannot identify base image %(path)s format"
-msgstr ""
+msgstr "未能识别基础镜像%(path)s格式"
#, python-format
msgid "Storage pool %(name)s already exists"
@@ -410,8 +412,8 @@ msgstr "不能创建存储池 %(name)s。详情: %(err)s"
#, python-format
msgid ""
-"Unable to get number of storage volumes in storage pool %(name)s. Details: "
-"%(err)s"
+"Unable to get number of storage volumes in storage pool %(name)s. Details: %"
+"(err)s"
msgstr "不能获取储存池%(name)s中卷的数目。详情: %(err)s"
#, python-format
@@ -441,7 +443,7 @@ msgstr "不支持的存储池类型:%(type)s"
#, python-format
msgid "Error while retrieving storage pool XML to %(pool)s"
-msgstr ""
+msgstr "查询存储池XML到%(pool)s时出现错误"
msgid "Storage pool name must be a string"
msgstr "存储池名字必须是一个字符串"
@@ -449,7 +451,7 @@ msgstr "存储池名字必须是一个字符串"
msgid ""
"Supported storage pool types are dir, netfs, logical, iscsi, isci and kimchi-"
"iso"
-msgstr ""
+msgstr "存储池类型仅支持dir,netfs,logical,iscsi,isci以及kimchi-iso"
msgid "Storage pool path must be a string"
msgstr "存储池路径必须是字符串"
@@ -458,7 +460,7 @@ msgid "Storage pool host must be a IP or hostname"
msgstr "存储池主机必须是一个IP后者主机名"
msgid "Storage pool device must be the absolute path to the block device"
-msgstr ""
+msgstr "存储池设备必须为块设备的一个绝对路径"
msgid "Storage pool devices parameter must be a list"
msgstr "存储池设备参数必须是一个列表"
@@ -470,23 +472,23 @@ msgid "Port of a remote storage server must be an integer between 1 and 65535"
msgstr "远程存储服务器的端口必须是1到65535之间的整数"
msgid "iSCSI target username must be a string"
-msgstr ""
+msgstr "iSCSI目标用户名必须为一个字符串"
msgid "iSCSI target password must be a string"
-msgstr ""
+msgstr "iSCSI目标密码必须为一个字符串"
msgid "Specify name and type to create a storage pool"
msgstr "为新存储池指定名字和类型"
#, python-format
msgid ""
-"%(disk)s is not a valid disk/partition. Could not add it to the pool "
-"%(pool)s."
+"%(disk)s is not a valid disk/partition. Could not add it to the pool %(pool)"
+"s."
msgstr "%(disk)s 不是有效的磁盘/分区。不能被添加到存储池%(pool)s中"
#, python-format
msgid "Unable to extend logical pool %(pool)s. Details: %(err)s"
-msgstr ""
+msgstr "未能实现逻辑池%(pool)s的扩展,详情:%(err)s"
msgid "The parameter disks only can be updated for logical storage pool."
msgstr "只有逻辑存储池支持更新磁盘参数。"
@@ -540,7 +542,7 @@ msgstr "存储池%(pool)s中没有存储卷%(name)s"
msgid ""
"Unable to create storage volume %(volume)s because storage pool %(pool)s is "
"not active"
-msgstr ""
+msgstr "未能创建存储卷%(volume)s,因为存储池%(pool)s 未被激活"
#, python-format
msgid "Specify %(item)s in order to create storage volume %(volume)s"
@@ -559,8 +561,8 @@ msgstr "不能列出存储卷,因为存储池%(pool)s没有激活"
#, python-format
msgid ""
-"Unable to create storage volume %(name)s in storage pool %(pool)s. Details: "
-"%(err)s"
+"Unable to create storage volume %(name)s in storage pool %(pool)s. Details: %"
+"(err)s"
msgstr "不能在存储池%(pool)s中创建存储卷%(name)s。详情:%(err)s"
#, python-format
@@ -603,17 +605,17 @@ msgstr "存储卷信息更新失败。详情:%(err)s"
#, python-format
msgid "Only one of parameter %(param)s can be specified"
-msgstr ""
+msgstr "只能对参数%(param)s中的一个进行指定"
#, python-format
msgid "Create volume from %(param)s is not supported"
-msgstr ""
+msgstr "不支持从%(param)s创建虚拟机"
msgid "Storage volume capacity must be an integer number."
-msgstr ""
+msgstr "存储卷容量必须为一个整数"
msgid "Storage volume URL must be http://, https://, ftp:// or ftps://."
-msgstr ""
+msgstr "存储卷URL必须为http://,https://,ftp://或ftps://"
#, python-format
msgid "Interface %(name)s does not exist"
@@ -711,19 +713,21 @@ msgstr "不能创建诊断报告%(name)s。详情:%(err)s"
#, python-format
msgid "Can not find any debug report with the given name %(name)s"
-msgstr ""
+msgstr "未能找到指定名称%(name)s的调试报告"
#, python-format
msgid "Unable to generate debug report %(name)s. Details: %(err)s"
msgstr "不能生成诊断报告%(name)s。详情:%(err)s"
msgid "You should give a name for the debug report file."
-msgstr ""
+msgstr "您应当为调试报告文件指定一个名称。"
msgid ""
"Debug report name must be a string. Only letters, digits, underscore ('_') "
"and hyphen ('-') are allowed."
msgstr ""
+"调试报告名称必须为一个字符串。只有英文字符,数字,下划线('_')以及连字符('-')"
+"为合法字符。"
#, python-format
msgid ""
@@ -780,7 +784,7 @@ msgid "Timeout while running command '%(cmd)s' after %(seconds)s seconds"
msgstr "命令'%(cmd)s'运行%(seconds)s秒后超时。"
msgid "Unable to choose a virtual machine name"
-msgstr ""
+msgstr "未能选择一个虚拟机名称"
msgid "Invalid vm storage device name"
msgstr "无效的虚拟机存储设备名称"
@@ -790,21 +794,21 @@ msgstr "无效的存储类型。支持类型为:'cdrom','disk'"
#, python-format
msgid "The path '%(value)s' is not a valid local/remote path for the device"
-msgstr ""
+msgstr "路径'%(value)s'不是设备的有效本地/远程路径"
#, python-format
msgid ""
"Device name %(dev_name)s already exists in the virtual machine %(vm_name)s"
-msgstr ""
+msgstr "设备名称%(dev_name)s已经存在于虚拟机%(vm_name)s"
msgid "Only CDROM path can be update."
-msgstr ""
+msgstr "仅支持CDROM路径更新。"
#, python-format
msgid ""
-"The storage device %(dev_name)s does not exist in the virtual machine "
-"%(vm_name)s"
-msgstr ""
+"The storage device %(dev_name)s does not exist in the virtual machine %"
+"(vm_name)s"
+msgstr "存储设备%(dev_name)s在虚拟机%(vm_name)s中不存在"
#, python-format
msgid "Error while creating new storage device: %(error)s"
@@ -819,7 +823,7 @@ msgid "Error while removing storage device: %(error)s"
msgstr "移除存储设备时出错:%(error)s"
msgid "Do not support IDE device hot plug"
-msgstr ""
+msgstr "不支持IDE设备的热插拔"
msgid ""
"Specify type and path or type and pool/volume to add a new virtual machine "
@@ -835,10 +839,10 @@ msgstr "控制器类型为%(type)s的设备达到上限%(limit)s"
#, python-format
msgid "Cannot retrieve disk path information for given pool/volume: %(error)s"
-msgstr ""
+msgstr "未能为给出的存储池/存储卷找到对应磁盘路径信息:%(error)s"
msgid "Volume already in use by other virtual machine."
-msgstr ""
+msgstr "该卷已经被其他虚拟机使用。"
msgid ""
"Only one of path or pool/volume can be specified to add a new virtual "
@@ -1148,7 +1152,7 @@ msgid "No such data available."
msgstr "没有可用的数据"
msgid "Options needed."
-msgstr ""
+msgstr "需要选项。"
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
@@ -1169,13 +1173,13 @@ msgid "Warning"
msgstr "警告"
msgid "Creating..."
-msgstr ""
+msgstr "正在创建..."
msgid "Loading..."
msgstr "正在加载..."
msgid "An error occurred while checking for packages update."
-msgstr ""
+msgstr "查找软件包更新时出现错误。"
msgid "Retry"
msgstr "重试"
@@ -1184,7 +1188,7 @@ msgid "Detailed message:"
msgstr "详细消息:"
msgid "No ISO found"
-msgstr ""
+msgstr "没有发现ISO文件"
msgid "This is not a valid ISO file."
msgstr "这不是一个有效的ISO文件"
@@ -1287,7 +1291,7 @@ msgid "Updating..."
msgstr "正在更新..."
msgid "Failed to retrieve packages update information."
-msgstr ""
+msgstr "查找软件包更新信息失败。"
msgid "Failed to update package(s)."
msgstr "更新软件包失败"
@@ -1351,11 +1355,11 @@ msgid "Note the guest OS may ignore this request. Would you like to continue?"
msgstr "注意,客户机操作系统可能会忽略这个请求,确认要继续吗?"
msgid "Virtual Machine delete Confirmation"
-msgstr ""
+msgstr "虚拟机删除确认"
msgid ""
"This virtual machine is not persistent. Power Off will delete it. Continue?"
-msgstr ""
+msgstr "该虚拟机不是一个稳定的虚拟机,关机将会删除它,是否继续?"
msgid ""
"This CDROM will be detached permanently and you can re-attach it. Continue "
@@ -1380,7 +1384,7 @@ msgstr "成功卸载"
msgid ""
"This disk will be detached permanently and you can re-attach it. Continue to "
"detach it?"
-msgstr ""
+msgstr "该磁盘将会被永久卸载,你可以重新添加它,继续执行卸载操作吗?"
msgid "The VLAN id must be between 1 and 4094."
msgstr "VLAN 标识符必须在1至4094之间"
@@ -1422,46 +1426,46 @@ msgid "No SCSI adapters found."
msgstr "没有发现SCSI适配器"
msgid "Loading iSCSI targets..."
-msgstr ""
+msgstr "读取iSCSI目标..."
msgid "No iSCSI found. Please input one."
-msgstr ""
+msgstr "未能找到iSCSI,请输入一个"
msgid "Failed to load iSCSI targets."
-msgstr ""
+msgstr "读取iSCSI目标失败。"
msgid "The storage pool name can not be blank."
-msgstr "存储池的名称不能为空"
+msgstr "存储池的名称不能为空。"
msgid "The storage pool path can not be blank."
-msgstr "存储池的路径不能为空"
+msgstr "存储池的路径不能为空。"
msgid "NFS server mount path can not be blank."
-msgstr "NFS服务器挂载路径不能为空"
+msgstr "NFS服务器挂载路径不能为空。"
msgid "Invalid storage pool name. It should not contain '/'."
msgstr "无效的存储池的名字。名字中不能包含‘/’。"
msgid "Invalid NFS mount path."
-msgstr "无效的NFS挂载路径"
+msgstr "无效的NFS挂载路径。"
msgid "No logical device selected."
-msgstr "没有选择逻辑设备"
+msgstr "没有选择逻辑设备。"
msgid "The iSCSI target can not be blank."
-msgstr "iSCSI目标不能为空"
+msgstr "iSCSI目标不能为空。"
msgid "Server name can not be blank."
-msgstr "服务器不能为空"
+msgstr "服务器不能为空。"
msgid "This is not a valid Server Name or IP. Please, modify it."
-msgstr ""
+msgstr "这不是你个有效的服务器名称或IP地址,请对其进行修改。"
msgid "Looking for available partitions ..."
msgstr "查找有效的分区 ..."
msgid "No available partitions found."
-msgstr "没有发现模板"
+msgstr "没有发现模板。"
msgid ""
"This storage pool is not persistent. Instead of deactivate, this action will "
@@ -1469,28 +1473,28 @@ msgid ""
msgstr "对于非持久存储池,这个操作将会永久删除存储池而不是停用。是否继续?"
msgid "Unable to retrieve partitions information."
-msgstr ""
+msgstr "未能找到分区信息。"
msgid "In progress..."
-msgstr ""
+msgstr "正在进行..."
msgid "Failed!"
-msgstr ""
+msgstr "失败!"
msgid "CDROM path needs to be a valid local/remote path and cannot be blank."
-msgstr ""
+msgstr "CDROM路径需要一个有效的本地/远程路径且不能为空。"
msgid "Disk pool or volume cannot be blank."
msgstr "存储池或卷不能为空"
msgid "Peers"
-msgstr ""
+msgstr "对等机"
msgid "Searching"
-msgstr ""
+msgstr "正在查询"
msgid "No peers found."
-msgstr ""
+msgstr "没有发现对等机。"
msgid "Help"
msgstr "帮助"
@@ -1528,15 +1532,15 @@ msgstr ""
"含字母、数字、下划线 ('_') 和连字符('-')"
msgid "Rename a Debug Report"
-msgstr ""
+msgstr "重命名一个调试报告"
msgid ""
"The name used to identify the report. Name can contain: letters, digits and "
"hyphen (\"-\")."
-msgstr ""
+msgstr "报告的唯一表示名称,名称可以包含:英文字符,数字和连字符(\"-\")。"
msgid "Submit"
-msgstr ""
+msgstr "提交"
msgid "Add a Repository"
msgstr "增加一个软件仓库"
@@ -1657,19 +1661,19 @@ msgid "Please, wait..."
msgstr "请等待..."
msgid "Add a Volume to Storage Pool"
-msgstr ""
+msgstr "为存储池添加一个卷"
msgid "Fetch from remote URL"
-msgstr ""
+msgstr "从远程URL获取"
msgid "Enter the remote URL here."
-msgstr ""
+msgstr "在这里输入远程URL。"
msgid "Upload an file"
-msgstr ""
+msgstr "上传一个文件"
msgid "Choose the ISO file (with .iso suffix) you want to upload."
-msgstr ""
+msgstr "选择您需要上传的ISO文件(以.iso为后缀名)。"
msgid "Add Template"
msgstr "创建模板"
@@ -1681,7 +1685,7 @@ msgid "Local ISO Image"
msgstr "本地ISO镜像"
msgid "Local Image File"
-msgstr ""
+msgstr "本地镜像文件"
msgid "Remote ISO Image"
msgstr "远程ISO镜像"
@@ -1738,7 +1742,7 @@ msgid "CDROM"
msgstr "光驱"
msgid "Image File"
-msgstr ""
+msgstr "镜像文件"
msgid "Graphics"
msgstr "图形"
@@ -1840,7 +1844,7 @@ msgid "Activate"
msgstr "激活"
msgid "Add Volume"
-msgstr ""
+msgstr "添加卷"
msgid "Extend"
msgstr "扩展"
--
1.7.1
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] Add firewall instructions to README-federation
by Aline Manera
To properly run Kimchi with federation on system behind firewall, the
user must configure the firewall to do not block multicast responses.
Add those instructions to README-federation.md
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
docs/README-federation.md | 41 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/docs/README-federation.md b/docs/README-federation.md
index fdf4aed..47adfeb 100644
--- a/docs/README-federation.md
+++ b/docs/README-federation.md
@@ -10,15 +10,46 @@ virtualization and requires additional software installation.
To enable it, do the following:
-1) Install openslp and openslp-server packages
-2) openSLP uses port 427 (UDP) and port 427 (TCP) so make sure to open those
+1. Install openslp and openslp-server packages
+2. openSLP uses port 427 (UDP) and port 427 (TCP) so make sure to open those
ports in your firewall configuration
-3) Start slpd service and make sure it is up while running Kimchi
-4) Enable federation on Kimchi by editing the /etc/kimchi/kimchi.conf file:
+
+ For system using firewalld, do:
+ sudo firewall-cmd --permanent --add-port=427/udp
+ sudo firewall-cmd --permanent --add-port=427/tcp
+ sudo firewall-cmd --reload
+
+ For openSUSE systems, do:
+ sudo /sbin/SuSEfirewall2 open EXT TCP 427
+ sudo /sbin/SuSEfirewall2 open EXT UDP 427
+
+ For system using iptables, do:
+ sudo iptables -A INPUT -p tcp --dport 427 -j ACCEPT
+ sudo iptables -A INPUT -p udp --dport 427 -j ACCEPT
+
+3. In addition to the openSLP ports, you also need to allow multicast in the
+ firewall configuration
+
+ For system using firewalld, do:
+ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -s <subnet> -j ACCEPT
+
+ For openSUSE systems, do:
+ Add the subnet to the trusted networks listed on FW_TRUSTED_NETS in
+ /etc/sysconfig/SuSEfirewall2 file.
+ Make sure to restart /sbin/SuSEfirewall2 after modifying /etc/sysconfig/SuSEfirewall2
+
+ For system using iptables, do:
+ sudo iptables -A INPUT -s <subnet> -j ACCEPT
+
+4. Start slpd service and make sure it is up while running Kimchi
+ sudo service slpd start
+
+5. Enable federation on Kimchi by editing the /etc/kimchi/kimchi.conf file:
federation = on
-5) Then restart Kimchi service
+6. Then start Kimchi service
+ sudo service kimchid start
The Kimchi server will be registered on openSLP on server starting up and will
be found by other Kimchi peers (with federation feature enabled) in the same
--
1.9.3
10 years, 3 months
[PATCH] mock: Do not write file when downloading a volume
by Crístian Viana
The storage volumes created via download in mockmodel are being written
to the filesystem. As it is a mock environment, there's no real need to
write that file.
After running the current tests, the storage pool at "/var/lib/libvirt/images/"
has the volume "anyurl.wor.kz" left because of that behaviour.
Remove the file writing implementation when creating a volume via
download.
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
src/kimchi/mockmodel.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 8b58c36..904d335 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -575,13 +575,9 @@ class MockModel(object):
pool = self._get_storagepool(pool_name)
- file_path = os.path.join(pool.info['path'], name)
-
- with open(file_path, 'w') as file:
- file.write(url)
-
- params['path'] = file_path
+ params['path'] = os.path.join(pool.info['path'], name)
params['type'] = 'file'
+ params['base'] = url
volume = MockStorageVolume(pool, name, params)
pool._volumes[name] = volume
--
1.9.3
10 years, 3 months
[PATCH] issue #447: Use required parameter in function "refresh"
by Crístian Viana
The function "refresh" (storage pool) has a required parameter in
older versions of libvirt. On newer versions, however, this parameter
is optional and it was causing an error on RHEL because it uses an old
version of libvirt.
Always use the parameter in function "refresh" with its default
value (0).
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
src/kimchi/model/storagevolumes.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index 237173d..f9f226f 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -132,8 +132,7 @@ class StorageVolumesModel(object):
'err': e.message})
# Refresh to make sure volume can be found in following lookup
- pool = StoragePoolModel.get_storagepool(pool_name, self.conn)
- pool.refresh()
+ StoragePoolModel.get_storagepool(pool_name, self.conn).refresh(0)
cb('OK', True)
def _create_volume_with_capacity(self, cb, params):
@@ -209,7 +208,7 @@ class StorageVolumesModel(object):
'pool': pool_name,
'err': e.message})
- StoragePoolModel.get_storagepool(pool_name, self.conn).refresh()
+ StoragePoolModel.get_storagepool(pool_name, self.conn).refresh(0)
cb('OK', True)
def get_list(self, pool_name):
--
1.9.3
10 years, 3 months