Everybody please add your comments!

This brainstorming page is about creating a new libvirt module for Drupal. It’s purpose is to replace old xen module with more general version. Basic functionality: Possibility to create virtual machines, edit them and start/stop/reboot them.

Adding some notes done by Jakub & Mitchell:

Hooks we should use

fucntion_hook_permissions
create vm_node
edit own vm_node

function_hook_actions_info
libvirt_actions_start_action (virt-install) (at this point is the kickstart file used??)
libvirt_actions_stop_action (shutdown)
(pause)
(delete)
(restart)

function_libvirt_menu
node/add/vm
admin/settings/libvirt

hook_node_form
- Fields: Stored in DB: uri, hostname, mac address or ip, allotted cpu, mem, hd,
- Fields: Loaded based on libvit queries.
RULES Sets:
- On Node Creation: (creating node, starting machine automatically after hook_submit)
- On Node Revision/Edit: (stopping, run command, etc)
- On Node Delete: execute libvirt delete and watchdog

function_hook_views
listing them
committing actions with views generated list of nodes using Flag module

hook_actions_info
- Start/stop/soft-hard-reboot actions pause? restart (though this could be a rules set)
Creating VMs

Let’s generate kickstart files
Use cases

Multi-user vps management.
User permissions

There is always a domain owner. He has access to all features.
There is an administrator. He has access to everything = user 1
Domain owner = Drupal user. Every domain has an owner, therefore one user may have more domains visible in his account – no need to have separate users for every domain.
Let’s stick with this. We can always add more permissions later (Domain owner adds some user as a viewer/editor of his VPS).
Permission to create new domain by unprivileged user – do it later, stick with basic functionality now.
User privileges

view own virtual machines
create virtual machine
edit own virtual machine
edit all virtual machines
VPS requirements and information

Storage: how much and where (let’s assume file based machines!)
RAM: how much, check limit of a server
Distribution: kickstart supported (Fedora, Red Hat, CentOS), version. Need to have some sort of information about these distributions – how to install, their kickstart examples, etc.
Root password: which password to use, how to pass it to the user. Should we keep it in plain text? No! Need different way
Owner: User UID, similar or different from node author? I propose different – User reference field.
Status: Pending (being installed)/Started/Stopped/Paused
Server configuration and information

Idea: Let’s support remote servers!
Architecture: one controller (our website), capable of connecting to multiple servers using libvirt
Libvirt should support some XML format, it should be easy to connect there using XML-RPC or something. This is great for us, we won’t have to use exec().
Future ideas

Provide connections to the VM or show stdout