Merge "Address nits in uefi agent iscsi deploy commit"
This commit is contained in:
commit
d5b2d498bc
@ -443,7 +443,7 @@ class BaseAgentVendor(base.VendorInterface):
|
||||
:param root_uuid: The UUID of the root partition. This is used
|
||||
for identifying the partition which contains the image deployed.
|
||||
:param efi_system_part_uuid: The UUID of the efi system partition.
|
||||
This is used only in uef boot mode.
|
||||
This is used only in uefi boot mode.
|
||||
:raises: InstanceDeployFailure if bootloader installation failed or
|
||||
on encountering error while setting the boot device on the node.
|
||||
"""
|
||||
|
@ -563,8 +563,12 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format,
|
||||
or configdrive HTTP URL.
|
||||
:param boot_option: Can be "local" or "netboot". "netboot" by default.
|
||||
:param boot_mode: Can be "bios" or "uefi". "bios" by default.
|
||||
:returns: a dictionary containing the UUID of root partition and efi system
|
||||
partition (if boot mode is uefi).
|
||||
:returns: a dictionary containing the following keys:
|
||||
'root uuid': UUID of root partition
|
||||
'efi system partition uuid': UUID of the uefi system partition
|
||||
(if boot mode is uefi).
|
||||
NOTE: If key exists but value is None, it means partition doesn't
|
||||
exist.
|
||||
"""
|
||||
# the only way for preserve_ephemeral to be set to true is if we are
|
||||
# rebuilding an instance with --preserve_ephemeral.
|
||||
@ -673,8 +677,12 @@ def deploy_partition_image(address, port, iqn, lun, image_path,
|
||||
or configdrive HTTP URL.
|
||||
:param boot_option: Can be "local" or "netboot". "netboot" by default.
|
||||
:param boot_mode: Can be "bios" or "uefi". "bios" by default.
|
||||
:returns: a dictionary containing the UUID of root partition and efi system
|
||||
partition (if boot mode is uefi).
|
||||
:returns: a dictionary containing the following keys:
|
||||
'root uuid': UUID of root partition
|
||||
'efi system partition uuid': UUID of the uefi system partition
|
||||
(if boot mode is uefi).
|
||||
NOTE: If key exists but value is None, it means partition doesn't
|
||||
exist.
|
||||
"""
|
||||
with _iscsi_setup_and_handle_errors(address, port, iqn,
|
||||
lun, image_path) as dev:
|
||||
@ -702,7 +710,8 @@ def deploy_disk_image(address, port, iqn, lun,
|
||||
:param image_path: Path for the instance's disk image.
|
||||
:param node_uuid: node's uuid. Used for logging. Currently not in use
|
||||
by this function but could be used in the future.
|
||||
:returns: a dictionary containing the disk identifier for the disk.
|
||||
:returns: a dictionary containing the key 'disk identifier' to identify
|
||||
the disk which was used for deployment.
|
||||
"""
|
||||
with _iscsi_setup_and_handle_errors(address, port, iqn,
|
||||
lun, image_path) as dev:
|
||||
|
@ -762,9 +762,9 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
|
||||
|
||||
iwdi = node.driver_internal_info.get('is_whole_disk_image')
|
||||
ilo_common.cleanup_vmedia_boot(task)
|
||||
uuid_dict_returned = iscsi_deploy.continue_deploy(task, **kwargs)
|
||||
root_uuid_or_disk_id = uuid_dict_returned.get(
|
||||
'root uuid', uuid_dict_returned.get('disk identifier'))
|
||||
uuid_dict = iscsi_deploy.continue_deploy(task, **kwargs)
|
||||
root_uuid_or_disk_id = uuid_dict.get(
|
||||
'root uuid', uuid_dict.get('disk identifier'))
|
||||
|
||||
# TODO(rameshg87): It's not correct to return here as it will leave
|
||||
# the node in DEPLOYING state. This will be fixed in bug 1405519.
|
||||
@ -817,12 +817,11 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
|
||||
|
||||
ilo_common.cleanup_vmedia_boot(task)
|
||||
|
||||
uuid_dict_returned = iscsi_deploy.do_agent_iscsi_deploy(task,
|
||||
self._client)
|
||||
root_uuid = uuid_dict_returned.get('root uuid')
|
||||
uuid_dict = iscsi_deploy.do_agent_iscsi_deploy(task, self._client)
|
||||
root_uuid = uuid_dict.get('root uuid')
|
||||
|
||||
if iscsi_deploy.get_boot_option(node) == "local":
|
||||
efi_system_part_uuid = uuid_dict_returned.get(
|
||||
efi_system_part_uuid = uuid_dict.get(
|
||||
'efi system partition uuid')
|
||||
self.configure_local_boot(
|
||||
task, root_uuid=root_uuid,
|
||||
|
@ -275,11 +275,15 @@ def continue_deploy(task, **kwargs):
|
||||
:param kwargs: the kwargs to be passed to deploy.
|
||||
:raises: InvalidState if the event is not allowed by the associated
|
||||
state machine.
|
||||
:returns: a dictionary containing some identifiers for the deployed
|
||||
image. If it's partition image, then it returns root uuid and efi
|
||||
system partition uuid (if boot mode is uefi). If it's whole disk
|
||||
image, it returns disk identifier. On error cases, it returns an
|
||||
empty dictionary.
|
||||
:returns: a dictionary containing the following keys:
|
||||
For partition image:
|
||||
'root uuid': UUID of root partition
|
||||
'efi system partition uuid': UUID of the uefi system partition
|
||||
(if boot mode is uefi).
|
||||
NOTE: If key exists but value is None, it means partition doesn't
|
||||
exist.
|
||||
For whole disk image:
|
||||
'disk identifier': ID of the disk to which image was deployed.
|
||||
"""
|
||||
node = task.node
|
||||
|
||||
@ -332,10 +336,15 @@ def do_agent_iscsi_deploy(task, agent_client):
|
||||
:param agent_client: an instance of agent_client.AgentClient
|
||||
which will be used during iscsi deploy (for exposing node's
|
||||
target disk via iSCSI, for install boot loader, etc).
|
||||
:returns: a dictionary containing some identifiers for the deployed
|
||||
image. If it's partition image, then it returns root uuid and efi
|
||||
system partition uuid (if boot mode is uefi). If it's whole disk
|
||||
image, it returns disk identifier.
|
||||
:returns: a dictionary containing the following keys:
|
||||
For partition image:
|
||||
'root uuid': UUID of root partition
|
||||
'efi system partition uuid': UUID of the uefi system partition
|
||||
(if boot mode is uefi).
|
||||
NOTE: If key exists but value is None, it means partition doesn't
|
||||
exist.
|
||||
For whole disk image:
|
||||
'disk identifier': ID of the disk to which image was deployed.
|
||||
:raises: InstanceDeployFailure, if it encounters some error
|
||||
during the deploy.
|
||||
"""
|
||||
|
@ -540,9 +540,9 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
|
||||
|
||||
_destroy_token_file(node)
|
||||
is_whole_disk_image = node.driver_internal_info['is_whole_disk_image']
|
||||
uuid_dict_returned = iscsi_deploy.continue_deploy(task, **kwargs)
|
||||
root_uuid_or_disk_id = uuid_dict_returned.get(
|
||||
'root uuid', uuid_dict_returned.get('disk identifier'))
|
||||
uuid_dict = iscsi_deploy.continue_deploy(task, **kwargs)
|
||||
root_uuid_or_disk_id = uuid_dict.get(
|
||||
'root uuid', uuid_dict.get('disk identifier'))
|
||||
|
||||
# TODO(rameshg87): It's not correct to return here as it will leave
|
||||
# the node in DEPLOYING state. This will be fixed in bug 1405519.
|
||||
@ -604,14 +604,13 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
|
||||
# it here.
|
||||
_destroy_token_file(node)
|
||||
|
||||
uuid_dict_returned = iscsi_deploy.do_agent_iscsi_deploy(task,
|
||||
self._client)
|
||||
uuid_dict = iscsi_deploy.do_agent_iscsi_deploy(task, self._client)
|
||||
|
||||
is_whole_disk_image = node.driver_internal_info['is_whole_disk_image']
|
||||
if iscsi_deploy.get_boot_option(node) == "local":
|
||||
# Install the boot loader
|
||||
root_uuid = uuid_dict_returned.get('root uuid')
|
||||
efi_sys_uuid = uuid_dict_returned.get('efi system partition uuid')
|
||||
root_uuid = uuid_dict.get('root uuid')
|
||||
efi_sys_uuid = uuid_dict.get('efi system partition uuid')
|
||||
self.configure_local_boot(
|
||||
task, root_uuid=root_uuid,
|
||||
efi_system_part_uuid=efi_sys_uuid)
|
||||
@ -620,8 +619,8 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
|
||||
# the PXE configuration files used for the deployment
|
||||
pxe_utils.clean_up_pxe_config(task)
|
||||
else:
|
||||
root_uuid_or_disk_id = uuid_dict_returned.get(
|
||||
'root uuid', uuid_dict_returned.get('disk identifier'))
|
||||
root_uuid_or_disk_id = uuid_dict.get(
|
||||
'root uuid', uuid_dict.get('disk identifier'))
|
||||
pxe_config_path = pxe_utils.get_pxe_config_file_path(node.uuid)
|
||||
boot_mode = driver_utils.get_node_capability(node, 'boot_mode')
|
||||
deploy_utils.switch_pxe_config(pxe_config_path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user