mistio / mist-ce

Mist is an open source, multicloud management platform
https://mist.io
Apache License 2.0
1.85k stars 310 forks source link

Add support for Virtualbox #913

Open adiroiban opened 6 years ago

adiroiban commented 6 years ago

As a side project I am looking for adding support for Virtualbox to MistIO.

To keep thing simple I plan to only support the SOAP API. For the start using the Virtualbox Python SDK.

Installing Python Virtualbox SDK is complicated, as there is no pypi package (only unofficial https://github.com/mmabey/vbox_sdk) and you need to download the SDK and copy some files into your python env.

The Python Virtualbox SDK is more complicated as it depends on ZSI which depends on pyXML... and pyXML is hard to install.

For my simple tests I was able to install ZSI with --no-deps and it looks like pyXML is not used so far.


After the proof of concept is done, it can be replaced the whole virtualbox sdk + zsi with zeep


For the libcloud driver, the initial plan is provide a 3rd party driver which is distributed with the mist.io vbox support. Later it can be integrated into libcloud as an official driver.


So this ticket is for creating the libcloud 3rd party driver + mist.io provider for virtualbox... and also sorting out the virtualbox sdk + zsi dependencies for simple deployment

mgogoulos commented 6 years ago

Hi,

we have been asked to support Virtualbox byother users too, so this would be great.

I would start by adding a driver for libcloud, as this is the library that powers most API communication. Based on my experience, they are reluctant in adding external dependencies, because this complicates things and requires maintenance. Of course they use external dependencies in cases where this is absolutely necessary (eg on vCenter, or on KVM).

On mist.io the bare necessary functionality for a new provider - related to libcloud- is

There's a great variety of other options depending on the provider/hypervisor, but this is the bare minimum behavior we expect for the Compute part. There is also the DNS support by mist.io but I guess this does not apply for Virtualbox.

Hope this helps, Markos

adiroiban commented 6 years ago

Thanks for the information. While working on this I am trying to document the dev process.


I have a POC. It uses a libcloud driver via set_driver and comes with all the vbox Python SDK. I will look at packaging the 3rd party driver for libcloud, together with the vbox Python SDK... the ZSI dependency is a PITA.

I understand that libcloud don't want external dependencies, but I don't understand why they discourage 3rd party driver. I think that having a 3rd party virtualbox driver for libcloud is perfectly fine.


VirtualbBox has no DNS, but I think that we can implement support for the internal networks.


I am now trying to see how to do TDD with mist.io . I am new to the whole Docker base development and git sub-module development.

So my next question is: How do I send you the contribution? :)

adiroiban commented 6 years ago

Initial code for libcloud is here https://github.com/chevah/libcloud-virtualbox

I am trying to see what arguments to pass to create_node.

For now it only supports seeding the disk size and a password via DMI.

I am reading the mist.io code so maybe this is already there. It would be nice if mist.io could provide an URL for the new node which can be used by cloud-init to set up the machine.


VirtualBox is a bit different than traditional cloud provides, so it would help if you can put here some feedback from other users.

How do they plan to use VirtualBox with mist.io?


I have a infastructure with a 7 year old design based on VirtualBox and PHPVirtualBox and about 5 vbox hosts. The whole thing is not designed as a cloud. I plan to continue to use the old VM and start/stop them from mist.io.

Any new VM will be created based on cloud-init and should have a more cloud-like design.