[PATCH v5] [Kimchi] Storage Volume management
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This patch adds Storage Volume management functions Wipe, Clone, Resize and Delete with multiple selection. It also includes a filter input for each Storage Pool and Gallery View for Storage Volumes.
v1:
- HTML and CSS
v2:
- Delete and Wipe with multi-selection
- Confirm messages with list of selected volumes when wiping or deleting volumes (requires SCSS/CSS patch sent to Wok)
- Filter working
- Removed "Add Volume" link from Storage Pool action button
- Added "Add Volume" to Volume box action button
v3:
- Clone function working with multiple selection
- Progress bar working for clone and create volume
- Temporary volume added to the volumes when cloning
- Seamless refresh on the volumes once each task is finished
- Fixed issue when list wouldn't refresh when all volumes are removed from the storage pool.
v4:
- Prevent scroll when Drop-down in volumes list is clicked
- Dropdown is not clipped from volumes list when there's only one or two items on the list
- Added Media Queries for small screen resolutions
v5:
- Fixed black border in Firefox and IE when switching from List View to Gallery View
- Allocation and % Used in the parent table are now updated when wiping/resizing/deleting/cloning volumes
- Removed success messages / duplicated messages
- Changed scrollbar position in Volumes area
- When applying multiple actions, the checkbox is hidden/disabled and a spinner is shown while the the queue of selected items is being processed
Samuel Guimarães (1):
Storage Volume management
model/storagevolumes.py | 2 +-
ui/css/kimchi.css | 396 +++++++++++++++--
ui/css/src/modules/_storage.scss | 375 ++++++++++++++--
ui/js/src/kimchi.api.js | 50 +++
ui/js/src/kimchi.storage_main.js | 488 +++++++++++++++++----
ui/js/src/kimchi.storagepool_add_volume_main.js | 2 +-
ui/js/src/kimchi.storagepool_resize_volume_main.js | 59 +++
ui/pages/i18n.json.tmpl | 4 +
ui/pages/storagepool-resize-volume.html.tmpl | 51 +++
ui/pages/tabs/storage.html.tmpl | 155 ++++---
10 files changed, 1323 insertions(+), 259 deletions(-)
create mode 100644 ui/js/src/kimchi.storagepool_resize_volume_main.js
create mode 100644 ui/pages/storagepool-resize-volume.html.tmpl
--
1.9.3
8 years, 6 months
Re: [Kimchi-devel] [PATCH] [Kimchi] Properly display network interfaces when more than one exists
by Socorro Stoppler
Hi Aline,
I tried this w/a test env (i.e. --test) so I could have an interface and
when I created a VEPA network, it showed the interface. What showed up
as unavailable was the Address Space column. Would you mind sending me
a picture?
Thanks
-Socorro
On 05/27/2016 12:36 PM, Aline Manera wrote:
>
> Hi Socorro,
>
> 1. Once I create a VEPA or Passthrough Bridged network, the interface
> column displays "unavailable". If I switch tabs and go back to Network
> tab, the interface column displays the interface values as proposed by
> this patch.
>
> 2. I'd suggest to rename the variable name to 'interfaces' just to
> reflect that this field can list multiple values.
>
> Regards,
> Aline Manera
>
> On 05/25/2016 03:03 PM, Socorro Stoppler wrote:
>> This patch fixes a bug in the listing of networks in that only one
>> network
>> interface is being shown regardless of the number of interfaces that
>> exist for
>> that network.
>>
>> In addition to now displaying all of the interfaces, in the case
>> that there's too many to fit in the column, an ellipsis has been
>> added to indicate
>> that there's more interfaces than what it being shown. A tooltip
>> will be seen when
>> the user hovers over the interface(s) to show all of the interfaces.
>>
>>
>> Signed-off-by: Socorro Stoppler <socorro(a)linux.vnet.ibm.com>
>> ---
>> ui/css/kimchi.css | 8 ++++++--
>> ui/css/src/modules/_network.scss | 9 ++++++---
>> ui/js/src/kimchi.network.js | 4 +++-
>> ui/pages/tabs/network.html.tmpl | 4 ++--
>> 4 files changed, 17 insertions(+), 8 deletions(-)
>>
>> diff --git a/ui/css/kimchi.css b/ui/css/kimchi.css
>> index 49ea39a..72f340c 100644
>> --- a/ui/css/kimchi.css
>> +++ b/ui/css/kimchi.css
>> @@ -2156,12 +2156,16 @@ body.wok-gallery {
>>
>> #network-root-container .wok-datagrid > .wok-datagrid-header >
>> span.column-interface,
>> #network-root-container .wok-datagrid > .wok-datagrid-body >
>> .wok-datagrid-row > span.column-interface {
>> - width: 10.3896%;
>> + width: 15.3896%;
>> + padding-right: 40px;
>> + white-space: nowrap;
>> + overflow: hidden;
>> + text-overflow: ellipsis;
>> }
>>
>> #network-root-container .wok-datagrid > .wok-datagrid-header >
>> span.column-space,
>> #network-root-container .wok-datagrid > .wok-datagrid-body >
>> .wok-datagrid-row > span.column-space {
>> - width: 30%;
>> + width: 25%;
>> }
>>
>> #network-root-container .wok-datagrid > .wok-datagrid-header >
>> span.column-action,
>> diff --git a/ui/css/src/modules/_network.scss
>> b/ui/css/src/modules/_network.scss
>> index 4627ab5..ab47c89 100644
>> --- a/ui/css/src/modules/_network.scss
>> +++ b/ui/css/src/modules/_network.scss
>> @@ -93,18 +93,21 @@
>> }
>>
>> > span.column-interface {
>> - width: 10.3896%;
>> + width: 15.3896%;
>> + padding-right: 40px;
>> + white-space: nowrap;
>> + overflow: hidden;
>> + text-overflow: ellipsis;
>> }
>>
>> > span.column-space {
>> - width: 30%;
>> + width: 25%;
>> }
>>
>> > span.column-action {
>> width: 25.909%;
>> text-align: right;
>> }
>> -
>> }
>>
>> .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span {
>> diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
>> index 381449d..ac6bf74 100644
>> --- a/ui/js/src/kimchi.network.js
>> +++ b/ui/js/src/kimchi.network.js
>> @@ -35,6 +35,7 @@ kimchi.initNetwork = function() {
>> kimchi.initNetworkListView = function() {
>> $('.wok-mask').removeClass('hidden');
>> kimchi.listNetworks(function(data) {
>> + $('[data-toggle="tooltip"]').tooltip();
>> for (var i = 0; i < data.length; i++) {
>> var network = {
>> name : data[i].name,
>> @@ -46,7 +47,8 @@ kimchi.initNetworkListView = function() {
>> } else {
>> network.type = data[i].connection;
>> }
>> - network.interface = data[i].interfaces ?
>> data[i].interfaces[0] : null;
>> + network.interface = data[i].interfaces ?
>> data[i].interfaces : null;
>> + network.interface.join();
>> network.addrSpace = data[i].subnet ? data[i].subnet :
>> null;
>> network.persistent = data[i].persistent;
>> kimchi.addNetworkItem(network);
>> diff --git a/ui/pages/tabs/network.html.tmpl
>> b/ui/pages/tabs/network.html.tmpl
>> index 6ddabaa..7e2825d 100644
>> --- a/ui/pages/tabs/network.html.tmpl
>> +++ b/ui/pages/tabs/network.html.tmpl
>> @@ -85,11 +85,11 @@
>> </div>
>> <div id="modalWindow" class="modal fade network-modal"
>> tabindex="-1" role="dialog" aria-labelledby="networkModalLabel"
>> aria-hidden="true"> </div>
>> <script id="networkItem" type="text/html">
>> - <div id='{name}' class='wok-nw-grid-body remove-when-logged-off '>
>> + <div id='{name}' class='wok-nw-grid-body remove-when-logged-off'>
>> <span class='column-state' val="{state}"><span
>> class='network-state {state}'><i class="fa fa-power-off"></i><span
>> class="wok-nw-loading-icon"></span></span></span><!--
>> --><span class='column-name' title="{name}"
>> val="{name}">{name}</span><!--
>> --><span class='column-type'
>> val="{type}">{type}</span><!--
>> - --><span class='column-interface'
>> val="{interface}">{interface}</span><!--
>> + --><span class='column-interface'
>> data-placement="top" data-toggle="tooltip" title="{interface}"
>> val="{interface}">{interface}</span><!--
>> --><span class='column-space'
>> val="{addrSpace}">{addrSpace}</span><!--
>> --><span class='column-action'
>> style="display:none">
>> <span class="pull-right">
>
8 years, 6 months
[PATCH] [Wok] Log error when using tee arg on run_command.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Make the error, not only the output, of run_command execution be logged when
using the tee argument.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
src/wok/utils.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/wok/utils.py b/src/wok/utils.py
index b37518f..0ee4964 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -280,6 +280,8 @@ def run_command(cmd, timeout=None, silent=False, tee=None,
else:
wok_log.error(msg)
+ if tee is not None:
+ tee_log(msg, tee)
elif error:
wok_log.debug("error: %s returned from cmd: %s",
error, ' '.join(cmd))
--
2.5.5
8 years, 6 months
Re: [Kimchi-devel] [PATCH] [Kimchi] Always update snapshot XML with new name and UUID
by Aline Manera
Hi Lucio,
I am getting the following errors while running the tests. Could you
fix it and resend? I tested on Fedora 23.
***** Running unit test: test_model... FAILED
======================================================================
ERROR: test_vm_edit (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_model.py", line 1080, in test_vm_edit
inst.vm_update('kimchi-vm1', params)
File "/home/alinefm/wok/src/wok/plugins/kimchi/model/vms.py", line
290, in update
vm_name, dom = self._static_vm_update(name, dom, params)
File "/home/alinefm/wok/src/wok/plugins/kimchi/model/vms.py", line
816, in _static_vm_update
self._redefine_snapshots(dom, snapshots_info)
File "/home/alinefm/wok/src/wok/plugins/kimchi/model/vms.py", line
737, in _redefine_snapshots
xml = xml_item_update(xml, XPATH_SNAP_VM_NAME, dom.name(), None)
File "/home/alinefm/wok/src/wok/xmlutils/utils.py", line 52, in
xml_item_update
item.text = value
File "lxml.etree.pyx", line 951, in lxml.etree._Element.text.__set__
(src/lxml/lxml.etree.c:46377)
File "apihelpers.pxi", line 695, in lxml.etree._setNodeText
(src/lxml/lxml.etree.c:20989)
File "apihelpers.pxi", line 683, in lxml.etree._createTextNode
(src/lxml/lxml.etree.c:20865)
File "apihelpers.pxi", line 1393, in lxml.etree._utf8
(src/lxml/lxml.etree.c:27155)
ValueError: All strings must be XML compatible: Unicode or ASCII, no
NULL bytes or control characters
======================================================================
FAIL: test_vm_lifecycle (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_model.py", line 230, in test_vm_lifecycle
self.assertEquals(result, [u'kimchi-vm', snap['name']])
AssertionError: Lists differ: ['kimchi-vm-new', u'mysnap'] !=
[u'kimchi-vm', u'mysnap']
First differing element 0:
kimchi-vm-new
kimchi-vm
- ['kimchi-vm-new', u'mysnap']
? ----
+ [u'kimchi-vm', u'mysnap']
? +
----------------------------------------------------------------------
Ran 25 tests in 96.215s
FAILED (failures=1, errors=1, skipped=1)
On 05/30/2016 05:32 PM, Lucio Correia wrote:
> When a guest with snapshots is renamed, and afterwards
> guest is reverted to a snapshot created before the name
> change, the guest is also renamed back. This patch fixes
> this issue by updating snapshot XML when guest is renamed.
>
> Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
> ---
> model/vms.py | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/model/vms.py b/model/vms.py
> index 5c1b4e6..f5fbd16 100644
> --- a/model/vms.py
> +++ b/model/vms.py
> @@ -97,6 +97,8 @@ XPATH_DOMAIN_DEV_CPU_ID = '/domain/devices/spapr-cpu-socket/@id'
> XPATH_CPU = './cpu'
> XPATH_NAME = './name'
> XPATH_NUMA_CELL = './cpu/numa/cell'
> +XPATH_SNAP_VM_NAME = './domain/name'
> +XPATH_SNAP_VM_UUID = './domain/uuid'
> XPATH_TOPOLOGY = './cpu/topology'
> XPATH_VCPU = './vcpu'
> XPATH_MAX_MEMORY = './maxMemory'
> @@ -728,7 +730,15 @@ class VMModel(object):
> if info['current']:
> flags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT
>
> - dom.snapshotCreateXML(info['xml'], flags)
> + # Snapshot XML contains the VM xml from the time it was created.
> + # Thus VM name and uuid must be updated to current ones. Otherwise,
> + # when reverted, the vm name will be inconsistent.
> + xml = info['xml']
> + xml = xml_item_update(xml, XPATH_SNAP_VM_NAME, dom.name(), None)
> + xml = xml_item_update(xml, XPATH_SNAP_VM_UUID, dom.UUIDString(),
> + None)
> +
> + dom.snapshotCreateXML(xml, flags)
>
> def _update_metadata_name(self, dom, nonascii_name):
> if nonascii_name is not None:
8 years, 6 months
[PATCH] [Kimchi] Always update snapshot XML with new name and UUID
by Lucio Correia
When a guest with snapshots is renamed, and afterwards
guest is reverted to a snapshot created before the name
change, the guest is also renamed back. This patch fixes
this issue by updating snapshot XML when guest is renamed.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
model/vms.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/model/vms.py b/model/vms.py
index 5c1b4e6..f5fbd16 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -97,6 +97,8 @@ XPATH_DOMAIN_DEV_CPU_ID = '/domain/devices/spapr-cpu-socket/@id'
XPATH_CPU = './cpu'
XPATH_NAME = './name'
XPATH_NUMA_CELL = './cpu/numa/cell'
+XPATH_SNAP_VM_NAME = './domain/name'
+XPATH_SNAP_VM_UUID = './domain/uuid'
XPATH_TOPOLOGY = './cpu/topology'
XPATH_VCPU = './vcpu'
XPATH_MAX_MEMORY = './maxMemory'
@@ -728,7 +730,15 @@ class VMModel(object):
if info['current']:
flags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT
- dom.snapshotCreateXML(info['xml'], flags)
+ # Snapshot XML contains the VM xml from the time it was created.
+ # Thus VM name and uuid must be updated to current ones. Otherwise,
+ # when reverted, the vm name will be inconsistent.
+ xml = info['xml']
+ xml = xml_item_update(xml, XPATH_SNAP_VM_NAME, dom.name(), None)
+ xml = xml_item_update(xml, XPATH_SNAP_VM_UUID, dom.UUIDString(),
+ None)
+
+ dom.snapshotCreateXML(xml, flags)
def _update_metadata_name(self, dom, nonascii_name):
if nonascii_name is not None:
--
1.9.1
8 years, 6 months