From cda04ed1706eae24b5dd599bae6d8598d055c460 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 23 Feb 2016 21:31:31 -0800 Subject: [PATCH] Support config drive when using shade-launch-node Some clouds may not have a metadata service and need to retrieve key info via config drive. Add a flag to specifically request that a config drive is provided to the instance booted by nova to facilitate this information injection. Change-Id: Ic41df5b34ea67ad62949244e064db82410077453 --- launch/shade-launch-node.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/launch/shade-launch-node.py b/launch/shade-launch-node.py index f8f3392d4b..a289f88f36 100644 --- a/launch/shade-launch-node.py +++ b/launch/shade-launch-node.py @@ -127,12 +127,13 @@ def bootstrap_server(server, key, cert, environment, name, def build_server(cloud, name, image, flavor, cert, environment, puppetmaster, volume, keep, net_label, - floating_ip_pool, boot_from_volume): + floating_ip_pool, boot_from_volume, + config_drive): key = None server = None create_kwargs = dict(image=image, flavor=flavor, name=name, - reuse_ips=False, wait=True) + reuse_ips=False, wait=True, config_drive=config_drive) #TODO: test with rax #TODO: use shade @@ -239,6 +240,10 @@ def main(): help="network label to attach instance to") parser.add_argument("--fip-pool", dest="floating_ip_pool", default=None, help="pool to assign floating IP from") + parser.add_argument("--config-drive", dest="config_drive", + help="Boot with config_drive attached.", + action='store_true', + default=False) options = parser.parse_args() if options.cert: @@ -285,7 +290,7 @@ def main(): options.environment, options.server, options.volume, options.keep, options.net_label, options.floating_ip_pool, - options.boot_from_volume) + options.boot_from_volume, options.config_drive) dns.shade_print_dns(server) # Remove the ansible inventory cache so that next run finds the new # server