Merge "Enable usage of config-drive for file injection"
This commit is contained in:
commit
cc6a281bd6
|
@ -84,6 +84,11 @@ mount_point = /var/lib/mysql
|
|||
volume_time_out=30
|
||||
server_delete_time_out=480
|
||||
|
||||
# Nova server boot options
|
||||
# sets the --config-drive argument when doing a nova boot
|
||||
# (controls how file injection is handled by nova)
|
||||
use_nova_server_config_drive = False
|
||||
|
||||
# Configuration options for talking to nova via the novaclient.
|
||||
# These options are for an admin user in your keystone config.
|
||||
# It proxy's the token received from the user to send to nova via this admin users creds,
|
||||
|
|
|
@ -124,6 +124,9 @@ common_opts = [
|
|||
cfg.IntOpt('trove_conductor_workers',
|
||||
help="Number of workers for the Conductor service. The default "
|
||||
"will be the number of CPUs available."),
|
||||
cfg.BoolOpt('use_nova_server_config_drive', default=False,
|
||||
help="Use config drive for file injection when booting "
|
||||
"instance."),
|
||||
cfg.BoolOpt('use_nova_server_volume', default=False),
|
||||
cfg.BoolOpt('use_heat', default=False),
|
||||
cfg.StrOpt('device_path', default='/dev/vdb'),
|
||||
|
|
|
@ -584,10 +584,13 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
|
|||
userdata = f.read()
|
||||
name = self.hostname or self.name
|
||||
bdmap = block_device_mapping
|
||||
config_drive = CONF.use_nova_server_config_drive
|
||||
|
||||
server = self.nova_client.servers.create(
|
||||
name, image_id, flavor_id, files=files, userdata=userdata,
|
||||
security_groups=security_groups, block_device_mapping=bdmap,
|
||||
availability_zone=availability_zone, nics=nics)
|
||||
availability_zone=availability_zone, nics=nics,
|
||||
config_drive=config_drive)
|
||||
LOG.debug("Created new compute instance %(server_id)s "
|
||||
"for id: %(id)s" %
|
||||
{'server_id': server.id, 'id': self.id})
|
||||
|
|
|
@ -259,7 +259,7 @@ class FakeServers(object):
|
|||
|
||||
def create(self, name, image_id, flavor_ref, files=None, userdata=None,
|
||||
block_device_mapping=None, volume=None, security_groups=None,
|
||||
availability_zone=None, nics=None):
|
||||
availability_zone=None, nics=None, config_drive=False):
|
||||
id = "FAKE_%s" % uuid.uuid4()
|
||||
if volume:
|
||||
volume = self.volumes.create(volume['size'], volume['name'],
|
||||
|
|
|
@ -76,7 +76,7 @@ class fake_Server:
|
|||
class fake_ServerManager:
|
||||
def create(self, name, image_id, flavor_id, files, userdata,
|
||||
security_groups, block_device_mapping, availability_zone=None,
|
||||
nics=None):
|
||||
nics=None, config_drive=False):
|
||||
server = fake_Server()
|
||||
server.id = "server_id"
|
||||
server.name = name
|
||||
|
|
Loading…
Reference in New Issue