[PATCH] [Kimchi 0/5] VEPA network support
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
This patch set implements the VEPA network support for Kimchi
in the backend and the frontend. VEPA networks are somewhat
similar to bridge networks that tunnels traffic between
VMs by using an external VEPA-enabled switch that will
process and forward the frames faster than the host
CPU/OS can do.
The UI support is similar to what we already have for the bridge
network. ATM the UI doesn't support multiple physical devices being
assigned to a single VEPA network but the backend does. This can
be enhanced in the future with an UI patch. The idea was to have
some UI support to get the feature alive ASAP.
To create a VEPA network the process is similar to the bridge
network with an extra parameter called 'vepa_devs', an array
of physical devices.
Let me show an example of use:
1- creating the VEPA network (can be done via the UI):
[danielhb@arthas kimchi]$ curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" -X POST 'https://localhost:8001/plugins/kimchi/networks' -d'{"name":"vepa_net", "connection":"vepa", "vepa_devs":["enp0s25"]}'
Enter host password for user 'root':
{
"in_use":false,
"persistent":true,
"interface":"",
"vms":[],
"subnet":"",
"vepa_devs":[
"enp0s25"
],
"name":"vepa_net",
"state":"inactive",
"connection":"vepa",
"autostart":true,
"dhcp":{
"start":"",
"end":""
}
}[danielhb@arthas kimchi]$
- this is the generated network XML in libvirt:
[danielhb@arthas kimchi]$ sudo virsh net-dumpxml vepa_net
<network>
<name>vepa_net</name>
<uuid>96da7b58-d655-4fa2-b0f6-d9a026cbf95a</uuid>
<forward dev='enp0s25' mode='vepa'>
<interface dev='enp0s25'/>
</forward>
</network>
[danielhb@arthas kimchi]$
2 - In Kimchi UI:
- activate the network
- create (or edit) a template and add this network to an interface
- create a VM using that template.
This is the result interface XML of the VM:
<interface type='network'>
<mac address='52:54:00:77:31:30'/>
<source network='vepa_net'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
And this is the backend call showing the status of the 'vepa_net' network after
these steps:
[danielhb@arthas kimchi]$ curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" -X GET 'https://localhost:8001/plugins/kimchi/networks/vepa_net'
Enter host password for user 'root':
{
"in_use":true,
"persistent":true,
"interface":"",
"vms":[
"vepa-vm"
],
"subnet":"",
"vepa_devs":[
"enp0s25"
],
"name":"vepa_net",
"state":"active",
"connection":"vepa",
"autostart":true,
"dhcp":{
"start":"",
"end":""
}
}[danielhb@arthas kimchi]$
Daniel Henrique Barboza (5):
VEPA network support: API and i18n changes
VEPA network support: xmlutils changes
VEPA network support: changes in networks control and model
VEPA network support: additional backend unit tests
VEPA network support: UI changes
API.json | 2 +-
control/networks.py | 5 +++--
docs/API.md | 5 +++++
i18n.py | 5 +++--
model/networks.py | 14 ++++++++++--
tests/test_networkxml.py | 42 +++++++++++++++++++++++++++++++++++-
ui/js/src/kimchi.network.js | 9 ++++++--
ui/js/src/kimchi.network_add_main.js | 19 ++++++++++------
ui/pages/network-add.html.tmpl | 5 +++--
xmlutils/network.py | 25 +++++++++++++++++++--
10 files changed, 111 insertions(+), 20 deletions(-)
--
2.5.0
8 years, 10 months
[PATCH] [Kimchi 0/6] Web serial console
by Jose Ricardo Ziviani
This is the initial version of a web serial console for kimchi/libvirt
VMs.
When a VM is turned on, a new action is displayed named "Connect
Serial", this will open a new tab with an interface like the existing
novnc.
That interface opens a websocket to kimchi webserver (nginx), then
it is redirected to websockify. Websockify will proxy that connection to
a local unix socket server to finally communicate with the guest
console.
I chose to create one server per guest because that's the way websockify
was designed (it was born inside novnc), so I could reuse the token
security plugin implemented in websockify. In order to avoid wasting
resources I decided to user unix socket, a local/lightweight/reliable
socket if compared with internet sockets, this uses files instead of
ports to accept connections.
When a connection is established no one else can get that console (I'm
not multiplexing it but it's possible in future). The serial console
will be available again if the current user does one of:
- type ctrl+q
- close the tab
- 2 min. timeout
Thanks
Jose Ricardo Ziviani (6):
Rename vnc.py to websocket.py
Implement the web serial console server
Implement the backend to support web serial console
Implement the web serial console front-end
Implement the Kimchi front-end for the web serial console
Add test case for the socket server
control/vms.py | 3 +-
i18n.py | 4 +-
kimchi.conf | 6 +
model/vms.py | 43 +-
root.py | 8 +-
serial_console.py | 291 ++
tests/test_model.py | 30 +-
ui/js/src/kimchi.api.js | 25 +
ui/js/src/kimchi.guest_main.js | 16 +-
ui/pages/guest.html.tmpl | 5 +-
ui/serial/images/favicon.ico | Bin 0 -> 15086 bytes
ui/serial/images/logo-white.png | Bin 0 -> 7583 bytes
ui/serial/serial.html | 80 +
ui/serial/term.js | 5973 +++++++++++++++++++++++++++++++++++++++
vnc.py | 92 -
websocket.py | 122 +
16 files changed, 6587 insertions(+), 111 deletions(-)
create mode 100644 serial_console.py
create mode 100644 ui/serial/images/favicon.ico
create mode 100644 ui/serial/images/logo-white.png
create mode 100644 ui/serial/serial.html
create mode 100644 ui/serial/term.js
delete mode 100644 vnc.py
create mode 100644 websocket.py
--
1.9.1
8 years, 10 months
[PATCH] [Kimchi] [RFC] Create new volume and attach to VM
by Socorro Stoppler
This is the initial checkin for creating a new volume and attaching to VM when editing
a guest. Not sure of all the supported cases, but tried default pool and qcow2 format
per the example provided in the back-end patch and it was successful.
Known issue - which currently exists in the code already in master - code is broken when VM
is running. This patch does not address that. It will get addressed separately.
Socorro Stoppler (1):
Create new volume and attach to VM
ui/js/src/kimchi.guest_storage_add.main.js | 320 ++++++++++++++++++++++++-----
ui/pages/guest-storage-add.html.tmpl | 58 ++++--
2 files changed, 315 insertions(+), 63 deletions(-)
--
1.9.1
8 years, 10 months
[PATCH] [Kimchi 0/4] Add backend support to set maxvcpus
by Lucio Correia
Lucio Correia (4):
Add maxvcpus attribute to templates
Add maxvcpus attribute to guests
Update tests
Do not break web UI
API.json | 34 +++---
control/templates.py | 3 +-
docs/API.md | 66 ++++++++---
i18n.py | 10 +-
model/cpuinfo.py | 63 ++++++++---
model/templates.py | 79 ++++++++------
model/vms.py | 194 +++++++++++++++++----------------
osinfo.py | 13 ++-
template.conf | 7 +-
tests/test_mockmodel.py | 7 +-
tests/test_model.py | 17 +--
tests/test_rest.py | 14 ++-
tests/test_template.py | 43 ++++----
tests/test_vmtemplate.py | 17 +--
ui/js/src/kimchi.guest_edit_main.js | 8 +-
ui/js/src/kimchi.template_edit_main.js | 15 ++-
ui/pages/guest-edit.html.tmpl | 2 +-
ui/pages/template-edit.html.tmpl | 4 +-
vmtemplate.py | 43 +++-----
xmlutils/cpu.py | 6 +-
20 files changed, 369 insertions(+), 276 deletions(-)
--
1.9.1
8 years, 10 months
[PATCH V2] [Kimchi] Add python-pillow as RPM dependency.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Distros based on RPM replaced PIL (python-imaging) with Pillow (python-pillow).
This patch add Pillow as dependency to prevent Kimchi to not be loaded during
Wok startup.
Distros based on DEB still have python-imaging package as option to install.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.fedora.in | 2 +-
contrib/kimchi.spec.suse.in | 2 +-
docs/fedora-deps.md | 10 +++++-----
docs/opensuse-deps.md | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index cc69da2..c2111f9 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -17,7 +17,7 @@ Requires: libvirt-daemon-config-network
Requires: python-websockify
Requires: python-configobj
Requires: novnc
-Requires: python-imaging
+Requires: python-pillow
Requires: pyparted
Requires: python-psutil >= 0.6.0
Requires: python-jsonschema >= 1.3.0
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index e9951b6..59207fd 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -17,7 +17,7 @@ Requires: libvirt-daemon-config-network
Requires: python-websockify
Requires: python-configobj
Requires: novnc
-Requires: python-imaging
+Requires: python-pillow
Requires: python-parted
Requires: python-psutil >= 0.6.0
Requires: python-jsonschema >= 1.3.0
diff --git a/docs/fedora-deps.md b/docs/fedora-deps.md
index 505993f..ca24994 100644
--- a/docs/fedora-deps.md
+++ b/docs/fedora-deps.md
@@ -26,11 +26,11 @@ Runtime Dependencies
--------------------
$ sudo yum install libvirt-python libvirt libvirt-daemon-config-network \
- qemu-kvm python-ethtool sos python-ipaddr \
- nfs-utils iscsi-initiator-utils pyparted \
- python-libguestfs libguestfs-tools \
- python-websockify novnc spice-html5 \
- python-configobj python-magic python-paramiko
+ qemu-kvm python-ethtool sos python-ipaddr nfs-utils \
+ iscsi-initiator-utils pyparted python-libguestfs \
+ libguestfs-tools python-websockify novnc spice-html5 \
+ python-configobj python-magic python-paramiko \
+ python-pillow
# For RHEL systems, install the additional packages:
$ sudo yum install python-ordereddict
diff --git a/docs/opensuse-deps.md b/docs/opensuse-deps.md
index d89cf3f..a8763b3 100644
--- a/docs/opensuse-deps.md
+++ b/docs/opensuse-deps.md
@@ -34,7 +34,7 @@ Runtime Dependencies
nfs-client open-iscsi python-parted \
python-libguestfs python-configobj guestfs-tools \
python-websockify novnc python-magic \
- python-paramiko
+ python-paramiko python-pillow
Packages required for UI development
------------------------------------
--
2.5.0
8 years, 10 months
[PATCH] [Kimchi] Add python-pillow as RPM dependency.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Distros based on RPM replaced PIL (python-imaging) with Pillow (python-pillow).
This patch add Pillow as dependency to prevent Kimchi to not be loaded during
Wok startup.
Distros based on DEB still have python-imaging package as option to install.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.fedora.in | 2 +-
contrib/kimchi.spec.suse.in | 2 +-
docs/fedora-deps.md | 10 +++++-----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index cc69da2..c2111f9 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -17,7 +17,7 @@ Requires: libvirt-daemon-config-network
Requires: python-websockify
Requires: python-configobj
Requires: novnc
-Requires: python-imaging
+Requires: python-pillow
Requires: pyparted
Requires: python-psutil >= 0.6.0
Requires: python-jsonschema >= 1.3.0
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index e9951b6..59207fd 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -17,7 +17,7 @@ Requires: libvirt-daemon-config-network
Requires: python-websockify
Requires: python-configobj
Requires: novnc
-Requires: python-imaging
+Requires: python-pillow
Requires: python-parted
Requires: python-psutil >= 0.6.0
Requires: python-jsonschema >= 1.3.0
diff --git a/docs/fedora-deps.md b/docs/fedora-deps.md
index 505993f..ca24994 100644
--- a/docs/fedora-deps.md
+++ b/docs/fedora-deps.md
@@ -26,11 +26,11 @@ Runtime Dependencies
--------------------
$ sudo yum install libvirt-python libvirt libvirt-daemon-config-network \
- qemu-kvm python-ethtool sos python-ipaddr \
- nfs-utils iscsi-initiator-utils pyparted \
- python-libguestfs libguestfs-tools \
- python-websockify novnc spice-html5 \
- python-configobj python-magic python-paramiko
+ qemu-kvm python-ethtool sos python-ipaddr nfs-utils \
+ iscsi-initiator-utils pyparted python-libguestfs \
+ libguestfs-tools python-websockify novnc spice-html5 \
+ python-configobj python-magic python-paramiko \
+ python-pillow
# For RHEL systems, install the additional packages:
$ sudo yum install python-ordereddict
--
2.5.0
8 years, 10 months
[PATCH][Wok] wokd service not comes up after reboot when enabled
by chandra@linux.vnet.ibm.com
From: Chandra Shekhar Reddy Potula <chandra(a)linux.vnet.ibm.com>
Fixed Issue #31 : Even after wokd service enabled, wokd service not comes up after reboot.
Chandra Shekhar Reddy Potula (1):
wokd service not comes up after reboot when enabled
contrib/wokd.service.fedora | 1 +
1 file changed, 1 insertion(+)
--
2.5.4 (Apple Git-61)
8 years, 10 months
[PATCH] [Kimchi] Fix error message for IOMMU configuration.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Modified the error message with the correct configuration file and parameter to
explain how to configure host kernel parameter to add support to IOMMU.
All latest version of supported distro at this moment (Fedora 23, Ubuntu 15.10,
Debian 8, RHEL 7.2 and OpenSUSE Leap) have the configuration file
(/etc/default/grub) and the kernel parameter (GRUB_CMDLINE_LINUX) to be
configured.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
i18n.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n.py b/i18n.py
index a575922..6e453f3 100644
--- a/i18n.py
+++ b/i18n.py
@@ -136,8 +136,8 @@ messages = {
"KCHVMHDEV0002E": _("The host device %(dev_name)s is not allowed to directly assign to VM."),
"KCHVMHDEV0003E": _("No IOMMU groups found. Host PCI pass through needs IOMMU group to function correctly. "
"Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify the Kernel is compiled with IOMMU support. "
- "For Intel CPU, add intel_iommu=on to your Kernel parameter in /boot/grub2/grub.conf. "
- "For AMD CPU, add iommu=pt iommu=1."),
+ "For Intel CPU, add 'intel_iommu=on' to GRUB_CMDLINE_LINUX parameter in /etc/default/grub file. "
+ "For AMD CPU, add 'iommu=pt iommu=1'."),
"KCHVMHDEV0004E": _('"name" should be a device name string'),
"KCHVMHDEV0005E": _('The device %(name)s is probably in use by the host. Unable to attach it to the guest.'),
--
2.5.0
8 years, 10 months
[PATCH][Kimchi] Remove hack that disables vhosts-net
by Ramon Medeiros
Vhosts-net wasn't support on the past. Now, as it works, enable the
feature.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
xmlutils/interface.py | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/xmlutils/interface.py b/xmlutils/interface.py
index 814caf9..de80524 100644
--- a/xmlutils/interface.py
+++ b/xmlutils/interface.py
@@ -18,7 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import lxml.etree as ET
-from distutils.version import LooseVersion
from lxml.builder import E
from wok.plugins.kimchi import osinfo
@@ -62,12 +61,4 @@ def get_iface_xml(params, arch=None, os_distro=None, os_version=None):
if mac is not None:
interface.append(E.mac(address=mac))
- # Hack to disable vhost feature in Ubuntu LE and SLES LE (PPC)
- if arch == 'ppc64' and \
- ((os_distro == 'ubuntu' and
- LooseVersion(os_version) >= LooseVersion('14.04')) or
- (os_distro == 'sles' and
- LooseVersion(os_version) >= LooseVersion('12'))):
- interface.append(E.driver(name='qemu'))
-
return ET.tostring(interface, encoding='utf-8', pretty_print=True)
--
2.1.0
8 years, 10 months
[PATCH] [Wok] Add function for inserting an XML element
by Lucio Correia
- Plus a minor fix
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/xmlutils/utils.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/wok/xmlutils/utils.py b/src/wok/xmlutils/utils.py
index d02139c..cabb859 100644
--- a/src/wok/xmlutils/utils.py
+++ b/src/wok/xmlutils/utils.py
@@ -36,6 +36,15 @@ def xpath_get_text(xml, expr):
return res
+def xml_item_insert(xml, xpath, item_xml):
+ root = ET.fromstring(xml)
+
+ element = root.find(xpath)
+ element.insert(0, ET.fromstring(item_xml))
+
+ return ET.tostring(root, encoding="utf-8")
+
+
def xml_item_update(xml, xpath, value, attr=None):
root = ET.fromstring(xml)
item = root.find(xpath)
@@ -51,7 +60,7 @@ def xml_item_remove(xml, xpath):
element = root.find(xpath)
parent = root.find(xpath + "/..")
- if parent:
+ if parent is not None:
parent.remove(element)
return ET.tostring(root, encoding="utf-8")
--
1.9.1
8 years, 10 months