Subject: Looking for advice regarding user portal development.

Evening all, I'm a student from the UK, currently studying Bsc (Hons) Computer Forensics & Security, looking for a bit of advice regarding front-end development for the oVirt user portal. For my final year project I’m going to be extending the current user portal to produce a user interface that fits the needs of Computer Security education. I want to create an interface that supports the workflow of a tutor configuring one to many virtual machines / networks for a scenario based lab session. The project will involve developing two different interfaces depending on whether a student or tutor is logged in. The project is going to be based on a paper that was presented in the UK at the first Cybersecurity Education and Training conference as part of the Vibrant Workshop, and is available in full here: http://z.cliffe.schreuders.org/publications/VibrantWorkshop2015%20-%20An%20o... The tutor portal will have an avenue for tutors to upload images and a way to group templates of virtual machines for students to clone. The student portal will have one webpage with a list of their owned VMs on the left, like the current user portal, and all lab VM templates on the right organised/grouped by lab. Students will be able to clone a VM or group of VM's from the right with a couple of clicks at most. I'm planning on forking the user-portal code and making changes here. I want a different interface to appear for the students and the tutors. Initial thoughts were to do this based on the 'Role' concept within oVirt - I plan on creating 2 new user group’s with predefined roles, Student and Tutor, and having the tutor-only functionality appear on an additional tab which only appears if the logged in user has the Tutor role. We have a powerful development server at university which is currently running oVirt 3.6 with 3 nodes. As of right now I've set up the engine development environment on Fedora 23. I'm still getting familiar with the code and build process and have not yet deployed a build to the server. It is my hope and intention that any work I produce will be of value to the greater community and will open source all work. I would really appreciate any input / advice in developing for the user portal and hope to produce something make my code changes more likely to be accepted upstream. Thanks for reading, Thomas Shaw

On Friday, December 11, 2015 09:38:16 PM Thomas Shaw wrote:
Evening all,
I'm a student from the UK, currently studying Bsc (Hons) Computer Forensics & Security, looking for a bit of advice regarding front-end development for the oVirt user portal. For my final year project I’m going to be extending the current user portal to produce a user interface that fits the needs of Computer Security education.
I want to create an interface that supports the workflow of a tutor configuring one to many virtual machines / networks for a scenario based lab session. The project will involve developing two different interfaces depending on whether a student or tutor is logged in.
The project is going to be based on a paper that was presented in the UK at the first Cybersecurity Education and Training conference as part of the Vibrant Workshop, and is available in full here: http://z.cliffe.schreuders.org/publications/VibrantWorkshop2015%20-%20An%20o pen%20cloud-based%20virtual%20lab%20environment%20for%20computer%20security% 20education:%20%20A%20pilot%20study%20evaluation%20of%20oVirt.pdf
The tutor portal will have an avenue for tutors to upload images and a way to group templates of virtual machines for students to clone. The student portal will have one webpage with a list of their owned VMs on the left, like the current user portal, and all lab VM templates on the right organised/grouped by lab. Students will be able to clone a VM or group of VM's from the right with a couple of clicks at most.
I'm planning on forking the user-portal code and making changes here. I want a different interface to appear for the students and the tutors. Initial thoughts were to do this based on the 'Role' concept within oVirt - I plan on creating 2 new user group’s with predefined roles, Student and Tutor, and having the tutor-only functionality appear on an additional tab which only appears if the logged in user has the Tutor role.
We have a powerful development server at university which is currently running oVirt 3.6 with 3 nodes. As of right now I've set up the engine development environment on Fedora 23. I'm still getting familiar with the code and build process and have not yet deployed a build to the server.
It is my hope and intention that any work I produce will be of value to the greater community and will open source all work. I would really appreciate any input / advice in developing for the user portal and hope to produce something make my code changes more likely to be accepted upstream.
Thanks for reading, Thomas Shaw
Thomas, Welcome to oVirt. Here is some background and options in regards to the User Portal. The User Portal is written in GWT which is a Java to Javascript compiler that takes Java code and turns it into Javascript. It also abstracts away a bunch of browser specific issues so you don't have to deal with them. It provides a bunch of widgets so you can build applications in swing like fashion. So its easy to pick up if you have some experience with swing. On the other hand there is some cost to this, and one of the main problems with GWT is that the compiler takes a long time to do the translation from Java to Javascript. In fact it creates permutations for each browser locale combination, which can add up really quick. For instance if you support 5 browsers (ie8, ie9, ie10+, safari(chrome), FF) and 6 locales, that creates 30 permutations to compile. This can take a huge amount of time. The current User Portal itself is not that big, so each permutation is relatively quick compared to the web admin which is a huge application. I know of a few other people that where not satisfied with the functionality of the User Portal and wrote their own. Either there was too much stuff or not enough for whatever they wanted to do. Every single one of them decided to write a new User Portal from scratch using some standard Javascript framework (angular/ember/whatever). Using the available REST api. The engine provides an api that allows one to do basically anything that the User Portal and Web Admin can do. There are also several SDKs available for working with the REST api in an easy fashion (Java/Python/Javascript [1]). Seeing the above you have some options to implement what you want: 1. If you want to make changes to the User Portal that is possible, but in the end if your code doesn't end up in the product, it will be a maintenance nightmare keeping up with the changes. Seeing as the User portal is fairly generic and you are solving a specific problem it is not very likely to be merged into the product. 2. Make a new web frontend portal using Javascript and use the Javascript SDK to call the REST api to do whatever you need it to do. Note as far as I know there is currently no way to upload templates with either the User Portal or the REST api. So you will have to find some other mechanism to get them into the system. And when I say templates I mean VM templates in the oVirt sense. You will be communicating with a stable interface (REST api). 3. Build your own web application, and have your backend use either the Python or Java SDK to make calls to the oVirt REST api. Then you can have your backend application be completely independent of oVirt and only interface using a stable API. Again you will have to find some mechanism of getting your templates into oVirt. TL;DR Don't extend the User Portal use the REST api to do what you need to do and determine which SDK works the best for your needs. Alexander [1] Not yet merged but very usable https://gerrit.ovirt.org/#/c/49466/

On Sat, Dec 12, 2015 at 12:07 AM, Alexander Wels <awels@redhat.com> wrote:
TL;DR Don't extend the User Portal use the REST api to do what you need to do and determine which SDK works the best for your needs.
I'd actually bring up a complete proposal first to the list - perhaps the use case is interesting and general, not only to a specific use case. The briefly described one sounds as such. If so, it'll make much more sense to do the (initially harder) contribution of code to the user portal over the (maintenance forever) fork. Y.

On 12/11/2015 05:07 PM, Alexander Wels wrote:
[...] Note as far as I know there is currently no way to upload templates with either the User Portal or the REST api. So you will have to find some other mechanism to get them into the system. And when I say templates I mean VM templates in the oVirt sense.
Hi Thomas, More on Alexander's point above, we are actively working on a project [1] to allow uploading images into the oVirt environment via WebAdmin and/or the REST API. Some parts may be useful to you despite it not being targeted for inclusion in the User Portal at this time. Alternatively, using a Glance Provider [2] may also help with your goals, though I'm not too familiar with the details. Greg [1] http://www.ovirt.org/Features/Image_Upload [2] http://ovedou.blogspot.com/2014/03/importing-glance-images-as-ovirt.html

Good Afternoon, First of all I want to thank you all for the detailed replies - I really appreciate it. I feel that I would much prefer to take the more difficult path and contribute code to the project rather than build something from scratch. After reviewing the responses with my tutor we feel that the functional additions that we require are generic enough and would likely be useful for other users. The existing userportal is close enough to what we need and has the benefit of being used and tested. As well as helping avoid the maintenance issues mentioned. Below I'll provide a breakdown of the functionality we need, justification for why we need it, and a proposed solution. 1) The ability to quickly create a new VM from a template, whilst hiding some of the complexity from the user. The current flow for creating a VM from template is to hit the extended tab, click create new VM, select the template and then fill in the name. I want to give the user a context menu when right clicking the desired template to 'quick launch', which will programmatically follow this process using the default options and fill in the Name field based on a format specified in a configuration file or options menu. By default I think something like "Username TemplateName Index", where index refers to the number of VMs created from that template by a specific user, would work well. e.g. "TShaw Fedora22 01". Benefits: Saves time, hides the complexity of some of the virtualisation concepts which end-users (particularly students) may find disconcerting, provides uniformity in VM names for all students. 2) The ability to provide some of the more advanced features whilst hiding some of the complexities of the Extended view The extended pane of the user portal provides the user with a lot of information, this is great for enterprise purposes but, again, may be a little distracting for students. Proposed Solution A: Create a third tab, something like a 'Quick start / Launcher' page, which sits between the basic and extended views displaying a list of the user's current VMs and a list of available templates (which following the completion of issue 1 will be easily creatable). Proposed Solution B: Similar to the above but rather than introduce a third tab, the list of templates would be displayed on the right hand side of the basic page. Either tabbed with the currently selected VM info pane or as another column. Proposed Solution C: Add settings that will allow the user to enable/disable GUI elements in the userportal as required. Benefits: Too much distracting information for students. Lessens the amount of input it takes a user to clone a template. Enables the user to create VMs based on templates from one page with a simple right click option and then launch. 3) Ability to specify sets of VM templates which can be created as new VMs together Proposed Solution: Introduce the concept of sets of templates. This will provide a tutor the ability to group templates together (through the admin portal). New submenu @ admin panel which sits below Templates called Sets, can create a new group, gives list of templates with checkbox. Requires set name + list of templates in the group. Benefits: Will enable the user to create a full set of templates as a context menu option. This will again utilise the feature added in issue 1 and default all of the VM names in the creation process. Enables tutors to set up all VMs required for a particular teaching scenario and have the student clone them all without having to find all individual templates, this is especially useful in teaching security as a lot of core topics require a networked environment of multiple different VMs running different OS’s. The university have some additional feature suggestions which will be proposed at a later date (regarding snapshot management by users). I'm confident that I have the ability and support around me to implement these features to a high enough standard to be accepted. Features 1 and 2 are of the highest priority right now and will be what I focus my efforts on until they are completed to a high standard. If anything above is unclear please let me know and I will expand upon it. All feedback and suggestions are greatly appreciated. Kind regards, Thomas Shaw

Hi, Thanks for getting involved with oVirt!
1) The ability to quickly create a new VM from a template, whilst hiding some of the complexity from the user.
It seems to me you can gain the same simplicity benefits by using VM pools and with no additional code... While cloud environments have made people used to dynamically spinning up VMs, this is a hammer that does not fit all nails, a pool of stateless pre-created VMs might suit your need better, and will work faster from an individual user's point of view. It is also more efficient in storage terms.
2) The ability to provide some of the more advanced features whilst hiding some of the complexities of the Extended view ...
Proposed Solution A: Create a third tab ...
Proposed Solution B: Similar to the above ...
Proposed Solution C: Add settings that will allow the user to enable/disable GUI elements in the userportal as required.
I would go with solution C which seems to me the most generally useful...
3) Ability to specify sets of VM templates which can be created as new VMs together
In conjunction with my proposal for feature 1, think about how this would work for pools... -- Barak Korren bkorren@redhat.com RHEV-CI Team

Thanks a lot for the welcome and suggestion! I brought your suggestion up with my tutor and was informed VM pooling is something which has been discussed and considered internally and at this juncture it has been decided that pooling is an optimisation which is going to be implemented at a later date. At this time the system is going to be used Makes sense from a performance perspective in an enterprise because you'd have separate storage server + all the images / software would likely be pre-loaded with the same bits of software. This is not always going to be the case with us as we've got a lot of different images with varied installations, we've got students from different year groups using different images at the same time. Also we want the students to have the freedom to install their own tools / software. The primary motivation for using oVirt at our university is to enable the students remote access to a lab environment. Although I mentioned in my previous mail that we wanted students to be able to quickly spin up VMs, I should have used the word simply, as it's more a case of minimising distractions + amount of actions required to create a VM from template. Unfortunately at this juncture we do not have the resources available to set up VM pooling for all of the different images we make use of so are going to approach the workflow in terms of students creating the VMs from template. Many Thanks, Thomas On 12 January 2016 at 09:02, Barak Korren <bkorren@redhat.com> wrote:
Hi,
Thanks for getting involved with oVirt!
1) The ability to quickly create a new VM from a template, whilst hiding some of the complexity from the user.
It seems to me you can gain the same simplicity benefits by using VM pools and with no additional code... While cloud environments have made people used to dynamically spinning up VMs, this is a hammer that does not fit all nails, a pool of stateless pre-created VMs might suit your need better, and will work faster from an individual user's point of view. It is also more efficient in storage terms.
2) The ability to provide some of the more advanced features whilst
hiding
some of the complexities of the Extended view ...
Proposed Solution A: Create a third tab ...
Proposed Solution B: Similar to the above ...
Proposed Solution C: Add settings that will allow the user to enable/disable GUI elements in the userportal as required.
I would go with solution C which seems to me the most generally useful...
3) Ability to specify sets of VM templates which can be created as new
VMs
together
In conjunction with my proposal for feature 1, think about how this would work for pools...
-- Barak Korren bkorren@redhat.com RHEV-CI Team

Hi Thomas, I wanted to add my thoughts to your interesting work! I'm a teacher at heart, so your project is captivating :) * Much of the "template" functionality you're describing is in Vagrant. Please check it out if you haven't already. [https://www.vagrantup.com/] That said, I'm not sure how much integration we have between vagrant and ovirt. [https://github.com/pradels/vagrant-ovirt] hasn't been touched since 2014. Hmm, something to look into. * I, too, would be very weary of trying to extend the current User Portal. We've had some success making some smaller REST-based portals. Check out this one: [https://github.com/jennykang/oVirtDash] * There are several of us who can be resources for you, whichever way you decide. I'll send you a private email with some contacts. * Not sure if you have a working server/setup yet, but we can help with that too. I typically mentor people on this -- just email me and I can make time to walk you through anything you need (via videochat, too, if that's easier). Best wishes, Greg On Mon, Jan 11, 2016 at 12:52 PM, Thomas Shaw <t.shaw7575@student.leedsbeckett.ac.uk> wrote:
Good Afternoon,
First of all I want to thank you all for the detailed replies - I really appreciate it.
I feel that I would much prefer to take the more difficult path and contribute code to the project rather than build something from scratch. After reviewing the responses with my tutor we feel that the functional additions that we require are generic enough and would likely be useful for other users. The existing userportal is close enough to what we need and has the benefit of being used and tested. As well as helping avoid the maintenance issues mentioned.
Below I'll provide a breakdown of the functionality we need, justification for why we need it, and a proposed solution.
1) The ability to quickly create a new VM from a template, whilst hiding some of the complexity from the user.
The current flow for creating a VM from template is to hit the extended tab, click create new VM, select the template and then fill in the name. I want to give the user a context menu when right clicking the desired template to 'quick launch', which will programmatically follow this process using the default options and fill in the Name field based on a format specified in a configuration file or options menu. By default I think something like "Username TemplateName Index", where index refers to the number of VMs created from that template by a specific user, would work well. e.g. "TShaw Fedora22 01".
Benefits: Saves time, hides the complexity of some of the virtualisation concepts which end-users (particularly students) may find disconcerting, provides uniformity in VM names for all students.
2) The ability to provide some of the more advanced features whilst hiding some of the complexities of the Extended view
The extended pane of the user portal provides the user with a lot of information, this is great for enterprise purposes but, again, may be a little distracting for students.
Proposed Solution A: Create a third tab, something like a 'Quick start / Launcher' page, which sits between the basic and extended views displaying a list of the user's current VMs and a list of available templates (which following the completion of issue 1 will be easily creatable).
Proposed Solution B: Similar to the above but rather than introduce a third tab, the list of templates would be displayed on the right hand side of the basic page. Either tabbed with the currently selected VM info pane or as another column.
Proposed Solution C: Add settings that will allow the user to enable/disable GUI elements in the userportal as required.
Benefits: Too much distracting information for students. Lessens the amount of input it takes a user to clone a template. Enables the user to create VMs based on templates from one page with a simple right click option and then launch.
3) Ability to specify sets of VM templates which can be created as new VMs together
Proposed Solution: Introduce the concept of sets of templates. This will provide a tutor the ability to group templates together (through the admin portal). New submenu @ admin panel which sits below Templates called Sets, can create a new group, gives list of templates with checkbox. Requires set name + list of templates in the group.
Benefits: Will enable the user to create a full set of templates as a context menu option. This will again utilise the feature added in issue 1 and default all of the VM names in the creation process. Enables tutors to set up all VMs required for a particular teaching scenario and have the student clone them all without having to find all individual templates, this is especially useful in teaching security as a lot of core topics require a networked environment of multiple different VMs running different OS’s.
The university have some additional feature suggestions which will be proposed at a later date (regarding snapshot management by users).
I'm confident that I have the ability and support around me to implement these features to a high enough standard to be accepted. Features 1 and 2 are of the highest priority right now and will be what I focus my efforts on until they are completed to a high standard.
If anything above is unclear please let me know and I will expand upon it. All feedback and suggestions are greatly appreciated.
Kind regards, Thomas Shaw
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
-- Greg Sheremeta, MBA Red Hat, Inc. Sr. Software Engineer gshereme@redhat.com
participants (6)
-
Alexander Wels
-
Barak Korren
-
Greg Padgett
-
Greg Sheremeta
-
Thomas Shaw
-
Yaniv Kaul