RFC - Guest memory usage
by Daniel Henrique Barboza
I was looking at the following item in the backlog:
Guests Stats: Display memory utilization (use virt-df or virt-top or ...)
If I understood it right, the idea here is to show the -inner- memory
allocation of the guest. If you have a VM with 4Gb of RAM running an
Ubuntu, we want to know how much memory the Ubuntu OS and its processes
are using.
I've done an investigation and I haven't found any tool to accomplish
this. "virt-top", "virsh dommemstat" and the libvirt API retrieves the
information of the memory usage of the guest relative to the host. In
the example mentioned before, supposing that the host has 64Gb of RAM,
all these tools would show that the VM is using 12% of the host RAM.
They do not dive in the VM and shows the actual mem usage of the Ubuntu
and its processes running there.
Haven't found anything useful in other MLs and forums. The common answer
is 'run top in a terminal inside the VM', which of course does not suit
us. My question is: any thoughts about how we can implement this
feature? Because I am starting to think that, in the end, this kind of
info is strict to the guest OS and can't be polled from the outside.
Thanks!
9 years, 2 months
[kimchi-devel][PATCHv3 0/6] Upload storage volume
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
known issue:
When using api to send requests without setting up session,
cherrypy server will report error after hundred of calls,
because race condition below:
https://bitbucket.org/cherrypy/cherrypy/pull-request/50/fix-race-conditio...
But it works well with session setup.
v3>v1,
Use libvirt upload api instead of r/w file
Use lock to synchronize upload to prevent
Royce Lv (6):
Update docs and json schema of storage volume upload
Update controller to make update accept formdata params
Add lock facility for storage volume upload
Update model for storage volume update
Fix incomplete record when uploading
update test case for storage volume upload
docs/API.md | 7 ++--
src/kimchi/API.json | 19 +++++++++++
src/kimchi/control/base.py | 6 ++--
src/kimchi/i18n.py | 4 +++
src/kimchi/isoinfo.py | 5 ++-
src/kimchi/mockmodel.py | 8 ++---
src/kimchi/model/storagevolumes.py | 61 +++++++++++++++-------------------
src/kimchi/model/utils.py | 46 ++++++++++++++++++++++++++
tests/test_model.py | 67 ++++++++++++++++++++++++++++++++++++++
9 files changed, 177 insertions(+), 46 deletions(-)
--
2.1.0
9 years, 8 months
[RFC] New API to create a random guest console password
by Aline Manera
Today user may set/change the guest console password and also its
expiration time through Kimchi API.
When passing an empty password, a random password is automatically
generated.
curl -u <user:password> -H "Content-Type: application/json" -H "Accept:
application/json"
http://localhost:8010/vms/blah -X PUT -d'{"graphics": {"passwd": ""}}'
That way is difficult to handle when user wants to reset the guest password.
We have a similar issue when we automatically change the passwdValidTo
when it is expired - increasing it in 30 seconds.
My proposal is simple: only change "passwd" and "passwdValidTo" when
user wants to do it.
curl -u <user:password> -H "Content-Type: application/json" -H "Accept:
application/json"
http://localhost:8010/vms/blah -X PUT -d'{"graphics": {"passwd":
"123456", "passwdValidTo": "<some datetime format>"}}'
curl -u <user:password> -H "Content-Type: application/json" -H "Accept:
application/json"
http://localhost:8010/vms/blah -X PUT -d'{"graphics":
{"passwdValidTo": "<some datetime format>"}}'
And make sure the passwdValidTo is only acceptable when there is a
passwd set.
And to reset those values, we only need to send an empty string:
curl -u <user:password> -H "Content-Type: application/json" -H "Accept:
application/json"
http://localhost:8010/vms/blah -X PUT -d'{"graphics": {"password":
"", "passwdValidTo": ""}}'
And create a new API: POST /vms/blah/ticket to automatically generate a
random password valid only for 30 seconds.
curl -u <user:password> -H "Content-Type: application/json" -H "Accept:
application/json"
http://localhost:8010/vms/blah/ticket -X POST -d'{}'
What do you think about it?
Regards,
Aline Manera
9 years, 8 months
[PATCH V2] UI: Add widget messagebar with sample
by Wen Wang
V1 -> V2:
Add a parameter "dismissTime" that allow delay time as well as "never"
for the dismiss time.
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/messagebar-flat.css | 64 ++++++++++++++++++++
ui/js/widgets/messagebar-flat.js | 71 +++++++++++++++++++++++
ui/js/widgets/samples/messagebar-flat-sample.html | 34 +++++++++++
3 files changed, 169 insertions(+)
create mode 100644 ui/css/theme-default/messagebar-flat.css
create mode 100644 ui/js/widgets/messagebar-flat.js
create mode 100644 ui/js/widgets/samples/messagebar-flat-sample.html
diff --git a/ui/css/theme-default/messagebar-flat.css b/ui/css/theme-default/messagebar-flat.css
new file mode 100644
index 0000000..d5efc8e
--- /dev/null
+++ b/ui/css/theme-default/messagebar-flat.css
@@ -0,0 +1,64 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+.messagebar {
+ height: 30px;
+}
+
+.messagebar .messagebar-text {
+ text-align: left;
+ vertical-align: 50%;
+}
+
+.messagebar .messageHead {
+ display: inline-block;
+ width: 5px;
+ height: 30px;
+}
+
+.messagebar-close {
+ line-height: 30px;
+ vertical-align: middle;
+ margin-right: 10px;
+ cursor: pointer;
+ float: right;
+}
+
+.green {
+ background-color: #DAE6CB;
+}
+
+.dark-green {
+ background-color: #89C53A;
+}
+
+.yellow {
+ background-color: #F1E3C2;
+}
+
+.dark-yellow {
+ background-color: #FDB60D;
+}
+
+.red {
+ background-color: #EAC3C7;
+}
+
+.dark-red {
+ background-color: #D81227;
+}
\ No newline at end of file
diff --git a/ui/js/widgets/messagebar-flat.js b/ui/js/widgets/messagebar-flat.js
new file mode 100644
index 0000000..203d194
--- /dev/null
+++ b/ui/js/widgets/messagebar-flat.js
@@ -0,0 +1,71 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+* Usage:
+ $(selector).messagebarFlat({
+ content: "Test", //message you want to show in the messagebar
+ color: "red", //Three color supported: "red", "yellow" and "green",
+ dismissTime: 3000 //when set to "never", the messagebar will never disappear.
+ // Or setting it to numbers for the dismiss time you want to delay.
+ });
+*/
+
+(function($) {
+ $.widget("kimchi.messagebarFlat", {
+ options : {
+ content : null,
+ color : "red",
+ dismissTime: 3000
+ },
+
+ _create: function() {
+ var now = this._getTime();
+ var that = this;
+ $("<div class='messagebar'><span class='messageHead'></span>" +
+ "<span class='messagebar-text'> " + this.options.content +": " + now + "</span></div>")
+ .addClass(this.options.color)
+ .appendTo(that.element);
+ $(".messageHead").addClass("dark-" + this.options.color);
+ $("<span class='messagebar-close icon-cancel-circled'></span>").on("click", function() {
+ that.destroy();
+ }).appendTo($(".messagebar"));
+ var dismissDelay = this.options.dismissTime;
+ if (dismissDelay != "never") {
+ setTimeout(function() {
+ that.destroy()
+ }, dismissDelay);
+ }
+ },
+
+ _getTime: function() {
+ var CT = new Date();
+ var currentDate = CT.getDate() + "/" + CT.getMonth()+1 + "/" +CT.getFullYear();
+ var currentTime = CT.getHours() + ":" + CT.getMinutes() + ":" + CT.getSeconds();
+ var now = currentDate + " " + currentTime;
+ return now;
+ },
+
+ destroy: function() {
+ var that = this;
+ that.element.fadeOut("normal", function() {
+ that.element.remove();
+ });
+ }
+ });
+})(jQuery);
\ No newline at end of file
diff --git a/ui/js/widgets/samples/messagebar-flat-sample.html b/ui/js/widgets/samples/messagebar-flat-sample.html
new file mode 100644
index 0000000..5ab4c73
--- /dev/null
+++ b/ui/js/widgets/samples/messagebar-flat-sample.html
@@ -0,0 +1,34 @@
+<!-- For the record if the icon didn't show properly, please copy the whole folder:
+ui/css/fontello/ under current directory and set the link of the css related
+to fontello to proper value. -->
+
+<!--Sample code -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Sample of messagebar</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+ <link rel="stylesheet" href="../../../css/fontello/css/fontello.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/animation.css">
+ <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
+ <link rel="stylesheet" href="../../../css/theme-default/messagebar-flat.css">
+ <script src="../../../libs/jquery-1.10.0.min.js"></script>
+ <script src="../../../libs/jquery-ui.min.js"></script>
+ <script src="../messagebar-flat.js"></script>
+ </head>
+ <body>
+ <div class="message"></div>
+ <script>
+ $(document).ready(function() {
+ $(".message").messagebarFlat({
+ content: "This is a test",
+ color: "red",
+ dismissTime: 1000
+ });
+ });
+ </script>
+ </body>
+
+</html>
--
2.1.0
9 years, 10 months
[v2 0/2] UI: Grid Widget(with sample)
by huoyuxin@linux.vnet.ibm.com
From: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
v2: add license statements and sample html
Yu Xin Huo (2):
UI: Grid Widget
ui: grid sample
ui/css/theme-default/datagrid.css | 63 +++++++++++++++++++++
ui/js/widgets/grid.js | 111 +++++++++++++++++++++++++++++++++++++
ui/js/widgets/samples/grid.html | 80 ++++++++++++++++++++++++++
3 files changed, 254 insertions(+), 0 deletions(-)
create mode 100644 ui/css/theme-default/datagrid.css
create mode 100644 ui/js/widgets/grid.js
create mode 100644 ui/js/widgets/samples/grid.html
9 years, 10 months
[kimchi-devel][RFC] Snapshot mockmodel tests fail for RHEL7 and fedora20
by Royce Lv
Latest added snapshots mockmodel tests fails at RHEL7 and fedora20
because libvirt test model lacks of related support:
======================================================================
ERROR: test_vm_lifecycle (test_rest.RestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_rest.py", line 92, in setUp
model.reset()
File "/home/royce/kimchi-2/kimchi/src/kimchi/mockmodel.py", line 133,
in reset
getattr(self, '%s_delete' % res[:-1])(i)
File "/home/royce/kimchi-2/kimchi/src/kimchi/model/vms.py", line 847,
in delete
snapshot_names = self.vmsnapshots.get_list(name)
File "/home/royce/kimchi-2/kimchi/src/kimchi/model/vmsnapshots.py",
line 117, in get_list
{'vm': vm_name, 'err': e.message})
OperationFailed: KCHSNAP0005E: Unable to list snapshots on virtual
machine 'kimchi-test'. Details: this function is not supported by the
connection driver: virDomainListAllSnapshots
I suggest probe the libvirt version or add feature probe as we do for
qemu stream to make sure tests run well on these systems.
9 years, 10 months
[PATCH] UI: Adding new textbox widget to new kimchi UI
by Wen Wang
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/textbox-flat.css | 22 ++++++++++++++++++++
ui/js/widgets/textbox-flat.js | 39 +++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 ui/css/theme-default/textbox-flat.css
create mode 100644 ui/js/widgets/textbox-flat.js
diff --git a/ui/css/theme-default/textbox-flat.css b/ui/css/theme-default/textbox-flat.css
new file mode 100644
index 0000000..39d5ffb
--- /dev/null
+++ b/ui/css/theme-default/textbox-flat.css
@@ -0,0 +1,22 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ .textbox-container {
+ border: 1px solid #CCC;
+ border-radius: 3px;
+ }
\ No newline at end of file
diff --git a/ui/js/widgets/textbox-flat.js b/ui/js/widgets/textbox-flat.js
new file mode 100644
index 0000000..80192ef
--- /dev/null
+++ b/ui/js/widgets/textbox-flat.js
@@ -0,0 +1,39 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// How to use:
+// $(".selector").textboxFlat({
+// hint: "hint"
+// });
+
+ (function($) {
+ $.widget("kimchi.textboxFlat", {
+ optons: {
+ hint: ""
+ },
+
+ _create: function() {
+ this.element.addClass("textbox-container");
+ this.element.attr("placeholder", this.options.hint);
+ },
+
+ destroy:function() {
+ this.element.remove();
+ }
+ });
+ })(jQuery);
\ No newline at end of file
--
2.1.0
9 years, 10 months
[PATCH] UI: Adding new radio widget of new kimchi UI
by Wen Wang
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/radio-flat.css | 30 +++++++++++++
ui/js/widgets/radio-flat.js | 86 +++++++++++++++++++++++++++++++++++++
2 files changed, 116 insertions(+)
create mode 100644 ui/css/theme-default/radio-flat.css
create mode 100644 ui/js/widgets/radio-flat.js
diff --git a/ui/css/theme-default/radio-flat.css b/ui/css/theme-default/radio-flat.css
new file mode 100644
index 0000000..0c03485
--- /dev/null
+++ b/ui/css/theme-default/radio-flat.css
@@ -0,0 +1,30 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ .radio-label {
+ position: relative;
+ cursor: pointer;
+ }
+
+ .radio-content {
+ margin-right: 10px;
+ }
+
+ .inline-radio {
+ display: inline-block;
+ }
\ No newline at end of file
diff --git a/ui/js/widgets/radio-flat.js b/ui/js/widgets/radio-flat.js
new file mode 100644
index 0000000..7be55f7
--- /dev/null
+++ b/ui/js/widgets/radio-flat.js
@@ -0,0 +1,86 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * //How to use:
+ * $(".selector").radioFlat({
+ * id: "t", //Base id of the radio set.
+ * name: "test", //name of the radio.
+ * whichChecked: 2, //First selected position, starts from 1.
+ * content: ["apple", "banana", "orange", "cherry"] //set the content array.
+ * });
+ *
+ *
+ * $(".test-bar").click(function() {
+ * console.log($(".test-bar").radioFlat("value")); //this is how to get the value of selected radio value
+ * });
+ *
+ *
+ *
+ */
+
+ (function($) {
+
+ $.widget("kimchi.radioFlat", {
+ options: {
+ id: "",
+ name: "",
+ whichChecked: "",
+ content:[],
+ },
+
+ _create: function() {
+ var that = this;
+ var radioName = this.options.name;
+ var labelID = this.options.id;
+ var checked = this.options.whichChecked;
+ var num = Number(this.options.content.length);
+ var html ="";
+ if(num >0) {
+ for(var i=1;i < num+1;i++) {
+ var tmpLabelID = labelID + i;
+ html += "<div class='icon-circle-empty inline-radio radio-label' id='" + tmpLabelID + "'></div>" +
+ "<label class='radio-content inline-radio' for='" + tmpLabelID + "'>" + that.options.content[i-1] + "</label>";
+ }
+ $(html).appendTo(that.element);
+ $("#" + labelID + checked).attr("checked", "true");
+ $("#" + labelID + checked).removeClass("icon-circle-empty");
+ $("#" + labelID + checked).addClass("icon-dot-circled");
+ }
+ $(".radio-label").on("click", function() {
+ $(".radio-label").removeClass("icon-dot-circled");
+ $(".radio-label").addClass("icon-circle-empty");
+ $(".radio-label").removeAttr("checked");
+ $(this).removeClass("icon-circle-empty");
+ $(this).addClass("icon-dot-circled");
+ $(this).attr("checked", "true");
+ var thisID = $(this).attr("id");
+ that.options.whichChecked = thisID.substring(labelID.length,thisID.length);
+ });
+ },
+
+ value: function() {
+ var value = Number(this.options.whichChecked) -1;
+ return this.options.content[value];
+ },
+
+ _destroy: function() {
+ this.element.remove();
+ }
+ });
+ })(jQuery);
\ No newline at end of file
--
2.1.0
9 years, 10 months
[PATCH] UI: Sample of dialog widget
by Wen Wang
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/js/widgets/samples/dialog-sample.html | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 ui/js/widgets/samples/dialog-sample.html
diff --git a/ui/js/widgets/samples/dialog-sample.html b/ui/js/widgets/samples/dialog-sample.html
new file mode 100644
index 0000000..65b77fb
--- /dev/null
+++ b/ui/js/widgets/samples/dialog-sample.html
@@ -0,0 +1,32 @@
+<!--Sample code of dialog-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Dialog Demo</title>
+ <script src="../../../libs/jquery-1.10.0.min.js"></script>
+ <script src="../../../libs/jquery-ui.min.js"></script>
+ <script src="../dialog-flat.js"></script>
+ <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
+ <link rel="stylesheet" href="../../../css/theme-default/dialog-flat.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/animation.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/fontello.css">
+ </head>
+ <body>
+ <div class="dialog-demo"></div>
+ <script>
+ $(document).ready(function() {
+ $(".dialog-demo").dialogFlat({
+ title: "Demo", //Title of the dialog.
+ confirmText: "Ok", //Text of the confirm button, "Ok" is the default value.
+ cancelText: "Cancel", //Text of the cancel button.
+ width: "600", //Width of the dialog, "px" is the default unit.
+ height: "500", //Height of the dialog, "px" is the default unit.
+ confirmFunc: function() {
+ alert("success");//Function after confirm
+ }
+ });
+ });
+ </script>
+ </body>
+</html>
\ No newline at end of file
--
2.1.0
9 years, 10 months
[v2 0/2] UI: Tabs Widget(With Sample)
by huoyuxin@linux.vnet.ibm.com
From: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
Yu Xin Huo (2):
UI: Customize jQuery UI Tabs Widget
UI: Tabs Widget Sample
ui/css/theme-default/tabs.css | 46 +++++++++++++++++++++++++
ui/css/theme-default/theme.css | 50 +++++++++++++++++++++++++++
ui/js/widgets/samples/tabs.html | 72 +++++++++++++++++++++++++++++++++++++++
3 files changed, 168 insertions(+), 0 deletions(-)
create mode 100644 ui/css/theme-default/tabs.css
create mode 100644 ui/css/theme-default/theme.css
create mode 100644 ui/js/widgets/samples/tabs.html
9 years, 10 months