Host Device Passthrough UI Task Discussion

Hi, As in Kimchi 1.3 TODO list (https://github.com/kimchi-project/kimchi/wiki/Todo-1.3), there is a task of passthrough support. It is to enable Kimchi to assign hos devices directly to a VM, thus greately improve VM performance. Currently we support assigning PCI device, USB device and SCSI LUN. For example, we can assign an NIC to VM to improve guest network throughput, or passthrough a USB camera to enable the guest OS to record video. The back-end patch also handles PCI device grouping (attach and detach all devices in the same iommu group together) and provides some other useful features. Since the due day is near, I think we can come up with an easy and simple UI for 1.3, and mark this feature as experimental. Then we improve it in future releases. So in this release we may only expose PCI devices to user and don't mention the iommu grouping logic. For this version I think we may provide the following operations to the user. In the VM edit window, initially, the user sees a list of PCI devices already assigned to the VM. This maps to GET vms/VM_NAME/hostdevs. In edit mode, the user can detach device. This maps to DELETE vms/VM_NAME/hostdevs/DEVICE_NAME. The user can also select device to attach to VM from a list. The listing of eligible devices is mapped to GET host/devices?_passthrough=true&_cap=pci. To attach a device, just POST a dict containing only the device name to vms/VM_NAME/hostdevs. I think these operations forms a basic interaction to enable user to consume this feature. It may be feasible to finish them before the due day. -- Zhou Zheng Sheng / 周征晟 E-mail: zhshzhou@linux.vnet.ibm.com Telephone: 86-10-82454397

On 07/16/2014 03:33 AM, Zhou Zheng Sheng wrote:
Hi,
As in Kimchi 1.3 TODO list (https://github.com/kimchi-project/kimchi/wiki/Todo-1.3), there is a task of passthrough support. It is to enable Kimchi to assign hos devices directly to a VM, thus greately improve VM performance. Currently we support assigning PCI device, USB device and SCSI LUN. For example, we can assign an NIC to VM to improve guest network throughput, or passthrough a USB camera to enable the guest OS to record video.
The back-end patch also handles PCI device grouping (attach and detach all devices in the same iommu group together) and provides some other useful features. Since the due day is near, I think we can come up with an easy and simple UI for 1.3, and mark this feature as experimental. Then we improve it in future releases. So in this release we may only expose PCI devices to user and don't mention the iommu grouping logic.
For this version I think we may provide the following operations to the user.
In the VM edit window, initially, the user sees a list of PCI devices already assigned to the VM. This maps to GET vms/VM_NAME/hostdevs.
In edit mode, the user can detach device. This maps to DELETE vms/VM_NAME/hostdevs/DEVICE_NAME.
The user can also select device to attach to VM from a list. The listing of eligible devices is mapped to GET host/devices?_passthrough=true&_cap=pci.
To attach a device, just POST a dict containing only the device name to vms/VM_NAME/hostdevs.
I think these operations forms a basic interaction to enable user to consume this feature. It may be feasible to finish them before the due day.
Sounds reasonable to me. Best regards, Leonardo Garcia

+1 On 07/16/2014 03:33 AM, Zhou Zheng Sheng wrote:
Hi,
As in Kimchi 1.3 TODO list (https://github.com/kimchi-project/kimchi/wiki/Todo-1.3), there is a task of passthrough support. It is to enable Kimchi to assign hos devices directly to a VM, thus greately improve VM performance. Currently we support assigning PCI device, USB device and SCSI LUN. For example, we can assign an NIC to VM to improve guest network throughput, or passthrough a USB camera to enable the guest OS to record video.
The back-end patch also handles PCI device grouping (attach and detach all devices in the same iommu group together) and provides some other useful features. Since the due day is near, I think we can come up with an easy and simple UI for 1.3, and mark this feature as experimental. Then we improve it in future releases. So in this release we may only expose PCI devices to user and don't mention the iommu grouping logic.
For this version I think we may provide the following operations to the user.
In the VM edit window, initially, the user sees a list of PCI devices already assigned to the VM. This maps to GET vms/VM_NAME/hostdevs.
In edit mode, the user can detach device. This maps to DELETE vms/VM_NAME/hostdevs/DEVICE_NAME.
The user can also select device to attach to VM from a list. The listing of eligible devices is mapped to GET host/devices?_passthrough=true&_cap=pci.
To attach a device, just POST a dict containing only the device name to vms/VM_NAME/hostdevs.
I think these operations forms a basic interaction to enable user to consume this feature. It may be feasible to finish them before the due day.

+1 On Wed, 2014-07-16 at 12:14 -0300, Aline Manera wrote:
+1
On 07/16/2014 03:33 AM, Zhou Zheng Sheng wrote:
Hi,
As in Kimchi 1.3 TODO list (https://github.com/kimchi-project/kimchi/wiki/Todo-1.3), there is a task of passthrough support. It is to enable Kimchi to assign hos devices directly to a VM, thus greately improve VM performance. Currently we support assigning PCI device, USB device and SCSI LUN. For example, we can assign an NIC to VM to improve guest network throughput, or passthrough a USB camera to enable the guest OS to record video.
The back-end patch also handles PCI device grouping (attach and detach all devices in the same iommu group together) and provides some other useful features. Since the due day is near, I think we can come up with an easy and simple UI for 1.3, and mark this feature as experimental. Then we improve it in future releases. So in this release we may only expose PCI devices to user and don't mention the iommu grouping logic.
For this version I think we may provide the following operations to the user.
In the VM edit window, initially, the user sees a list of PCI devices already assigned to the VM. This maps to GET vms/VM_NAME/hostdevs.
In edit mode, the user can detach device. This maps to DELETE vms/VM_NAME/hostdevs/DEVICE_NAME.
The user can also select device to attach to VM from a list. The listing of eligible devices is mapped to GET host/devices?_passthrough=true&_cap=pci.
To attach a device, just POST a dict containing only the device name to vms/VM_NAME/hostdevs.
I think these operations forms a basic interaction to enable user to consume this feature. It may be feasible to finish them before the due day.
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

1. generally, how many devices will be available? 2. the already attached devices will always be a subset of available host devices, right? 3. please add support to add multiple devices in one request? The API design does not match current API style related to vm, please change it for consistency. 'devices' is just an attribute along with other vm attributes, should not take a separate url. Refer to API.md for current vm API design and follow it. change attribute name 'hostdevs' to 'devices', at vm level, it is just devices of the vm. On 7/16/2014 2:33 PM, Zhou Zheng Sheng wrote:
Hi,
As in Kimchi 1.3 TODO list (https://github.com/kimchi-project/kimchi/wiki/Todo-1.3), there is a task of passthrough support. It is to enable Kimchi to assign hos devices directly to a VM, thus greately improve VM performance. Currently we support assigning PCI device, USB device and SCSI LUN. For example, we can assign an NIC to VM to improve guest network throughput, or passthrough a USB camera to enable the guest OS to record video.
The back-end patch also handles PCI device grouping (attach and detach all devices in the same iommu group together) and provides some other useful features. Since the due day is near, I think we can come up with an easy and simple UI for 1.3, and mark this feature as experimental. Then we improve it in future releases. So in this release we may only expose PCI devices to user and don't mention the iommu grouping logic.
For this version I think we may provide the following operations to the user.
In the VM edit window, initially, the user sees a list of PCI devices already assigned to the VM. This maps to GET vms/VM_NAME/hostdevs.
In edit mode, the user can detach device. This maps to DELETE vms/VM_NAME/hostdevs/DEVICE_NAME.
The user can also select device to attach to VM from a list. The listing of eligible devices is mapped to GET host/devices?_passthrough=true&_cap=pci.
To attach a device, just POST a dict containing only the device name to vms/VM_NAME/hostdevs.
I think these operations forms a basic interaction to enable user to consume this feature. It may be feasible to finish them before the due day.

on 2014/07/21 16:25, Yu Xin Huo wrote:
1. generally, how many devices will be available?
Usually, on a personal laptop, there would be about 10 devices available. On small servers, there would be more, maybe about 30 devices, including the SCSI LUNs. In future we may want to support SR-IOV, in this case it would be a lot more devices, probably several dozens of devices. My current thought is to add a new window/dialog when adding a new device. In the window we have two areas, one is for listing all available devices, when the user click a device, we display the detail information in the other area.
2. the already attached devices will always be a subset of available host devices, right?
Correct.
3. please add support to add multiple devices in one request?
I think this suggestion is nice. I just have a few concerns. Firstly the underlying operation of adding a device is much slower than a request round trip, so it may not save much time to adding multiple device in one request. Another reason is that it seem the collections in Kimchi back-end framework does not support creating multiple elements in one request. Technically it's possible and simple to support this. I am just worried about being different to other collection APIs may break the consistency of the concept of current collection implementation.
The API design does not match current API style related to vm, please change it for consistency. 'devices' is just an attribute along with other vm attributes, should not take a separate url. Refer to API.md for current vm API design and follow it. change attribute name 'hostdevs' to 'devices', at vm level, it is just devices of the vm.
On 7/16/2014 2:33 PM, Zhou Zheng Sheng wrote:
Hi,
As in Kimchi 1.3 TODO list (https://github.com/kimchi-project/kimchi/wiki/Todo-1.3), there is a task of passthrough support. It is to enable Kimchi to assign hos devices directly to a VM, thus greately improve VM performance. Currently we support assigning PCI device, USB device and SCSI LUN. For example, we can assign an NIC to VM to improve guest network throughput, or passthrough a USB camera to enable the guest OS to record video.
The back-end patch also handles PCI device grouping (attach and detach all devices in the same iommu group together) and provides some other useful features. Since the due day is near, I think we can come up with an easy and simple UI for 1.3, and mark this feature as experimental. Then we improve it in future releases. So in this release we may only expose PCI devices to user and don't mention the iommu grouping logic.
For this version I think we may provide the following operations to the user.
In the VM edit window, initially, the user sees a list of PCI devices already assigned to the VM. This maps to GET vms/VM_NAME/hostdevs.
In edit mode, the user can detach device. This maps to DELETE vms/VM_NAME/hostdevs/DEVICE_NAME.
The user can also select device to attach to VM from a list. The listing of eligible devices is mapped to GET host/devices?_passthrough=true&_cap=pci.
To attach a device, just POST a dict containing only the device name to vms/VM_NAME/hostdevs.
I think these operations forms a basic interaction to enable user to consume this feature. It may be feasible to finish them before the due day.
-- Zhou Zheng Sheng / 周征晟 E-mail: zhshzhou@linux.vnet.ibm.com Telephone: 86-10-82454397

on 2014/07/21 16:25, Yu Xin Huo worte:
1. generally, how many devices will be available? 2. the already attached devices will always be a subset of available host devices, right? 3. please add support to add multiple devices in one request?
The API design does not match current API style related to vm, please change it for consistency. 'devices' is just an attribute along with other vm attributes, should not take a separate url. Refer to API.md for current vm API design and follow it. change attribute name 'hostdevs' to 'devices', at vm level, it is just devices of the vm.
I'm following existing vm/AAA/storages/BBB and vm/AAA/ifaces/DDD style. I think it's different with other simple attributes since the passthrough devices form a collection. Regard for the naming, the reason I didn't use "devices", is because it's a general term. A device can be a cd rom, a disk, an NIC, a video card. As you can see, if I use "devices", it's overlapped with many existing sub-resources and attributes of the VM. I have to do a big refactor to re-arrange the existing devices, and this topic is debatable because we already treat every kind of devices specially. You can consider passthrough devices are a kind of very different devices. A passthrough network card is very different to a emulated network card. The passthrough devices also share some common attributes and features, so we want to manage them together.
On 7/16/2014 2:33 PM, Zhou Zheng Sheng wrote:
Hi,
As in Kimchi 1.3 TODO list (https://github.com/kimchi-project/kimchi/wiki/Todo-1.3), there is a task of passthrough support. It is to enable Kimchi to assign hos devices directly to a VM, thus greately improve VM performance. Currently we support assigning PCI device, USB device and SCSI LUN. For example, we can assign an NIC to VM to improve guest network throughput, or passthrough a USB camera to enable the guest OS to record video.
The back-end patch also handles PCI device grouping (attach and detach all devices in the same iommu group together) and provides some other useful features. Since the due day is near, I think we can come up with an easy and simple UI for 1.3, and mark this feature as experimental. Then we improve it in future releases. So in this release we may only expose PCI devices to user and don't mention the iommu grouping logic.
For this version I think we may provide the following operations to the user.
In the VM edit window, initially, the user sees a list of PCI devices already assigned to the VM. This maps to GET vms/VM_NAME/hostdevs.
In edit mode, the user can detach device. This maps to DELETE vms/VM_NAME/hostdevs/DEVICE_NAME.
The user can also select device to attach to VM from a list. The listing of eligible devices is mapped to GET host/devices?_passthrough=true&_cap=pci.
To attach a device, just POST a dict containing only the device name to vms/VM_NAME/hostdevs.
I think these operations forms a basic interaction to enable user to consume this feature. It may be feasible to finish them before the due day.
-- Zhou Zheng Sheng / 周征晟 E-mail: zhshzhou@linux.vnet.ibm.com Telephone: 86-10-82454397
participants (5)
-
Aline Manera
-
Leonardo Augusto Guimarães Garcia
-
Paulo Ricardo Paz Vital
-
Yu Xin Huo
-
Zhou Zheng Sheng