Merge "Implement managed in-band inspection boot for redfish-virtual-media"
This commit is contained in:
commit
75f10d81ac
@ -639,6 +639,21 @@ class RedfishVirtualMediaBoot(base.BootInterface):
|
|||||||
if task.driver.storage.should_write_image(task):
|
if task.driver.storage.should_write_image(task):
|
||||||
self._validate_instance_info(task)
|
self._validate_instance_info(task)
|
||||||
|
|
||||||
|
def validate_inspection(self, task):
|
||||||
|
"""Validate that the node has required properties for inspection.
|
||||||
|
|
||||||
|
:param task: A TaskManager instance with the node being checked
|
||||||
|
:raises: MissingParameterValue if node is missing one or more required
|
||||||
|
parameters
|
||||||
|
:raises: UnsupportedDriverExtension
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
self._validate_driver_info(task)
|
||||||
|
except exception.MissingParameterValue:
|
||||||
|
# Fall back to non-managed in-band inspection
|
||||||
|
raise exception.UnsupportedDriverExtension(
|
||||||
|
driver=task.node.driver, extension='inspection')
|
||||||
|
|
||||||
def prepare_ramdisk(self, task, ramdisk_params):
|
def prepare_ramdisk(self, task, ramdisk_params):
|
||||||
"""Prepares the boot of deploy or rescue ramdisk over virtual media.
|
"""Prepares the boot of deploy or rescue ramdisk over virtual media.
|
||||||
|
|
||||||
@ -663,7 +678,8 @@ class RedfishVirtualMediaBoot(base.BootInterface):
|
|||||||
# modify the state of the node due to virtual media operations.
|
# modify the state of the node due to virtual media operations.
|
||||||
if node.provision_state not in (states.DEPLOYING,
|
if node.provision_state not in (states.DEPLOYING,
|
||||||
states.CLEANING,
|
states.CLEANING,
|
||||||
states.RESCUING):
|
states.RESCUING,
|
||||||
|
states.INSPECTING):
|
||||||
return
|
return
|
||||||
|
|
||||||
manager_utils.node_power_action(task, states.POWER_OFF)
|
manager_utils.node_power_action(task, states.POWER_OFF)
|
||||||
|
@ -531,6 +531,27 @@ class RedfishVirtualMediaBootTestCase(db_base.DbTestCase):
|
|||||||
self.assertRaises(exception.MissingParameterValue,
|
self.assertRaises(exception.MissingParameterValue,
|
||||||
task.driver.boot.validate, task)
|
task.driver.boot.validate, task)
|
||||||
|
|
||||||
|
@mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True)
|
||||||
|
def test_validate_inspection(self, mock_parse_driver_info):
|
||||||
|
with task_manager.acquire(self.context, self.node.uuid,
|
||||||
|
shared=True) as task:
|
||||||
|
task.node.driver_info.update(
|
||||||
|
{'deploy_kernel': 'kernel',
|
||||||
|
'deploy_ramdisk': 'ramdisk',
|
||||||
|
'bootloader': 'bootloader'}
|
||||||
|
)
|
||||||
|
|
||||||
|
task.driver.boot.validate_inspection(task)
|
||||||
|
|
||||||
|
mock_parse_driver_info.assert_called_once_with(task.node)
|
||||||
|
|
||||||
|
@mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True)
|
||||||
|
def test_validate_inspection_missing(self, mock_parse_driver_info):
|
||||||
|
with task_manager.acquire(self.context, self.node.uuid,
|
||||||
|
shared=True) as task:
|
||||||
|
self.assertRaises(exception.UnsupportedDriverExtension,
|
||||||
|
task.driver.boot.validate_inspection, task)
|
||||||
|
|
||||||
@mock.patch.object(redfish_boot.RedfishVirtualMediaBoot,
|
@mock.patch.object(redfish_boot.RedfishVirtualMediaBoot,
|
||||||
'_prepare_deploy_iso', autospec=True)
|
'_prepare_deploy_iso', autospec=True)
|
||||||
@mock.patch.object(redfish_boot.RedfishVirtualMediaBoot,
|
@mock.patch.object(redfish_boot.RedfishVirtualMediaBoot,
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``redfish-virtual-media`` boot interface now supports managing boot
|
||||||
|
for in-band inspection. This enables using virtual media instead of PXE
|
||||||
|
for in-band inspection.
|
@ -148,11 +148,12 @@
|
|||||||
IRONIC_ENABLED_MANAGEMENT_INTERFACES: redfish
|
IRONIC_ENABLED_MANAGEMENT_INTERFACES: redfish
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ironic-tempest-partition-bios-redfish-vmedia
|
name: ironic-tempest-partition-uefi-redfish-vmedia
|
||||||
description: "Deploy ironic node over Redfish virtual media using legacy BIOS boot mode"
|
description: "Deploy ironic node over Redfish virtual media using UEFI boot mode"
|
||||||
parent: ironic-tempest-partition-bios-redfish-pxe
|
parent: ironic-tempest-partition-bios-redfish-pxe
|
||||||
vars:
|
vars:
|
||||||
devstack_localrc:
|
devstack_localrc:
|
||||||
|
IRONIC_BOOT_MODE: uefi
|
||||||
IRONIC_ENABLED_BOOT_INTERFACES: redfish-virtual-media
|
IRONIC_ENABLED_BOOT_INTERFACES: redfish-virtual-media
|
||||||
IRONIC_VM_SPECS_RAM: 512
|
IRONIC_VM_SPECS_RAM: 512
|
||||||
SWIFT_ENABLE_TEMPURLS: True
|
SWIFT_ENABLE_TEMPURLS: True
|
||||||
@ -164,13 +165,23 @@
|
|||||||
s-proxy: True
|
s-proxy: True
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ironic-tempest-partition-uefi-redfish-vmedia
|
name: ironic-inspector-tempest-partition-bios-redfish-vmedia
|
||||||
description: "Deploy ironic node over Redfish virtual media using UEFI boot mode"
|
description: "Inspect and deploy ironic node over Redfish virtual media using legacy BIOS boot mode"
|
||||||
parent: ironic-tempest-partition-bios-redfish-vmedia
|
parent: ironic-tempest-partition-uefi-redfish-vmedia
|
||||||
|
required-projects:
|
||||||
|
- openstack/ironic-inspector
|
||||||
vars:
|
vars:
|
||||||
|
# NOTE(dtantsur): the inspector job includes booting an instance too
|
||||||
|
tempest_test_regex: Inspector
|
||||||
devstack_localrc:
|
devstack_localrc:
|
||||||
IRONIC_BOOT_MODE: uefi
|
IRONIC_BOOT_MODE: bios
|
||||||
IRONIC_VM_SPECS_RAM: 512
|
IRONIC_INSPECTOR_MANAGED_BOOT: True
|
||||||
|
IRONIC_INSPECTOR_NODE_NOT_FOUND_HOOK: ''
|
||||||
|
devstack_plugins:
|
||||||
|
ironic-inspector: https://opendev.org/openstack/ironic-inspector
|
||||||
|
devstack_services:
|
||||||
|
ironic-inspector: True
|
||||||
|
ironic-inspector-dhcp: True
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ironic-tempest-pxe_ipmitool-postgres
|
name: ironic-tempest-pxe_ipmitool-postgres
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
- ironic-grenade-dsvm-multinode-multitenant:
|
- ironic-grenade-dsvm-multinode-multitenant:
|
||||||
voting: false
|
voting: false
|
||||||
- ironic-tempest-partition-bios-redfish-pxe
|
- ironic-tempest-partition-bios-redfish-pxe
|
||||||
- ironic-tempest-partition-bios-redfish-vmedia:
|
|
||||||
voting: false
|
|
||||||
- ironic-tempest-partition-uefi-redfish-vmedia
|
- ironic-tempest-partition-uefi-redfish-vmedia
|
||||||
- ironic-tempest-ipa-partition-pxe_ipmitool-tinyipa
|
- ironic-tempest-ipa-partition-pxe_ipmitool-tinyipa
|
||||||
- ironic-tempest-ipa-partition-uefi-pxe_ipmitool-tinyipa
|
- ironic-tempest-ipa-partition-uefi-pxe_ipmitool-tinyipa
|
||||||
@ -38,6 +36,8 @@
|
|||||||
voting: false
|
voting: false
|
||||||
- ironic-inspector-tempest-managed:
|
- ironic-inspector-tempest-managed:
|
||||||
voting: false
|
voting: false
|
||||||
|
- ironic-inspector-tempest-partition-bios-redfish-vmedia:
|
||||||
|
voting: false
|
||||||
- ironic-tempest-ipa-wholedisk-bios-ipmi-direct-dib-centos7:
|
- ironic-tempest-ipa-wholedisk-bios-ipmi-direct-dib-centos7:
|
||||||
voting: false
|
voting: false
|
||||||
- bifrost-integration-tinyipa-ubuntu-xenial:
|
- bifrost-integration-tinyipa-ubuntu-xenial:
|
||||||
|
Loading…
Reference in New Issue
Block a user