Changes for bypassing metadata/cloud init and use config drive

Change-Id: I5d04d7c7613b372d54b0ea16e388e08ec6de3978
This commit is contained in:
akalambu 2015-02-16 20:41:44 -08:00 committed by AJAY KALAMBUR
parent 4f3b5b0774
commit 5282156bc3
4 changed files with 12 additions and 0 deletions

View File

@ -64,6 +64,10 @@ floating_ip: True
# and reuse existing VM
reuse_existing_vm :
# Set config drive to true to bypass metadata service and use config drive
# An option of config_drive to True is provided to nova boot to enable this
config_drive:
# Default name for the router to use to connect the internal mgmt network
# with the external network. If a router exists with this name it will be
# reused, otherwise a new router will be created

View File

@ -145,6 +145,7 @@ class Compute(object):
# if exists delete and recreate
def create_server(self, vmname, image, flavor, key_name,
nic, sec_group, avail_zone=None, user_data=None,
config_drive=None,
retry_count=10):
# Also attach the created security group for the test
@ -155,6 +156,7 @@ class Compute(object):
nics=nic,
availability_zone=avail_zone,
userdata=user_data,
config_drive=config_drive,
security_groups=[sec_group.id])
flag_exist = self.find_server(vmname, retry_count)
if flag_exist:

View File

@ -95,6 +95,7 @@ class Instance(object):
sec_group,
az,
user_data,
self.config_drive,
self.config.generic_retry_count)
if user_data:
user_data.close()

View File

@ -30,6 +30,11 @@ class PerfInstance(Instance):
self.tp_tool = config.tp_tool(self, config.perf_tool_path)
else:
self.tp_tool = None
# Override the config drive option to save in instance
if config.config_drive:
self.config_drive = True
else:
self.config_drive = None
# No args is reserved for native host server
def create(self, image=None, flavor_type=None,