Ganeti Manager

  • Alexandros Kiousis's avatar
    Support extstorage providers · 6ec076b3
    Alexandros Kiousis authored
    Summary:
    First step in supporting Instance creation with ExtStorage providers enabled in
    clusters. Extstorage is the 'ext' disk template but needs to specify the name
    of the provider in the disks dictionary.
    
    Ganeti has gnt-storage as a CLI interface for extstorage that closely resembles
    the gnt-os interface but it (gnt-storage) is not exposed through the API.
    
    Taking a similar approach with alternate VGs for DRBD template, we designate a
    cluster-wide tag GANETI_TAG_PREFIX:ext:<provider_name> as a way for Ganetimgr
    to determine the name of all available Extstorage providers.
    
    This means that a cluster with the ext storage template enabled and a tag
    vima:ext:dataontap will show up in the application approval form as
    dataontap[ext].  If no appropriate tag is found, then the ext template is not
    displayed at all because it's not a valid option.
    
    Extstorage provider parameters are not handled at all. There is no way to
    discover the available params and no way to figure out possible values for
    them. I'm thinking a similar approach
    
    A cluster can have multiple ExtStorage providers enabled. An instance can have
    multiple disks with different providers. In that case the instance's
    disk_template is 'ext'.
    
    (Relates to T787)
    
    ---
    
    Also since it took a lot of time to map the things i needed to change, here's
    the layout for this call:
    
    The Instance approval form that does the RAPI lookups is located at
    /application/apply. The clusters are fetched from the db for the dropdown and a
    jQuery AJAX lookup hits the /nodegroups/cluster/?cluster_id=<id> endpoint which
    returns a JSON with the clusters details that are then filled in the form.
    
    The /nodegroups/cluster endpoint is defined at ganeti/urls/nodegroup.py and
    points to the get_cluster_node_group_stack. That view is located in
    ganeti/views/nodegroups.py and calls the function
    prepare_cluster_node_group_stack from ganeti/utils.py.
    
    prepare_node_group_stack was changed and get_extstorage_providers was
    introduced, in order for the  json returned to the form to contain the
    ExtStorage info.
    
    The form is submitted to /application/save/ which (in
    apply/urls/application.py) is mapped to the review_application view inside
    apply/views.py. That view uses the InstanceApplicationReviewForm which when
    submitted calls the submit function on the InstanceApplication model.
    
    The submit method was altered so when an extstorage template was selected the
    disk_template and disks are changed accordingly. disks is a lists of
    dictionaries (one for each instance disk to be created).
    Signed-off-by: 's avatarAlex Kiousis <alexk@noc.grnet.gr>
    
    Test Plan: Tested/developed on vima.staging.grnet.gr
    
    Reviewers: #developers, pgotsis
    
    Reviewed By: pgotsis
    
    Subscribers: pgotsis, #servers
    
    Differential Revision: https://phab.noc.grnet.gr/D1907
    6ec076b3
Name
Last commit
Last update
accounts Loading commit data...
apply Loading commit data...
auditlog Loading commit data...
context Loading commit data...
contrib Loading commit data...
docs Loading commit data...
ganeti Loading commit data...
ganetimgr Loading commit data...
locale/el/LC_MESSAGES Loading commit data...
middleware Loading commit data...
notifications Loading commit data...
redis_cache Loading commit data...
regbackends Loading commit data...
static Loading commit data...
stats Loading commit data...
templates Loading commit data...
util Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
COPYRIGHT Loading commit data...
Changelog Loading commit data...
README.md Loading commit data...
__init__.py Loading commit data...
_version.py Loading commit data...
manage.py Loading commit data...
readthedocs-requirements.txt Loading commit data...
requirements.txt Loading commit data...
version Loading commit data...
watcher.py Loading commit data...