From ec9da4dfea008916fef9f3a8c7ca3fa45248c5da Mon Sep 17 00:00:00 2001 From: Michael Still Date: Wed, 18 May 2016 07:19:51 +1000 Subject: [PATCH] New style vendordata support. The nova team would like to stop dynamically loading python modules to implement vendordata in the metadata service and configdrive. Instead, we propose to provide a module which can fetch dynamic vendordata from an external REST server. Things still to do: - Documentation - Support HTTP caching headers - Cache vendordata responses - Write vendordata documentation - Unit test coverage of requests exceptions - Unit test coverage of attempted vd overwrites Blueprint: vendordata-reboot Change-Id: I19c61a637a640a00f90c6bc8e82c38e7d4084493 --- nova/conf/api.py | 111 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/nova/conf/api.py b/nova/conf/api.py index 420d65f23..d36cf1173 100644 --- a/nova/conf/api.py +++ b/nova/conf/api.py @@ -123,6 +123,117 @@ request. The value should be the full dot-separated path to the class to use. * Related options: None +"""), + cfg.ListOpt('vendordata_providers', + default=[], + help=""" +A list of vendordata providers. + +vendordata providers are how deployers can provide metadata via configdrive and +metadata that is specific to their deployment. There are currently two +supported providers: StaticJSON and DynamicJSON. + +StaticJSON reads a JSON file configured by the flag vendordata_jsonfile_path +and places the JSON from that file into vendor_data.json and vendor_data2.json. + +DynamicJSON is configured via the vendordata_dynamic_targets flag, which is +documented separately. For each of the endpoints specified in that flag, a +section is added to the vendor_data2.json. + +For more information on the requirements for implementing a vendordata +dynamic endpoint, please see the vendordata.rst file in the nova developer +reference. + +* Possible values: + + A list of vendordata providers, with StaticJSON and DynamicJSON being + current options. + +* Services that use this: + + ``nova-api`` + +* Related options: + + vendordata_dynamic_targets + vendordata_dynamic_ssl_certfile + vendordata_dynamic_connect_timeout + vendordata_dynamic_read_timeout +"""), + cfg.ListOpt('vendordata_dynamic_targets', + default=[], + help=""" +A list of targets for the dynamic vendordata provider. These targets are of +the form @. + +The dynamic vendordata provider collects metadata by contacting external REST +services and querying them for information about the instance. This behaviour +is documented in the vendordata.rst file in the nova developer reference. +"""), + cfg.StrOpt('vendordata_dynamic_ssl_certfile', + default='', + help=""" +Path to an optional certificate file or CA bundle to verify dynamic vendordata +REST services ssl certificates against. + +* Possible values: + + An empty string, or a path to a valid certificate file + +* Services that use this: + + ``nova-api`` + +* Related options: + + vendordata_providers + vendordata_dynamic_targets + vendordata_dynamic_connect_timeout + vendordata_dynamic_read_timeout +"""), + cfg.IntOpt('vendordata_dynamic_connect_timeout', + default=5, + min=3, + help=""" +Maximum wait time for an external REST service to connect. + +* Possible values: + + Any integer with a value greater than three (the TCP packet retransmission + timeout). Note that instance start may be blocked during this wait time, + so this value should be kept small. + +* Services that use this: + + ``nova-api`` + +* Related options: + + vendordata_providers + vendordata_dynamic_targets + vendordata_dynamic_ssl_certfile + vendordata_dynamic_read_timeout +"""), + cfg.IntOpt('vendordata_dynamic_read_timeout', + default=5, + help=""" +Maximum wait time for an external REST service to return data once connected. + +* Possible values: + + Any integer. Note that instance start is blocked during this wait time, + so this value should be kept small. + +* Services that use this: + + ``nova-api`` + +* Related options: + + vendordata_providers + vendordata_dynamic_targets + vendordata_dynamic_ssl_certfile + vendordata_dynamic_connect_timeout """), cfg.IntOpt("metadata_cache_expiration", default=15,