Merge "Use driver_internal_info methods for other drivers"
This commit is contained in:
commit
bc5ac8b94c
@ -269,9 +269,7 @@ class CustomAgentDeploy(agent_base.AgentBaseMixin, agent_base.AgentDeployMixin,
|
|||||||
# deploy step.
|
# deploy step.
|
||||||
if not task.node.driver_internal_info.get('deployment_reboot'):
|
if not task.node.driver_internal_info.get('deployment_reboot'):
|
||||||
manager_utils.node_power_action(task, states.REBOOT)
|
manager_utils.node_power_action(task, states.REBOOT)
|
||||||
info = task.node.driver_internal_info
|
task.node.del_driver_internal_info('deployment_reboot')
|
||||||
info.pop('deployment_reboot', None)
|
|
||||||
task.node.driver_internal_info = info
|
|
||||||
task.node.save()
|
task.node.save()
|
||||||
return states.DEPLOYWAIT
|
return states.DEPLOYWAIT
|
||||||
|
|
||||||
@ -600,15 +598,13 @@ class AgentDeploy(CustomAgentDeploy):
|
|||||||
# NOTE(mjturek): In the case of local boot using a partition image on
|
# NOTE(mjturek): In the case of local boot using a partition image on
|
||||||
# ppc64* hardware we need to provide the 'PReP_Boot_partition_uuid' to
|
# ppc64* hardware we need to provide the 'PReP_Boot_partition_uuid' to
|
||||||
# direct where the bootloader should be installed.
|
# direct where the bootloader should be installed.
|
||||||
driver_internal_info = task.node.driver_internal_info
|
|
||||||
client = agent_client.get_client(task)
|
client = agent_client.get_client(task)
|
||||||
partition_uuids = client.get_partition_uuids(node).get(
|
partition_uuids = client.get_partition_uuids(node).get(
|
||||||
'command_result') or {}
|
'command_result') or {}
|
||||||
root_uuid = partition_uuids.get('root uuid')
|
root_uuid = partition_uuids.get('root uuid')
|
||||||
|
|
||||||
if root_uuid:
|
if root_uuid:
|
||||||
driver_internal_info['root_uuid_or_disk_id'] = root_uuid
|
node.set_driver_internal_info('root_uuid_or_disk_id', root_uuid)
|
||||||
task.node.driver_internal_info = driver_internal_info
|
|
||||||
task.node.save()
|
task.node.save()
|
||||||
elif not iwdi:
|
elif not iwdi:
|
||||||
LOG.error('No root UUID returned from the ramdisk for node '
|
LOG.error('No root UUID returned from the ramdisk for node '
|
||||||
@ -738,7 +734,7 @@ class AgentRAID(base.RAIDInterface):
|
|||||||
create_nonroot_volumes=create_nonroot_volumes)
|
create_nonroot_volumes=create_nonroot_volumes)
|
||||||
# Rewrite it back to the node object, but no need to save it as
|
# Rewrite it back to the node object, but no need to save it as
|
||||||
# we need to just send this to the agent ramdisk.
|
# we need to just send this to the agent ramdisk.
|
||||||
node.driver_internal_info['target_raid_config'] = target_raid_config
|
node.set_driver_internal_info('target_raid_config', target_raid_config)
|
||||||
|
|
||||||
LOG.debug("Calling agent RAID create_configuration for node %(node)s "
|
LOG.debug("Calling agent RAID create_configuration for node %(node)s "
|
||||||
"with the following target RAID configuration: %(target)s",
|
"with the following target RAID configuration: %(target)s",
|
||||||
|
@ -140,16 +140,15 @@ class AgentPower(base.PowerInterface):
|
|||||||
|
|
||||||
self._client.reboot(node)
|
self._client.reboot(node)
|
||||||
|
|
||||||
info = node.driver_internal_info
|
|
||||||
# NOTE(dtantsur): wipe the agent token, otherwise the rebooted agent
|
# NOTE(dtantsur): wipe the agent token, otherwise the rebooted agent
|
||||||
# won't be able to heartbeat. This is mostly a precaution since the
|
# won't be able to heartbeat. This is mostly a precaution since the
|
||||||
# calling code in conductor is expected to handle it.
|
# calling code in conductor is expected to handle it.
|
||||||
if not info.get('agent_secret_token_pregenerated'):
|
if not node.driver_internal_info.get(
|
||||||
info.pop('agent_secret_token', None)
|
'agent_secret_token_pregenerated'):
|
||||||
|
node.del_driver_internal_info('agent_secret_token')
|
||||||
# NOTE(dtantsur): the URL may change on reboot, wipe it as well (but
|
# NOTE(dtantsur): the URL may change on reboot, wipe it as well (but
|
||||||
# only after we call reboot).
|
# only after we call reboot).
|
||||||
info.pop('agent_url', None)
|
node.del_driver_internal_info('agent_url')
|
||||||
node.driver_internal_info = info
|
|
||||||
node.save()
|
node.save()
|
||||||
|
|
||||||
LOG.debug('Requested reboot of node %(node)s via the agent, waiting '
|
LOG.debug('Requested reboot of node %(node)s via the agent, waiting '
|
||||||
|
@ -962,20 +962,18 @@ def _constructor_checks(driver):
|
|||||||
|
|
||||||
def _allocate_port(task, host=None):
|
def _allocate_port(task, host=None):
|
||||||
node = task.node
|
node = task.node
|
||||||
dii = node.driver_internal_info or {}
|
|
||||||
allocated_port = console_utils.acquire_port(host=host)
|
allocated_port = console_utils.acquire_port(host=host)
|
||||||
dii['allocated_ipmi_terminal_port'] = allocated_port
|
node.set_driver_internal_info('allocated_ipmi_terminal_port',
|
||||||
node.driver_internal_info = dii
|
allocated_port)
|
||||||
node.save()
|
node.save()
|
||||||
return allocated_port
|
return allocated_port
|
||||||
|
|
||||||
|
|
||||||
def _release_allocated_port(task):
|
def _release_allocated_port(task):
|
||||||
node = task.node
|
node = task.node
|
||||||
dii = node.driver_internal_info or {}
|
allocated_port = node.del_driver_internal_info(
|
||||||
allocated_port = dii.pop('allocated_ipmi_terminal_port', None)
|
'allocated_ipmi_terminal_port')
|
||||||
if allocated_port:
|
if allocated_port:
|
||||||
node.driver_internal_info = dii
|
|
||||||
node.save()
|
node.save()
|
||||||
console_utils.release_port(allocated_port)
|
console_utils.release_port(allocated_port)
|
||||||
|
|
||||||
@ -1255,16 +1253,18 @@ class IPMIManagement(base.ManagementInterface):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
driver_info = task.node.driver_info
|
driver_info = task.node.driver_info
|
||||||
driver_internal_info = task.node.driver_internal_info
|
node = task.node
|
||||||
ifbd = driver_info.get('ipmi_force_boot_device', False)
|
ifbd = driver_info.get('ipmi_force_boot_device', False)
|
||||||
|
|
||||||
driver_info = _parse_driver_info(task.node)
|
driver_info = _parse_driver_info(task.node)
|
||||||
|
|
||||||
if (strutils.bool_from_string(ifbd)
|
if (strutils.bool_from_string(ifbd)
|
||||||
and driver_internal_info.get('persistent_boot_device')
|
and node.driver_internal_info.get('persistent_boot_device')
|
||||||
and driver_internal_info.get('is_next_boot_persistent', True)):
|
and node.driver_internal_info.get('is_next_boot_persistent',
|
||||||
|
True)):
|
||||||
return {
|
return {
|
||||||
'boot_device': driver_internal_info['persistent_boot_device'],
|
'boot_device': node.driver_internal_info[
|
||||||
|
'persistent_boot_device'],
|
||||||
'persistent': True
|
'persistent': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,5 @@ class IRMCBIOS(base.BIOSInterface):
|
|||||||
delete_names)
|
delete_names)
|
||||||
|
|
||||||
def _resume_cleaning(self, task):
|
def _resume_cleaning(self, task):
|
||||||
driver_internal_info = task.node.driver_internal_info
|
task.node.set_driver_internal_info('cleaning_reboot', True)
|
||||||
driver_internal_info['cleaning_reboot'] = True
|
|
||||||
task.node.driver_internal_info = driver_internal_info
|
|
||||||
task.node.save()
|
task.node.save()
|
||||||
|
@ -288,20 +288,20 @@ def _prepare_boot_iso(task, root_uuid):
|
|||||||
for BIOS boot_mode failed.
|
for BIOS boot_mode failed.
|
||||||
"""
|
"""
|
||||||
deploy_info = _parse_deploy_info(task.node)
|
deploy_info = _parse_deploy_info(task.node)
|
||||||
driver_internal_info = task.node.driver_internal_info
|
|
||||||
|
|
||||||
# fetch boot iso
|
# fetch boot iso
|
||||||
if deploy_info.get('boot_iso'):
|
if deploy_info.get('boot_iso'):
|
||||||
boot_iso_href = deploy_info['boot_iso']
|
boot_iso_href = deploy_info['boot_iso']
|
||||||
if _is_image_href_ordinary_file_name(boot_iso_href):
|
if _is_image_href_ordinary_file_name(boot_iso_href):
|
||||||
driver_internal_info['boot_iso'] = boot_iso_href
|
task.node.set_driver_internal_info('boot_iso', boot_iso_href)
|
||||||
else:
|
else:
|
||||||
boot_iso_filename = _get_iso_name(task.node, label='boot')
|
boot_iso_filename = _get_iso_name(task.node, label='boot')
|
||||||
boot_iso_fullpathname = os.path.join(
|
boot_iso_fullpathname = os.path.join(
|
||||||
CONF.irmc.remote_image_share_root, boot_iso_filename)
|
CONF.irmc.remote_image_share_root, boot_iso_filename)
|
||||||
images.fetch(task.context, boot_iso_href, boot_iso_fullpathname)
|
images.fetch(task.context, boot_iso_href, boot_iso_fullpathname)
|
||||||
|
|
||||||
driver_internal_info['boot_iso'] = boot_iso_filename
|
task.node.set_driver_internal_info('boot_iso',
|
||||||
|
boot_iso_filename)
|
||||||
|
|
||||||
# create boot iso
|
# create boot iso
|
||||||
else:
|
else:
|
||||||
@ -329,10 +329,10 @@ def _prepare_boot_iso(task, root_uuid):
|
|||||||
kernel_params=kernel_params,
|
kernel_params=kernel_params,
|
||||||
boot_mode=boot_mode)
|
boot_mode=boot_mode)
|
||||||
|
|
||||||
driver_internal_info['boot_iso'] = boot_iso_filename
|
task.node.set_driver_internal_info('boot_iso',
|
||||||
|
boot_iso_filename)
|
||||||
|
|
||||||
# save driver_internal_info['boot_iso']
|
# save driver_internal_info['boot_iso']
|
||||||
task.node.driver_internal_info = driver_internal_info
|
|
||||||
task.node.save()
|
task.node.save()
|
||||||
|
|
||||||
|
|
||||||
@ -1047,8 +1047,8 @@ class IRMCVirtualMediaBoot(base.BootInterface, IRMCVolumeBootMixIn):
|
|||||||
manager_utils.node_set_boot_device(task, boot_devices.DISK,
|
manager_utils.node_set_boot_device(task, boot_devices.DISK,
|
||||||
persistent=True)
|
persistent=True)
|
||||||
else:
|
else:
|
||||||
driver_internal_info = node.driver_internal_info
|
root_uuid_or_disk_id = node.driver_internal_info[
|
||||||
root_uuid_or_disk_id = driver_internal_info['root_uuid_or_disk_id']
|
'root_uuid_or_disk_id']
|
||||||
self._configure_vmedia_boot(task, root_uuid_or_disk_id)
|
self._configure_vmedia_boot(task, root_uuid_or_disk_id)
|
||||||
|
|
||||||
# Enable secure boot, if being requested
|
# Enable secure boot, if being requested
|
||||||
@ -1073,11 +1073,9 @@ class IRMCVirtualMediaBoot(base.BootInterface, IRMCVolumeBootMixIn):
|
|||||||
boot_mode_utils.deconfigure_secure_boot_if_needed(task)
|
boot_mode_utils.deconfigure_secure_boot_if_needed(task)
|
||||||
|
|
||||||
_remove_share_file(_get_iso_name(task.node, label='boot'))
|
_remove_share_file(_get_iso_name(task.node, label='boot'))
|
||||||
driver_internal_info = task.node.driver_internal_info
|
task.node.del_driver_internal_info('boot_iso')
|
||||||
driver_internal_info.pop('boot_iso', None)
|
task.node.del_driver_internal_info('irmc_boot_iso')
|
||||||
driver_internal_info.pop('irmc_boot_iso', None)
|
|
||||||
|
|
||||||
task.node.driver_internal_info = driver_internal_info
|
|
||||||
task.node.save()
|
task.node.save()
|
||||||
_cleanup_vmedia_boot(task)
|
_cleanup_vmedia_boot(task)
|
||||||
|
|
||||||
|
@ -139,9 +139,8 @@ def backup_bios_config(task):
|
|||||||
error=e)
|
error=e)
|
||||||
|
|
||||||
# Save bios config into the driver_internal_info
|
# Save bios config into the driver_internal_info
|
||||||
internal_info = task.node.driver_internal_info
|
task.node.set_driver_internal_info('irmc_bios_config',
|
||||||
internal_info['irmc_bios_config'] = result['bios_config']
|
result['bios_config'])
|
||||||
task.node.driver_internal_info = internal_info
|
|
||||||
task.node.save()
|
task.node.save()
|
||||||
|
|
||||||
LOG.info('BIOS config is backed up successfully for node %s',
|
LOG.info('BIOS config is backed up successfully for node %s',
|
||||||
@ -170,14 +169,12 @@ def _restore_bios_config(task):
|
|||||||
|
|
||||||
def _remove_bios_config(task, reboot_flag=False):
|
def _remove_bios_config(task, reboot_flag=False):
|
||||||
"""Remove backup bios config from the node."""
|
"""Remove backup bios config from the node."""
|
||||||
internal_info = task.node.driver_internal_info
|
task.node.del_driver_internal_info('irmc_bios_config')
|
||||||
internal_info.pop('irmc_bios_config', None)
|
|
||||||
# NOTE(tiendc): If reboot flag is raised, then the BM will
|
# NOTE(tiendc): If reboot flag is raised, then the BM will
|
||||||
# reboot and cause a bug if the next clean step is in-band.
|
# reboot and cause a bug if the next clean step is in-band.
|
||||||
# See https://storyboard.openstack.org/#!/story/2002731
|
# See https://storyboard.openstack.org/#!/story/2002731
|
||||||
if reboot_flag:
|
if reboot_flag:
|
||||||
internal_info['cleaning_reboot'] = True
|
task.node.set_driver_internal_info('cleaning_reboot', True)
|
||||||
task.node.driver_internal_info = internal_info
|
|
||||||
task.node.save()
|
task.node.save()
|
||||||
|
|
||||||
irmc_info = irmc_common.parse_driver_info(task.node)
|
irmc_info = irmc_common.parse_driver_info(task.node)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user