[PATCH V2] Fix issue 766 - Define network interface in libvirt
by Lucio Correia
When a network interface was only visible to the system and
not to libvirt, libvirt throws an error when user asks a
bridged network to be created using that interface, since
it is not visible to libvirt.
This patch adds network interface redefinition code to make
it visible to libvirt, allowing the bridged network to be
created.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
Changes in V2:
- Daniel's review
- Removed error message
- Default interface type changed to 'network' in get_iface_xml
---
src/wok/plugins/kimchi/i18n.py | 1 -
src/wok/plugins/kimchi/model/networks.py | 25 ++++++++++++++++++++-----
src/wok/plugins/kimchi/network.py | 5 +++++
src/wok/plugins/kimchi/xmlutils/interface.py | 20 ++++++++++++++++----
4 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/src/wok/plugins/kimchi/i18n.py b/src/wok/plugins/kimchi/i18n.py
index de7962a..b3414e2 100644
--- a/src/wok/plugins/kimchi/i18n.py
+++ b/src/wok/plugins/kimchi/i18n.py
@@ -267,7 +267,6 @@ messages = {
"KCHNET0020E": _("Failed to activate interface %(iface)s: %(err)s."),
"KCHNET0021E": _("Failed to activate interface %(iface)s. Please check the physical link status."),
"KCHNET0022E": _("Failed to start network %(name)s. Details: %(err)s"),
- "KCHNET0023E": _("Unable to get XML definition for interface %(name)s. Details: %(err)s"),
"KCHNET0024E": _("Unable to redefine interface %(name)s. Details: %(err)s"),
"KCHNET0025E": _("Unable to create bridge %(name)s. Details: %(err)s"),
"KCHNET0026E": _("Open VSwitch bridges can only host bridged networks."),
diff --git a/src/wok/plugins/kimchi/model/networks.py b/src/wok/plugins/kimchi/model/networks.py
index 7f50003..403996a 100644
--- a/src/wok/plugins/kimchi/model/networks.py
+++ b/src/wok/plugins/kimchi/model/networks.py
@@ -33,6 +33,7 @@ from wok.xmlutils.utils import xpath_get_text
from wok.plugins.kimchi import netinfo
from wok.plugins.kimchi import network as knetwork
from wok.plugins.kimchi.osinfo import defaults as tmpl_defaults
+from wok.plugins.kimchi.xmlutils.interface import get_iface_xml
from wok.plugins.kimchi.xmlutils.network import create_linux_bridge_xml
from wok.plugins.kimchi.xmlutils.network import create_vlan_tagged_bridge_xml
from wok.plugins.kimchi.xmlutils.network import get_no_network_config_xml
@@ -240,13 +241,29 @@ class NetworksModel(object):
# get xml definition of interface
iface_xml = self._get_interface_desc_xml(interface)
+ # interface not defined in libvirt: try to define it
+ iface_defined = False
+ conn = self.conn.get()
+ if iface_xml is None:
+ try:
+ mac = knetwork.get_dev_macaddr(str(interface))
+ iface_xml = get_iface_xml({'type': 'ethernet',
+ 'name': interface,
+ 'mac': mac,
+ 'startmode': "onboot"})
+ conn.interfaceDefineXML(iface_xml.encode("utf-8"))
+ iface_defined = True
+ except libvirt.libvirtError, e:
+ raise OperationFailed("KCHNET0024E", {'name': interface,
+ 'err': e.get_error_message()})
+
# Truncate the interface name if it exceeds 13 characters to make sure
# the length of bridge name is less than 15 (its maximum value).
br_name = KIMCHI_BRIDGE_PREFIX + interface[-13:]
br_xml = create_linux_bridge_xml(br_name, interface, iface_xml)
# drop network config from interface
- self._redefine_iface_no_network(interface)
+ iface_defined or self._redefine_iface_no_network(interface, iface_xml)
# create and start bridge
self._create_bridge(br_name, br_xml)
@@ -270,16 +287,14 @@ class NetworksModel(object):
iface = conn.interfaceLookupByName(name)
xml = iface.XMLDesc(flags=VIR_INTERFACE_XML_INACTIVE)
except libvirt.libvirtError, e:
- raise OperationFailed("KCHNET0023E",
- {'name': name, 'err': e.get_error_message()})
+ return None
return xml
- def _redefine_iface_no_network(self, name):
+ def _redefine_iface_no_network(self, name, iface_xml):
conn = self.conn.get()
# drop network config from definition of interface
- iface_xml = self._get_interface_desc_xml(name)
xml = get_no_network_config_xml(iface_xml.encode("utf-8"))
try:
diff --git a/src/wok/plugins/kimchi/network.py b/src/wok/plugins/kimchi/network.py
index 1433b8a..eee0e8c 100644
--- a/src/wok/plugins/kimchi/network.py
+++ b/src/wok/plugins/kimchi/network.py
@@ -31,6 +31,11 @@ DefaultNetsPool = [ipaddr.IPNetwork('192.168.122.0/23'),
ipaddr.IPNetwork('192.168.128.0/17')]
+def get_dev_macaddr(dev):
+ info = ethtool.get_interfaces_info(dev)[0]
+ return info.mac_address
+
+
def get_dev_netaddr(dev):
info = ethtool.get_interfaces_info(dev)[0]
return (info.ipv4_address and
diff --git a/src/wok/plugins/kimchi/xmlutils/interface.py b/src/wok/plugins/kimchi/xmlutils/interface.py
index 64df8cd..814caf9 100644
--- a/src/wok/plugins/kimchi/xmlutils/interface.py
+++ b/src/wok/plugins/kimchi/xmlutils/interface.py
@@ -26,15 +26,27 @@ from wok.plugins.kimchi import osinfo
def get_iface_xml(params, arch=None, os_distro=None, os_version=None):
"""
- <interface type='network'>
+ <interface type='network' name='ethX'>
+ <start mode='onboot'/>
<source network='default'/>
<model type='virtio'/>
</interface>
"""
- interface = E.interface(type=params['type'])
- interface.append(E.source(network=params['network']))
+ name = params.get('name', None)
+ if name:
+ interface = E.interface(type=params.get('type', 'network'), name=name)
+ else:
+ interface = E.interface(type=params.get('type', 'network'))
- model = params.get('model')
+ stmode = params.get('startmode', None)
+ if stmode:
+ interface.append(E.start(mode=stmode))
+
+ nw = params.get('network', None)
+ if nw:
+ interface.append(E.source(network=nw))
+
+ model = params.get('model', None)
# no model specified; let's try querying osinfo
if model is None:
--
1.9.1
9 years
[PATCH V3 0/1] Debugreport generation
by mesmriti@linux.vnet.ibm.com
From: Megha Smriti <mesmriti(a)linux.vnet.ibm.com>
Fixed the comments as a part of which removed the check
for platform s390x.Modified the log_errors to wok_log.
Removed the replacement of underscore in the sosreport name
and check for /usr/sbin/dbginfo.sh command in system_reports_tools.
root (1):
Fixed the comments for debugreports in report tool and removed the
check for platform s390x and introduced wok_log errors in
log_errors.
src/wok/plugins/gingerbase/i18n.py | 4 +-
src/wok/plugins/gingerbase/model/debugreports.py | 181 ++++++++++++++++++-----
2 files changed, 143 insertions(+), 42 deletions(-)
--
2.4.3
9 years
[PATCH] Issue 769 : kimchi dependancy update to gingerbase instead wok
by chandra@linux.vnet.ibm.com
From: Chandra Shekhar Reddy Potula <chandra(a)linux.vnet.ibm.com>
Kimchi should be pointing to gingerbase than wok, as plugin kimchi
have dependeny on gingerbase common files (like disks.py)
Taken care of README.md to shows png files correctly when browse it
---
src/wok/plugins/kimchi/contrib/DEBIAN/control.in | 2 +-
src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in | 2 +-
src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in | 2 +-
src/wok/plugins/kimchi/docs/README.md | 12 ++++++------
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/wok/plugins/kimchi/contrib/DEBIAN/control.in b/src/wok/plugins/kimchi/contrib/DEBIAN/control.in
index ba528a1..7a111ed 100644
--- a/src/wok/plugins/kimchi/contrib/DEBIAN/control.in
+++ b/src/wok/plugins/kimchi/contrib/DEBIAN/control.in
@@ -3,7 +3,7 @@ Version: @PACKAGE_VERSION@
Section: base
Priority: optional
Architecture: all
-Depends: wok,
+Depends: ginger-base,
python-imaging,
python-configobj,
websockify,
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
index d1e0046..457bdb4 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
@@ -7,7 +7,7 @@ BuildArch: noarch
Group: System Environment/Base
License: LGPL/ASL2
Source0: %{name}-%{version}.tar.gz
-Requires: wok
+Requires: ginger-base
Requires: qemu-kvm
Requires: gettext
Requires: libvirt
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
index 640ade9..80ca4bc 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
@@ -7,7 +7,7 @@ BuildArch: noarch
Group: System Environment/Base
License: LGPL/ASL2
Source0: %{name}-%{version}.tar.gz
-Requires: wok
+Requires: ginger-base
Requires: kvm
Requires: gettext-tools
Requires: libvirt
diff --git a/src/wok/plugins/kimchi/docs/README.md b/src/wok/plugins/kimchi/docs/README.md
index 23db018..628d3b9 100644
--- a/src/wok/plugins/kimchi/docs/README.md
+++ b/src/wok/plugins/kimchi/docs/README.md
@@ -48,7 +48,7 @@ Install Dependencies
**For fedora and RHEL:**
- $ sudo yum install wok libvirt-python libvirt \
+ $ sudo yum install ginger-base libvirt-python libvirt \
libvirt-daemon-config-network python-imaging \
qemu-kvm python-ethtool sos python-ipaddr \
nfs-utils iscsi-initiator-utils pyparted \
@@ -76,7 +76,7 @@ channel at RHN Classic or Red Hat Satellite.
**For Ubuntu (Debian-based):**
- $ sudo apt-get install wok python-imaging python-configobj websockify \
+ $ sudo apt-get install ginger-base python-imaging python-configobj websockify \
novnc python-libvirt libvirt-bin nfs-common \
qemu-kvm python-parted python-ethtool sosreport \
xsltproc python-ipaddr python-lxml open-iscsi \
@@ -88,7 +88,7 @@ channel at RHN Classic or Red Hat Satellite.
**For openSUSE:**
- $ sudo zypper install wok libvirt-python libvirt \
+ $ sudo zypper install ginger-base libvirt-python libvirt \
libvirt-daemon-config-network python-imaging \
kvm python-ethtool python-ipaddr nfs-client \
open-iscsi python-parted python-libguestfs \
@@ -178,13 +178,13 @@ Usage
Connect your browser to https://localhost:8001. You should see a screen like:
-![Wok Login Screen](/docs/kimchi-login.png)
+![Wok Login Screen](docs/kimchi-login.png)
Wok uses PAM to authenticate users so you can log in with the same username
and password that you would use to log in to the machine itself. Once logged in
you will see a screen like:
-![Kimchi Guest View](/docs/kimchi-guest.png)
+![Kimchi Guest View](docs/kimchi-guest.png)
This shows you the list of running guests including a live screenshot of
the guest session. You can use the action buttons to shutdown the guests
@@ -198,7 +198,7 @@ top navigation bar.
The template screen looks like:
-![Kimchi Template View](/docs/kimchi-templates.png)
+![Kimchi Template View](docs/kimchi-templates.png)
From this view, you can change the parameters of a template or create a
new template using the "+" button in the upper right corner.
--
2.4.3
9 years
[PATCH 0/2 V2] #749 Dbginfo report generation
by mesmriti@linux.vnet.ibm.com
From: Megha Smriti <mesmriti(a)linux.vnet.ibm.com>
The reveiw comments have been fixed.We have
now different methods for sosreport generation
and dbginfo report generation combined with
sosreport for s390x platform.Modifications were made
in the dbginfo.sh command such that the dbginfo
reports can now be generated in the desired location.
So the sosreport and dbgreport are generated in /var/tmp
path and finally compressed and moved to config.path()
root (1):
Dbginfo report generation
src/wok/plugins/gingerbase/i18n.py | 4 +-
src/wok/plugins/gingerbase/model/debugreports.py | 212 ++++++++++++++++++-----
2 files changed, 167 insertions(+), 49 deletions(-)
--
2.4.3
9 years
[PATCH 0/2] Live Migration UI
by sguimaraes943@gmail.com
From: samhenri <samuel.guimaraes(a)eldorado.org.br>
This patch addes Live Migration functionality to the new-ui.
I'm attaching Socorro initial commit because I had to merge and resolve conflicts with the current new-ui version of Guests tab.
The "Delete this VM when the migration is completed" checkbox is currently disabled because it wasn't working properly (trying to delete VM before migration was complete).
Socorro Stoppler (1):
Initial checkin for live migration UI support
samhenri (1):
Fixing Live Migration for the new-ui Guests tab
src/wok/plugins/ginger | 2 +-
src/wok/plugins/kimchi/ui/js/src/kimchi.api.js | 3 +-
.../kimchi/ui/js/src/kimchi.guest_livemigration.js | 109 +++++++++++++++++++++
.../plugins/kimchi/ui/js/src/kimchi.guest_main.js | 41 +++++++-
.../kimchi/ui/pages/guest-migration.html.tmpl | 67 +++++++++++++
src/wok/plugins/kimchi/ui/pages/guest.html.tmpl | 3 +-
src/wok/plugins/kimchi/ui/pages/i18n.json.tmpl | 2 +
src/wok/plugins/kimchi/ui/pages/network.html.tmpl | 1 -
8 files changed, 219 insertions(+), 9 deletions(-)
create mode 100644 src/wok/plugins/kimchi/ui/js/src/kimchi.guest_livemigration.js
create mode 100644 src/wok/plugins/kimchi/ui/pages/guest-migration.html.tmpl
--
1.9.3
9 years
[PATCH 0/8] [new-ui] Ginger / Administration
by sguimaraes943@gmail.com
From: samhenri <samuel.guimaraes(a)eldorado.org.br>
This patch adds the new-ui to Ginger.
Andre Teodoro (8):
Changing Collapse from Admin Screen to Bootstrap Accodion
Applying new-ui at SAN Adapters Admin panel
Applying new ui at Administration tab
Applying new-ui at SEP Configuration Panel
Applying new-ui at SEP Configuration Modal
Applying new ui at Admin User Management Modal
Applying new ui at Admin Backup Batch Delete Modal
Fixing minor issues at Admin Backup Batch Delete Modal
ui/css/src/host-admin.scss | 75 +++-
ui/js/host-admin.js | 846 +++++++++++++++++++++---------------------
ui/pages/host-admin.html.tmpl | 589 +++++++++++++++++++----------
3 files changed, 874 insertions(+), 636 deletions(-)
--
1.9.3
9 years
[PATCH 0/3] [new-ui] Guests tab and Admin SCSS
by sguimaraes943@gmail.com
From: samhenri <samuel.guimaraes(a)eldorado.org.br>
This patch adds new-ui to Guests page and some styles for new-ui in Ginger.
Andre Teodoro (1):
[new-ui] Adding new-ui to Administration tab
* If applied may break some jQuery-UI collapsible elements
samhenri (2):
Minor CSS fixes in the new-ui
[new-ui] Guests tab
.../plugins/kimchi/ui/css/theme-default/list.css | 330 ----------
.../plugins/kimchi/ui/js/src/kimchi.guest_main.js | 676 +++++++++++++--------
src/wok/plugins/kimchi/ui/pages/guest.html.tmpl | 125 ++--
src/wok/plugins/kimchi/ui/pages/guests.html.tmpl | 33 +-
ui/css/src/modules/_administration.scss | 340 +++++++++++
ui/css/src/modules/_guests.scss | 241 ++++++++
ui/css/src/modules/_network.scss | 2 +-
ui/css/src/modules/_storage.scss | 2 +-
ui/css/src/modules/_wok-grid.scss | 2 +-
ui/css/src/modules/_wok-variables.scss | 9 +-
ui/images/theme-default/icon-unknown.png | Bin 761 -> 3797 bytes
11 files changed, 1115 insertions(+), 645 deletions(-)
delete mode 100644 src/wok/plugins/kimchi/ui/css/theme-default/list.css
--
1.9.3
9 years, 1 month
[PATCH 0/3] [new-ui] Guests tab and Admin SCSS v2
by sguimaraes943@gmail.com
From: samhenri <samuel.guimaraes(a)eldorado.org.br>
This patch adds new-ui to Guests page and fixes some bugs in Templates.
It also removes Administration / Ginger references from SCSS files. A patch will be sent to Ginger community with the modified files.
Andre Teodoro (1):
[new-ui] Removed Administration / Ginger references from WOK ui assets
samhenri (2):
[new-ui] Templates tab and modal windows bugfixes
[new-ui] Guests tab
.../plugins/kimchi/ui/css/theme-default/list.css | 330 ----------
.../plugins/kimchi/ui/js/src/kimchi.guest_main.js | 677 +++++++++++++--------
.../kimchi/ui/js/src/kimchi.template_add_main.js | 10 +-
src/wok/plugins/kimchi/ui/pages/guest.html.tmpl | 122 ++--
src/wok/plugins/kimchi/ui/pages/guests.html.tmpl | 33 +-
.../plugins/kimchi/ui/pages/template-add.html.tmpl | 3 +-
.../plugins/kimchi/ui/pages/templates.html.tmpl | 2 +-
ui/css/src/modules/_administration.scss | 0
ui/css/src/modules/_guests.scss | 237 ++++++++
ui/css/src/modules/_network.scss | 2 +-
ui/css/src/modules/_storage.scss | 2 +-
ui/css/src/modules/_templates.scss | 2 +-
ui/css/src/modules/_wok-grid.scss | 2 +-
ui/css/src/modules/_wok-variables.scss | 9 +-
ui/css/src/wok.scss | 2 -
ui/images/theme-default/icon-unknown.png | Bin 761 -> 3797 bytes
16 files changed, 776 insertions(+), 657 deletions(-)
delete mode 100644 src/wok/plugins/kimchi/ui/css/theme-default/list.css
delete mode 100644 ui/css/src/modules/_administration.scss
--
1.9.3
9 years, 1 month
[PATCH v2] Support Linux Bridge creation
by Ramon Medeiros
Create linux-bridge with libvirt API. Kimchi was only creating macvtap
devices, with has some limitation. For further information, take a look
at Kimchi wiki discuss:
https://github.com/kimchi-project/kimchi/wiki/Create-guest-network
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
Changes:
v2:
Remove unused imports and constants
Fix pep8 issues
Testing:
In my case, i create a new bridge over the interface enp0s25 with name ramon
curl -u root -H "Content-Type: application/json" -H "Accept: application/json" "http://localhost:8010/plugins/kimchi/networks" -X POST -d '{"name": "ramon", "connection":"bridge", "interface":"enp0s25", "mode":"linux-bridge"}'
To delete, you can remove by UI or:
curl -u root -H "Content-Type: application/json" -H "Accept: application/json" "http://localhost:8010/plugins/kimchi/networks/ramon" -X DELETE -d ''
---
src/wok/plugins/kimchi/model/networks.py | 35 ++++++++++++++++++++++++++++--
src/wok/plugins/kimchi/network.py | 19 ++++++++++++++++
src/wok/plugins/kimchi/xmlutils/network.py | 12 ++++++++++
3 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/src/wok/plugins/kimchi/model/networks.py b/src/wok/plugins/kimchi/model/networks.py
index 71ea595..c17a3bf 100644
--- a/src/wok/plugins/kimchi/model/networks.py
+++ b/src/wok/plugins/kimchi/model/networks.py
@@ -30,12 +30,13 @@ from wok.rollbackcontext import RollbackContext
from wok.utils import run_command, wok_log
from wok.xmlutils.utils import xpath_get_text
+
from wok.plugins.kimchi import netinfo
from wok.plugins.kimchi import network as knetwork
from wok.plugins.kimchi.osinfo import defaults as tmpl_defaults
from wok.plugins.kimchi.xmlutils.network import create_vlan_tagged_bridge_xml
from wok.plugins.kimchi.xmlutils.network import to_network_xml
-
+from wok.plugins.kimchi.xmlutils.network import create_linux_bridge
KIMCHI_BRIDGE_PREFIX = 'kb'
@@ -160,7 +161,10 @@ class NetworksModel(object):
def _set_network_bridge(self, params):
try:
iface = params['interface']
- if iface in self.get_all_networks_interfaces():
+
+ if params["mode"] == "linux-bridge":
+ iface = self._create_linux_bridge(iface)
+ elif iface in self.get_all_networks_interfaces():
msg_args = {'iface': iface, 'network': params['name']}
raise InvalidParameter("KCHNET0006E", msg_args)
except KeyError:
@@ -196,6 +200,33 @@ class NetworksModel(object):
net_dict['bridge'] and interfaces.append(net_dict['bridge'])
return interfaces
+ def _create_linux_bridge(self, interface):
+ newBridge = KIMCHI_BRIDGE_PREFIX + interface[-8:]
+ bridges_list = knetwork.list_bridges()
+
+ bridges = []
+ for bridge in bridges_list:
+ bridges.append(bridge["bridge"])
+
+ # bridge already exists: create new name
+ if newBridge in bridges:
+ for i in range(0, 10):
+ newBridge = KIMCHI_BRIDGE_PREFIX + interface[-7:] + str(i)
+ if newBridge not in bridges:
+ break
+
+ # create linux bridge by libvirt
+ try:
+ conn = self.conn.get()
+ iface = conn.interfaceDefineXML(create_linux_bridge(newBridge,
+ interface))
+ iface.create()
+ except libvirt.libvirtError as e:
+ raise OperationFailed("KCHNET0008E",
+ {'name': newBridge,
+ 'err': e.get_error_message()})
+ return newBridge
+
def _create_vlan_tagged_bridge(self, interface, vlan_id):
# Truncate the interface name if it exceeds 8 characters to make sure
# the length of bridge name is less than 15 (its maximum value).
diff --git a/src/wok/plugins/kimchi/network.py b/src/wok/plugins/kimchi/network.py
index 1433b8a..18df281 100644
--- a/src/wok/plugins/kimchi/network.py
+++ b/src/wok/plugins/kimchi/network.py
@@ -21,6 +21,7 @@
import ethtool
import ipaddr
+from wok.utils import run_command
APrivateNets = ipaddr.IPNetwork("10.0.0.0/8")
BPrivateNets = ipaddr.IPNetwork("172.16.0.0/12")
@@ -60,3 +61,21 @@ def get_one_free_network(used_nets, nets_pool=PrivateNets):
if net:
return net
return None
+
+def list_bridges():
+ # get all bridges
+ _, err, rc = run_command(['brctl', 'show'])
+ output = _.splitlines()
+
+ # iterate over output
+ i = 1
+ bridges = []
+ while (i < len(output)):
+
+ # get bridge name
+ bridges.append({"bridge": output[i].split('\t')[0],
+ "interface": output[i].split('\t')[5]})
+ i += 1
+
+ return bridges
+
diff --git a/src/wok/plugins/kimchi/xmlutils/network.py b/src/wok/plugins/kimchi/xmlutils/network.py
index c73aad9..2fdf8d4 100644
--- a/src/wok/plugins/kimchi/xmlutils/network.py
+++ b/src/wok/plugins/kimchi/xmlutils/network.py
@@ -120,3 +120,15 @@ def create_vlan_tagged_bridge_xml(bridge, interface, vlan_id):
type='bridge',
name=bridge)
return ET.tostring(m)
+
+def create_linux_bridge(bridge, interface):
+ m = E.interface(
+ E.start(mode='onboot'),
+ E.bridge(
+ E.interface(
+ type='ethernet',
+ name=interface)),
+ type='bridge',
+ name=bridge)
+ return ET.tostring(m)
+
--
2.1.0
9 years, 1 month
[PATCH V4] [Ginger-Base 0/1] Issue 728 - Processor Info in s390 architecture
by sureshab@linux.vnet.ibm.com
From: Suresh Babu Angadi <sureshab(a)in.ibm.com>
V3 - V4:
fixed get_cpus() bug for s390x
V2 -V3:
Changed test_host.py to check memory(Aline)
added description for get_total_cpus() of lscpu(Rodrigo)
V1 to V2 changes:
Changed cpus and memory object to be same across all platforms(aline)
Changed API.md and lookup as per review comments(aline & abhiram)
As per RFC mail thread -
[Kimchi-devel] RFC - #728 - Processor Info in s390 architecture
this patch set adds functionality in back-end to add
architecture, and host name(for all architecture),
split CPUs to online and offline(x86, s390x),
additional virtualization details(for s390x)
Note: Subsequent patch set from Chandra will include
UI changes to accommodate these changes
Test Cases Executed:
====================
1) On x86 machine(ppc o/p will be similar to x86):
curl -k -u suresh -H "Content-Type: application/json" -H "Accept: application/json" -X GET 'https://127.0.0.1:8001/plugins/gingerbase/host'
{
"os_distro":"Fedora",
"cpus":{
"offline":0,
"online":4
},
"cpu_model":"Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz",
"os_version":"21",
"host":"localhost.localdomain",
"os_codename":"Twenty One",
"architecture":"x86_64",
"memory":{
"offline":0,
"online":7933902848
}
}
2) On s390x machine:
curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" -X GET 'https://127.0.0.1:8001/plugins/gingerbase/host'
{
"os_distro":"KVM for IBM z Systems",
"cpus":{
"shared":2,
"offline":2,
"dedicated":0,
"online":2
},
"cpu_model":"IBM/2827/743 H43",
"os_version":"1.1.1",
"host":"zfwcec103",
"os_codename":"Z",
"architecture":"s390x",
"memory":{
"offline":2147483648,
"online":2147483648
},
"virtualization":{
"lpar_name":"CSTLIN1",
"hypervisor":"PR/SM",
"lpar_number":55,
"hypervisor_vendor":"IBM"
}
}
Suresh Babu Angadi (1):
Fix for issue 728: processor info displays blank for system z
this patch set also adds additional capability:
retrieving architecture and host name (for all architecture)
split CPUs to show online and offline cpus also
includes shared and dedicated cpus for s390x
split memory to show online and offline
additional virtualization details(for s390x):
virtualization will have hypervisor details and lpar details
src/wok/plugins/gingerbase/docs/API.md | 18 +-
src/wok/plugins/gingerbase/i18n.py | 1 +
src/wok/plugins/gingerbase/lscpu.py | 60 ++++++
src/wok/plugins/gingerbase/model/host.py | 259 ++++++++++++++++++++++----
src/wok/plugins/gingerbase/tests/test_host.py | 12 +-
5 files changed, 307 insertions(+), 43 deletions(-)
--
2.1.0
9 years, 1 month