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
This commit is contained in:
Clark Boylan 2016-02-23 21:31:31 -08:00
parent 78c55f3223
commit cda04ed170

View File

@ -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