Vcenter driver Import rework
Enhancement Request
Description
Vcenter driver is completely splitted for Sunstone and CLI.
This structure breaks any architecture process and make any way of development very tedious. Also de driver itself has 0 scalability.
Design changes
Sunstone
- should not have standalone code regarding any vcenter operation.
- The correct behaviour for sunstone will be to make clean calls to the importer (vcenter_driver).
- Sunstone can browse directly into opennebula core in the case of expensive operations.
Code
vcenter.rb (backend)
resource = network || template || wild || datastore
-
get /vcenter/< resource > Should return a list with the available networks ready to import and some info.
-
post /vcenter/import/< resource > Should be called knowing the list of
that u want to import, the list format may vary. The idea is to build a selected json list in Sunstone, result of the previous call.
host
- get /vcenter/cluster should return a list with importable hosts
- post /vcenter/import/cluster Will be used to import a cluster, the user won't have the possibility to import more than 1 host/opennebula cluster at the same time, the user will choose between create a new opennebula cluster or attach the host to a selected one,
CLI
Code
onevcenter_helper.rb should be created. This helper will aid onevcenter to display text over the cli. To achieve that, the helper will call importer.rb methods
importer.rb The purpose of this part of the driver will be to have the proper methods regarding any import operation. The importer should not write in stdout.
vCenter Driver
- Code restructure for import operations, we need to have fully organized the methods used for import operations into importer.rb
Flow example
Import networks: retrieve the list (GUI) User (Sunstone) selects import_networks -> vcenter.rb(ruby_back) -> importer.rb => Sunstone
CLI User (onevcenter) -> onevcenter_helper.rb -> importer.rb
Progress Status
Development tracked in issue #1884